Merge branch 'feature/GFRS-247【待确定】卡单产品投保'

This commit is contained in:
yuweiqi
2020-04-29 09:22:56 +08:00
29 changed files with 3249 additions and 41 deletions

View File

@@ -17,5 +17,6 @@
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<!-- <script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script> --> <!-- <script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script> -->
<script src="https://cdn.bootcss.com/echarts/4.2.1-rc1/echarts.min.js"></script> <script src="https://cdn.bootcss.com/echarts/4.2.1-rc1/echarts.min.js"></script>
</body> </body>
</html> </html>

View File

@@ -0,0 +1,76 @@
// 卡单接口
import request from '@/assets/js/utils/request'
import getUrl from '@/assets/js/utils/get-url'
// 获取卡单列表
export function getCardList(data) {
return request({
url: getUrl('/sale/product/getProList', 1),
method: 'post',
data
})
}
// 获取我的卡单列表
export function getMyCardList(data) {
return request({
url: getUrl('/sale/card/getMyCardList', 1),
method: 'post',
data
})
}
// 获取产品详情
export function getProductDetails(data) {
return request({
url: getUrl('/sale/product/getItemDetail', 1),
method: 'post',
data
})
}
// 获取产品试算详情
export function getProductInfo(data) {
return request({
url: getUrl('/sale/product/getDetail', 1),
method: 'post',
data
})
}
// 进行试算
export function insureTrial(data) {
return request({
url: getUrl('/sale/insure/trial', 1),
method: 'post',
data
})
}
// 保存卡单信息
export function saveOrUpdateCard(data) {
return request({
url: getUrl('/sale/card/saveOrUpdateCard', 1),
method: 'post',
data
})
}
// 保存卡单支付信息
export function saveOrUpdateAccount(data) {
return request({
url: getUrl('/sale/card/saveOrUpdateAccount', 1),
method: 'post',
data
})
}
//获取我的订单列表
export function getOrderList(data) {
return request({
url: getUrl('/sale/order/cardOrderList', 1),
method: 'post',
data
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1 @@
<svg t="1567079553293" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20073" width="200" height="200"><path d="M358.419788 392.527249c0-37.683671-30.557838-68.26503-68.256849-68.26503-37.700034 0-68.257872 30.582382-68.257872 68.26503 0 37.715373 30.557838 68.26503 68.257872 68.26503C327.86195 460.793302 358.419788 430.242622 358.419788 392.527249zM733.847287 324.262218c-37.699011 0-68.267076 30.582382-68.267076 68.26503 0 37.715373 30.568065 68.26503 68.267076 68.26503s68.256849-30.55068 68.256849-68.26503C802.104137 354.843577 771.546298 324.262218 733.847287 324.262218zM511.999489 0c-282.737469 0-511.94222 229.212932-511.94222 511.991307s229.204751 512.008693 511.94222 512.008693 511.943243-229.229295 511.943243-512.008693S794.736958 0 511.999489 0zM511.999489 972.783586c-254.462188 0-460.743192-206.313728-460.743192-460.792279 0-254.478551 206.279981-460.775917 460.743192-460.775917 254.463211 0 460.75035 206.297366 460.75035 460.775917C972.749839 766.469858 766.463722 972.783586 511.999489 972.783586zM512.066984 597.339725c-154.214767 0-204.796114 136.532106-204.796114 136.532106l51.199028 0c0 0 39.032548-85.331032 153.597085-85.331032 116.072948 0 153.597085 85.331032 153.597085 85.331032l51.198006 0C716.863098 733.871831 666.28175 597.339725 512.066984 597.339725z" p-id="20074" fill="#1296db"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -828,6 +828,14 @@ export default {
{ {
id: '55', id: '55',
text: '支付失败' text: '支付失败'
},
{
id: '56',
text: '卡单投被保人信息保存成功'
},
{
id: '57',
text: '卡单保存账户信息成功'
} }
], ],
// 产品编码 // 产品编码
@@ -1446,21 +1454,9 @@ export default {
{ id: 'EAM', text: '资深部经理' }, { id: 'EAM', text: '资深部经理' },
{ id: 'AD', text: '营业总监' } { id: 'AD', text: '营业总监' }
], ],
relationType: [ relationType: [{ id: '0', text: '配偶' }, { id: '1', text: '子女' }, { id: '2', text: '父母' }],
{ id: '0', text: '配偶' }, guarantRelationType: [{ id: '0', text: '亲属' }, { id: '1', text: '朋友' }, { id: '2', text: '同事' }, { id: '3', text: '其他' }],
{ id: '1', text: '子女' }, classification: [{ id: '0', text: '司内' }, { id: '1', text: '司外' }],
{ id: '2', text: '父母' }
],
guarantRelationType: [
{ id: '0', text: '亲属' },
{ id: '1', text: '朋友' },
{ id: '2', text: '同事' },
{ id: '3', text: '其他' }
],
classification: [
{ id: '0', text: '司内' },
{ id: '1', text: '司外' }
],
//入司国籍/地区 //入司国籍/地区
rsnativeplace: [ rsnativeplace: [
{ id: 'AGO', text: '安哥拉' }, { id: 'AGO', text: '安哥拉' },
@@ -1754,18 +1750,9 @@ export default {
{ id: '08', text: '其它' } { id: '08', text: '其它' }
], ],
// 申请人身份 // 申请人身份
applicantStatus: [ applicantStatus: [{ id: '01', text: '本人' }, { id: '02', text: '监护人' }],
{ id: '01', text: '本人' },
{ id: '02', text: '监护人' }
],
// 理赔申请人身份 // 理赔申请人身份
lpApplicantStatus: [ lpApplicantStatus: [{ id: '1', text: '本人' }, { id: '2', text: '配偶' }, { id: '3', text: '父母' }, { id: '4', text: '子女' }, { id: '5', text: '其他' }],
{ id: '1', text: '本人' },
{ id: '2', text: '配偶' },
{ id: '3', text: '父母' },
{ id: '4', text: '子女' },
{ id: '5', text: '其他' }
],
// 出险申请类型 // 出险申请类型
applyType: [ applyType: [
{ {
@@ -2014,10 +2001,7 @@ export default {
} }
], ],
//对象 //对象
targetDictionary: [ targetDictionary: [{ value: '本人', code: '00' }, { value: '配偶', code: '01' }],
{ value: '本人', code: '00' },
{ value: '配偶', code: '01' }
],
nbsRelation: [ nbsRelation: [
{ name: '配偶', value: '00' }, { name: '配偶', value: '00' },
{ name: '子女', value: '01' }, { name: '子女', value: '01' },
@@ -2038,11 +2022,7 @@ export default {
{ code: '08', value: '其他费用' } { code: '08', value: '其他费用' }
], ],
//险种类型字典 //险种类型字典
insuranceDictionary: [ insuranceDictionary: [{ code: '01', value: '寿险' }, { code: '02', value: '重疾' }, { code: '03', value: '年金' }],
{ code: '01', value: '寿险' },
{ code: '02', value: '重疾' },
{ code: '03', value: '年金' }
],
// 活动量管理 - 人才库 - 状态 // 活动量管理 - 人才库 - 状态
talentPoolStatus: [ talentPoolStatus: [
{ id: 0, text: '暂不考虑' }, { id: 0, text: '暂不考虑' },

View File

@@ -0,0 +1,17 @@
let currentYear = new Date().getFullYear()
let currentMonth = new Date().getMonth()
let currentDay = new Date().getDate()
export default {
getAfterYear: function(numberYear) {
//获取“多少年”之后的时间 例如 30年后 即 numberYear=30
let afterDate = ''
afterDate = new Date(currentYear - numberYear, currentMonth, currentDay)
return afterDate
},
getAfterDays: function(days) {
//获取“多少天数”之后的时间 例如28天后 即days=28
let currentTime = new Date().getTime()
return new Date(Number(currentTime) + 1000 * 60 * 60 * 24 * days)
}
}

View File

@@ -65,6 +65,8 @@ let survey = [
let manpower = [ let manpower = [
'/customer/answer/queryList' //DISC性格分析 '/customer/answer/queryList' //DISC性格分析
] ]
// 卡单
let cardList = []
let whiteList = ['/customer/agent/getCustomersList', ...proposal, ...sale, ...agentEnter, ...claims, ...survey, ...manpower] let whiteList = ['/customer/agent/getCustomersList', ...proposal, ...sale, ...agentEnter, ...claims, ...survey, ...manpower]
// 创建axios实例 // 创建axios实例

10
src/config/cardList.js Normal file
View File

@@ -0,0 +1,10 @@
// 卡单
let mockBaseUrl = 'http://mock-api.com/9KOlmpzk.mock'
export default {
// 获取产品列表接口
'/sale/card/getCardList': mockBaseUrl + '/sale/card/getCardList',
// 获取我的卡单接口
getMyCardList: mockBaseUrl + '/sale/card/getMyCardList',
// 获取卡单详情接口
getProductInfo: mockBaseUrl + '/sale/card/getCardDetail'
}

View File

@@ -16,7 +16,7 @@ switch (process.env.VUE_APP_FLAG) {
// 静态服务资源 // 静态服务资源
assetsUrl = 'http://139.199.50.151:8000/app/' assetsUrl = 'http://139.199.50.151:8000/app/'
mainUrl = 'http://139.199.50.151' mainUrl = 'http://139.199.50.151'
payUrl = 'http://funduat.e-guofu.com/s3-modules-gateway/embed/gateway.action' payUrl = 'https://funduat.e-guofu.com/s3-modules-gateway/embed/gateway.action'
zssqUrl = 'http://139.199.50.151/html/test/index.html#/' zssqUrl = 'http://139.199.50.151/html/test/index.html#/'
break break
case 'uat': case 'uat':
@@ -25,7 +25,7 @@ switch (process.env.VUE_APP_FLAG) {
// 静态服务资源 // 静态服务资源
assetsUrl = 'http://115.159.235.59:8000/app/' assetsUrl = 'http://115.159.235.59:8000/app/'
mainUrl = 'http://115.159.235.59' mainUrl = 'http://115.159.235.59'
payUrl = 'http://funduat.e-guofu.com/s3-modules-gateway/embed/gateway.action' payUrl = 'https://funduat.e-guofu.com/s3-modules-gateway/embed/gateway.action'
zssqUrl = '' zssqUrl = ''
break break
case 'prd': case 'prd':

View File

@@ -12,6 +12,7 @@ import serve from './serve'
import common from './common' import common from './common'
import survey from './survey' import survey from './survey'
import manpower from './manpower' import manpower from './manpower'
import cardList from './cardList'
const mockBaseUrl = 'http://rap2api.taobao.org/app/mock' const mockBaseUrl = 'http://rap2api.taobao.org/app/mock'
let baseObj = { let baseObj = {
@@ -19,6 +20,6 @@ let baseObj = {
'/user/info': mockBaseUrl + '/223948/info', '/user/info': mockBaseUrl + '/223948/info',
'/user/logout': mockBaseUrl + '/223948/logout' '/user/logout': mockBaseUrl + '/223948/logout'
} }
Object.assign(baseObj, proposal, sale, customer, my, product, serve, common, survey, manpower) Object.assign(baseObj, proposal, sale, customer, my, product, serve, common, cardList, survey, manpower)
export default baseObj export default baseObj

View File

@@ -0,0 +1,85 @@
// 卡单路由
const information = () => import('@/views/ebiz/cardList/information')
const cardTotreasure = () => import('@/views/ebiz/cardList/CardTotreasure')
const productDetails = () => import('@/views/ebiz/cardList/productDetails')
const pay = () => import('@/views/ebiz/cardList/Pay')
const payResult = () => import('@/views/ebiz/cardList/PayResult')
const paySuccess = () => import('@/views/ebiz/cardList/PaySuccess')
const payLoser = () => import('@/views/ebiz/cardList/PayLoser')
const ShowPDF = () => import('@/views/ebiz/cardList/ShowPDF')
export default [
{
path: '/cardList/information',
name: 'information',
component: information,
meta: {
title: '填写投被保人信息',
index: 1
}
},
{
path: '/cardList/cardTotreasure',
name: 'cardTotreasure',
component: cardTotreasure,
meta: {
title: '产品列表',
index: 2
}
},
{
path: '/cardList/productDetails/:productDetailCode',
name: 'productDetails',
component: productDetails,
meta: {
title: '产品详情',
index: 3
}
},
{
path: '/cardList/pay',
name: 'pay',
component: pay,
meta: {
title: '支付',
index: 4
}
},
{
path: '/cardList/payResult',
name: 'payResult',
component: payResult,
meta: {
title: '支付结果',
index: 5
}
},
{
path: '/cardList/paySuccess',
name: 'paySuccess',
component: paySuccess,
meta: {
title: '支付成功',
index: 5
}
},
{
path: '/cardList/payLoser',
name: 'payLoser',
component: payLoser,
meta: {
title: '支付失败',
index: 6
}
},
{
path: '/cardList/ShowPDF',
name: 'ShowPDF',
component: ShowPDF,
meta: {
title: '',
index: 7
}
}
]

View File

@@ -13,4 +13,5 @@ import report from './report'
import survey from './survey' import survey from './survey'
import nbs from './nbs' import nbs from './nbs'
import manpower from './manpower' import manpower from './manpower'
export default [...proposal, ...sale, ...customer, ...my, ...serve, ...common, ...product, ...agentEenter, ...milestone, ...poster, ...report, ...survey, ...nbs, ...manpower] //根据需要进行删减 import cardList from './cardList'
export default [...proposal, ...sale, ...customer, ...my, ...serve, ...common, ...product, ...cardList ,...agentEenter, ...milestone, ...poster, ...report, ...survey, ...nbs, ...manpower] //根据需要进行删减

View File

@@ -2,6 +2,7 @@ import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import App from './app' import App from './app'
import Example from './example' import Example from './example'
import Ebiz from './ebiz' import Ebiz from './ebiz'
Vue.use(Router) Vue.use(Router)

View File

@@ -32,6 +32,20 @@
<li><router-link to="/manpower/DiscAnalysis/List">DISC性格分析</router-link></li> <li><router-link to="/manpower/DiscAnalysis/List">DISC性格分析</router-link></li>
</ul> </ul>
</li> </li>
<li class="mt10">
<p class="fw600">卡单投保</p>
<ul class="pl20">
<li>
<router-link to="/cardList/CardTotreasure">产品列表</router-link>
</li>
<li>
<router-link to="/cardList/information">填写投被保人信息</router-link>
</li>
<li>
<router-link to="/cardList/Pay">支付页面</router-link>
</li>
</ul>
</li>
</ul> </ul>
<van-tabbar v-model="active"> <van-tabbar v-model="active">
<van-tabbar-item icon="home-o">首页</van-tabbar-item> <van-tabbar-item icon="home-o">首页</van-tabbar-item>

View File

@@ -0,0 +1,451 @@
<template>
<div class="card-Insurance">
<div class="card-Insurance-box">
<div class="card-Insurance-header">
<van-sticky>
<van-tabs v-model="activeName" @click="changeTab">
<van-tab title="产品列表" name="product"> </van-tab>
<van-tab title="我的订单" name="order"> </van-tab>
</van-tabs>
</van-sticky>
<div class="show" v-if="activeName == 'product'">
<ul class="card-Products">
<li v-for="(itemIcon, index) in list" :key="index" class="border-gb" @click="formsD(itemIcon.productCode)">
<div>
<img :src="itemIcon.productImageUrl" class="ml10" width="118" height="70" />
</div>
<div>
<p>{{ itemIcon.productName }}</p>
<span>{{ itemIcon.productDesc }}</span>
</div>
</li>
<template v-if="list.length === 0">
<li class="flex flex-direction-colunm align-items-c">
<img src="@/assets/images/pic_page-non.png" class="mt50" alt="" />
<p class="gray text-center pt20">暂无产品</p>
</li>
</template>
</ul>
</div>
<div v-if="activeName == 'order'">
<van-list
v-model="loading"
:immediate-check="false"
:finished="finished"
:finished-text="finishedText"
error-text="请求失败点击重新加载"
:error.sync="error"
@load="loadMore"
class="pb45"
>
<div v-if="isSuccess">
<div class="order-container" v-for="(orderItem, index) in NewItems" :key="index">
<div class="fs14 fwb mb5">{{ orderItem.riskName }}</div>
<div>
<span>投保单号{{ orderItem.prtNo }}</span>
</div>
<div>
<span>订单号{{ orderItem.orderNo }}</span>
</div>
<div>
<span>投保人{{ orderItem.appantName }}</span>
</div>
<div>
<span>被保人{{ orderItem.insuredName }}</span>
</div>
<div class="flex justify-content-s">
<span>订单状态{{ orderItem.orderStatus | statusFormat }}</span>
<div v-if="orderItem.isCanPay && orderItem.orderStatus == '02'">
<van-button round @click="goPay(orderItem.orderNo)" size="small" class="mr5" type="danger" v-no-more-click="1000">去支付</van-button>
</div>
</div>
</div>
<template v-if="NewItems.length === 0">
<li class="flex flex-direction-colunm align-items-c">
<img src="@/assets/images/pic_page-non.png" class="mt50" alt="" />
<p class="gray text-center pt20">暂无订单</p>
</li>
</template>
</div>
</van-list>
</div>
</div>
</div>
</div>
</template>
<script>
import { getCardList, getOrderList } from '@/api/ebiz/cardList/cardList.js'
import { Tab, Tabs, List, Sticky } from 'vant'
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到订单状态
import formatDate from '@/assets/js/utils/date-utils'
export default {
name: 'kadantoubao.vue',
components: {
[Sticky.name]: Sticky,
[List.name]: List,
[Tab.name]: Tab,
[Tabs.name]: Tabs
},
data() {
return {
activeName: 'product',
loading: false,
finished: false,
currentPage: 1, //当前页数
error: false,
finishedText: '',
pageSize: 10, //每页数据条数
isSuccess: false,
// , '我的卡单'
list: [],
// orderList: [{ text: '11111' }, { text: '11111' }], //我的订单
orderList: [], //我的订单
iNow: 0
}
},
created() {
this.getLists()
},
mounted() {
document.body.style.backgroundColor = '#fff'
setTimeout(() => {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_left_button', {
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
}, 100)
window.appCallBack = this.appCallBack
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()
},
methods: {
//分页用-查询订单列表
loadMore() {
let pageInfo = {
pageNum: this.currentPage,
pageSize: this.pageSize
}
this.getOrderList(pageInfo)
},
appCallBack(data) {
if (data.trigger == 'left_button_click') {
this.$jump({
flag: 'service'
})
}
},
//改变菜单栏
changeTab(name) {
if (name == 'product') {
this.getLists()
} else {
this.loadMore()
}
},
//跳转到详情页
formsD(productCode) {
localStorage.productDetailCode = productCode
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/cardList/productDetails/${productCode}`
},
routerInfo: {
path: `/cardList/productDetails/${productCode}`
}
})
},
// getLists: function() {
// var self = this
// // 产品列表
// getCardList({
// type: 'app'
// })
// .then(res => {
// console.log(res)
// // if (res.result == 0) {
// // self.navList = res.productTypeList
// // window.localStorage.setItem('productList', JSON.stringify(res.productList))
// // let productList = window.localStorage.getItem('productList')
// // var resu = JSON.parse(productList).filter(function(obj) {
// // return obj.productType == '01'
// // })
// // self.dataList = resu
// // } else {
// // Toast.fail(res.resultMessage)
// // }
// })
// .then(function(err) {
// console.log(err)
// })
// }
// 获取卡单列表
getLists() {
let data = {
type: 'appCard'
}
getCardList(data)
.then(res => {
if (res.result == 0) {
this.list = res.productList
} else {
this.$toast.fail(res.resultMessage)
}
})
.catch(err => {
console.log('errerr', err)
})
},
//获取我的订单列表
getOrderList(data) {
getOrderList(data).then(
res => {
if (res.result == '0') {
this.isSuccess = true
this.currentPage++
this.loading = false
if (res.orderDTOPageInfo == null) {
this.finished = true
this.loading = false
this.finishedText = ''
return
}
let answerList = res.orderDTOPageInfo.list
this.orderList = this.orderList.concat(answerList)
if (answerList.length == 0) {
this.finishedText = ''
} else {
this.finishedText = '已经全部加载'
}
if (answerList.length == 0) {
this.isSuccess = false
}
this.loading = false
if (res.orderDTOPageInfo.hasNextPage == false) {
//当下一页为0时 表示全部数据加载完毕
this.finished = true
}
} else {
this.finished = true
this.loading = false
this.finishedText = res.resultMessage
}
},
error => {
console.log(error)
}
)
},
//去支付
goPay(val) {
localStorage.setItem('orderNo', JSON.stringify(parseInt(val)))
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/cardList/pay`,
forbidSwipeBack: 1
},
routerInfo: {
path: `/cardList/pay`
}
})
}
},
filters: {
statusFormat(val) {
let text
dataDictionary.policyState.forEach(state => {
if (state.id == val) {
text = state.text
}
})
return text
}
},
computed: {
NewItems() {
var NewItems = []
this.orderList.map(function(orderItem) {
let currentTime = '',
compareTime = '',
orderObj = {
riskName: orderItem.insuredDTOs[0].riskDTOLst[0].riskName,
orderNo: orderItem.orderInfoDTO.orderNo,
prtNo: orderItem.orderInfoDTO.prtNo,
appantName: orderItem.appntDTO.name,
insuredName: orderItem.insuredDTOs[0].name,
orderStatus: orderItem.orderInfoDTO.orderStatus
}
let dateToday = new Date()
dateToday.setHours(0)
dateToday.setMinutes(0)
dateToday.setSeconds(0)
currentTime = dateToday.getTime()
compareTime = new Date(orderItem.orderInfoDTO.appntDateStr.replace(/-/g, "/")).getTime()
let tmpSub = compareTime - currentTime
if( tmpSub > 0 && tmpSub < 24*60*60*1000){
orderObj.isCanPay = true
}
NewItems.push(orderObj)
})
return NewItems
}
}
}
</script>
<style scoped>
/* .myCardl {
width: 100%;
display: flex;
flex-direction: column;
} */
.order-container {
margin: 10px;
padding: 15px;
border-radius: 3px;
border: 1px solid #dadada;
box-shadow: 0 3px 9px 1px hsla(0, 0%, 80%, 0.35);
}
.order-container > div {
margin-bottom: 2px;
}
.product-list-default-bg {
left: 50%;
transform: translateX(-50%);
}
.myCard li {
display: flex;
flex-direction: column;
width: 360px;
height: 124px;
/* border: 1px solid #dadada; */
/* box-shadow: 0 3px 9px 1px hsla(0, 0%, 80%, 0.35); */
margin: 0 auto;
}
.myCard li:nth-child(1) {
margin-top: 15px;
}
.myCard li p {
font-size: 15px;
margin-bottom: 12px;
}
.myCard li span {
font-size: 11px;
font-family: '微软雅黑';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: #999999;
}
.Tab {
width: 100%;
display: flex;
height: 30px;
background-color: #f2f2f2;
}
.tab {
width: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.card-Products {
width: 100%;
display: flex;
flex-direction: column;
}
.card-Products > li {
width: 100%;
display: flex;
height: 100px;
/* border-bottom: 1px solid #cccccc; */
}
.card-Products > li img {
/* width: 117px;
height: 70px;
margin-left: 10px; */
}
.card-Products li div:nth-of-type(1) {
display: flex;
align-items: center;
justify-content: center;
}
.card-Products li > div:nth-of-type(2) {
display: flex;
flex-direction: column;
justify-content: center;
justify-content: space-between;
padding: 15px 5px;
}
.card-Products li > div:nth-of-type(2) p {
font-weight: bold;
font-size: 15px;
}
.card-Products li > div:nth-of-type(2) span {
color: #b5b5b5;
font-size: 11px;
}
.ac {
border-bottom: 0.04rem solid #1296db;
color: #1296db;
}
.nav {
width: 100%;
display: flex;
align-items: center;
padding-left: 10px;
height: 45px;
}
.card-Insurance {
width: 100%;
display: flex;
flex-direction: column;
}
.header > img {
width: 100%;
}
.card-Insurance-box {
width: 100%;
display: flex;
flex-direction: column;
margin: 0 auto;
}
.card-Insurance-header {
width: 100%;
display: flex;
flex-direction: column;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-size: 14px;
}
</style>

View File

@@ -0,0 +1,587 @@
<template>
<div class="pay">
<div v-if="!isScan">
<van-cell-group>
<van-field v-model="underWriteData.appntName" type="textarea" autosize readonly label="产品名称" class="projuct" />
<van-field :value="underWriteData.orderAmount == undefined ? '' : `${underWriteData.orderAmount} 元`" readonly label="支付金额" />
</van-cell-group>
<!-- 银行卡支付开始 -->
<div class="money">
<div>
<img src="../../../assets/images/u10280.png" alt style="margin-top:-5px;margin-right:10px;" />
<span class="oi">银行卡支付</span>
</div>
<div class="i mr20">
<van-radio-group v-model="radio" class="flex justify-content-fe"><van-radio name="1"></van-radio></van-radio-group>
</div>
</div>
<!-- 银行卡支付结束 -->
<van-cell-group>
<van-field
v-model="underWriteData.name"
label="姓名"
name="姓名"
readonly
placeholder="请输入"
v-validate="'required|name'"
maxlength="6"
clearable
required
/>
<van-field
v-model="underWriteData.bankCode"
maxlength="19"
:readonly="orderStatus != '56'"
label="银行卡号"
name="银行卡号"
placeholder="请输入"
required
clearable
v-validate="'required|bankCard'"
data-vv-name="银行卡号"
>
<van-button slot="button" v-if="orderStatus == '56'" size="small" type="danger" round @click="cardScanning('0')">银行卡扫描</van-button>
</van-field>
<van-field
:value="bankListName"
label="开户银行"
name="开户银行"
placeholder="请输入"
v-validate="'required'"
readonly
@click="focus"
right-icon="arrow"
data-vv-name="开户银行"
required
/>
<!-- <van-field v-model="bank" label="开户银行" placeholder="请选择" required @click="focus" readonly v-validate="'required'" data-vv-name="开户银行" /> -->
</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 class="bg-white bottom-btn"><van-button type="danger" size="large" @click="pay" v-no-more-click="1000">支付</van-button></div>
</div>
<!-- 银行卡扫描按钮 -->
<van-popup v-model="isScan" style="height:100vh" position="bottom">
<BankCardScan :scanShow="isScan" :clear="isClear" @getScanInfo="getBankCardInfo"></BankCardScan>
</van-popup>
<!-- 开户银行选择 -->
<van-popup v-model="show" position="bottom" style="height:354px">
<van-list>
<van-cell v-for="item in bankList" :key="item.code" :title="item.bankName" class="text-center" @click="clickList(item.bankName, item.code)" />
</van-list>
</van-popup>
</div>
</template>
<script>
import Vue from 'vue'
import { Field, Checkbox, CheckboxGroup, RadioGroup, Radio, Popup, CellGroup, Button, List, Cell } from 'vant'
Vue.use(Checkbox).use(CheckboxGroup)
Vue.use(Field)
Vue.use(Button)
import { acceptInsurance, getBankList, underWrite, getOrderDetail } from '@/api/ebiz/sale/sale'
import { saveOrUpdateAccount } from '@/api/ebiz/cardList/cardList.js'
import BankCardScan from '@/components/ebiz/sale/BankCardScan'
import config from '@/config'
export default {
name: 'pay',
components: {
BankCardScan,
[Popup.name]: Popup,
[CellGroup.name]: CellGroup,
[Field.name]: Field,
[List.name]: List,
[Cell.name]: Cell,
[RadioGroup.name]: RadioGroup,
[Radio.name]: Radio
},
data() {
return {
// trialList: JSON.parse(localStorage.trialList),
// 核保数据
orderStatus: '',
underWriteData: {
appntName: '', //产品名称
orderAmount: '', //支付金额
name: '',
bankCode: '', //银行卡号
bankName: '' //开户银行
},
radio: '1',
result: [],
isScan: false, //是否显示证件扫描组件
isClear: false, //是否清空
show: false, // 银行列表弹框
bankList: [], // 银行卡列表
bankListName: '', // 银行列表ID
formActionUrl: config.payUrl, // 支付表单
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: '' // 接口返回的支付状态
}
},
created() {},
mounted() {
setTimeout(() => {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close-btn@3x.png',
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
}, 100)
// window.appCallBack = this.appCallBack
// console.log('trialList', this.trialList[0].prem)
// this.underWrite.orderAmount = this.trialList[0].prem
document.body.style.backgroundColor = '#fff'
window.appCallBack = this.appCallBack
// 获取银行卡
this.getBankList()
// this.getOrderDetail()
// console.log('----保融form.action', config.payUrl)
// if (localStorage.salelist == '1') {
// 第一次支付 调核保获取
// this.underWrite()
// this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
// } else {
// 再次支付 调详情 获取信息
this.getOrderDetail()
// this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
// }
// console.log('--自核结果--支付信息:', JSON.stringify(this.underWriteData))
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()
},
destroyed() {
setTimeout(() => {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_left_button', {
intercept: '0' //是否拦截原生返回事件 1是 其他否
})
// window.appCallBack = this.appCallBack
}, 100)
},
methods: {
appCallBack(data) {
if (data.trigger == 'left_button_click') {
return this.$dialog
.confirm({
className: 'dialog-delete',
title: '提示',
message: '是否确认退出?',
cancelButtonColor: '#E9332E',
confirmButtonColor: '#FFFFFF'
})
.then(() => {
this.$jump({
flag: 'h5',
extra: {
title: '产品列表',
forbidSwipeBack: 1, //当前页面禁止右滑返回
url: location.origin + `/#/cardList/CardTotreasure`
},
routerInfo: {
path: `/cardList/CardTotreasure`,
type: '1'
}
})
})
.catch(() => {
return
})
} else {
// 筛选按钮的点击事件
this.$jump({
flag: 'navigation',
extra: {
title: '支付',
hiddenRight: '1'
}
})
this.isScan = false
}
},
//获取银行卡扫描信息
getBankCardInfo(data) {
this.underWriteData.bankCode = data.name
this.$jump({
flag: 'navigation',
extra: {
title: '账户信息',
hiddenRight: '1'
}
})
this.isScan = false
},
// 银行卡扫描
cardScanning(cardScanningType) {
window.localStorage.setItem('cardScanningType', cardScanningType)
document.body.style.backgroundColor = '#F5F5F5'
let title = ''
this.isclear = false
;[this.isScan, title] = [true, '银行卡扫描']
setTimeout(() => {
this.$jump({
flag: 'navigation',
extra: {
title,
hiddenLeft: '1'
}
})
this.closeBtn()
}, 400)
},
closeBtn() {
// 筛选按钮的显示
this.$jump({
flag: 'webview_right_button',
extra: {
btns: [
{
img: this.$assetsUrl + 'images/del-close.png',
route: { flag: '', extra: {} }
}
]
}
})
},
// 获取银行列表的focus
focus() {
if (this.orderStatus == '56') {
this.show = true
}
},
// 获取银行卡列表
getBankList() {
let self = this
let data = {
operateType: 'bank_type'
}
getBankList(data).then(res => {
if (res.result == '0') {
console.log('银行卡列表', res.content)
self.bankList = res.content
} else {
this.$toast(res.resultMessage)
}
})
},
// 选择银行卡
clickList(item, bankCode) {
console.log('英航卡', item, bankCode)
this.bankListName = item
this.underWriteData.bankName = bankCode
this.show = false
},
// 再次支付
getOrderDetail() {
getOrderDetail({ orderNo: window.localStorage.getItem('orderNo') }).then(res => {
console.log('getOrderDetail', res)
if (res.result == '0') {
this.orderStatus = res.orderDTO.orderInfoDTO.orderStatus
this.$toast.clear()
console.log(res.orderDTO.orderAccountDTO.bankCode)
this.underWriteData = {
appntName: res.orderDTO.insuredDTOs[0].riskDTOLst[0].riskName,
name: res.orderDTO.appntDTO.name,
bankCode: res.orderDTO.orderAccountDTO.cardBookCode,
bankName: res.orderDTO.orderAccountDTO.bankCode,
cardBookCode: res.orderDTO.orderAccountDTO.cardBookCode,
orderAmount: res.orderDTO.orderInfoDTO.orderAmount,
orderNo: res.orderDTO.orderAccountDTO.orderNo,
result: '',
resultMessage: '交易处理成功',
uwResult: '02'
}
this.bankListName = res.orderDTO.orderAccountDTO.bankName
// window.localStorage.setItem('underWriteData', JSON.stringify(underWriteData))
} else {
this.underWriteData = {
accountName: '',
appntName: '',
bankCode: '',
bankName: '',
cardBookCode: '',
orderAmount: '',
orderNo: '',
result: '',
resultMessage: '交易处理失败',
uwResult: '00'
}
// window.localStorage.setItem('underWriteData', JSON.stringify(underWriteData))
this.$toast(res.resultMessage)
}
})
},
// 获取支付信息
async underWrite() {
let data = {
platform: 'app',
type: '1',
orderDTO: {
orderInfoDTO: {
orderNo: window.localStorage.getItem('orderNo')
}
}
}
return underWrite(data)
// .then(res => {
// console.log(res);
// if (res.result == '0') {
// this.$toast.clear()
// if (res.uwResult == '33') {
// window.localStorage.setItem('uwResult', res.uwResult)
// window.localStorage.setItem('resultMessage', res.message)
// } else {
// window.localStorage.setItem('uwResult', res.uwResult)
// }
// this.underWriteData = res
// return true
// } else {
// return false
// this.$toast(res.resultMessage)
// }
// })
},
async pay() {
let valid = await this.$validator.validate()
console.log(valid)
if (true !== valid) {
console.log(this.$validator)
return this.$toast(this.$validator.errors.all()[0])
}
switch (this.orderStatus) {
case '56':
case '57':
this.payMent()
break
case '02':
this.acceptInsurance()
break
default:
return this.$toast('当前不可支付')
}
},
acceptInsurance() {
let data = {
orderNo: window.localStorage.getItem('orderNo'),
cardOrder: 'cardOrder'
}
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()
window.localStorage.setItem('resMessage', res.resultMessage)
window.localStorage.setItem('payStatus', res.payStatus)
window.localStorage.setItem('payInfo', JSON.stringify(res))
this.underWriteData.bankListName = this.bankListName
localStorage['cardList-detail'] = JSON.stringify(this.underWriteData)
let thisRef = this
this.$nextTick(() => {
thisRef.$refs.payForm.submit() // 表单提交,发起支付,跳至收银台
setTimeout(() => {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_left_button', {
intercept: '0' //是否拦截原生返回事件 1是 其他否
})
}, 100)
})
} else {
this.$toast.clear()
this.$toast(res.resultMessage)
}
})
},
// 点击支付
async payMent() {
let data = {
orderDTO: {
orderInfoDTO: {
orderNo: window.localStorage.getItem('orderNo')
},
orderAccountDTO: {
accountType: '0',
accountName: this.underWriteData.name,
bankName: this.bankListName,
bankCode: this.underWriteData.bankName,
cardBookType: '1',
cardBookCode: this.underWriteData.bankCode,
isAutoPay: '0',
isAutoRenewal: '1'
}
}
}
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
/*
支付之前要先保存银行账户信息
*/
let res = await saveOrUpdateAccount(data)
// .then(res => {
console.log('res', res)
this.$toast.clear()
if (res.result == '0') {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let rs = await this.underWrite()
if (rs.result != '0') {
this.$toast.clear()
return this.$toast(rs.resultMessage)
}
if (rs.uwResult != '02') {
return this.$toast(rs.message)
} else {
this.acceptInsurance()
}
} else {
this.$toast(res.resultMessage)
}
// })
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
* {
box-sizing: border-box;
}
.oi {
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';
font-weight: 700;
font-style: normal;
color: #666666;
}
.money {
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
z-index: 100;
background: white;
height: 40px;
overflow: hidden;
> div:nth-of-type(1) {
display: flex;
align-items: center;
img {
width: 33px;
height: 32px;
}
span {
font-size: 14px;
}
}
> div:nth-of-type(2) {
display: flex;
align-items: center;
}
}
</style>

View File

@@ -0,0 +1,49 @@
<template>
<div class="PayLoser">
<div>
<img src="../../../assets/images/u10608.svg" alt="" />
<p>支付失败</p>
</div>
<van-button type="info" size="large" class="payBtn">返回首页</van-button>
</div>
</template>
<script>
export default {}
</script>
<style lang="scss" scoped>
* {
margin: 0;
padding: 0;
}
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
.PayLoser {
display: flex;
flex-direction: column;
height: 650px;
justify-content: space-between;
align-items: center;
img {
width: 100px;
height: 100px;
}
}
.PayLoser > div:nth-of-type(1) {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
box-sizing: border-box;
margin-top: 100px;
p {
margin-top: 30px;
}
}
</style>

View File

@@ -0,0 +1,204 @@
<template>
<div class="payResult-container" v-if="isReady">
<div class="payResult-header flex justify-content-c align-items-c m15 bg-white flex-direction-colunm">
<img :src="srcSuccess" class="payResult-img mb15 pt15" v-if="payStatus == '1'" />
<img :src="srcPending" class="payResult-img mb15 pt15" v-if="payStatus == '4' || payStatus == '8'" />
<img :src="srcFail" class="payResult-img mb15 pt15" v-if="payStatus == '2'" />
<img :src="srcFail" class="payResult-img mb15 pt15" v-if="payStatus == '9'" />
<h3 v-if="payStatus == '1'" class="mb10">支付成功</h3>
<h3 v-if="payStatus == '4'" class="mb10">支付中...</h3>
<h3 v-if="payStatus == '2'" class="mb10">支付失败</h3>
<h3 v-if="payStatus == '9'" class="mb10">支付失败</h3>
<span v-if="payStatus == '4'" class="pb10">银行扣款中请稍后查询</span>
<span v-if="payStatus == '8'" class="pb10">线下批扣中</span>
<!-- <span v-if="payStatus == '8'">{{ resMessage }}</span> -->
</div>
<van-cell-group v-if="payStatus == 1">
<van-cell title="产品名称" :value="card.appntName" />
<van-cell title="支付金额" :value="`${payInfo.amnt}元` | moneyFormat" v-if="payInfo.amnt != ''" />
<van-cell title="卡号" :value="card.bankCode" />
</van-cell-group>
<!-- <div v-if="payStatus != '2' && payStatus != '1'" class=" p10 pb250 bg-white">
<span class="pt150 fs14"> 如有相关问题请联系信息技术部运维人员</span>
</div> -->
<div v-if="payStatus == '1'" class=" p10 pb250 bg-white">
<span class="pt150 fs14"> 核心承保中请您稍后查看</span>
</div>
<div v-if="payStatus == '2' || payStatus == '4' || payStatus == '8'" class=" p10 pb250 bg-white">
<span v-html="resMessage"></span>
</div>
<!-- <div class=" p10 pb250 bg-white">
<span v-html="resMessage"></span>
</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>
</div> -->
<div class="bottom-area bottom-btn flex">
<!-- <van-button class="m-btn w250" type="danger" size="normal" @click="rePayMent">重新支付</van-button> -->
<van-button size="large" type="danger" @click="next" v-no-more-click="1000">返回首页</van-button>
</div>
</div>
</template>
<script>
import { Cell, CellGroup } from 'vant'
import { getPayState } from '@/api/ebiz/sale/sale'
export default {
data() {
return {
// 保融收银台返回的支付流水号
paySeqNo: '',
// 接口返回数据前,不做页面渲染
isReady: false,
// 是否已重新获取支付状态。(首次进入本页,立即查询支付结果。如果是‘支付中’,两秒后再次(最后一次)再次获取一次支付状态。)
isReloaded: false,
// 结果原因
resMessage: '',
// 支付结果
payStatus: '',
// 支付信息
payInfo: {
appntName: '', // 投保人
prtNo: '', // 投保单号
amnt: '' // 支付金额
},
card:{
},
// 图片
srcSuccess: this.$assetsUrl + 'images/success.png',
srcPending: this.$assetsUrl + 'images/pending.png',
srcFail: this.$assetsUrl + 'images/fail.png'
}
},
components: {
[Cell.name]: Cell,
[CellGroup.name]: CellGroup
},
methods: {
appCallBack(data) {
if (data.trigger == 'left_button_click') {
this.$jump({
flag: 'h5',
extra: {
title: '产品列表',
forbidSwipeBack: 1, //当前页面禁止右滑返回
url: location.origin + `/#/cardList/CardTotreasure`
},
routerInfo: {
path: `/cardList/CardTotreasure`,
type: '1'
}
})
}
},
// 返回列表页
next() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/cardList/cardTotreasure'
},
routerInfo: {
path: '/cardList/cardTotreasure'
}
})
},
// 查询支付状态
queryPayState() {
this.$toast.clear()
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let data = { orderNo: this.paySeqNo }
getPayState(data).then(res => {
this.$toast.clear()
this.isReady = true
console.log('----支付结果查询', JSON.stringify(res))
if (res.result == '0') {
this.payStatus = res.payStatus
this.payInfo = res
// 如果是支付中2秒后重新获取一次支付状态
if (this.payStatus == '4' && !this.isReloaded) {
this.isReloaded = true
setTimeout(() => {
this.queryPayState()
}, 2000)
}
} else {
this.$toast(res.resultMessage)
}
})
}
// // 重新支付
// rePayMent() {
// // localStorage.orderNo = order.orderInfoDTO.orderNo
// // 再次支付 salelist为 0
// localStorage.salelist = '0'
// this.$jump({
// flag: 'h5',
// extra: {
// url: location.origin + '/#/sale/payMent'
// },
// routerInfo: {
// path: '/sale/payMent'
// }
// })
// }
},
created() {
setTimeout(() => {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close-btn@3x.png',
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
}, 100)
window.appCallBack = this.appCallBack
},
mounted() {
document.body.style.backgroundColor = '#fff'
let that = this
that.payStatus = window.localStorage.getItem('payStatus')
this.card = JSON.parse(window.localStorage.getItem('cardList-detail'))
that.payInfo = JSON.parse(window.localStorage.getItem('payInfo'))
if (window.localStorage.getItem('resMessage') != null) {
that.resMessage = window.localStorage.getItem('resMessage').replace(/\\n/g, '<br>')
}
this.paySeqNo = this.$route.query.RdSeq
if (!this.paySeqNo) {
this.$toast({ message: '参数错误缺少支付流水号RdSeq查询参数', duration: 5000 })
} else {
this.queryPayState()
}
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()
}
}
</script>
<style lang="scss" scoped>
.payResult-container {
.payResult-header {
width: 345px;
// height: 143px;
.payResult-img {
width: 70px;
height: 70px;
}
}
}
// /deep/ .van-cell__value {
// text-align: left;
// }
</style>

View File

@@ -0,0 +1,104 @@
<template>
<div class="paySuccess">
<template v-if="payStatus == '1'">
<div class="paySucc">
<van-icon name="passed" size="100px" color="#1296DB" />
<span>支付成功</span>
</div>
<van-cell-group name="payInfo">
<van-field v-model="payInfo.productName" readonly clearable label="产品名称" name="产品名称" placeholder="国富安全出行2.0" />
<van-field v-model="payInfo.paymentAmount" readonly clearable label="支付金额" name="支付金额" placeholder="100.00元" />
<van-field v-model="payInfo.bankCardNumber" readonly clearable label="卡号" name="卡号" placeholder="1297793740298" />
</van-cell-group>
</template>
<template v-else-if="payStatus == '2'">
<div class="flex flex-direction-colunm align-items-c pt100">
<img :src="this.$assetsUrl + 'images/fail.png'" class="w100 h100" alt="" />
<p class="mt30">支付失败</p>
</div>
</template>
<div class="bg-white bottom-btn">
<van-button type="danger" size="large" class="payBtn" @click="goHome">返回首页</van-button>
</div>
</div>
</template>
<script>
import Vue from 'vue'
import { Field, CellGroup } from 'vant'
Vue.use(Field)
export default {
name: 'paySuccess',
components: {
[CellGroup.name]: CellGroup
},
data() {
return {
payStatus: '1',
productName: '',
paymentAmount: '',
bankCardNumber: '',
// 保融收银台返回的支付流水号
paySeqNo: '',
// 接口返回数据前,不做页面渲染
isReady: false,
// 是否已重新获取支付状态。(首次进入本页,立即查询支付结果。如果是‘支付中’,两秒后再次(最后一次)再次获取一次支付状态。)
isReloaded: false,
// 结果原因
resMessage: '',
// 支付信息
payInfo: {
appntName: '', // 投保人
prtNo: '', // 投保单号
amnt: '' // 支付金额
}
}
},
created() {
this.payInfo = JSON.parse(window.localStorage.getItem('payInfo'))
},
methods: {
goHome() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/cardList/CardTotreasure`
},
routerInfo: {
path: `/cardList/CardTotreasure`
}
})
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
.van-field__label span {
font-family: '微软雅黑';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: #666666;
}
a {
font-size: 16px;
}
.van-field__control {
margin-left: 30px;
}
.paySucc {
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
width: 100%;
height: 250px;
align-items: center;
justify-content: center;
border-top: 1px solid #ccc;
border-bottom: 7.5px solid rgb(235, 233, 233);
}
</style>

View File

@@ -0,0 +1,29 @@
<template>
<div>
<iframe :src="src + pdfUrl" style="width:100vw;height:100vh"></iframe>
</div>
</template>
<script>
export default {
data() {
return {
pdfUrl: '',
src: location.origin + '/pdfjs/web/viewer.html?file='
}
},
created() {
this.init()
},
mounted() {},
methods: {
init() {
let cardListPDF = JSON.parse(localStorage.cardListPDF)
console.log(cardListPDF)
this.pdfUrl = cardListPDF.documentUrl
this.shareContent = cardListPDF.title
document.title = cardListPDF.title
}
}
}
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,123 @@
//点击弹出组件
export function selectComp(that, index, type = '') {
that.currentPopupIndex = index
let title = ''
if (index == 1) {
if (that.selectUser == '1') {
;[that.customerShowPicker2, title] = [true, '客户列表']
} else {
;[that.customerShowPicker, title] = [true, '客户列表']
}
// ;[that.customerShowPicker, title] = [true, '客户列表']
} else if (index == 2) {
;[that.occupationShowPicker, title] = [true, '职业类别']
} else if (index == 3) {
if (type == '1') {
//投保人
localStorage.scanFromInsured = 'true'
} else if (type == '2') {
//被保人
localStorage.scanFromInsured = 'false'
}
;[that.isScan, title] = [true, '身份证扫描']
}
setTimeout(() => {
that.$jump({
flag: 'navigation',
extra: {
title,
hiddenLeft: '1'
}
})
closeBtn(that)
}, 400)
}
// 关闭按钮的显示
function closeBtn(that) {
that.$jump({
flag: 'webview_right_button',
extra: {
btns: [
{
img: that.$assetsUrl + 'images/del-close.png',
route: { flag: '', extra: {} }
}
]
}
})
}
// 获取身份证扫描信息
/**
*
* @param {*} that 上下文
* @param {*} data 扫描数据
* @param {*} type 1 投保人 2 被保人
*/
export function getIdentityInfo(that, data, type) {
if (type == '1') {
// 正面
if (data.name && data.name != '待识别') {
that.userInfo.name = data.name
that.userInfo.idNo = data.idNo
that.userInfo.birthday = `${data.birthYear}-${data.birthMonth}-${data.birthDay}`
that.userInfo.sex = data.gender == '男' ? '0' : '1'
}
// 反面
if (data.startDate && data.startDate != '待识别') {
that.userInfo.certificateValidate = `${data.startDate.substr(0, 4)}-${data.startDate.substr(5, 2)}-${data.startDate.substr(8, 2)}`
//that.userInfo.certificateValidate = `${data.startDate.substr(0, 4)}-${data.startDate.substr(4, 2)}-${data.startDate.substr(6, 2)}`
// 是否为长期身份证
if (data.endDate != '长期') {
that.userInfo.certiexpiredate = `${data.endDate.substr(0, 4)}-${data.endDate.substr(5, 2)}-${data.endDate.substr(8, 2)}`
// that.userInfo.certiexpiredate = `${data.endDate.substr(0, 4)}-${data.endDate.substr(4, 2)}-${data.endDate.substr(6, 2)}`
that.effectiveDateTypeAble = true
} else {
// 勾选长期
that.userInfo.effectiveDateType = true
// 长期按钮不禁用
that.effectiveDateTypeAble = false
// 证件截止日期不需要校验
that.certiexpiredateRequired = false
}
}
}
if (type == '2') {
// 正面
if (data.name && data.name != '待识别') {
that.userInfo.insuredName = data.name
that.userInfo.insuredidNo = data.idNo
that.userInfo.insuredBirthday = `${data.birthYear}-${data.birthMonth}-${data.birthDay}`
that.userInfo.insuredSex = data.gender == '男' ? '0' : '1'
}
// 反面
if (data.startDate && data.startDate != '待识别') {
that.userInfo.certificateValidate = `${data.startDate.substr(0, 4)}-${data.startDate.substr(5, 2)}-${data.startDate.substr(8, 2)}`
//that.userInfo.certificateValidate = `${data.startDate.substr(0, 4)}-${data.startDate.substr(4, 2)}-${data.startDate.substr(6, 2)}`
// 是否为长期身份证
if (data.endDate != '长期') {
that.userInfo.certiexpiredate = `${data.endDate.substr(0, 4)}-${data.endDate.substr(5, 2)}-${data.endDate.substr(8, 2)}`
// that.userInfo.certiexpiredate = `${data.endDate.substr(0, 4)}-${data.endDate.substr(4, 2)}-${data.endDate.substr(6, 2)}`
that.effectiveDateTypeAble = true
} else {
// 勾选长期
that.userInfo.effectiveDateType = true
// 长期按钮不禁用
that.effectiveDateTypeAble = false
// 证件截止日期不需要校验
that.certiexpiredateRequired = false
}
}
}
that.isScan = false
let title = type == '1' ? '投保人信息' : '被保人信息'
that.$jump({
flag: 'navigation',
extra: {
title,
hiddenRight: '1'
}
})
}

View File

@@ -0,0 +1,52 @@
import changeFifteenToEighteen from '@/assets/js/utils/changeFifteenToEighteen'
import idNoCheck from '@/assets/js/utils/idNoCheck'
import utilsAge from '@/assets/js/utils/age'
//身份证带出出生日期,性别,年龄
export function idToData(idNo) {
//非空
if (!idNo.trim()) {
return {
text: '证件号码不能为空'
}
}
// 证件号码规则校验
if (!idNoCheck.isIdno(idNo)) {
return {
text: '您填写的证件号码有误'
}
}
//如果是15位身份证号先转为18位
if (idNo.length == 15) {
idNo = changeFifteenToEighteen(idNo)
}
let birthday = getBirthById(idNo)
let age = utilsAge.getAge(birthday, new Date())
let sex = getSexById(idNo)
return {
birthday,
age,
sex
}
}
function getBirthById(idNo) {
// 获取生日
var year = idNo.substr(6, 4)
var month = idNo.substr(10, 2)
var day = idNo.substr(12, 2)
return year + '-' + month + '-' + day
}
function getSexById(idNo) {
// 获取性别
if (idNo.charAt(16) >= '0' && idNo.charAt(16) <= '9') {
if (parseInt(idNo.charAt(16)) % 2 == 0) {
return '1'
} else {
return '0'
}
}
}

View File

@@ -0,0 +1,255 @@
<template>
<div class="chanpingxiangqing-wxa">
<div class="mt10">
<img v-for="(items, id) in introductImages" :key="id" :src="items" alt="产品详情" width="100%" />
</div>
<div class="pb50 pt10">
<van-cell
class="product-detail-list-item p10 fs12 fw400 bg-white"
:title="item.name"
is-link
v-for="(item, index) in docuList"
:key="index"
@click="goDocu(item.url, item.name)"
/>
</div>
<div class="bottom-area bottom-btn">
<van-button type="danger" size="large" @click="gotoInformation">下一步</van-button>
</div>
</div>
</template>
<script>
import { Cell, Toast } from 'vant'
import { getProductDetails, getProductInfo, insureTrial } from '@/api/ebiz/cardList/cardList.js'
export default {
name: 'Chanpingxiangqing.vue',
components: {
[Cell.name]: Cell
},
data() {
return {
introductImages: [],
docuList: [],
productCode: '',
results: [],
trialInfos: []
}
},
async created() {
let code = this.$route.params.productDetailCode
console.log(code)
await this.getData(code)
await this.getProductDetail()
await this.insureTrial()
},
methods: {
goDocu(url, name) {
// let pdfUrl = //encodeURIComponent(url)
localStorage.setItem('cardListPDF', JSON.stringify({ documentUrl: url, title: name }))
console.log('url', url)
this.$jump({
flag: 'h5',
extra: {
title: name,
// url: 'http://47.96.143.111/pdfjs/web/viewer.html?file=' + url //测试代码
url: location.origin + '/#/cardList/ShowPDF'
},
routerInfo: {
path: '/cardList/ShowPDF'
}
})
// 跳转到产品资料详情
// 保存url
// window.localStorage.setItem('documentInfo', JSON.stringify({ documentUrl: url, documentType: type }))
// // 保存文件类型
// // 0-图片, 1-pdf, 2-word, 3-excel
// window.localStorage.setItem('documentType', type)
// this.$jump({
// flag: 'h5',
// extra: {
// url: location.origin + '/#/product/productDocument'
// },
// routerInfo: {
// path: `/product/productDocument`
// }
// })
},
gotoInformation() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/cardList/information'
},
routerInfo: {
path: '/cardList/information'
}
})
},
async getData(code) {
let data = {
itemCode: code,
platform: 'app'
}
await getProductDetails(data)
.then(res => {
console.log('res', res)
if (res.result == 0) {
// 获取产品特色图片
this.introductImages = res.productShowInfo.introductImages
// 获取产品资料文件
this.docuList = res.productShowInfo.documents
this.productCode = res.productShowInfo.itemProductDTOS[0].productCode
this.results = res.productShowInfo.itemProductDTOS[0]
console.log(' this.resultresultss', this.results)
} else {
Toast.fail(res.resultMessage)
}
})
.catch(err => {
console.log('errerr', err)
})
},
async getProductDetail() {
let that = this
let data = {
platform: 'app',
productCodes: [that.productCode],
type: '1'
}
console.log('data', data)
await getProductInfo(data)
.then(res => {
if (res.result == 0) {
this.trialInfos = res.trialDTOS[0].productTrialInfoDTO
console.log('this.trialInfos', this.trialInfos)
let resultData = res.trialDTOS[0]
if (resultData.productTrialInfoDTO.dutyGroup != null) {
resultData.productTrialInfoDTO.dutyGroup.map(item => {
if (item.dutyName == '意外身故/伤残保险金') {
item.defaultDutyAmt = '50'
}
})
}
//保存附加险
localStorage.addtionRiskLst = JSON.stringify(resultData.productTrialInfoDTO.addtionRiskLst)
// console.log('resultData', resultData)
localStorage.isAutoPay = resultData.isAutoPay
localStorage.isRenew = resultData.isRenew
let calFactorLst = this.getFactorList(resultData)
let hasAddtionRisk = resultData.productTrialInfoDTO.addtionRiskLst ? true : false
console.log('that.results.riskName', that.results.riskName)
let currentProductInfo = {
calFactorLst,
hasAddtionRisk,
isMainRisk: 0,
riskType: resultData.riskType,
riskName: that.results.productName,
productCode: that.results.productCode,
mainRiskCode: that.results.productCode,
documentDTOS: resultData.productTrialInfoDTO.documentDTOS,
influences: resultData.productTrialInfoDTO.influences,
isRemit: resultData.productTrialInfoDTO.isRemit,
hasPredictTransferPrem: resultData.productTrialInfoDTO.hasPredictTransferPrem, //建议书使用 是否展示预计转入保费
predictTransferPrem: null //建议书使用 预计转入保费字段
}
//构建险种数组
let productsData
// if (localStorage.chooseProducts) {
// productsData = JSON.parse(localStorage.chooseProducts)
// productsData.push(currentProductInfo)
// } else {
productsData = [currentProductInfo]
console.log('productsDataproductsData', productsData)
// }
//保存选择险种
localStorage.chooseProducts = JSON.stringify(productsData)
} else {
Toast.fail(res.resultMessage)
}
})
.catch(err => {
console.log('errerr', err)
})
},
insureTrial() {
let that = this
// 获取卡单列表
let data = {
trialInfos: [{ productCode: that.productCode }]
}
insureTrial(data)
.then(res => {
console.log('resrrrrrr', res)
if (res.result == 0) {
localStorage.trialList = JSON.stringify(res.trialList)
} else {
Toast.fail(res.resultMessage)
}
})
.catch(err => {
console.log('errerr', err)
})
},
//构建险种因子列表
getFactorList(resultData) {
let productTrialInfoDTO = resultData.productTrialInfoDTO
console.log(productTrialInfoDTO, 'wode')
let calFactorLst = resultData.productTrialInfoDTO.calFactorLst
console.log('calFactorLst', calFactorLst)
calFactorLst.forEach(item => {
item['isMainRisk'] = 0
item.columns = []
if (item.type == 0) {
//1、type=0 select 2、type=1 input+stepper
productTrialInfoDTO[item.code].forEach(factor => {
if (factor.defaultValue == 0) {
item.showContent = factor.showContent
if (factor[item.code + 'Flag'] != undefined) {
item[item.code] = factor[item.code]
item[item.code + 'Flag'] = factor[item.code + 'Flag']
item.hasFlag = '1'
} else {
item[item.code] = factor[item.code]
}
}
item.columns.push({ text: factor.showContent, value: factor[item.code], flag: factor[item.code + 'Flag'] })
})
} else if (item.type == 1) {
//按年龄选择
productTrialInfoDTO[item.code].forEach(factor => {
item = Object.assign(item, factor)
})
if (item.code == 'inputPrem') {
item['inputPrem'] = Number(item.minPrem) * Number(item.moneyUnit)
} else {
item['amt'] = Number(item.minAmt) * Number(item.moneyUnit)
}
}
//规则储存
item['rules'] = productTrialInfoDTO[item.code]
})
// // 用于意外险初始化保额
// calFactorLst.map(item => {
// if (item.code == '"dutyGroup"') {
// item.rules.map(factor => {
// factor[0].defaultDutyAmt = 50
// })
// }
// })
return calFactorLst
}
}
}
</script>
<style lang="scss" scoped>
img {
width: 100%;
}
</style>

View File

@@ -493,6 +493,14 @@ export default {
} }
}, },
created() { created() {
localStorage.removeItem('bankCardUrlPath')
localStorage.removeItem('bankCard')
localStorage.removeItem('bankCardUrlInsuredPath')
localStorage.removeItem('bankCardInsured')
localStorage.removeItem('imgfrontPath')
localStorage.removeItem('imgfrontInsuredPath')
localStorage.removeItem('imgBackPath')
localStorage.removeItem('imgBackInsuredPath')
// document.body.style.backgroundColor = '#F5F5F5' // document.body.style.backgroundColor = '#F5F5F5'
//如果是编辑/导航进来 //如果是编辑/导航进来
this.isElecCont = '0' this.isElecCont = '0'