Merge branch 'feature/GFRS-2069【待确定】白名单管理' into dev

# Conflicts:
#	src/views/ebiz/preserve/common/HandleResult.vue
This commit is contained in:
mengxiaolong
2020-12-10 14:54:28 +08:00
8 changed files with 724 additions and 75 deletions

View File

@@ -369,10 +369,9 @@ export default {
})
// 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++
}

View File

@@ -406,6 +406,20 @@
<div class="bottom-btn bg-white">
<van-button type="danger" size="large" @click="nextStep" v-no-more-click="1000">下一步</van-button>
</div>
<!-- 短信验证弹窗 -->
<van-dialog v-model="isCaptchaModalShow" title="提示" show-cancel-button :before-close="onCaptchaConfirm" @cancel="onCaptchaCancel">
<van-cell>
<p class="fs14">为确保是您本人操作短信验证码将发送至您手机号{{ encryptMobile }}请您输入验证码以完成后续操作</p>
</van-cell>
<van-field v-model="code" type="number" :maxlength="6" center clearable label="短信验证码" placeholder="请输入短信验证码">
<template #button>
<van-button size="small" type="danger" :disabled="countDownNum !== 0" @click="getCaptcha">{{
countDownNum === 0 ? '获取验证码' : countDownNum | countDownText
}}</van-button>
</template>
</van-field>
</van-dialog>
</div>
</template>
@@ -423,7 +437,7 @@ import idNoCheck from '@/assets/js/utils/idNoCheck'
import { apply, query } from '@/api/ebiz/claims/claims'
import { idToData } from '@/views/ebiz/customer/js/verification'
import BankCardScan from '@/components/ebiz/sale/BankCardScan'
import { getBankList, checkCard } from '@/api/ebiz/sale/sale'
import { getBankList, checkCard, getAuthCode, autchCodeCheck } from '@/api/ebiz/sale/sale'
import { getIdentityInfo, onDateConfirm, effectiveDataTypeChange } from '../sale/js/methods'
import occupationList from '@/components/ebiz/occipation/data/occupation'
import getAreaName from '@/assets/js/utils/get-area-name'
@@ -452,12 +466,15 @@ export default {
},
data() {
return {
// change: '', //待修改!!
// OtherFeesList: [], //暂定其他费用的数组
cardAuthCount: 0,
isCaptchaModalShow: false,
code: '',
sid: '',
countDownNum: 0,
countDownTimer: null,
isPassedCardCheck: false,
customerNo: '', //客户编号
DataIndex: '', //点击客户的index用来获取对应客户信息
// CustomerDetails:[],//客户详情数据
currentDate: new Date(), //当前时间
customerShowPicker: false,
currentPopupIndex: '',
@@ -545,6 +562,14 @@ export default {
]
}
},
computed: {
encryptMobile() {
if (this.userInfo && this.userInfo.applyerMobile) {
return this.userInfo.applyerMobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
}
return ''
}
},
created() {
this.getBankList()
this.init()
@@ -562,6 +587,75 @@ export default {
next()
},
methods: {
async getCaptcha() {
let data = {
operateType: 'appntInfoEntry',
type: 'H5',
operateCode: this.appntDTO.mobile,
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.save()
} 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 = ''
},
init() {
let data = {
slaveStatus: this.slaveStatus,
@@ -1142,9 +1236,21 @@ export default {
}
// 用户不再白名单内做银行卡鉴权
else {
let res = await checkCard(params)
if (res.result != '0') {
return this.$toast(res.resultMessage)
// 没通过鉴权进行银行卡鉴权
if (!this.isPassedCardCheck) {
// 鉴权失败未达到3次调接口鉴权
if (this.cardAuthCount < 3) {
let res = await checkCard(params)
if (res.result != '0') {
this.cardAuthCount++
return this.$toast(res.resultMessage)
}
}
// 超过3次调用短信验证
else {
this.isCaptchaModalShow = true
return
}
}
}
} else {
@@ -1187,6 +1293,15 @@ export default {
// }
// console.log(this.OtherFeesList)
// }
},
filters: {
countDownText(val) {
if (isNaN(parseFloat(val))) {
return val
} else {
return `${val} s`
}
}
}
}
</script>

View File

@@ -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)
}

View File

@@ -9,17 +9,36 @@
</div>
<div class="bg-white bottom-btn"><van-button type="danger" size="large" @click="nextStep" v-no-more-click="2000">客户确认</van-button></div>
<!-- 短信验证弹窗 -->
<van-dialog v-model="isCaptchaModalShow" title="提示" show-cancel-button :before-close="onCaptchaConfirm" @cancel="onCaptchaCancel">
<van-field v-model="code" type="number" :maxlength="6" center clearable label="短信验证码" placeholder="请输入短信验证码">
<template #button>
<van-button size="small" type="danger" :disabled="countDownNum !== 0" @click="getCaptcha">{{
countDownNum === 0 ? '获取验证码' : countDownNum | countDownText
}}</van-button>
</template>
</van-field>
</van-dialog>
</div>
</template>
<script>
import utilsAge from '@/assets/js/utils/age'
// import { getWhitelist } from '@/api/ebiz/whitelist'
import { getAuthCode, autchCodeCheck } from '@/api/ebiz/sale/sale'
import { getWhitelist } from '@/api/ebiz/whitelist'
export default {
name: 'HandleResult',
data() {
return {
// 人脸验证次数
faceAuthCount: 0,
isCaptchaModalShow: false,
code: '',
sid: '',
countDownNum: 0,
countDownTimer: null,
path: '', //页面跳转路径
srcSuccess: this.$assetsUrl + 'images/success.png',
entry: '',
@@ -66,6 +85,72 @@ export default {
document.getElementsByTagName('body')[0].classList.remove('bg-white')
},
methods: {
async onCaptchaConfirm(action, done) {
if (!this.sid) {
done(false)
return
}
if (!this.code.trim()) {
done(false)
return this.$toast('请输入验证码')
}
try {
let res = await autchCodeCheck({
smsId: this.sid,
code: this.code
})
console.log(this.sid, this.code)
if (res.result === '0') {
this.jumpNextPage(this.path)
} else {
this.$toast(res.resultMessage)
}
} catch (error) {
this.$toast('网络异常')
console.log(error)
}
this.onCaptchaCancel()
done()
},
onCaptchaCancel() {
this.isCaptchaModalShow = false
clearInterval(this.countDownTimer)
this.countDownTimer = null
this.countDownNum = 0
this.sid = ''
this.code = ''
},
async getCaptcha() {
let data = {
operateType: 'appntInfoEntry',
type: 'H5',
operateCode: this.agentInfo.mobile,
system: 'agentApp',
operateCodeType: '0'
}
//获取验证码
try {
let res = await getAuthCode(data)
console.log(res)
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('网络异常')
}
},
nextStep() {
if (this.entry != 'BC') {
// 如果 保全项不是 受益人变更、则 在证件类型为身份证时 直接接入人脸识别
@@ -122,34 +207,33 @@ export default {
})
},
async toFace(config) {
// const res = await getWhitelist({
// idNo: this.customerInfo.idNo,
// name: this.customerInfo.customerName,
// whiteType: 'edor_face_show'
// })
// if (res.result === '0') {
// // 用户在白名单内
// if (res.content && res.content.length) {
// this.jumpNextPage(this.path)
// return
// }
// } else {
// this.$toast(res.resultMessage)
// }
// eslint-disable-next-line no-undef
// EWebBridge.webCallAppInJs('face_auth', config) //启用人脸识别
// 跳过人脸识别
new Promise(resolve => {
console.log('--跳过人脸识别--返回识别成功')
resolve(JSON.stringify({ state: '1' }))
}).then(data => {
if (JSON.parse(data).state == '1') {
const res = await getWhitelist({
idNo: this.customerInfo.idNo,
name: this.customerInfo.customerName,
whiteType: 'edor_face_show'
})
if (res.result === '0') {
// 用户在白名单内
if (res.content && res.content.length) {
this.jumpNextPage(this.path)
return
}
} else {
this.$toast(res.resultMessage)
}
if (this.faceAuthCount < 3) {
// eslint-disable-next-line no-undef
const authRes = await EWebBridge.webCallAppInJs('face_auth', config)
if (JSON.parse(authRes).state == '1') {
this.jumpNextPage(this.path)
} else {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_toast', '人脸检测失败')
this.faceAuthCount++
}
})
} else {
this.isCaptchaModalShow = true
}
}
}
}

View File

@@ -120,6 +120,20 @@
</div>
<!-- 银行卡扫描 -->
<BankCardScan :scanShow="isScan" :clear="false" @getScanInfo="getBankCardInfo"></BankCardScan>
<!-- 短信验证弹窗 -->
<van-dialog v-model="isCaptchaModalShow" title="提示" show-cancel-button :before-close="onCaptchaConfirm" @cancel="onCaptchaCancel">
<van-cell>
<p class="fs14">为确保是您本人操作短信验证码将发送至您手机号{{ encryptMobile }}请您输入验证码以完成后续操作</p>
</van-cell>
<van-field v-model="code" type="number" :maxlength="6" center clearable label="短信验证码" placeholder="请输入短信验证码">
<template #button>
<van-button size="small" type="danger" :disabled="countDownNum !== 0" @click="getCaptcha">{{
countDownNum === 0 ? '获取验证码' : countDownNum | countDownText
}}</van-button>
</template>
</van-field>
</van-dialog>
</div>
</template>
@@ -127,7 +141,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'
@@ -149,6 +163,13 @@ export default {
},
data() {
return {
cardAuthCount: 0,
isCaptchaModalShow: false,
code: '',
sid: '',
countDownNum: 0,
countDownTimer: null,
isPassedCardCheck: false,
valueKey: '',
popupShow: false,
pickerType: '',
@@ -200,6 +221,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'])
@@ -217,9 +246,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) => {
@@ -452,10 +557,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 {

View File

@@ -86,6 +86,20 @@
<p class="p15 pb20 fs14 text-center">该客户涉及到的所有保单相应信息将变更</p>
</van-dialog>
</div>
<!-- 短信验证弹窗 -->
<van-dialog v-model="isCaptchaModalShow" title="提示" show-cancel-button :before-close="onCaptchaConfirm" @cancel="onCaptchaCancel">
<van-cell>
<p class="fs14">为确保是您本人操作短信验证码将发送至您手机号{{ encryptMobile }}请您输入验证码以完成后续操作</p>
</van-cell>
<van-field v-model="code" type="number" :maxlength="6" center clearable label="短信验证码" placeholder="请输入短信验证码">
<template #button>
<van-button size="small" type="danger" :disabled="countDownNum !== 0" @click="getCaptcha">{{
countDownNum === 0 ? '获取验证码' : countDownNum | countDownText
}}</van-button>
</template>
</van-field>
</van-dialog>
</div>
</template>
@@ -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`
}
}
}
}
</script>

View File

@@ -120,6 +120,20 @@
</div>
<!-- 银行卡扫描 -->
<BankCardScan :scanShow="isScan" :clear="false" @getScanInfo="getBankCardInfo"></BankCardScan>
<!-- 短信验证弹窗 -->
<van-dialog v-model="isCaptchaModalShow" title="提示" show-cancel-button :before-close="onCaptchaConfirm" @cancel="onCaptchaCancel">
<van-cell>
<p class="fs14">为确保是您本人操作短信验证码将发送至您手机号{{ encryptMobile }}请您输入验证码以完成后续操作</p>
</van-cell>
<van-field v-model="code" type="number" :maxlength="6" center clearable label="短信验证码" placeholder="请输入短信验证码">
<template #button>
<van-button size="small" type="danger" :disabled="countDownNum !== 0" @click="getCaptcha">{{
countDownNum === 0 ? '获取验证码' : countDownNum | countDownText
}}</van-button>
</template>
</van-field>
</van-dialog>
</div>
</template>
@@ -127,7 +141,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'
@@ -149,6 +163,13 @@ export default {
},
data() {
return {
cardAuthCount: 0,
isCaptchaModalShow: false,
code: '',
sid: '',
countDownNum: 0,
countDownTimer: null,
isPassedCardCheck: false,
valueKey: '',
popupShow: false,
pickerType: '',
@@ -197,6 +218,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'])
@@ -217,6 +246,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) => {
@@ -447,10 +545,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 {

View File

@@ -135,12 +135,26 @@
@cancel="isAreaListShow = false"
/>
</van-popup>
<!-- 短信验证弹窗 -->
<van-dialog v-model="isCaptchaModalShow" title="提示" show-cancel-button :before-close="onCaptchaConfirm" @cancel="onCaptchaCancel">
<van-cell>
<p class="fs14">为确保是您本人操作短信验证码将发送至您手机号{{ encryptMobile }}请您输入验证码以完成后续操作</p>
</van-cell>
<van-field v-model="code" type="number" :maxlength="6" center clearable label="短信验证码" placeholder="请输入短信验证码">
<template #button>
<van-button size="small" type="danger" :disabled="countDownNum !== 0" @click="getCaptcha">{{
countDownNum === 0 ? '获取验证码' : countDownNum | countDownText
}}</van-button>
</template>
</van-field>
</van-dialog>
</div>
</template>
<script>
import { Cell, CellGroup, Field, RadioGroup, Radio, Popup, List, Switch, Toast, SwitchCell, Icon, Area } from 'vant'
import { saveInformation, getOrderDetail, checkCard } from '@/api/ebiz/sale/sale'
import { saveInformation, getOrderDetail, checkCard, getAuthCode, autchCodeCheck } from '@/api/ebiz/sale/sale'
import utilsAge from '@/assets/js/utils/age'
import BankCardScan from '@/components/ebiz/sale/BankCardScan'
import IndexBar from '@/components/ebiz/sale/IndexBar'
@@ -150,6 +164,14 @@ import { getWhitelist } from '@/api/ebiz/whitelist'
export default {
data() {
return {
cardAuthCount: 0,
isCaptchaModalShow: false,
code: '',
sid: '',
countDownNum: 0,
countDownTimer: null,
isPassedCardCheck: false,
isCancel: false,
inputShow: true, //模糊查询功能
islistShow: false, //选择银行弹窗
// 选中后传给后端的投保人或者被保险人名字
@@ -202,6 +224,75 @@ export default {
}
},
methods: {
async getCaptcha() {
let data = {
operateType: 'appntInfoEntry',
type: 'H5',
operateCode: this.appntDTO.mobile,
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.next()
} 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 = ''
},
areaSelect() {
this.isAreaListShow = true
this.$refs['areaSelect'].reset('450000')
@@ -348,7 +439,7 @@ export default {
bankNo: this.bankId,
whiteType: 'sale_bank_check'
})
console.log(whiteRes)
console.log('白名单查询结果: ', whiteRes)
if (whiteRes.result === '0') {
// 用户在白名单内
@@ -357,17 +448,28 @@ export default {
}
// 用户不再白名单内做银行卡鉴权
else {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let res = await checkCard(cardData)
console.log(res)
this.$toast.clear()
if (res.result !== '0') {
return this.$toast(res.resultMessage)
if (!this.isPassedCardCheck) {
// 鉴权次数未达到3次
if (this.cardAuthCount < 3) {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let res = await checkCard(cardData)
this.$toast.clear()
if (res.result !== '0') {
this.cardAuthCount++
return this.$toast(res.resultMessage)
}
}
// 鉴权次数达到3次
else {
this.isCaptchaModalShow = true
this.isCancel = false
return
}
}
}
} else {
@@ -608,6 +710,12 @@ export default {
listenChange() {
const { bankId, bank } = this
return { bankId, bank }
},
encryptMobile() {
if (this.appntDTO && this.appntDTO.mobile) {
return this.appntDTO.mobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
}
return ''
}
},
watch: {
@@ -625,6 +733,15 @@ export default {
}
}
},
filters: {
countDownText(val) {
if (isNaN(parseFloat(val))) {
return val
} else {
return `${val} s`
}
}
},
components: {
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,