mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-10 01:06:45 +08:00
Merge branch 'feature/GFRS-1036【待确定】对接保融微信支付' into release/0514
This commit is contained in:
30
src/components/ebiz/Loading.vue
Normal file
30
src/components/ebiz/Loading.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div class="loading-container">
|
||||
<van-overlay :show="isLoading" z-index="999"> </van-overlay>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Overlay } from 'vant'
|
||||
export default {
|
||||
name: 'Loading',
|
||||
props: {
|
||||
isLoading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
components: {
|
||||
[Overlay.name]: Overlay
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/deep/.van-overlay {
|
||||
background: white;
|
||||
}
|
||||
</style>
|
||||
@@ -290,6 +290,7 @@ export default {
|
||||
//去支付
|
||||
goPay(order) {
|
||||
localStorage.orderNo = order.orderInfoDTO.orderNo
|
||||
localStorage.setItem('AppntidType', order.appntDTO.idType)
|
||||
localStorage.salelist = '1'
|
||||
localStorage.removeItem('changeCard')
|
||||
this.$jump({
|
||||
|
||||
@@ -9,13 +9,21 @@
|
||||
<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="1"></van-radio>
|
||||
<van-radio name=""></van-radio>
|
||||
</van-radio-group>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
<van-cell title="姓名" :value="underWriteData.accountName" />
|
||||
<van-cell title="卡号" :value="underWriteData.cardBookCode" />
|
||||
<van-cell title="银行">
|
||||
<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" />
|
||||
@@ -63,28 +71,40 @@
|
||||
</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">
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Cell, CellGroup, RadioGroup, Radio } from 'vant'
|
||||
import { Cell, CellGroup, RadioGroup, Radio, Dialog } from 'vant'
|
||||
import { acceptInsurance } from '@/api/ebiz/sale/sale'
|
||||
import { underWrite, getOrderDetail } from '@/api/ebiz/sale/sale'
|
||||
import Loading from '@/components/ebiz/Loading'
|
||||
import config from '@/config'
|
||||
export default {
|
||||
data() {
|
||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||
return {
|
||||
// 支付表单
|
||||
formActionUrl: config.payUrl,
|
||||
// 单选
|
||||
radio: '1',
|
||||
// 图片地址
|
||||
radio: '',
|
||||
// 银行卡支付图片地址
|
||||
src: this.$assetsUrl + 'images/cardImg.png',
|
||||
// 微信支付图片地址
|
||||
vxSrc: this.$assetsUrl + 'images/vxImg.png',
|
||||
// 核保数据
|
||||
underWriteData: {},
|
||||
srcImg: '',
|
||||
@@ -144,38 +164,59 @@ export default {
|
||||
CITIC: '302',
|
||||
PSBC: '7008',
|
||||
CIB: '309'
|
||||
}
|
||||
},
|
||||
isWeixin, // 是否为微信环境
|
||||
isLoading: false // 分享到微信后的页面loading
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isWeixin) {
|
||||
this.radio = '3'
|
||||
this.isLoading = true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log('----保融form.action', config.payUrl)
|
||||
document.body.style.backgroundColor = '#fff'
|
||||
if (localStorage.salelist == '1') {
|
||||
// 第一次支付 调核保获取
|
||||
this.underWrite().then(() => {
|
||||
this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
|
||||
this.srcImg = this.$assetsUrl + `images/bank/bank_${JSON.parse(window.localStorage.getItem('underWriteData')).bankCode}.png`
|
||||
})
|
||||
// 不在微信环境下
|
||||
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/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 {
|
||||
// 再次支付 调详情 获取信息
|
||||
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`
|
||||
let token = this.$route.query.token
|
||||
let orderNo = this.$route.query.orderNo
|
||||
localStorage.token = token
|
||||
localStorage.orderNo = orderNo
|
||||
this.payMent()
|
||||
}
|
||||
console.log('--自核结果--支付信息:', JSON.stringify(this.underWriteData))
|
||||
},
|
||||
methods: {
|
||||
// 点击支付
|
||||
payMent() {
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true, // 禁用背景点击
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
if (!this.isWeixin) {
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true, // 禁用背景点击
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
}
|
||||
let that = this
|
||||
let data = {
|
||||
orderNo: window.localStorage.getItem('orderNo')
|
||||
orderNo: window.localStorage.getItem('orderNo'),
|
||||
payType: this.radio
|
||||
}
|
||||
acceptInsurance(data).then(res => {
|
||||
console.log('----取支付参数结果:', JSON.stringify(res))
|
||||
@@ -214,7 +255,11 @@ export default {
|
||||
window.localStorage.setItem('payStatus', res.payStatus)
|
||||
window.localStorage.setItem('payInfo', JSON.stringify(res))
|
||||
} else {
|
||||
that.$toast.clear()
|
||||
if (!this.isWeixin) {
|
||||
that.$toast.clear()
|
||||
} else {
|
||||
this.isLoading = false
|
||||
}
|
||||
that.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
@@ -244,6 +289,7 @@ export default {
|
||||
let underWriteData = {
|
||||
accountName: res.orderDTO.orderAccountDTO.accountName,
|
||||
appntName: res.orderDTO.appntDTO.name,
|
||||
idType: res.orderDTO.appntDTO.idType,
|
||||
bankCode: _this.typebank[res.orderDTO.orderAccountDTO.bankCode],
|
||||
bankName: res.orderDTO.orderAccountDTO.bankName,
|
||||
cardBookCode: res.orderDTO.orderAccountDTO.cardBookCode,
|
||||
@@ -260,6 +306,7 @@ export default {
|
||||
let underWriteData = {
|
||||
accountName: '',
|
||||
appntName: '',
|
||||
idType: '',
|
||||
bankCode: '',
|
||||
bankName: '',
|
||||
cardBookCode: '',
|
||||
@@ -307,13 +354,38 @@ export default {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择微信支付校验身份证类型
|
||||
vxVerify() {
|
||||
if (this.underWriteData.idType != '1') {
|
||||
Dialog.confirm({
|
||||
message: '证件类型不是身份证,无法使用微信支付',
|
||||
showCancelButton: false
|
||||
}).then(() => {
|
||||
this.radio = ''
|
||||
})
|
||||
}
|
||||
},
|
||||
share() {
|
||||
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'
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
components: {
|
||||
[Cell.name]: Cell,
|
||||
[CellGroup.name]: CellGroup,
|
||||
[RadioGroup.name]: RadioGroup,
|
||||
[Radio.name]: Radio
|
||||
[Radio.name]: Radio,
|
||||
[Dialog.name]: Dialog,
|
||||
[Loading.name]: Loading
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
document.body.style.backgroundColor = ''
|
||||
@@ -335,4 +407,10 @@ export default {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
.vximg {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
padding-left: 13px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
</div>
|
||||
|
||||
<div class="bottom-btn bg-white" v-if="payStatus == '1' || payStatus == '4' || payStatus == '8'">
|
||||
<van-button type="danger" size="large" @click="next" v-no-more-click="1000">返回列表页</van-button>
|
||||
<van-button type="danger" size="large" @click="next" v-no-more-click="1000"> {{isWeixin ? '返回' :'返回列表页'}}</van-button>
|
||||
</div>
|
||||
<div class="bottom-area bottom-btn flex" v-if="payStatus == '2'">
|
||||
<van-button class="m-btn w250" type="danger" size="normal" @click="rePayMent">重新支付</van-button>
|
||||
<van-button class="m-btn w250" type="danger" size="normal" @click="next">返回列表页</van-button>
|
||||
<van-button class="m-btn w250" type="danger" size="normal" @click="next">{{isWeixin ? '返回' :'返回列表页'}}</van-button>
|
||||
</div>
|
||||
<div class="bottom-area bottom-btn flex" v-if="payStatus == '9'">
|
||||
<van-button class="m-btn w250" type="danger" size="normal" @click="rePayMent">重新支付</van-button>
|
||||
@@ -50,7 +50,9 @@ import { Cell, CellGroup } from 'vant'
|
||||
import { getPayState } from '@/api/ebiz/sale/sale'
|
||||
export default {
|
||||
data() {
|
||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||
return {
|
||||
isWeixin,
|
||||
// 保融收银台返回的支付流水号
|
||||
paySeqNo: '',
|
||||
// 接口返回数据前,不做页面渲染
|
||||
@@ -80,16 +82,19 @@ export default {
|
||||
methods: {
|
||||
// 返回列表页
|
||||
next() {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/sale/list'
|
||||
},
|
||||
|
||||
routerInfo: {
|
||||
path: '/sale/list'
|
||||
}
|
||||
})
|
||||
if(this.isWeixin){
|
||||
WeixinJSBridge.call("closeWindow");
|
||||
}else{
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/sale/list'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/sale/list'
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 查询支付状态
|
||||
queryPayState() {
|
||||
|
||||
@@ -994,7 +994,7 @@ export default {
|
||||
}
|
||||
}*/
|
||||
localStorage.setItem('lastOrderNo', data.orderNo)
|
||||
|
||||
localStorage.setItem('AppntidType', res.orderDTO.appntDTO.idType)
|
||||
this.$toast.clear()
|
||||
this.$utils.intLocalStorage(res)
|
||||
// 获取被保险人信息recmd
|
||||
|
||||
Reference in New Issue
Block a user