mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-09 23:56:43 +08:00
银行卡签约需求-前端判断逻辑调整
This commit is contained in:
@@ -409,11 +409,19 @@ export default {
|
||||
},
|
||||
|
||||
async checkBankCardSign(){
|
||||
// 是否需要签约标识
|
||||
let isNeedSignFlag = true;
|
||||
// 1.短期险不需要签约
|
||||
console.log("是否是长险", this.$CacheUtils.getLocItem('isLongInsuranceFlag'))
|
||||
if (this.$CacheUtils.getLocItem('isLongInsuranceFlag') === 'N') {
|
||||
return true;
|
||||
isNeedSignFlag = false;
|
||||
}
|
||||
const bankCode = JSON.parse(window.localStorage.getItem('underWriteData')).bankCode;
|
||||
// 1.微信支付方式 2.银行卡支付 且 招商银行卡 需要签约
|
||||
if (!((this.radio == '' && ('CMB' == bankCode || '308' == bankCode)) || this.radio == '3')){
|
||||
isNeedSignFlag = false;
|
||||
}
|
||||
|
||||
this.$toast.clear()
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
@@ -423,25 +431,27 @@ export default {
|
||||
})
|
||||
//校验
|
||||
let data = { orderNo: this.orderNo }
|
||||
console.log("orderNo", data)
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve) => {
|
||||
if (!isNeedSignFlag) {
|
||||
resolve(true)
|
||||
return
|
||||
}
|
||||
getBankCardSignState(data).then(checkRes => {
|
||||
if (checkRes.result == '0') {
|
||||
this.$toast.clear()
|
||||
console.log("=========", checkRes)
|
||||
if (checkRes.signState == '2') {
|
||||
// 不需签约 或 已签约 不做处理 发起支付
|
||||
if (checkRes.signState == '2' || checkRes.needSign == '0') {
|
||||
// 不需签约 或 已签约 不做处理 可以发起支付
|
||||
localStorage.removeItem('changeCard')
|
||||
resolve(true);
|
||||
} else {
|
||||
const bankCode = JSON.parse(window.localStorage.getItem('underWriteData')).bankCode;
|
||||
} else if (checkRes.needSign == '1'){
|
||||
// 需要签约
|
||||
const shortUrl = checkRes.shortUrl;
|
||||
// 招商银行卡 提示去官微签约
|
||||
if(checkRes.signState == '1' && checkRes.needSign == '1' && this.radio == '' && ('CMB' == bankCode || '308' == bankCode)){
|
||||
if(checkRes.signState == '1'){
|
||||
// 需签约 且 未签约
|
||||
this.bankSignJump(shortUrl)
|
||||
resolve(false);
|
||||
}
|
||||
if (checkRes.signState == '4') {
|
||||
}else if (checkRes.signState == '4') {
|
||||
// 签约中
|
||||
this.$toast('亲,您的银行卡正在签约中,请稍后再试')
|
||||
resolve(false);
|
||||
@@ -466,12 +476,10 @@ export default {
|
||||
// on cancel
|
||||
resolve(false);
|
||||
});
|
||||
} else if (checkRes.signState == '1' && checkRes.needSign == '1' && this.radio == '3') {
|
||||
// 需签约 且 未签约
|
||||
// 提示去签约
|
||||
this.bankSignJump(shortUrl)
|
||||
resolve(false);
|
||||
}
|
||||
} else {
|
||||
this.$toast(checkRes.resultMessage)
|
||||
resolve(false);
|
||||
}
|
||||
}else{
|
||||
this.$toast(checkRes.resultMessage)
|
||||
|
||||
Reference in New Issue
Block a user