This commit is contained in:
bai.jinyan
2021-11-05 18:34:49 +08:00
2 changed files with 46 additions and 3 deletions

View File

@@ -172,6 +172,7 @@ service.interceptors.request.use(
let u = navigator.userAgent;
let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //判断是否是 android终端
if(isAndroid){
console.log(window.Android.getToken(),'Android获取token')
CacheUtils.setLocItem('token', JSON.parse(window.Android.getToken()))
}else{
const res = await EWebBridge.webCallAppInJs('getToken')

View File

@@ -158,7 +158,8 @@ export default {
gotPayParam: false, // 是否已正确获取支付参数,
payStatus: '', // 接口返回的支付状态
isWeixin, // 是否为微信环境
isLoading: false // 分享到微信后的页面loading
isLoading: false, // 分享到微信后的页面loading
isShare:'' //0是点击分享 1是点击支付
}
},
created() {
@@ -193,13 +194,26 @@ export default {
console.log('--自核结果--支付信息:', JSON.stringify(this.underWriteData))
} else {
let token = this.$route.query.token
this.orderNo = this.$route.query.orderNo
let orderNo = this.$route.query.orderNo
localStorage.token = token
localStorage.orderNo = orderNo
this.payMent()
this.payMentWx(orderNo) //直接调支付
}
},
methods: {
async payMentWx(orderNo){
const res = await payFlag({ orderNo: orderNo })
console.dir(res)
if (res.content.payFlag == 'Y') {
this.getAcceptInsurance()
} else {
this.$toast(res.resultMessage)
setTimeout(() => {
this.$router.push({ path: '/sale/payResultFail' })
}, 2000)
}
},
getAcceptInsurance() {
let that = this
let data = {
@@ -263,6 +277,7 @@ export default {
})
}
// signFlag 是否完成签约
this.isShare = 1
let signFlag = await this.checkBankCardSign()
if (signFlag) {
const res = await payFlag({ orderNo: this.orderNo })
@@ -324,6 +339,7 @@ export default {
}
let mobile = res.orderDTO.appntDTO.mobile
this.encyCustomerMobile = mobile.slice(0, 3) + '****' + mobile.slice(-4)
console.log(this.encyCustomerMobil,'手机号2')
} else {
let underWriteData = {
accountName: '',
@@ -376,6 +392,9 @@ export default {
if (res.result == '0') {
this.$toast.clear()
let riskDTOLst = res.orderDTO.insuredDTOs[0].riskDTOLst[0];
let mobile = res.orderDTO.appntDTO.mobile
this.encyCustomerMobile = mobile.slice(0, 3) + '****' + mobile.slice(-4)
console.log(this.encyCustomerMobil,'手机号1')
// 判断是否为长期险 短期险不校验签约
if ((riskDTOLst.insuYearFlag == 'Y' && riskDTOLst.insuYear > 1) || riskDTOLst.insuYearFlag == 'A') {
this.$CacheUtils.setLocItem('isLongInsuranceFlag', "Y");
@@ -402,6 +421,7 @@ export default {
},
async share() {
// signFlag 是否完成签约
this.isShare = 0
let signFlag = await this.checkBankCardSign()
if (signFlag) {
let shareName = this.underWriteData.appntName
@@ -577,6 +597,12 @@ export default {
},
// 验证码弹框--签约确认
authConfirm(){
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let data = {
rdSeq:this.rdSeq,
verfyCode:this.verfyCode,
@@ -594,8 +620,24 @@ export default {
this.verfyCode = ''
let data = res.content
if (data.result == '0') {
this.getAcceptInsurance()
this.$toast.clear()
this.show = false
if(this.isShare == 1){
this.getAcceptInsurance()
}else if(this.isShare == 0){
let shareName = this.underWriteData.appntName
EWebBridge.webCallAppInJs('bridge', {
flag: 'share',
extra: {
title: `国富人寿电子投保单(${shareName})付款`,
content: '付款进行',
url: location.origin + '/#/sale/payMent?orderNo=' + localStorage.orderNo + '&token=' + localStorage.token,
img: this.$assetsUrl + 'images/logo.png'
}
})
}
}else{
this.$toast.clear()
// 签约失败
const info = '亲,您当前银行卡账户续期签约失败,\n原因' + data.resultMessage
Dialog.confirm({