From c8c3ba0afe3913d10019d08924374f475fa58bf5 Mon Sep 17 00:00:00 2001 From: mengxiaolong Date: Wed, 9 Dec 2020 10:31:41 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=94=B5=E6=8A=95=E9=93=B6=E8=A1=8C?= =?UTF-8?q?=E5=8D=A1=E9=89=B4=E6=9D=83=E7=99=BD=E5=90=8D=E5=8D=95+?= =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/sale/AccountInformation.vue | 143 +++++++++++++++++++-- 1 file changed, 130 insertions(+), 13 deletions(-) diff --git a/src/views/ebiz/sale/AccountInformation.vue b/src/views/ebiz/sale/AccountInformation.vue index 9ec42acbc..e52efc89a 100644 --- a/src/views/ebiz/sale/AccountInformation.vue +++ b/src/views/ebiz/sale/AccountInformation.vue @@ -135,12 +135,26 @@ @cancel="isAreaListShow = false" /> + + + + +

为确保是您本人操作,短信验证码已发送至您手机号{{ encryptMobile }},请您输入验证码以完成后续操作。

+
+ + + +
diff --git a/src/views/ebiz/sale/AccountInformation.vue b/src/views/ebiz/sale/AccountInformation.vue index e52efc89a..2d8896a17 100644 --- a/src/views/ebiz/sale/AccountInformation.vue +++ b/src/views/ebiz/sale/AccountInformation.vue @@ -139,7 +139,7 @@ -

为确保是您本人操作,短信验证码已发送至您手机号{{ encryptMobile }},请您输入验证码以完成后续操作。

+

为确保是您本人操作,短信验证码将发送至您手机号{{ encryptMobile }},请您输入验证码以完成后续操作。

@@ -129,7 +143,7 @@ import { Field, Cell, CellGroup, Popup, Row, Col, Picker, Area } from 'vant' import BankCardScan from '@/components/ebiz/sale/BankCardScan' import { policyInfo, trial, changeEdor } from '@/api/ebiz/preserve/preserve' -import { getBankList, checkCard } from '@/api/ebiz/sale/sale' +import { getBankList, checkCard, getAuthCode, autchCodeCheck } from '@/api/ebiz/sale/sale' import dataDic from '../js/data-dictionary.js' import filters from '@/views/ebiz/preserve/filters' import getAreaName from '@/views/ebiz/preserve/js/utils/get-area-name' @@ -151,6 +165,13 @@ export default { }, data() { return { + cardAuthCount: 0, + isCaptchaModalShow: false, + code: '', + sid: '', + countDownNum: 0, + countDownTimer: null, + isPassedCardCheck: false, valueKey: '', popupShow: false, pickerType: '', @@ -202,6 +223,14 @@ export default { } } }, + computed: { + encryptMobile() { + if (this.customerInfo && this.customerInfo.customerMobile) { + return this.customerInfo.customerMobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2') + } + return '' + } + }, created() { this.customerInfo = JSON.parse(localStorage['preserve-customerInfo']) //客户详情 this.policy = JSON.parse(localStorage['preserve-policy']) @@ -219,9 +248,85 @@ export default { }, filters: { idToText: filters.idToText, - amtFormat1: filters.amtFormat1 + amtFormat1: filters.amtFormat1, + countDownText(val) { + if (isNaN(parseFloat(val))) { + return val + } else { + return `${val} s` + } + } }, methods: { + async getCaptcha() { + let data = { + operateType: 'appntInfoEntry', + type: 'H5', + operateCode: this.customerInfo.customerMobile, + system: 'agentApp', + operateCodeType: '0' + } + //获取验证码 + try { + let res = await getAuthCode(data) + if (res.result === '0') { + this.$toast(res.resultMessage) + this.sid = res.sessionId + this.countDownNum = 60 + this.countDownTimer = setInterval(() => { + this.countDownNum-- + if (this.countDownNum <= 0) { + clearInterval(this.countDownTimer) + this.countDownTimer = null + } + }, 1000) + } else { + this.$toast(res.resultMessage) + } + } catch (error) { + console.log(error) + this.$toast('网络异常') + } + }, + async onCaptchaConfirm(action, done) { + if (!this.sid) { + if (!this.isCancel) { + this.$toast('请先获取验证码') + } + done(false) + return + } + if (!this.code.trim()) { + done(false) + return this.$toast('请输入验证码') + } + try { + let res = await autchCodeCheck({ + smsId: this.sid, + code: this.code + }) + if (res.result === '0') { + this.isPassedCardCheck = true + this.nextStep() + } else { + this.$toast(res.resultMessage) + } + } catch (error) { + this.$toast('网络异常') + console.log(error) + } + this.onCaptchaCancel() + done() + }, + onCaptchaCancel() { + this.isCancel = true + this.isCaptchaModalShow = false + clearInterval(this.countDownTimer) + this.countDownTimer = null + this.countDownNum = 0 + this.sid = '' + this.code = '' + }, //获取试算信息 getTrial(data) { return new Promise((resolve, reject) => { @@ -454,10 +559,22 @@ export default { } // 用户不再白名单内做银行卡鉴权 else { - let res = await checkCard(params) - this.$toast.clear() - if (res.result != '0') { - return this.$toast(res.resultMessage) + // 没通过鉴权进行银行卡鉴权 + if (!this.isPassedCardCheck) { + // 鉴权失败未达到3次调接口鉴权 + if (this.cardAuthCount < 3) { + let res = await checkCard(params) + this.$toast.clear() + if (res.result != '0') { + this.cardAuthCount++ + return this.$toast(res.resultMessage) + } + } + // 超过3次调用短信验证 + else { + this.isCaptchaModalShow = true + return + } } } } else { diff --git a/src/views/ebiz/preserve/pc/RenewalInfo.vue b/src/views/ebiz/preserve/pc/RenewalInfo.vue index 8f9fd6d94..7aa85cd1a 100644 --- a/src/views/ebiz/preserve/pc/RenewalInfo.vue +++ b/src/views/ebiz/preserve/pc/RenewalInfo.vue @@ -86,6 +86,20 @@

该客户涉及到的所有保单相应信息将变更

+ + + + +

为确保是您本人操作,短信验证码将发送至您手机号{{ encryptMobile }},请您输入验证码以完成后续操作。

+
+ + + +
@@ -93,7 +107,7 @@ import { Field, Collapse, CollapseItem, Area, Picker, Cell, CellGroup, Dialog, Popup, List } from 'vant' import BankCardScan from '@/components/ebiz/sale/BankCardScan' import { changeEdor } from '@/api/ebiz/preserve/preserve' -import { getBankList, checkCard } from '@/api/ebiz/sale/sale' +import { getBankList, checkCard, getAuthCode, autchCodeCheck } from '@/api/ebiz/sale/sale' import filters from '@/views/ebiz/preserve/filters' import getAreaName from '@/views/ebiz/preserve/js/utils/get-area-name' import areaList from '@/views/ebiz/preserve/js/utils/area' @@ -117,6 +131,13 @@ export default { }, data() { return { + cardAuthCount: 0, + isCaptchaModalShow: false, + code: '', + sid: '', + countDownNum: 0, + countDownTimer: null, + isPassedCardCheck: false, dialogShow: true, //信息变更弹窗是否显示 valueKey: '', pickerType: '', @@ -139,17 +160,15 @@ export default { customerInfo: JSON.parse(localStorage.getItem('preserve-customerInfo')) } }, + computed: { + encryptMobile() { + if (this.customerInfo && this.customerInfo.customerMobile) { + return this.customerInfo.customerMobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2') + } + return '' + } + }, created() { - /* - this.getPolicyList({ - customerNo: this.customerInfo.customerNo, - edorType: 'PC', //续期账号变更 - idno: this.customerInfo.idNo, - mobile: this.customerInfo.customerMobile, - name: this.customerInfo.customerName - }) - */ - // this.list = this.$store.getters.getPcPolicyInfo this.getBank() }, mounted() { @@ -157,6 +176,75 @@ export default { window.appCallBack = this.appCallBack }, methods: { + async getCaptcha() { + let data = { + operateType: 'appntInfoEntry', + type: 'H5', + operateCode: this.customerInfo.customerMobile, + system: 'agentApp', + operateCodeType: '0' + } + //获取验证码 + try { + let res = await getAuthCode(data) + if (res.result === '0') { + this.$toast(res.resultMessage) + this.sid = res.sessionId + this.countDownNum = 60 + this.countDownTimer = setInterval(() => { + this.countDownNum-- + if (this.countDownNum <= 0) { + clearInterval(this.countDownTimer) + this.countDownTimer = null + } + }, 1000) + } else { + this.$toast(res.resultMessage) + } + } catch (error) { + console.log(error) + this.$toast('网络异常') + } + }, + async onCaptchaConfirm(action, done) { + if (!this.sid) { + if (!this.isCancel) { + this.$toast('请先获取验证码') + } + done(false) + return + } + if (!this.code.trim()) { + done(false) + return this.$toast('请输入验证码') + } + try { + let res = await autchCodeCheck({ + smsId: this.sid, + code: this.code + }) + if (res.result === '0') { + this.isPassedCardCheck = true + this.change() + } else { + this.$toast(res.resultMessage) + } + } catch (error) { + this.$toast('网络异常') + console.log(error) + } + this.onCaptchaCancel() + done() + }, + onCaptchaCancel() { + this.isCancel = true + this.isCaptchaModalShow = false + clearInterval(this.countDownTimer) + this.countDownTimer = null + this.countDownNum = 0 + this.sid = '' + this.code = '' + }, //弹框选择 toSelect(valueKey) { this.bankPopup = true @@ -340,10 +428,22 @@ export default { } // 用户不再白名单内做银行卡鉴权 else { - let res = await checkCard(params) - this.$toast.clear() - if (res.result != '0') { - return this.$toast(res.resultMessage) + // 没通过鉴权进行银行卡鉴权 + if (!this.isPassedCardCheck) { + // 鉴权失败未达到3次调接口鉴权 + if (this.cardAuthCount < 3) { + let res = await checkCard(params) + this.$toast.clear() + if (res.result != '0') { + this.cardAuthCount++ + return this.$toast(res.resultMessage) + } + } + // 超过3次调用短信验证 + else { + this.isCaptchaModalShow = true + return + } } } } else { @@ -417,7 +517,14 @@ export default { } }, filters: { - idToText: filters.idToText + idToText: filters.idToText, + countDownText(val) { + if (isNaN(parseFloat(val))) { + return val + } else { + return `${val} s` + } + } } } diff --git a/src/views/ebiz/preserve/wt/WSurrenderInfo.vue b/src/views/ebiz/preserve/wt/WSurrenderInfo.vue index 74e1124ab..6a213ab4b 100644 --- a/src/views/ebiz/preserve/wt/WSurrenderInfo.vue +++ b/src/views/ebiz/preserve/wt/WSurrenderInfo.vue @@ -122,6 +122,20 @@ + + + + +

为确保是您本人操作,短信验证码将发送至您手机号{{ encryptMobile }},请您输入验证码以完成后续操作。

+
+ + + +
@@ -129,7 +143,7 @@ import { Field, Cell, CellGroup, Popup, Row, Col, Picker, Area } from 'vant' import BankCardScan from '@/components/ebiz/sale/BankCardScan' import { policyInfo, trial, changeEdor } from '@/api/ebiz/preserve/preserve' -import { getBankList, checkCard } from '@/api/ebiz/sale/sale' +import { getBankList, checkCard, getAuthCode, autchCodeCheck } from '@/api/ebiz/sale/sale' import dataDic from '../js/data-dictionary.js' import filters from '@/views/ebiz/preserve/filters' import getAreaName from '@/views/ebiz/preserve/js/utils/get-area-name' @@ -151,6 +165,13 @@ export default { }, data() { return { + cardAuthCount: 0, + isCaptchaModalShow: false, + code: '', + sid: '', + countDownNum: 0, + countDownTimer: null, + isPassedCardCheck: false, valueKey: '', popupShow: false, pickerType: '', @@ -199,6 +220,14 @@ export default { } } }, + computed: { + encryptMobile() { + if (this.customerInfo && this.customerInfo.customerMobile) { + return this.customerInfo.customerMobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2') + } + return '' + } + }, created() { this.customerInfo = JSON.parse(localStorage['preserve-customerInfo']) //客户详情 this.policy = JSON.parse(localStorage['preserve-policy']) @@ -219,6 +248,75 @@ export default { amtFormat1: filters.amtFormat1 }, methods: { + async getCaptcha() { + let data = { + operateType: 'appntInfoEntry', + type: 'H5', + operateCode: this.customerInfo.customerMobile, + system: 'agentApp', + operateCodeType: '0' + } + //获取验证码 + try { + let res = await getAuthCode(data) + if (res.result === '0') { + this.$toast(res.resultMessage) + this.sid = res.sessionId + this.countDownNum = 60 + this.countDownTimer = setInterval(() => { + this.countDownNum-- + if (this.countDownNum <= 0) { + clearInterval(this.countDownTimer) + this.countDownTimer = null + } + }, 1000) + } else { + this.$toast(res.resultMessage) + } + } catch (error) { + console.log(error) + this.$toast('网络异常') + } + }, + async onCaptchaConfirm(action, done) { + if (!this.sid) { + if (!this.isCancel) { + this.$toast('请先获取验证码') + } + done(false) + return + } + if (!this.code.trim()) { + done(false) + return this.$toast('请输入验证码') + } + try { + let res = await autchCodeCheck({ + smsId: this.sid, + code: this.code + }) + if (res.result === '0') { + this.isPassedCardCheck = true + this.nextStep() + } else { + this.$toast(res.resultMessage) + } + } catch (error) { + this.$toast('网络异常') + console.log(error) + } + this.onCaptchaCancel() + done() + }, + onCaptchaCancel() { + this.isCancel = true + this.isCaptchaModalShow = false + clearInterval(this.countDownTimer) + this.countDownTimer = null + this.countDownNum = 0 + this.sid = '' + this.code = '' + }, //获取试算信息 getTrial(data) { return new Promise((resolve, reject) => { @@ -449,10 +547,22 @@ export default { } // 用户不再白名单内做银行卡鉴权 else { - let res = await checkCard(params) - this.$toast.clear() - if (res.result != '0') { - return this.$toast(res.resultMessage) + // 没通过鉴权进行银行卡鉴权 + if (!this.isPassedCardCheck) { + // 鉴权失败未达到3次调接口鉴权 + if (this.cardAuthCount < 3) { + let res = await checkCard(params) + this.$toast.clear() + if (res.result != '0') { + this.cardAuthCount++ + return this.$toast(res.resultMessage) + } + } + // 超过3次调用短信验证 + else { + this.isCaptchaModalShow = true + return + } } } } else { From 5dee06bdb821b1099dc396898f9d4d30d95a4243 Mon Sep 17 00:00:00 2001 From: mengxiaolong Date: Thu, 10 Dec 2020 11:56:59 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95+=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/agentEenter/SignContract.vue | 15 ++- .../ebiz/claims/SignatureConfirmation.vue | 2 +- .../ebiz/preserve/common/HandleResult.vue | 118 +++++++++++++++--- 3 files changed, 112 insertions(+), 23 deletions(-) diff --git a/src/views/ebiz/agentEenter/SignContract.vue b/src/views/ebiz/agentEenter/SignContract.vue index e6a469e65..69554421a 100644 --- a/src/views/ebiz/agentEenter/SignContract.vue +++ b/src/views/ebiz/agentEenter/SignContract.vue @@ -362,17 +362,16 @@ export default { if (this.faceAuthCount < 3) { try { // eslint-disable-next-line no-undef - // const authRes = await EWebBridge.webCallAppInJs('face_auth', { - // businessSource: '2', //业务来源:1-电投,2-入司,3-理赔,4-保全 - // number: this.agentInfo.idNo, //身份证号码 - // name: this.agentInfo.name //姓名 - // }) - const authRes = await this.fakeFaceAuth(true) + const authRes = await EWebBridge.webCallAppInJs('face_auth', { + businessSource: '2', //业务来源:1-电投,2-入司,3-理赔,4-保全 + number: this.agentInfo.idNo, //身份证号码 + name: this.agentInfo.name //姓名 + }) + // const authRes = await this.fakeFaceAuth(true) console.log(authRes) - if (authRes.state == '1') { + if (JSON.parse(authRes).state == '1') { this.goUrl(code) } else { - this.$toast('人脸识别失败') // 人脸验证失败更新faceAuthCount this.faceAuthCount++ } diff --git a/src/views/ebiz/claims/SignatureConfirmation.vue b/src/views/ebiz/claims/SignatureConfirmation.vue index 497d6a6bb..97cab09ea 100644 --- a/src/views/ebiz/claims/SignatureConfirmation.vue +++ b/src/views/ebiz/claims/SignatureConfirmation.vue @@ -178,7 +178,7 @@ export default { }) console.log(this.sid, this.code) if (res.result === '0') { - this.goUrl(this.authCode) + this.showRead() } else { this.$toast(res.resultMessage) } diff --git a/src/views/ebiz/preserve/common/HandleResult.vue b/src/views/ebiz/preserve/common/HandleResult.vue index cd7f3a48c..5076b407b 100644 --- a/src/views/ebiz/preserve/common/HandleResult.vue +++ b/src/views/ebiz/preserve/common/HandleResult.vue @@ -9,17 +9,36 @@
客户确认
+ + + + + + +