fix
This commit is contained in:
parent
8375b86499
commit
1d5c05dbda
@ -24,8 +24,34 @@ export const register = (data) => {
|
|||||||
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 {
|
export default {
|
||||||
login,
|
login,
|
||||||
getTel,
|
getTel,
|
||||||
register,
|
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",
|
"path": "pages/cameraContext/cameraContext",
|
||||||
"style": {
|
"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>
|
||||||
<view class="face">
|
<view class="face">
|
||||||
<view class="faceTitle">法大大认证</view>
|
<view class="faceTitle">法大大认证</view>
|
||||||
<view class="recognition" >
|
<view class="recognition" @click="fddRealName" v-if="!isFdd || video">
|
||||||
<view style="color: #fff;margin-right:10rpx">前往认证</view>
|
<view style="color: #fff;margin-right:10rpx">前往认证</view>
|
||||||
<u-icon name="arrow-right-double" color="#fff"></u-icon>
|
<u-icon name="arrow-right-double" color="#fff"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="recognition">
|
<view class="recognition" @click="fddRealName" v-else>
|
||||||
<view style="color: #fff;margin-right:10rpx">认证成功</view>
|
<view style="color: #fff;margin-right:10rpx">认证成功</view>
|
||||||
<u-icon name="checkmark-circle" color="#fff"></u-icon>
|
<u-icon name="checkmark-circle" color="#fff"></u-icon>
|
||||||
</view> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="agreement">
|
<view class="agreement">
|
||||||
<u-checkbox-group v-model="checked" iconPlacement="left" placement="row" inactiveColor="#76C458">
|
<u-checkbox-group v-model="checked" iconPlacement="left" placement="row" inactiveColor="#76C458">
|
||||||
@ -97,19 +97,30 @@ export default {
|
|||||||
fileList: [],
|
fileList: [],
|
||||||
fileList2: [],
|
fileList2: [],
|
||||||
video: '',
|
video: '',
|
||||||
isfinish: false
|
isfinish: false,
|
||||||
|
isChecked: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
async onLoad(options) {
|
||||||
if (options.tempVideoPath) {
|
if (options.tempVideoPath) {
|
||||||
this.isfinish = JSON.parse(options.isfinish) || false
|
this.isfinish = JSON.parse(options.isfinish) || false
|
||||||
this.video = options.tempVideoPath;
|
this.video = await this.uploadFilePromise(options.tempVideoPath)
|
||||||
this.uploadFilePromise(options.tempVideoPath,'video')
|
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.name = uni.getStorageSync("info").name || ''
|
||||||
this.num = uni.getStorageSync("info").num || ''
|
this.num = uni.getStorageSync("info").num || ''
|
||||||
this.fileList = uni.getStorageSync("info").fileList || []
|
this.fileList = uni.getStorageSync("info").fileList || []
|
||||||
this.fileList2 = uni.getStorageSync("info").fileList2 || []
|
this.fileList2 = uni.getStorageSync("info").fileList2 || []
|
||||||
|
this.video = uni.getStorageSync("info").video || ''
|
||||||
|
// this.isFdd = uni.getStorageSync("isFdd") || false
|
||||||
uni.removeStorageSync("info")
|
uni.removeStorageSync("info")
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -132,13 +143,6 @@ export default {
|
|||||||
uni.setStorageSync("info", data)
|
uni.setStorageSync("info", data)
|
||||||
},
|
},
|
||||||
async completeRegistration() {
|
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({
|
console.log({
|
||||||
telNum: uni.getStorageSync("telNum"),
|
telNum: uni.getStorageSync("telNum"),
|
||||||
realNameIDName: this.num,
|
realNameIDName: this.num,
|
||||||
@ -147,14 +151,27 @@ export default {
|
|||||||
realIDImgA: this.fileList[0]?.url,
|
realIDImgA: this.fileList[0]?.url,
|
||||||
realIDImgB: this.fileList2[0].url
|
realIDImgB: this.fileList2[0].url
|
||||||
})
|
})
|
||||||
const res = await this.$api.login.register({user:{
|
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"),
|
telNum: uni.getStorageSync("telNum"),
|
||||||
realNameIDName: this.num,
|
realNameIDName: this.num,
|
||||||
realName: this.name,
|
realName: this.name,
|
||||||
video: this.video,
|
video: this.video,
|
||||||
realIDImgA: this.fileList[0]?.url,
|
realIDImgA: this.fileList[0]?.url,
|
||||||
realIDImgB: this.fileList2[0]?.url
|
realIDImgB: this.fileList2[0]?.url
|
||||||
}})
|
}
|
||||||
|
})
|
||||||
if (res.status === 0) {
|
if (res.status === 0) {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/home/index'
|
url: '/pages/home/index'
|
||||||
@ -185,7 +202,8 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
for (let i = 0; i < lists.length; i++) {
|
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]
|
let item = this[`fileList`][fileListLen]
|
||||||
this[`fileList`].splice(fileListLen, 1, Object.assign(item, {
|
this[`fileList`].splice(fileListLen, 1, Object.assign(item, {
|
||||||
status: 'success',
|
status: 'success',
|
||||||
@ -218,23 +236,70 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
uploadFilePromise(url, type = null) {
|
uploadFilePromise(url, type = null) {
|
||||||
console.log(url)
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: http.baseUrl + "/api/wxuser/uploadpic",
|
url: http.baseUrl + "/api/wxuser/uploadpic",
|
||||||
filePath: url,
|
filePath: url,
|
||||||
name: "file",
|
name: "file",
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log(9999999999999999999,res)
|
const { path } = JSON.parse(res.data).data;
|
||||||
res.data = JSON.parse(res.data);
|
console.log('@@@@', path)
|
||||||
resolve(res.data.data.path);
|
resolve(path);
|
||||||
if(type ==='video'){
|
if (type === 'check') {
|
||||||
this.video = res.data.data.path
|
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>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user