Files
ebiz-h5/src/views/ebiz/sale/PayMent.vue

751 lines
32 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="payMent-container redRadioCheckbox">
<div>
<van-cell-group>
<van-cell title="投保人" :value="underWriteData.appntName" />
<van-cell title="支付金额" :value="underWriteData.orderAmount == undefined ? '' : `${underWriteData.orderAmount}元`" class="payMent-title" />
<van-cell-group class="flex align-items-c">
<img :src="src" class="pl10" />
<van-cell title="银行卡支付" clickable>
<!-- <van-checkbox v-model="checked" class="flex justify-content-fe"></van-checkbox> -->
<van-radio-group v-model="radio" class="flex justify-content-fe">
<van-radio name=""></van-radio>
</van-radio-group>
</van-cell>
</van-cell-group>
<van-cell-group class="flex align-items-c">
<img :src="vxSrc" class="vximg" />
<van-cell title="微信支付" clickable>
<van-radio-group v-model="radio" class="flex justify-content-fe">
<van-radio name="3" @click="vxVerify"></van-radio>
</van-radio-group>
</van-cell>
</van-cell-group>
<van-cell title="姓名" :value="underWriteData.accountName" v-if="radio == '' && !isWeixin" />
<van-cell title="卡号" :value="underWriteData.cardBookCode" v-if="radio == '' && !isWeixin" />
<van-cell title="银行" v-if="radio == '' && !isWeixin">
<!-- <van-icon slot="right-icon" name="search" style="line-height: inherit;" /> -->
<div class="flex align-items-c justify-content-fe">
<img :src="srcImg" class="imgItem mr10" />
<span>{{ underWriteData.bankName }}</span>
</div>
</van-cell>
</van-cell-group>
<!-- 第三方支付所需表单 -->
<form ref="payForm" :action="formActionUrl" method="post">
<input name="TransSource" type="hidden" v-model="payParam.TransSource" />
<input name="TransDate" type="hidden" v-model="payParam.TransDate" />
<input name="TransTime" type="hidden" v-model="payParam.TransTime" />
<input name="TransSeq" type="hidden" v-model="payParam.TransSeq" />
<input name="Version" type="hidden" v-model="payParam.Version" />
<input name="RdSeq" type="hidden" v-model="payParam.RdSeq" />
<input name="PaymentCode" type="hidden" v-model="payParam.PaymentCode" />
<input name="PayType" type="hidden" v-model="payParam.PayType" />
<input name="SettleMode" type="hidden" v-model="payParam.SettleMode" />
<input name="ApplyEntity" type="hidden" v-model="payParam.ApplyEntity" />
<input name="Cur" type="hidden" v-model="payParam.Cur" />
<input name="OurAmount" type="hidden" v-model="payParam.OurAmount" />
<input name="FixUser" type="hidden" v-model="payParam.FixUser" />
<input name="Insurer" type="hidden" v-model="payParam.Insurer" />
<input name="CertType" type="hidden" v-model="payParam.CertType" />
<input name="CertNum" type="hidden" v-model="payParam.CertNum" />
<input name="OppBank" type="hidden" v-model="payParam.OppBank" />
<input name="OppAct" type="hidden" v-model="payParam.OppAct" />
<input name="OppActName" type="hidden" v-model="payParam.OppActName" />
<input name="CellPhone" type="hidden" v-model="payParam.CellPhone" />
<input name="ExpireDate" type="hidden" v-model="payParam.ExpireDate" />
<input name="Purpose" type="hidden" v-model="payParam.Purpose" />
<input name="Memo" type="hidden" v-model="payParam.Memo" />
<input name="Description" type="hidden" v-model="payParam.Description" />
<input name="SourceNotecode" type="hidden" v-model="payParam.SourceNotecode" />
<input name="ReturnURL" type="hidden" v-model="payParam.ReturnURL" />
<input name="NotifyURL" type="hidden" v-model="payParam.NotifyURL" />
<input name="SaleChannel" type="hidden" v-model="payParam.SaleChannel" />
<input name="ReqReserved1" type="hidden" v-model="payParam.ReqReserved1" />
<input name="ReqReserved2" type="hidden" v-model="payParam.ReqReserved2" />
<input name="ReqReserved3" type="hidden" v-model="payParam.ReqReserved3" />
<input name="ReqReserved4" type="hidden" v-model="payParam.ReqReserved4" />
<input name="ReqReserved5" type="hidden" v-model="payParam.ReqReserved5" />
<input name="S3Sign" type="hidden" v-model="payParam.S3Sign" />
</form>
</div>
<!-- <van-button class="m-btn fr" type="danger" @click="submit">确定</van-button>
<van-button class="m-btn fr green" @click="reset">重置</van-button>-->
<div class="bg-white bottom-btn" v-if="radio == '' && !isWeixin">
<van-button type="danger" style="width: 50vw" @click="cancel" v-no-more-click="1000">返回投保单列表</van-button>
<van-button type="danger" style="width: 50vw" @click="payMent" v-no-more-click="1000" :disabled="payStatus == '1' || payStatus == '2' || payStatus == '8'"
>去支付</van-button
>
</div>
<div class="bg-white bottom-btn" v-if="radio == '3' && !isWeixin">
<van-button type="danger" style="width: 50vw" @click="payMent" v-no-more-click="1000" :disabled="payStatus == '1' || payStatus == '2' || payStatus == '8'"
>去支付</van-button
>
<van-button type="danger" style="width: 50vw" @click="share" v-no-more-click="1000">分享</van-button>
</div>
<!-- 分享到微信的页面loading -->
<Loading :isLoading="isLoading"></Loading>
<van-dialog v-model="show" title="提示" show-cancel-button @confirm="authConfirm" :before-close="checkModelBeforeClose" @cancel="checkModelCancel">
<p class="p10 fs14">您的银行卡账户未进行续期签约为确保是您本人操作短信验证码已发送至您的手机号{{ encyCustomerMobile }}请您输入验证码完成签约流程~</p>
<van-cell-group class="flex align-items-c pr5 mb15">
<van-field maxlength="6" placeholder="请输入短信验证码" v-model="verfyCode" clearable label-width="0" />
</van-cell-group>
</van-dialog>
</div>
</template>
<script>
import { Cell, CellGroup, RadioGroup, Radio, Dialog } from 'vant'
import { acceptInsurance, getBankCardSignState,payFlag, underWrite, getOrderDetail,signConfirm} from '@/api/ebiz/sale/sale'
import Loading from '@/components/ebiz/Loading'
import config from '@/config'
import { wxShare } from '@/api/ebiz/common/common.js'
export default {
data() {
let isWeixin = this.$utils.device().isWeixin //判断环境
return {
encyCustomerMobile:'',//投保人手机号
show:false, //验证码弹框
rdSeq:'',
verfyCode:'', //验证码
orderNo: '', //订单号
// 支付表单
formActionUrl: config.payUrl,
// 单选
radio: '',
// 银行卡支付图片地址
src: this.$assetsUrl + 'images/cardImg.png',
// 微信支付图片地址
vxSrc: this.$assetsUrl + 'images/vxImg.png',
// 核保数据
underWriteData: {},
srcImg: '',
payParam: {
TransSource: '', // 对接系统
TransDate: '', // 请求日期
TransTime: '', // 请求时间
TransSeq: '', // 时间戳
Version: '', // 版本号
RdSeq: '', // 指令流水号
PaymentCode: '', // 业务唯一号
PayType: '', // 交易类型
SettleMode: '', // 支付方式
ApplyEntity: '', // 业务发生机构
Cur: '', // 币种
OurAmount: '', // 金额
FixUser: '', // 实名认证标识
Insurer: '', // 对接系统
CertType: '', // 证件类型
CertNum: '', // 证件号码
OppBank: '', // 交易方银行
OppAct: '', // 交易方账号
OppActName: '', // 交易方名称
CellPhone: '', // 手机号码
ExpireDate: '', // 订单失效时间
Purpose: '', // 用途
Memo: '', // 备注
Description: '', // 描述
SourceNotecode: '', // 外部系统业务单据号
ReturnURL: '', // 页面跳转同步通知地址
NotifyURL: '', // 后台通知地址
SaleChannel: '', // 销售渠道
ReqReserved1: '', // 备用字段1
ReqReserved2: '', // 备用字段2
ReqReserved3: '', // 备用字段3
ReqReserved4: '', // 备用字段4
ReqReserved5: '', // 备用字段5
S3Sign: '', // 验签信息
tradeState: '' // 状态
},
gotPayParam: false, // 是否已正确获取支付参数,
payStatus: '', // 接口返回的支付状态
isWeixin, // 是否为微信环境
isLoading: false, // 分享到微信后的页面loading
isShare:'' //0是点击分享 1是点击支付
}
},
created() {
if (this.isWeixin) {
this.radio = '3'
this.isLoading = true
}
},
mounted() {
this.orderNo = window.localStorage.getItem('orderNo')
if (this.$route.query.sourceFrom && this.$route.query.sourceFrom == 's3' && this.$route.query.orderNo) {
this.orderNo = this.$route.query.orderNo;
window.localStorage.setItem("orderNo",this.orderNo);
}
console.log('----保融form.action', config.payUrl)
document.body.style.backgroundColor = '#fff'
// 不在微信环境下
if (!this.isWeixin) {
if (localStorage.salelist == '1') {
// 第一次支付 调核保获取
this.underWrite().then(() => {
this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
this.underWriteData.idType = window.localStorage.getItem('AppntidType')
this.srcImg = this.$assetsUrl + `images/bank/${JSON.parse(window.localStorage.getItem('underWriteData')).bankCode}.png`
})
} else {
// 再次支付 调详情 获取信息
this.twounderWrite()
// this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
// this.srcImg = this.$assetsUrl + `images/bank/bank_${JSON.parse(window.localStorage.getItem('underWriteData')).bankCode}.png`
}
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.payMentWx(orderNo) //直接调支付
}
},
methods: {
getOpenid(){
wxShare({ url: location.href }).then(response => {
if (response.result == '0') {
let orderNo = this.$route.query.orderNo
let code = this.getUrlParam('code')
if(!code){
window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + response.content.appid + '&redirect_uri=' + encodeURIComponent(location.href + '?orderNo=' + orderNo) + '&response_type=code&scope=snsapi_base&state=1#wechat_redirect'
}else{
window.location.href = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=' + response.content.appid + '&secret=' + response.content.appsecret + '&code=' + code + '&grant_type=authorization_code'
}
}
})
},
// 获取地址上的参数
getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
},
async payMentWx(orderNo){
const res = await payFlag({ orderNo: orderNo })
console.dir(res)
if (res.result == '0' && res.content.payFlag == 'Y') {
this.getAcceptInsurance()
} else {
this.$toast(res.resultMessage)
setTimeout(() => {
this.$router.push({
path: '/sale/payResultFail',
query: {
orderNo: this.$route.query.orderNo
}
})
}, 2000)
}
},
getAcceptInsurance() {
let that = this
let data = {
orderNo: this.orderNo,
payType: this.radio
}
if(that.isWeixin){
data.payType = 'WXJSAPI'
}
acceptInsurance(data).then(res => {
console.log('----取支付参数结果:', JSON.stringify(res))
// res = {'result':'0','resultMessage':'','content':null,'prtNo':'8186270000000008','payStatus':'4','amnt':'63700.00','appntName':'投保人','message':null,'brPayReturnData':{'result':'','resultMessage':'','content':null,'businessId':'1569125393518','businessNo':'8186270000000008','tradeSubType':'COMM','businessType':'SALE','systemType':'GF','money':63700,'businessSubType':'XDCB','thirdType':'0002','thirdName':null,'bankCode':'ABC','epayOrderNo':'1909221209536259999900','companyAccount':null,'tradeState':'TRADING','standardCode':'DEALING','standardMsg':null,'thirdOrderNo':null,'respRemark':null,'tradeTime':'2019-09-22T04:09:53.518+0000','description':'','version':'1','sourceNotecode':'8186270000000008','payType':'MIT01','expireDate':'20191010101010','transSeq':'20190922120953782','transSource':'MIT','applyEntity':'11860000','paymentCode':'8186270000000008','transDate':'20190922','rdSeq':'1909221209536259999900','settleMode':null,'cur':'CNY','transTime':'120953','ourAmount':63700,'fixUser':'1','insurer':'投保人','certType':'0','certNum':'110101199009210011','oppBank':'ABC','oppAct':'6228481200290317812','oppActName':'投保人','cellPhone':null,'purpose':null,'memo':null,'returnURL':'http://139.199.50.151/#/sale/payResult','notifyURL':'http://139.199.50.151:7000/api/v1/epay/epay/payResult','s3Sign':'e3f0581ec6b751337e8eca360a0746bc'}}
if (res.result == '0') {
// 1成 4支付中 2支付失败 8转批扣(无此情况)
this.payStatus = res.payStatus
if (this.payStatus == '1') {
this.$toast({ message: '当前投保单已支付成功,请返回列表页查询', duration: 5000 })
return
}
// 支付参数大小写转换
let keyMap = {}
for (let key in this.payParam) {
keyMap[key.toLowerCase()] = key
}
let paramKey
for (let rKey in res.brPayReturnData) {
if (keyMap.hasOwnProperty(rKey.toLowerCase())) {
paramKey = keyMap[rKey.toLowerCase()]
this.payParam[paramKey] = res.brPayReturnData[rKey]
}
}
console.log('----支付参数this.payParam:', JSON.stringify(this.payParam))
this.gotPayParam = true
this.$forceUpdate()
let thisRef = this
this.$nextTick(() => {
thisRef.$refs.payForm.submit() // 表单提交,发起支付,跳至收银台
})
window.localStorage.setItem('resMessage', res.resultMessage)
window.localStorage.setItem('payStatus', res.payStatus)
window.localStorage.setItem('payInfo', JSON.stringify(res))
} else {
if (!this.isWeixin) {
that.$toast.clear()
} else {
this.isLoading = false
}
that.$toast(res.resultMessage)
}
})
},
// 点击支付
async payMent() {
if (!this.isWeixin) {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
}
// signFlag 是否完成签约
this.isShare = 1
let signFlag = await this.checkBankCardSign()
if (signFlag) {
const res = await payFlag({ orderNo: this.orderNo })
console.dir(res)
if (res.result == 0) {
if (res.content.payFlag == 'Y') {
this.getAcceptInsurance()
}
} else {
this.$toast(res.resultMessage)
}
}
},
// 取消支付
cancel() {
this.$toast.clear()
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/list',
backToFirst: '1'
},
routerInfo: {
path: '/sale/list'
}
})
},
// 再次支付
twounderWrite() {
getOrderDetail({ orderNo: window.localStorage.getItem('orderNo') }).then(res => {
console.log(res)
if (res.result == '0') {
this.$toast.clear()
console.log(res.orderDTO.orderAccountDTO.bankCode)
let underWriteData = {
accountName: res.orderDTO.orderAccountDTO.accountName,
appntName: res.orderDTO.appntDTO.name,
idType: res.orderDTO.appntDTO.idType,
bankCode: res.orderDTO.orderAccountDTO.bankCode,
bankName: res.orderDTO.orderAccountDTO.bankName,
cardBookCode: res.orderDTO.orderAccountDTO.cardBookCode,
orderAmount: res.orderDTO.orderInfoDTO.orderAmount,
orderNo: res.orderDTO.orderAccountDTO.orderNo,
result: '',
resultMessage: '交易处理成功',
uwResult: '02'
}
window.localStorage.setItem('underWriteData', JSON.stringify(underWriteData))
this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
this.srcImg = this.$assetsUrl + `images/bank/${JSON.parse(window.localStorage.getItem('underWriteData')).bankCode}.png`
let riskDTOLst = res.orderDTO.insuredDTOs[0].riskDTOLst[0];
// 判断是否为长期险 短期险不校验签约
if ((riskDTOLst.insuYearFlag == 'Y' && riskDTOLst.insuYear > 1) || riskDTOLst.insuYearFlag == 'A') {
this.$CacheUtils.setLocItem('isLongInsuranceFlag', "Y");
}else{
this.$CacheUtils.setLocItem('isLongInsuranceFlag', "N");
}
let mobile = res.orderDTO.appntDTO.mobile
this.encyCustomerMobile = mobile.slice(0, 3) + '****' + mobile.slice(-4)
console.log(this.encyCustomerMobil,'手机号2')
} else {
let underWriteData = {
accountName: '',
appntName: '',
idType: '',
bankCode: '',
bankName: '',
cardBookCode: '',
orderAmount: '',
orderNo: '',
result: '',
resultMessage: '交易处理失败',
uwResult: '00'
}
window.localStorage.setItem('underWriteData', JSON.stringify(underWriteData))
this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
this.srcImg = this.$assetsUrl + `images/bank/${JSON.parse(window.localStorage.getItem('underWriteData')).bankCode}.png`
this.$toast(res.resultMessage)
}
})
},
// 获取支付信息
underWrite() {
let data = {
platform: 'app',
type: '1',
orderDTO: {
orderInfoDTO: {
orderNo: window.localStorage.getItem('orderNo')
}
}
}
return underWrite(data).then(res => {
if (res.result == '0') {
this.$toast.clear()
if (res.uwResult == '02') {
// window.localStorage.setItem('uwResult', res.uwResult)
window.localStorage.setItem('underWriteData', JSON.stringify(res))
} else if (res.uwResult == '33') {
window.localStorage.setItem('underWriteData', JSON.stringify(res))
window.localStorage.setItem('uwResult', res.uwResult)
window.localStorage.setItem('resultMessage', res.message)
} else {
window.localStorage.setItem('uwResult', res.uwResult)
window.localStorage.setItem('underWriteData', JSON.stringify(res))
// window.localStorage.setItem('resultMessage', res.resultMessage)
}
getOrderDetail({ orderNo: window.localStorage.getItem('orderNo') }).then(res => {
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");
}else{
this.$CacheUtils.setLocItem('isLongInsuranceFlag', "N");
}
}
})
} else {
this.$toast(res.resultMessage)
}
})
},
// 选择微信支付校验身份证类型
vxVerify() {
if (this.underWriteData.idType != '1') {
Dialog.confirm({
message: '证件类型不是身份证,无法使用微信支付',
showCancelButton: false
}).then(() => {
this.radio = ''
})
}
},
async share() {
// signFlag 是否完成签约
this.isShare = 0
let signFlag = await this.checkBankCardSign()
if (signFlag) {
let shareName = this.underWriteData.appntName
EWebBridge.webCallAppInJs('bridge', {
flag: 'share',
extra: {
title: `国富人寿电子投保单(${shareName})付款`,
content: '投保单号:'+ localStorage.orderNo + '\n' + '支付金额:' + this.underWriteData.orderAmount + '元',
url: location.origin + '/#/sale/payMent?orderNo=' + localStorage.orderNo + '&token=' + localStorage.token,
img: this.$assetsUrl + 'images/logo.png'
}
})
}
},
bankSignJump(shortUrl){
const dialogContent = '亲,您的银行卡账户未进行续期签约~'
Dialog.alert({
message: dialogContent,
className: 'confirmBtn',
confirmButtonText: '去签约',
confirmButtonColor: '#ff5e50',
closeOnClickOverlay: true
}).then(() => {
//跳转页面
window.location.href = shortUrl
});
},
async checkBankCardSign(){
// 是否需要签约标识
let isNeedSignFlag = true;
// 1.短期险不需要签约
console.log("是否是长险", this.$CacheUtils.getLocItem('isLongInsuranceFlag'))
if (this.$CacheUtils.getLocItem('isLongInsuranceFlag') === 'N') {
isNeedSignFlag = false;
return true;
}
const bankCode = JSON.parse(window.localStorage.getItem('underWriteData')).bankCode;
// 1.微信支付方式 2.银行卡支付 且 招商银行卡 需要签约 20220426 招商银行不走官微签约,同其他银行签约流程
// if (!((this.radio == '' && ('CMB' == bankCode || '308' == bankCode)) || this.radio == '3')){
if (!(this.radio == '3')){
isNeedSignFlag = false;
return true;
}
this.$toast.clear()
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '校验续期银行卡签约中,请稍等'
})
//校验
let data = { orderNo: this.orderNo }
return new Promise((resolve) => {
if (!isNeedSignFlag) {
resolve(true)
return
}
getBankCardSignState(data).then(res => {
let checkRes = res.content
if (checkRes.result == '0') {
this.$toast.clear()
console.log("=========", checkRes)
if (checkRes.signState == '2' || checkRes.needSign == '0') {
// 不需签约 或 已签约 不做处理 可以发起支付
localStorage.removeItem('changeCard')
resolve(true);
} else if (checkRes.needSign == '1'){
if (checkRes.signConfirmType == '2'){
this.show = true
this.rdSeq = checkRes.rdSeq
resolve(false);
}else if (checkRes.signConfirmType == '3'){
Dialog.alert({
message: '亲,银行已发送短信至手机号'+ this.encyCustomerMobile +',按照短信提示完成短信回复签约,再次通过金掌桂完成后续流程。',
confirmButtonColor: '#ff5e50',
}).then(() => {})
resolve(false);
}else{
this.$toast('该微信绑定的银行卡金掌桂暂不支持续期签约!')
resolve(false);
}
// 需要签约
// const shortUrl = checkRes.shortUrl;
// if(checkRes.signState == '1'){
// // 需签约 且 未签约
// this.bankSignJump(shortUrl)
// resolve(false);
// }else
// if (checkRes.signState == '4' && shortUrl) {
if (checkRes.signState == '4') {
// 签约中
// if (checkRes.signConfirmType == '4' && ('CMB' == bankCode || '308' == bankCode)) {
// // signConfirmType = 4 代表 招行需签约
// // this.bankSignJump(shortUrl);
// Dialog.alert({
// message: '亲,招商银行卡请至官微续期签约~',
// confirmButtonColor: '#ff5e50',
// }).then(() => {})
// resolve(false);
// }
// else {
// 其他银行
// const info = '亲,银行卡已在签约中,请确认是否已完成续期银行卡签约,如未完成可以点击继续签约~'
const info = '亲,银行卡已在签约中,请稍后'
Dialog.alert({
message: info,
className: 'reConfirm leftConfirm',
// cancelButtonText: '确认',
// cancelButtonColor: '#ff5e50',
// confirmButtonText: '继续签约',
confirmButtonColor: '#ff5e50',
allowHtml: true
}).then(() => {
// 继续签约 跳转页面
// window.location.href = shortUrl
// resolve(false);
}).catch(() => {
// 返回 保留在当前页面
resolve(false);
})
// }
} else if (checkRes.signState == '3') {
// 签约失败
const info = '亲,您当前银行卡账户续期签约失败,\n原因' + checkRes.resultMessage
Dialog.confirm({
message: info,
className: 'reConfirm leftConfirm',
cancelButtonText: '返回',
cancelButtonColor: '#ff5e50',
confirmButtonText: '修改银行卡信息',
confirmButtonColor: '#ff5e50',
allowHtml: true
}).then(() => {
// on confirm
// 订单状态已同步修改为 签约失败,页面提示去修改银行卡信息
localStorage.setItem('changeCard', true)
this.$router.push({
path: '/sale/AccountInformation',
query: {
orderNo: this.$route.query.orderNo
}
})
resolve(false);
}).catch(() => {
// on cancel
resolve(false);
});
}
} else {
this.$toast(checkRes.resultMessage)
resolve(false);
}
}else{
// this.$toast(checkRes.resultMessage)
const info = '亲,您当前银行卡账户续期签约失败,\n原因' + checkRes.resultMessage
Dialog.confirm({
message: info,
className: 'reConfirm leftConfirm',
cancelButtonText: '返回',
cancelButtonColor: '#ff5e50',
confirmButtonText: '修改银行卡信息',
confirmButtonColor: '#ff5e50',
allowHtml: true
}).then(() => {
// on confirm
// 订单状态已同步修改为 签约失败,页面提示去修改银行卡信息
localStorage.setItem('changeCard', true)
this.$router.push({
path: '/sale/AccountInformation',
query: {
orderNo: this.$route.query.orderNo
}
})
resolve(false);
}).catch(() => {
// on cancel
resolve(false);
});
resolve(false);
}
})
})
},
// 验证码弹框--签约确认
authConfirm(){
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let data = {
rdSeq:this.rdSeq,
verfyCode:this.verfyCode,
businessNo:this.orderNo
}
if (!this.verfyCode || this.verfyCode == '') {
this.show = true
return this.$toast('请输入短信验证码')
}
if (this.verfyCode.length !== 6) {
this.show = true
return this.$toast('验证码格式错误')
}
signConfirm(data).then(res => {
this.verfyCode = ''
let data = res.content
if (data.result == '0') {
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({
message: info,
className: 'reConfirm leftConfirm',
cancelButtonText: '返回',
cancelButtonColor: '#ff5e50',
confirmButtonText: '修改银行卡信息',
confirmButtonColor: '#ff5e50',
allowHtml: true
}).then(() => {
// 订单状态已同步修改为 签约失败,页面提示去修改银行卡信息
localStorage.setItem('changeCard', true)
this.$router.push({
path: '/sale/AccountInformation',
query: {
orderNo: this.$route.query.orderNo
}
})
})
}
})
},
//弹窗关闭提示
checkModelBeforeClose(action, done) {
if (action === 'confirm' && !this.show) {
setTimeout(done, 1000)
} else {
done(false)
}
},
// 取消按钮
checkModelCancel() {
this.show = false
this.verfyCode = ''
}
},
components: {
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
[RadioGroup.name]: RadioGroup,
[Radio.name]: Radio,
[Dialog.name]: Dialog,
[Loading.name]: Loading
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()
}
}
</script>
<style lang="scss" scoped>
@import '@/assets/sass/variables.scss';
.payMent-title {
.van-cell__value {
/deep/ span {
color: $red;
}
}
}
.imgItem {
width: 20px;
height: 20px;
}
.vximg {
width: 25px;
height: 25px;
padding-left: 13px;
padding-right: 3px;
}
</style>