重新投保页面修改,模拟原接口数据

This commit is contained in:
pangxingyue
2021-03-04 18:10:25 +08:00
parent c8d56adc23
commit 23c7377a96
11 changed files with 329 additions and 264 deletions

View File

@@ -1,44 +1,102 @@
<template>
<div>
<van-search v-model="value" placeholder="请输入保单号/投保人姓名/被保险人姓名" />
<van-search v-model="searchName" placeholder="请输入保单号/投保人姓名/被保险人姓名" @change="searchList" @keyup.enter="searchList" />
<van-sticky>
<van-tabs v-model="active">
<van-tab title="未提交" />
<van-tab title="已提交" />
<van-tabs v-model="active" @change="tabChange">
<van-tab name="uncommit" title="未提交" />
<van-tab name="commit" title="已提交" />
</van-tabs>
</van-sticky>
<div class="container">
<component :is="is" />
<van-pull-refresh v-model="isLoading" @refresh="onRefresh">
<van-list ref="uncommitted" v-model="loading" :finished="finished" :finished-text="finishedText" @load="loadMore">
<div v-if="insureList.length>0">
<Order v-for="(order,index) in insureList" :key="index" :order="order">
<p v-if="active === 'uncommit'" class="name mb8">
<van-tag plain color="#999999">保单保障日截止日期</van-tag>
<span class="ml5 span">{{ order.orderInfoDTO.orderNo }}</span>
</p>
<div v-if="active === 'commit'">
<p class="name mb8">
<van-tag plain color="#999999">重新投保单号</van-tag>
<span class="ml5 span">{{ order.orderInfoDTO.orderNo }}</span>
</p>
<p class="name">
<van-tag plain color="#999999">状态</van-tag>
<span class="ml5 span">{{ order.stateName }}</span>
</p>
</div>
<template #btns>
<van-button size="small" round type="danger" @click="insureAgainDetail" plain>查看详情</van-button>
<van-button class="ml10" size="small" round type="danger" @click="insureAgain">重新投保</van-button>
</template>
</Order>
</div>
</van-list>
</van-pull-refresh>
<van-popup v-model="isAgreementShow" position="right" :style="{ height: '100vh', width: '100vw' }">
<ReadingAgreement :needTime="false">
<h3 class="p10">重新投保声明提示</h3>
<p class="pl10">尊敬的xxx先生/女士</p>
<p class="p10">
您好您于保单生效日期投保的保单号为保单号码的国富人寿国富民惠医疗保险2020保单即将到期到期日期详见保单以下简称旧保单为保护您的权益即日起至<期满日后第60天>期间您可以选择重新投保国富人寿国富民惠医疗保险2020本次申请投保的国富人寿国富民惠医疗保险2020保单以下简称新保单请您仔细阅读以下内容
1.国富人寿国富民惠医疗保险2020合同保险期间为一年到期后需要重新投保
2.本次重新投保我们将按照国富人寿国富民惠医疗保险2020费率表中的在上一保险期间届满后60日内申请重新投保时对应的费率计算保费
3.若本次重新投保成功新保单免除等待期
4.本次重新投保仅限于无其他补充告知的情况若您有其他补充告知您的条件不符合本重新投保流程请您联系保单服务专员通过新增投保单进行投保申请
5.若您于旧保单满期前申请重新投保且于满期前成功支付保险费则新保单在旧保单保险期满日对应日的次日零时生效旧保单在保险期满日24时终止若您于旧保单满期后60天包含内重新投保申请且成功支付保险费则新保单于支付次日零时生效旧保单在保险期满日24时终止
6.若您未在旧保单满期后60天包含内申请重新投保则您的重新投保资格将被取消后续您可再次申请投保但新单不再与旧保单关联需重新计算等待期具体详情可咨询保单服务专员
</p>
<template #action>
<van-radio-group class="m10" v-model="radio">
<van-radio :name="false">
<span style="font-size: 14px;">本人已阅读知晓本投保声明内容同意重新投保</span>
</van-radio>
</van-radio-group>
<div class="btns">
<van-button type="danger" :disabled="radio" block @click="nextStep">下一步</van-button>
</div>
</template>
</ReadingAgreement>
</van-popup>
</div>
</div>
</template>
<script>
import { Search, Sticky } from 'vant'
import Committed from './Committed'
import Uncommitted from './Uncommitted'
import { Search, Sticky, PullRefresh, list, Tag, Popup, Radio, RadioGroup } from 'vant'
import { orderList } from '@/api/ebiz/insureAgain/insureAgain'
import { formatRiskList } from '@/assets/js/utils/formatRiskList.js'
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到用户等级
import Order from '@/components/ebiz/insureAgain/Order'
import ReadingAgreement from '@/components/ebiz/insureAgain/ReadingAgreement'
export default {
name: 'InsureAgain',
components: {
Committed,
Uncommitted,
components: {
Order,
ReadingAgreement,
[Search.name]: Search,
[Sticky.name]: Sticky
[Sticky.name]: Sticky,
[PullRefresh.name]: PullRefresh,
[list.name]: list,
[Tag.name]: Tag,
[Popup.name]: Popup,
[RadioGroup.name]: RadioGroup,
[Radio.name]: Radio
},
data() {
return {
active: 0,
value: ''
}
},
computed: {
is() {
if (this.active === 0) {
return 'Uncommitted'
} else {
return 'Committed'
}
searchName: '', //搜索名
active: 'uncommit',
insureList: [],
currentPage: 1, //当前页数
isLoading: false,
loading: false,
finished: false,
finishedText: '没有更多了',
pageSize: 5,
isAgreementShow: false,
radio: ''
}
},
mounted() {
@@ -53,10 +111,140 @@ export default {
methods: {
appCallBack(data) {
if (data.trigger == 'left_button_click') {
this.$jump({
flag: 'service'
})
if (this.isAgreementShow) {
this.isAgreementShow = false
setTimeout(() => {
window.EWebBridge.webCallAppInJs('webview_left_button', {
intercept: '1'
})
}, 100)
} else {
this.$jump({
flag: 'service'
})
}
}
},
tabChange(name) {
this.currentPage = 1
this.active = name
this.saleList = []
;[this.loading, this.finished] = [true, false]
this.loadMore()
},
searchList() {
this.currentPage = 1
this.insureList = []
;[this.loading, this.finished] = [true, false]
// this.finishedText = '正在加载...'
let pageInfo = {
pageNum: this.currentPage,
pageSize: this.pageSize,
orderType: this.active,
name: this.searchName,
desensitizType: this.active === 'uncommit' ? 1 : 0
}
this.getOrderList(pageInfo)
},
//初始化保单列表
getOrderList(pageInfo) {
orderList(pageInfo).then(res => {
if (res.result == '0') {
this.currentPage++
if (!res.orderDTOPageInfo && res.orderDTOPageInfo !== {}) {
this.finished = true
this.loading = false
this.finishedText = ''
return
}
let list = res.orderDTOPageInfo.list
if (list.length == 0) {
this.finishedText = ''
} else {
this.finishedText = '已经全部加载'
}
list = formatRiskList(list, 'insuredDTOs', 'riskDTOLst') //根据后面两个参数 来格式化数据
dataDictionary.policyState.forEach(state => {
list.forEach(order => {
if (state.id == order.orderInfoDTO.orderStatus) {
order.stateName = state.text
}
})
})
this.insureList = this.insureList.concat(list)
// if (this.insureList.length == 0) {
// this.isSuccess = false
// }
this.loading = false
if (res.orderDTOPageInfo.nextPage == 0) {
//当下一页为0时 表示全部数据加载完毕
this.finished = true
}
} else {
this.finished = true
this.loading = false
this.finishedText = res.resultMessage
}
})
},
insureAgain() {
setTimeout(() => {
window.EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close-btn@3x.png',
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
}, 100)
this.isAgreementShow = true
},
insureAgainDetail(order) {
localStorage.orderNo = order.orderInfoDTO.orderNo
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/insureAgain/insureAgainDetail'
},
routerInfo: {
path: '/insureAgain/insureAgainDetail'
}
})
},
nextStep() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/insureAgain/progress`,
forbidSwipeBack: '1',
needRefresh: '1'
},
routerInfo: { path: `/insureAgain/progress` }
})
},
onRefresh() {
let pageInfo = {
pageNum: 1,
pageSize: this.pageSize,
orderType: this.active,
name: '',
desensitizType: this.active === 'uncommit' ? 1 : 0
}
this.isLoading = false
this.insureList = []
this.getOrderList(pageInfo)
},
//分页用
loadMore() {
if (this.showFlag) {
return
}
let pageInfo = {
pageNum: this.currentPage,
pageSize: this.pageSize,
orderType: this.active,
name: this.searchName,
desensitizType: this.active === 'uncommit' ? 1 : 0
}
this.getOrderList(pageInfo)
}
}
}