Commit df268d7e authored by caimeng's avatar caimeng

Merge branch 'auth-dev' of ssh://gitlab.jqtianxia.cn:2222/zhanhai/uni-app-ddh-shop into auth-dev

parents af65a8bb c2c52f98
<template> <template>
<view class="content"> <view class="content">
<template v-if="isCertified"> <!-- <template v-if="isCertified">
<uni-list > <uni-list >
<uni-list-item class="item" title="姓名1" :rightText="realName"></uni-list-item> <uni-list-item class="item" title="姓名1" :rightText="realName"></uni-list-item>
<uni-list-item class="item" title="身份证号码" :rightText="idCard"></uni-list-item> <uni-list-item class="item" title="身份证号码" :rightText="idCard"></uni-list-item>
</uni-list> </uni-list>
</template> </template>
<template v-else> <template v-else> -->
<uni-frv-external-realname ref="frv" @start="startVerify" @finish="verifyFinish"></uni-frv-external-realname> <uni-frv-external-realname ref="frv" @start="startVerify" @finish="verifyFinish"></uni-frv-external-realname>
</template> <!-- </template> -->
</view> </view>
</template> </template>
...@@ -22,14 +22,18 @@ export default { ...@@ -22,14 +22,18 @@ export default {
idCard: '', idCard: '',
ossData:null, ossData:null,
certifyId:'', certifyId:'',
MetaInfo:null MetaInfo:null,
eventChannel: null,
} }
}, },
onLoad() { onLoad() {
this.eventChannel = this.getOpenerEventChannel()
this.MetaInfo=uni.getFacialRecognitionMetaInfo()
const { idCard,realName}=uni.getStorageSync('userFData') const { idCard,realName}=uni.getStorageSync('userFData')
this.realName=realName this.realName=realName
this.idCard=idCard this.idCard=idCard
this.initOss() this.initOss()
this.startVerifys()
}, },
methods: { methods: {
initOss(){ initOss(){
...@@ -40,21 +44,52 @@ export default { ...@@ -40,21 +44,52 @@ export default {
fileType: FilePath, fileType: FilePath,
} }
self.$request('/app/v1/oss', 'GET',params).then(res => { self.$request('/app/v1/oss', 'GET',params).then(res => {
// console.log(res.result,'oss') console.log(res.result,'oss')
self.ossData=res.result self.ossData=res.result
}).catch(err => { }).catch(err => {
console.log(err, '请求出错') console.log(err, '请求出错')
}) })
}, },
async startVerify ({realName,idCard,metaInfo}) { startVerifys () {
console.log('44325')
// {realName,idCard,metaInfo}
const self = this
const params={
appId:'__UNI__DE04B13',
realName:self.realName,
idCard:self.idCard,
metaInfo:self.MetaInfo
}
console.log(params,'params')
self.$request('/app/v1/ocrTokenByUni', 'POST',params).then(res => {
const {ocrToken}=res.result
console.log(res.result)
if(ocrToken.certifyId){
self.certifyId=ocrToken.certifyId
self.$refs.frv.startFacialRecognitionVerify(ocrToken.certifyId)
}else{
const {message}=ocrToken.error
uni.showToast({
title:message,
icon: "none",
})
}
}).catch(err => {
console.log(err, '请求出错')
})
},
async startVerify () {
console.log('44325') console.log('44325')
// {realName,idCard,metaInfo}
const self = this const self = this
const params={ const params={
appId:'__UNI__DE04B13', appId:'__UNI__DE04B13',
realName:realName, realName:self.realName,
idCard:idCard, idCard:self.idCard,
metaInfo:metaInfo metaInfo:self.MetaInfo
} }
console.log(params,'params') console.log(params,'params')
self.$request('/app/v1/ocrTokenByUni', 'POST',params).then(res => { self.$request('/app/v1/ocrTokenByUni', 'POST',params).then(res => {
...@@ -84,8 +119,11 @@ export default { ...@@ -84,8 +119,11 @@ export default {
self.$request('/app/v1/resultByUni', 'POST',params).then(res => { self.$request('/app/v1/resultByUni', 'POST',params).then(res => {
console.log(res,'resultByUni') console.log(res,'resultByUni')
const {ocrToken }=res.result const {ocrToken }=res.result
UploadFile(self.ossData,`data:image/png;base64,${ocrToken.photo}`).then(file=>{ UploadFile(self.ossData,`data:image/jpg;base64,${ocrToken.photo}`).then(file=>{
console.log(file) console.log(file.fileUrl)
uni.setStorageSync('fileUrlFace',file.fileUrl)
this.eventChannel.emit('send', JSON.stringify(file.fileUrl))
self.Back()
}) })
}).catch(err => { }).catch(err => {
console.log(err, '请求出错') console.log(err, '请求出错')
......
...@@ -470,7 +470,6 @@ export default { ...@@ -470,7 +470,6 @@ export default {
const that = this; const that = this;
try{ try{
CheckUniFace((data)=>{ CheckUniFace((data)=>{
console.log(data,'uni_Face')
that.GetWebView().evalJS(`receiveUniFace('${JSON.stringify(data)}')`) that.GetWebView().evalJS(`receiveUniFace('${JSON.stringify(data)}')`)
}) })
}catch(err){ }catch(err){
......
...@@ -463,10 +463,8 @@ export default { ...@@ -463,10 +463,8 @@ export default {
const that = this; const that = this;
try{ try{
CheckUniFace((data)=>{ CheckUniFace((data)=>{
console.log(data,'uni_Face')
that.GetWebView().evalJS(`receiveUniFace('${JSON.stringify(data)}')`) that.GetWebView().evalJS(`receiveUniFace('${JSON.stringify(data)}')`)
}) })
}catch(err){ }catch(err){
console.log(err, '获取人脸失败') console.log(err, '获取人脸失败')
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<button type="primary" @click="_retry" v-else>返回</button> <button type="primary" @click="_retry" v-else>返回</button>
<view class="dev-tip" v-if="isDev">请在控制台查看详细错误(此提示仅在开发环境展示)</view> <view class="dev-tip" v-if="isDev">请在控制台查看详细错误(此提示仅在开发环境展示)</view>
</template> </template>
<template v-else> <!-- <template v-else>
<text class="title">实名认证</text> <text class="title">实名认证</text>
<uni-forms> <uni-forms>
<uni-forms-item name="realName"> <uni-forms-item name="realName">
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</view> </view>
</view> </view>
<button type="primary" :disabled="!certifyIdNext" @click="_getCertifyId">确定</button> <button type="primary" :disabled="!certifyIdNext" @click="_getCertifyId">确定</button>
</template> </template> -->
</view> </view>
</template> </template>
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment