Compare commits

..

No commits in common. "a62d60c9b308d0563fa51077405314f8fda9661c" and "8375b86499ef29c052d14dbb56dc1a4429b9dea0" have entirely different histories.

4 changed files with 39 additions and 173 deletions

View File

@ -24,34 +24,8 @@ 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,
}; };

View File

@ -34,16 +34,6 @@
} }
} }
}, },
{
"path": "pages/realName/FDDRegister",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false //
}
}
},
{ {
"path": "pages/cameraContext/cameraContext", "path": "pages/cameraContext/cameraContext",
"style": { "style": {

View File

@ -1,33 +0,0 @@
<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>

View File

@ -50,7 +50,7 @@
</view> </view>
<view class="face"> <view class="face">
<view class="faceTitle">人脸识别</view> <view class="faceTitle">人脸识别</view>
<view class="recognition" @click="camera" v-if="!video"> <view class="recognition" @click="camera" v-if="!isfinish">
<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>
@ -61,14 +61,14 @@
</view> </view>
<view class="face"> <view class="face">
<view class="faceTitle">法大大认证</view> <view class="faceTitle">法大大认证</view>
<view class="recognition" @click="fddRealName" v-if="!isFdd"> <view class="recognition" >
<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" @click="fddRealName" v-else> <!-- <view class="recognition">
<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,30 +97,19 @@ export default {
fileList: [], fileList: [],
fileList2: [], fileList2: [],
video: '', video: '',
isfinish: false, isfinish: false
isChecked: false
}; };
}, },
async onLoad(options) { onLoad(options) {
if (options.tempVideoPath) { if(options.tempVideoPath){
this.isfinish = JSON.parse(options.isfinish) || false this.isfinish = JSON.parse(options.isfinish)||false
this.video = await this.uploadFilePromise(options.tempVideoPath) this.video = options.tempVideoPath;
console.log('this.video',this.video) this.uploadFilePromise(options.tempVideoPath,'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.name = uni.getStorageSync("info").name || '' this.fileList = uni.getStorageSync("info").fileList||[]
this.num = uni.getStorageSync("info").num || '' this.fileList2 = uni.getStorageSync("info").fileList2||[]
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") uni.removeStorageSync("info")
}, },
methods: { methods: {
@ -143,6 +132,13 @@ 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,
@ -151,32 +147,19 @@ export default {
realIDImgA: this.fileList[0]?.url, realIDImgA: this.fileList[0]?.url,
realIDImgB: this.fileList2[0].url realIDImgB: this.fileList2[0].url
}) })
this.checkFdd().then((res) => { const res = await this.$api.login.register({user:{
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'
}); });
} else { }else{
this.$common.msgToast(res.msg) this.$common.msgToast(res.msg)
} }
@ -202,8 +185,7 @@ 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, 'check') const result = await this.uploadFilePromise(lists[i].url)
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',
@ -235,71 +217,24 @@ export default {
fileListLen++ fileListLen++
} }
}, },
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) => {
const { path } = JSON.parse(res.data).data; console.log(9999999999999999999,res)
console.log('@@@@', path) res.data = JSON.parse(res.data);
resolve(path); resolve(res.data.data.path);
if (type === 'check') { if(type ==='video'){
this.chenckId(path) this.video = res.data.data.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>