Merge branch 'feature/GFRS-1858-【人核保单支持线上支付】' into release/1012

This commit is contained in:
mengxiaolong
2020-10-12 15:14:54 +08:00
6 changed files with 135 additions and 24 deletions

View File

@@ -1,6 +1,5 @@
import request from '@/assets/js/utils/request' import request from '@/assets/js/utils/request'
import getUrl from '@/assets/js/utils/get-url' import getUrl from '@/assets/js/utils/get-url'
// 保费计算 // 保费计算
export function saveOrUpdateOrderInfo(data) { export function saveOrUpdateOrderInfo(data) {
return request({ return request({
@@ -9,6 +8,14 @@ export function saveOrUpdateOrderInfo(data) {
data data
}) })
} }
//人核转线上支付判断是否可进行支付操作
export function payFlag(data) {
return request({
url: getUrl('/sale/insure/payFlag', 1),
method: 'post',
data
})
}
// 订单列表 // 订单列表
export function orderList(data) { export function orderList(data) {
return request({ return request({

View File

@@ -1656,6 +1656,10 @@ export default {
{ {
id: '57', id: '57',
text: '卡单保存账户信息成功' text: '卡单保存账户信息成功'
},
{
id: '58',
text: '待客户付款'
} }
], ],
// 产品编码 // 产品编码

View File

@@ -24,7 +24,7 @@ const detail = () => import('@/views/ebiz/sale/Detail')
const productTip = () => import('@/views/ebiz/sale/productTip') const productTip = () => import('@/views/ebiz/sale/productTip')
const avoidDutyTip = () => import('@/views/ebiz/sale/AvoidDutyTip') const avoidDutyTip = () => import('@/views/ebiz/sale/AvoidDutyTip')
const doubleRecordTip = () => import('@/views/ebiz/sale/DoubleRecordTip') const doubleRecordTip = () => import('@/views/ebiz/sale/DoubleRecordTip')
const PayResultFail = () => import('@/views/ebiz/sale/PayResultFail')
let riskName = localStorage.riskName let riskName = localStorage.riskName
console.log('sale/riskName==', riskName) console.log('sale/riskName==', riskName)
export default [ export default [
@@ -212,5 +212,13 @@ export default [
{ {
path: '/sale/test', path: '/sale/test',
component: Test component: Test
},
{
path: '/sale/payResultFail',
name: 'payResultFail',
component: PayResultFail,
meta: {
title: '支付结果'
}
} }
] ]

View File

@@ -77,6 +77,7 @@
<div v-if="!!order.orderInfoDTO.doubleFlag && order.orderInfoDTO.doubleFlag == '0'" class="fs12 mt15"> <div v-if="!!order.orderInfoDTO.doubleFlag && order.orderInfoDTO.doubleFlag == '0'" class="fs12 mt15">
温馨提示本投保单满足双录条件需要双录质检通过后才能承保 温馨提示本投保单满足双录条件需要双录质检通过后才能承保
</div> </div>
<div class="text-right mt15 "> <div class="text-right mt15 ">
<van-button v-if="active == 'uncommit'" round @click="goDetail(order)" size="small" class="mr5" type="danger" v-no-more-click="1000" <van-button v-if="active == 'uncommit'" round @click="goDetail(order)" size="small" class="mr5" type="danger" v-no-more-click="1000"
>编辑</van-button >编辑</van-button
@@ -114,16 +115,9 @@
<van-button @click="changeCard(order)" size="small" class="mr5" type="danger" round>修改卡号</van-button> <van-button @click="changeCard(order)" size="small" class="mr5" type="danger" round>修改卡号</van-button>
<van-button @click="againPay(order)" size="small" class="mr5" type="danger" round>重新支付</van-button> <van-button @click="againPay(order)" size="small" class="mr5" type="danger" round>重新支付</van-button>
</template> </template>
<template v-if="active == 'commit' && (order.orderInfoDTO.orderStatus == '02' || order.orderInfoDTO.orderStatus == '58')">
<van-button <van-button @click="goPay(order)" size="small" class="mr5" type="danger" round>去支付</van-button>
@click="goPay(order)" </template>
v-if="active == 'commit' && order.orderInfoDTO.orderStatus == '02'"
size="small"
class="mr5"
type="danger"
round
>去支付</van-button
>
<!-- <van-button <!-- <van-button
@click="goNucleus(order)" @click="goNucleus(order)"

View File

@@ -90,13 +90,14 @@
<script> <script>
import { Cell, CellGroup, RadioGroup, Radio, Dialog } 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 { payFlag, underWrite, getOrderDetail } from '@/api/ebiz/sale/sale'
import Loading from '@/components/ebiz/Loading' 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 //判断环境 let isWeixin = this.$utils.device().isWeixin //判断环境
return { return {
orderNo: '', //订单号
// 支付表单 // 支付表单
formActionUrl: config.payUrl, formActionUrl: config.payUrl,
// 单选 // 单选
@@ -158,6 +159,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.orderNo = window.localStorage.getItem('orderNo')
console.log('----保融form.action', config.payUrl) console.log('----保融form.action', config.payUrl)
document.body.style.backgroundColor = '#fff' document.body.style.backgroundColor = '#fff'
// 不在微信环境下 // 不在微信环境下
@@ -185,19 +187,10 @@ export default {
} }
}, },
methods: { methods: {
// 点击支付 getAcceptInsurance() {
payMent() {
if (!this.isWeixin) {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
}
let that = this let that = this
let data = { let data = {
orderNo: window.localStorage.getItem('orderNo'), orderNo: this.orderNo,
payType: this.radio payType: this.radio
} }
acceptInsurance(data).then(res => { acceptInsurance(data).then(res => {
@@ -246,6 +239,29 @@ export default {
} }
}) })
}, },
// 点击支付
async payMent() {
if (!this.isWeixin) {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
}
const res = await payFlag({ orderNo: this.orderNo })
console.dir(res)
if (res.content.payFlag == 'Y') {
this.getAcceptInsurance()
} else {
this.$toast(res.resultMessage)
setTimeout(() => {
this.$router.push({ path: '/sale/payResultFail' })
}, 2000)
}
},
// 取消支付 // 取消支付
cancel() { cancel() {
this.$toast.clear() this.$toast.clear()

View File

@@ -0,0 +1,82 @@
<template>
<div class="payResult-container" >
<div class="payResult-header flex justify-content-c align-items-c m15 bg-white flex-direction-colunm">
<img :src="srcFail" class="payResult-img mb15 pt15" />
<h3>支付失败</h3>
<div class="bottom-btn bg-white" >
<van-button type="danger" size="large" @click="next" v-no-more-click="1000"> 返回</van-button>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
// 图片
srcSuccess: this.$assetsUrl + 'images/success.png',
srcPending: this.$assetsUrl + 'images/pending.png',
srcFail: this.$assetsUrl + 'images/fail.png'
}
},
methods: {
// 返回列表页
next() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/list'
},
routerInfo: {
path: '/sale/list'
}
})
},
appCallBack(data) {
if (data.trigger == 'left_button_click') {
this.next()
}
}
},
created() {
EWebBridge.webCallAppInJs('webview_left_button', {
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
window.appCallBack = this.appCallBack
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()
}
}
</script>
<style lang="scss" scoped>
h3{
padding:20px 0px;
}
.payResult-container {
.payResult-header {
width: 345px;
// height: 143px;
.payResult-img {
width: 70px;
height: 70px;
}
}
}
// /deep/ .van-cell__value {
// text-align: left;
// }
</style>