mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 20:16:44 +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) {
|
goPay(order) {
|
||||||
localStorage.orderNo = order.orderInfoDTO.orderNo
|
localStorage.orderNo = order.orderInfoDTO.orderNo
|
||||||
|
localStorage.setItem('AppntidType', order.appntDTO.idType)
|
||||||
localStorage.salelist = '1'
|
localStorage.salelist = '1'
|
||||||
localStorage.removeItem('changeCard')
|
localStorage.removeItem('changeCard')
|
||||||
this.$jump({
|
this.$jump({
|
||||||
|
|||||||
@@ -9,13 +9,21 @@
|
|||||||
<van-cell title="银行卡支付" clickable>
|
<van-cell title="银行卡支付" clickable>
|
||||||
<!-- <van-checkbox v-model="checked" class="flex justify-content-fe"></van-checkbox> -->
|
<!-- <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-group v-model="radio" class="flex justify-content-fe">
|
||||||
<van-radio name="1"></van-radio>
|
<van-radio name=""></van-radio>
|
||||||
</van-radio-group>
|
</van-radio-group>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
<van-cell title="姓名" :value="underWriteData.accountName" />
|
<van-cell-group class="flex align-items-c">
|
||||||
<van-cell title="卡号" :value="underWriteData.cardBookCode" />
|
<img :src="vxSrc" class="vximg" />
|
||||||
<van-cell title="银行">
|
<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;" /> -->
|
<!-- <van-icon slot="right-icon" name="search" style="line-height: inherit;" /> -->
|
||||||
<div class="flex align-items-c justify-content-fe">
|
<div class="flex align-items-c justify-content-fe">
|
||||||
<img :src="srcImg" class="imgItem mr10" />
|
<img :src="srcImg" class="imgItem mr10" />
|
||||||
@@ -63,28 +71,40 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- <van-button class="m-btn fr" type="danger" @click="submit">确定</van-button>
|
<!-- <van-button class="m-btn fr" type="danger" @click="submit">确定</van-button>
|
||||||
<van-button class="m-btn fr green" @click="reset">重置</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="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 type="danger" style="width: 50vw" @click="payMent" v-no-more-click="1000" :disabled="payStatus == '1' || payStatus == '2' || payStatus == '8'"
|
||||||
>去支付</van-button
|
>去支付</van-button
|
||||||
>
|
>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { Cell, CellGroup, RadioGroup, Radio } from 'vant'
|
import { Cell, CellGroup, RadioGroup, Radio, Dialog } from 'vant'
|
||||||
import { acceptInsurance } from '@/api/ebiz/sale/sale'
|
import { acceptInsurance } from '@/api/ebiz/sale/sale'
|
||||||
import { underWrite, getOrderDetail } from '@/api/ebiz/sale/sale'
|
import { underWrite, getOrderDetail } from '@/api/ebiz/sale/sale'
|
||||||
|
import Loading from '@/components/ebiz/Loading'
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||||
return {
|
return {
|
||||||
// 支付表单
|
// 支付表单
|
||||||
formActionUrl: config.payUrl,
|
formActionUrl: config.payUrl,
|
||||||
// 单选
|
// 单选
|
||||||
radio: '1',
|
radio: '',
|
||||||
// 图片地址
|
// 银行卡支付图片地址
|
||||||
src: this.$assetsUrl + 'images/cardImg.png',
|
src: this.$assetsUrl + 'images/cardImg.png',
|
||||||
|
// 微信支付图片地址
|
||||||
|
vxSrc: this.$assetsUrl + 'images/vxImg.png',
|
||||||
// 核保数据
|
// 核保数据
|
||||||
underWriteData: {},
|
underWriteData: {},
|
||||||
srcImg: '',
|
srcImg: '',
|
||||||
@@ -144,38 +164,59 @@ export default {
|
|||||||
CITIC: '302',
|
CITIC: '302',
|
||||||
PSBC: '7008',
|
PSBC: '7008',
|
||||||
CIB: '309'
|
CIB: '309'
|
||||||
}
|
},
|
||||||
|
isWeixin, // 是否为微信环境
|
||||||
|
isLoading: false // 分享到微信后的页面loading
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.isWeixin) {
|
||||||
|
this.radio = '3'
|
||||||
|
this.isLoading = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log('----保融form.action', config.payUrl)
|
console.log('----保融form.action', config.payUrl)
|
||||||
document.body.style.backgroundColor = '#fff'
|
document.body.style.backgroundColor = '#fff'
|
||||||
if (localStorage.salelist == '1') {
|
// 不在微信环境下
|
||||||
// 第一次支付 调核保获取
|
if (!this.isWeixin) {
|
||||||
this.underWrite().then(() => {
|
if (localStorage.salelist == '1') {
|
||||||
this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
|
// 第一次支付 调核保获取
|
||||||
this.srcImg = this.$assetsUrl + `images/bank/bank_${JSON.parse(window.localStorage.getItem('underWriteData')).bankCode}.png`
|
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 {
|
} else {
|
||||||
// 再次支付 调详情 获取信息
|
let token = this.$route.query.token
|
||||||
this.twounderWrite()
|
let orderNo = this.$route.query.orderNo
|
||||||
// this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
|
localStorage.token = token
|
||||||
// this.srcImg = this.$assetsUrl + `images/bank/bank_${JSON.parse(window.localStorage.getItem('underWriteData')).bankCode}.png`
|
localStorage.orderNo = orderNo
|
||||||
|
this.payMent()
|
||||||
}
|
}
|
||||||
console.log('--自核结果--支付信息:', JSON.stringify(this.underWriteData))
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 点击支付
|
// 点击支付
|
||||||
payMent() {
|
payMent() {
|
||||||
this.$toast.loading({
|
if (!this.isWeixin) {
|
||||||
duration: 0, // 持续展示 toast
|
this.$toast.loading({
|
||||||
forbidClick: true, // 禁用背景点击
|
duration: 0, // 持续展示 toast
|
||||||
loadingType: 'spinner',
|
forbidClick: true, // 禁用背景点击
|
||||||
message: '加载中……'
|
loadingType: 'spinner',
|
||||||
})
|
message: '加载中……'
|
||||||
|
})
|
||||||
|
}
|
||||||
let that = this
|
let that = this
|
||||||
let data = {
|
let data = {
|
||||||
orderNo: window.localStorage.getItem('orderNo')
|
orderNo: window.localStorage.getItem('orderNo'),
|
||||||
|
payType: this.radio
|
||||||
}
|
}
|
||||||
acceptInsurance(data).then(res => {
|
acceptInsurance(data).then(res => {
|
||||||
console.log('----取支付参数结果:', JSON.stringify(res))
|
console.log('----取支付参数结果:', JSON.stringify(res))
|
||||||
@@ -214,7 +255,11 @@ export default {
|
|||||||
window.localStorage.setItem('payStatus', res.payStatus)
|
window.localStorage.setItem('payStatus', res.payStatus)
|
||||||
window.localStorage.setItem('payInfo', JSON.stringify(res))
|
window.localStorage.setItem('payInfo', JSON.stringify(res))
|
||||||
} else {
|
} else {
|
||||||
that.$toast.clear()
|
if (!this.isWeixin) {
|
||||||
|
that.$toast.clear()
|
||||||
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
that.$toast(res.resultMessage)
|
that.$toast(res.resultMessage)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -244,6 +289,7 @@ export default {
|
|||||||
let underWriteData = {
|
let underWriteData = {
|
||||||
accountName: res.orderDTO.orderAccountDTO.accountName,
|
accountName: res.orderDTO.orderAccountDTO.accountName,
|
||||||
appntName: res.orderDTO.appntDTO.name,
|
appntName: res.orderDTO.appntDTO.name,
|
||||||
|
idType: res.orderDTO.appntDTO.idType,
|
||||||
bankCode: _this.typebank[res.orderDTO.orderAccountDTO.bankCode],
|
bankCode: _this.typebank[res.orderDTO.orderAccountDTO.bankCode],
|
||||||
bankName: res.orderDTO.orderAccountDTO.bankName,
|
bankName: res.orderDTO.orderAccountDTO.bankName,
|
||||||
cardBookCode: res.orderDTO.orderAccountDTO.cardBookCode,
|
cardBookCode: res.orderDTO.orderAccountDTO.cardBookCode,
|
||||||
@@ -260,6 +306,7 @@ export default {
|
|||||||
let underWriteData = {
|
let underWriteData = {
|
||||||
accountName: '',
|
accountName: '',
|
||||||
appntName: '',
|
appntName: '',
|
||||||
|
idType: '',
|
||||||
bankCode: '',
|
bankCode: '',
|
||||||
bankName: '',
|
bankName: '',
|
||||||
cardBookCode: '',
|
cardBookCode: '',
|
||||||
@@ -307,13 +354,38 @@ export default {
|
|||||||
this.$toast(res.resultMessage)
|
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: {
|
components: {
|
||||||
[Cell.name]: Cell,
|
[Cell.name]: Cell,
|
||||||
[CellGroup.name]: CellGroup,
|
[CellGroup.name]: CellGroup,
|
||||||
[RadioGroup.name]: RadioGroup,
|
[RadioGroup.name]: RadioGroup,
|
||||||
[Radio.name]: Radio
|
[Radio.name]: Radio,
|
||||||
|
[Dialog.name]: Dialog,
|
||||||
|
[Loading.name]: Loading
|
||||||
},
|
},
|
||||||
beforeRouteLeave(to, from, next) {
|
beforeRouteLeave(to, from, next) {
|
||||||
document.body.style.backgroundColor = ''
|
document.body.style.backgroundColor = ''
|
||||||
@@ -335,4 +407,10 @@ export default {
|
|||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
.vximg {
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
padding-left: 13px;
|
||||||
|
padding-right: 3px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -32,11 +32,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bottom-btn bg-white" v-if="payStatus == '1' || payStatus == '4' || payStatus == '8'">
|
<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>
|
||||||
<div class="bottom-area bottom-btn flex" v-if="payStatus == '2'">
|
<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="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>
|
||||||
<div class="bottom-area bottom-btn flex" v-if="payStatus == '9'">
|
<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>
|
<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'
|
import { getPayState } from '@/api/ebiz/sale/sale'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||||
return {
|
return {
|
||||||
|
isWeixin,
|
||||||
// 保融收银台返回的支付流水号
|
// 保融收银台返回的支付流水号
|
||||||
paySeqNo: '',
|
paySeqNo: '',
|
||||||
// 接口返回数据前,不做页面渲染
|
// 接口返回数据前,不做页面渲染
|
||||||
@@ -80,16 +82,19 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 返回列表页
|
// 返回列表页
|
||||||
next() {
|
next() {
|
||||||
this.$jump({
|
if(this.isWeixin){
|
||||||
flag: 'h5',
|
WeixinJSBridge.call("closeWindow");
|
||||||
extra: {
|
}else{
|
||||||
url: location.origin + '/#/sale/list'
|
this.$jump({
|
||||||
},
|
flag: 'h5',
|
||||||
|
extra: {
|
||||||
routerInfo: {
|
url: location.origin + '/#/sale/list'
|
||||||
path: '/sale/list'
|
},
|
||||||
}
|
routerInfo: {
|
||||||
})
|
path: '/sale/list'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 查询支付状态
|
// 查询支付状态
|
||||||
queryPayState() {
|
queryPayState() {
|
||||||
|
|||||||
@@ -994,7 +994,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
localStorage.setItem('lastOrderNo', data.orderNo)
|
localStorage.setItem('lastOrderNo', data.orderNo)
|
||||||
|
localStorage.setItem('AppntidType', res.orderDTO.appntDTO.idType)
|
||||||
this.$toast.clear()
|
this.$toast.clear()
|
||||||
this.$utils.intLocalStorage(res)
|
this.$utils.intLocalStorage(res)
|
||||||
// 获取被保险人信息recmd
|
// 获取被保险人信息recmd
|
||||||
|
|||||||
Reference in New Issue
Block a user