fix
This commit is contained in:
parent
8375b86499
commit
1d5c05dbda
@ -24,8 +24,34 @@ export const register = (data) => {
|
||||
data,
|
||||
});
|
||||
};
|
||||
// 身份验证
|
||||
export const chenckId = (data) => {
|
||||
return http.request({
|
||||
url: "/api/wxuser/ocr",
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
};
|
||||
// 法大大
|
||||
export const fddRealName = (data) => {
|
||||
return http.request({
|
||||
url: "/api/wxuser/bind/fdd",
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
};
|
||||
//法大大是否验证
|
||||
export const checkFdd = () => {
|
||||
return http.request({
|
||||
url: "/api/wxuser/fdd/check",
|
||||
method: "POST",
|
||||
});
|
||||
};
|
||||
export default {
|
||||
login,
|
||||
getTel,
|
||||
register,
|
||||
chenckId,
|
||||
fddRealName,
|
||||
checkFdd,
|
||||
};
|
||||
|
10
pages.json
10
pages.json
@ -34,6 +34,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/realName/FDDRegister",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false,
|
||||
"app-plus": {
|
||||
"titleNView": false // 禁用原生导航
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/cameraContext/cameraContext",
|
||||
"style": {
|
||||
|
33
pages/realName/FDDRegister.vue
Normal file
33
pages/realName/FDDRegister.vue
Normal file
@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<view>
|
||||
<web-view :src="fddUrl" bindmessage="handleMessage"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
fddUrl: ""
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
uni.getStorage({
|
||||
key: "fddUrl",
|
||||
success: res => {
|
||||
this.$nextTick(() => {
|
||||
this.fddUrl = res.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
handleMessage(e) {
|
||||
console.log(e, "fffffffffffffffffffffffffffff");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
@ -61,14 +61,14 @@
|
||||
</view>
|
||||
<view class="face">
|
||||
<view class="faceTitle">法大大认证</view>
|
||||
<view class="recognition" >
|
||||
<view class="recognition" @click="fddRealName" v-if="!isFdd || video">
|
||||
<view style="color: #fff;margin-right:10rpx">前往认证</view>
|
||||
<u-icon name="arrow-right-double" color="#fff"></u-icon>
|
||||
</view>
|
||||
<!-- <view class="recognition">
|
||||
<view class="recognition" @click="fddRealName" v-else>
|
||||
<view style="color: #fff;margin-right:10rpx">认证成功</view>
|
||||
<u-icon name="checkmark-circle" color="#fff"></u-icon>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="agreement">
|
||||
<u-checkbox-group v-model="checked" iconPlacement="left" placement="row" inactiveColor="#76C458">
|
||||
@ -97,19 +97,30 @@ export default {
|
||||
fileList: [],
|
||||
fileList2: [],
|
||||
video: '',
|
||||
isfinish: false
|
||||
isfinish: false,
|
||||
isChecked: false
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
if(options.tempVideoPath){
|
||||
this.isfinish = JSON.parse(options.isfinish)||false
|
||||
this.video = options.tempVideoPath;
|
||||
this.uploadFilePromise(options.tempVideoPath,'video')
|
||||
async onLoad(options) {
|
||||
if (options.tempVideoPath) {
|
||||
this.isfinish = JSON.parse(options.isfinish) || false
|
||||
this.video = await this.uploadFilePromise(options.tempVideoPath)
|
||||
console.log('this.video',this.video)
|
||||
const data = {
|
||||
num: uni.getStorageSync("info").name || '',
|
||||
name: uni.getStorageSync("info").num || '',
|
||||
fileList: uni.getStorageSync("info").fileList || [],
|
||||
fileList2: uni.getStorageSync("info").fileList2,
|
||||
video: this.video
|
||||
}
|
||||
uni.setStorageSync("info", data)
|
||||
}
|
||||
this.name = uni.getStorageSync("info").name||''
|
||||
this.num = uni.getStorageSync("info").num||''
|
||||
this.fileList = uni.getStorageSync("info").fileList||[]
|
||||
this.fileList2 = uni.getStorageSync("info").fileList2||[]
|
||||
this.name = uni.getStorageSync("info").name || ''
|
||||
this.num = uni.getStorageSync("info").num || ''
|
||||
this.fileList = uni.getStorageSync("info").fileList || []
|
||||
this.fileList2 = uni.getStorageSync("info").fileList2 || []
|
||||
this.video = uni.getStorageSync("info").video || ''
|
||||
// this.isFdd = uni.getStorageSync("isFdd") || false
|
||||
uni.removeStorageSync("info")
|
||||
},
|
||||
methods: {
|
||||
@ -132,13 +143,6 @@ export default {
|
||||
uni.setStorageSync("info", data)
|
||||
},
|
||||
async completeRegistration() {
|
||||
if (!this.checked.length) return this.$common.msgToast("请阅读并勾选协议");
|
||||
if (!this.checked.length) return this.$common.msgToast("请阅读并勾选协议");
|
||||
if (!this.name) return this.$common.msgToast("请输入姓名");
|
||||
if (!this.num) return this.$common.msgToast("请输入身份证号");
|
||||
if (!this.fileList.length) return this.$common.msgToast("请上传身份证人面像");
|
||||
if (!this.fileList2.length) return this.$common.msgToast("请上传身份国徽面");
|
||||
if (!this.video) return this.$common.msgToast("请上传人脸识别视频");
|
||||
console.log({
|
||||
telNum: uni.getStorageSync("telNum"),
|
||||
realNameIDName: this.num,
|
||||
@ -147,19 +151,32 @@ export default {
|
||||
realIDImgA: this.fileList[0]?.url,
|
||||
realIDImgB: this.fileList2[0].url
|
||||
})
|
||||
const res = await this.$api.login.register({user:{
|
||||
telNum: uni.getStorageSync("telNum"),
|
||||
realNameIDName: this.num,
|
||||
realName: this.name,
|
||||
video: this.video,
|
||||
realIDImgA: this.fileList[0]?.url,
|
||||
realIDImgB: this.fileList2[0]?.url
|
||||
}})
|
||||
this.checkFdd().then((res) => {
|
||||
if (!res) return this.$common.msgToast("法大大验证未通过")
|
||||
})
|
||||
if (!this.checked.length) return this.$common.msgToast("请阅读并勾选协议");
|
||||
if (!this.checked.length) return this.$common.msgToast("请阅读并勾选协议");
|
||||
if (!this.name) return this.$common.msgToast("请输入姓名");
|
||||
if (!this.num) return this.$common.msgToast("请输入身份证号");
|
||||
if (!this.fileList.length) return this.$common.msgToast("请上传身份证人面像");
|
||||
if (!this.fileList2.length) return this.$common.msgToast("请上传身份国徽面");
|
||||
if (!this.video) return this.$common.msgToast("请上传人脸识别视频");
|
||||
|
||||
const res = await this.$api.login.register({
|
||||
user: {
|
||||
telNum: uni.getStorageSync("telNum"),
|
||||
realNameIDName: this.num,
|
||||
realName: this.name,
|
||||
video: this.video,
|
||||
realIDImgA: this.fileList[0]?.url,
|
||||
realIDImgB: this.fileList2[0]?.url
|
||||
}
|
||||
})
|
||||
if (res.status === 0) {
|
||||
uni.switchTab({
|
||||
url: '/pages/home/index'
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
this.$common.msgToast(res.msg)
|
||||
}
|
||||
|
||||
@ -185,7 +202,8 @@ export default {
|
||||
})
|
||||
})
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await this.uploadFilePromise(lists[i].url)
|
||||
const result = await this.uploadFilePromise(lists[i].url, 'check')
|
||||
console.log(result)
|
||||
let item = this[`fileList`][fileListLen]
|
||||
this[`fileList`].splice(fileListLen, 1, Object.assign(item, {
|
||||
status: 'success',
|
||||
@ -217,24 +235,71 @@ export default {
|
||||
fileListLen++
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url,type=null) {
|
||||
console.log(url)
|
||||
uploadFilePromise(url, type = null) {
|
||||
return new Promise((resolve) => {
|
||||
uni.uploadFile({
|
||||
url: http.baseUrl + "/api/wxuser/uploadpic",
|
||||
filePath: url,
|
||||
name: "file",
|
||||
success: (res) => {
|
||||
console.log(9999999999999999999,res)
|
||||
res.data = JSON.parse(res.data);
|
||||
resolve(res.data.data.path);
|
||||
if(type ==='video'){
|
||||
this.video = res.data.data.path
|
||||
const { path } = JSON.parse(res.data).data;
|
||||
console.log('@@@@', path)
|
||||
resolve(path);
|
||||
if (type === 'check') {
|
||||
this.chenckId(path)
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
},
|
||||
async chenckId(realIDImgA) {
|
||||
const res = await this.$api.login.chenckId({ realIDImgA })
|
||||
if (res.status === 0) {
|
||||
this.num = res.data.iDNum
|
||||
this.name = res.data.realName
|
||||
} else {
|
||||
this.$common.msgToast(res.msg)
|
||||
}
|
||||
},
|
||||
async fddRealName() {
|
||||
const data = {
|
||||
num: this.num,
|
||||
name: this.name,
|
||||
fileList: this.fileList,
|
||||
fileList2: this.fileList2,
|
||||
video: this.video
|
||||
}
|
||||
console.log(data, 'data')
|
||||
uni.setStorageSync("info", data)
|
||||
const mobile = uni.getStorageSync("telNum")
|
||||
const res = await this.$api.login.fddRealName({
|
||||
customerName: this.name,
|
||||
customerIdentNo: this.num,
|
||||
mobile
|
||||
})
|
||||
if (res.status === 0) {
|
||||
uni.setStorage({
|
||||
key: "fddUrl",
|
||||
data: res.data?.url,
|
||||
success: function () {
|
||||
uni.navigateTo({
|
||||
url: "/pages/realName/FDDRegister",
|
||||
});
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$common.msgToast(res.msg)
|
||||
}
|
||||
},
|
||||
checkFdd() {
|
||||
return this.$api.login.checkFdd().then((res) => {
|
||||
if (res.status === 0) {
|
||||
return res.data.isVerify
|
||||
} else {
|
||||
this.$common.msgToast(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user