mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-06 23:36:43 +08:00
【FEAT】新增问卷测评部分逻辑
This commit is contained in:
198
src/views/ebiz/common/EvaluateResult.vue
Normal file
198
src/views/ebiz/common/EvaluateResult.vue
Normal file
@@ -0,0 +1,198 @@
|
||||
<template>
|
||||
<div class="fit-wrapper">
|
||||
<div v-if="assessResult == '1'" class="fit-container">
|
||||
<img src="@/assets/images/ebiz/refresh.png" alt="">
|
||||
<div class="pt20 pb20 pr10 pl20">
|
||||
<span>{{ evalDesc }}</span>
|
||||
<span class="red fw400">根据以上与适当性问卷匹配结果,我司建议您终止投保,关注该产品的特征及风险,审慎作出投保决策。 如您坚持投保,请您确认和签署《投保风险警示确认书》。</span>
|
||||
</div>
|
||||
<div class="footer-btn bottom-btn bg-white flex">
|
||||
<van-button type="danger" size="large" plain square class="btn" @click="exitProcess" v-no-more-click="1000">终止投保</van-button>
|
||||
<van-button type="danger" size="large" square class="btn" @click="showRisks = true" v-no-more-click="1000">已知晓上述提示,本人仍继续投保</van-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="assessResult === '0'" class="fit-container">
|
||||
<img src="@/assets/images/ebiz/refresh.png" alt="">
|
||||
<div class="pt20 pb20 pr10 pl20">{{evalDesc}}</div>
|
||||
<div class="bottom-btn bg-white flex">
|
||||
<van-button type="danger" size="large" square class="btn" v-no-more-click="1000" @click="onConfirm">确认</van-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<van-dialog
|
||||
v-model="showRisks"
|
||||
title="投保风险警示确认书"
|
||||
confirmButtonText="知晓并同意警示书,继续投保"
|
||||
@confirm="onConfirm"
|
||||
class="riskDialog"
|
||||
>
|
||||
<span>
|
||||
本人声明已了解及完全清楚产品责任、风险情况、保险利益不确定及不及时交纳保险费的风险,经审慎考虑后,仍坚持购买该产品,并愿意承担由此可能产生的损失和其他后果。购买该产品的决定,系本人独立、自主、真实的意思表示。
|
||||
</span>
|
||||
</van-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getOrderDetail, saveEvalateAnswer } from '@/api/ebiz/sale/sale'
|
||||
export default {
|
||||
name: 'EvaluateResult',
|
||||
data(){
|
||||
return {
|
||||
assessResult:null, //适应性问卷评估结果 0通过 1不通过
|
||||
showPopUp:true,
|
||||
showRisks:false,
|
||||
assessResultDescList:[],
|
||||
evalDesc:'',//测评结果描述
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.$jump({
|
||||
flag: 'navigation',
|
||||
extra: {
|
||||
title: '评估结果'
|
||||
},
|
||||
})
|
||||
if (localStorage.isFrom == 'sale') {
|
||||
setTimeout(() => {
|
||||
EWebBridge.webCallAppInJs('webview_left_button', {
|
||||
img: this.$assetsUrl + 'images/del-close-btn@3x.png',
|
||||
intercept: '1' //是否拦截原生返回事件 1是 其他否
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
window.appCallBack = this.appCallBack
|
||||
document.body.style.backgroundColor = '#fff'
|
||||
this.$route.query.assessResult && (this.assessResult = this.$route.query.assessResult)
|
||||
getOrderDetail({ orderNo: this.$route.query.orderNo,userAssessLogic:true }).then(res => {
|
||||
if (res.result == 0) {
|
||||
this.assessResultDescList = res.orderDTO.orderInfoDTO.assessResultDescMap
|
||||
this.assessResult = res.orderDTO.orderInfoDTO.assessResult
|
||||
if(Object.keys(this.assessResultDescList).includes('pass')&&this.assessResult==='0'){
|
||||
this.evalDesc = this.assessResultDescList['pass']
|
||||
}else{
|
||||
this.handlerAssessResultDesc()
|
||||
}
|
||||
console.log('this.assessResultDescList',this.assessResultDescList)
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
},
|
||||
methods:{
|
||||
|
||||
handlerAssessResultDesc(){
|
||||
// 获取所有以1开头的属性键
|
||||
let numStr = ['1','2','3','4']
|
||||
let evalDesc = ''
|
||||
numStr.forEach(num=>{
|
||||
let keysStartWith = Object.keys(this.assessResultDescList).filter(key => key.startsWith(num));
|
||||
// 获取这些键对应的所有元素值组成的数组
|
||||
let filterValue = keysStartWith.map(key => {
|
||||
return JSON.parse(this.assessResultDescList[key]);
|
||||
});
|
||||
console.log('filterValue',filterValue)
|
||||
if(filterValue.length==1){
|
||||
evalDesc += filterValue[0].join('')
|
||||
}else if(filterValue.length>1){
|
||||
evalDesc += filterValue.map(item => item[0]).join(',') + filterValue[0][1]
|
||||
}else return
|
||||
})
|
||||
this.evalDesc = evalDesc
|
||||
},
|
||||
|
||||
//终止投保
|
||||
exitProcess(){
|
||||
this.$dialog.confirm(
|
||||
{
|
||||
className: 'dialog-delete',
|
||||
title: '提示',
|
||||
message: '退出流程可能会丢失部分数据,是否确认退出?',
|
||||
cancelButtonColor: '#E9332E',
|
||||
confirmButtonColor: '#FFFFFF'
|
||||
})
|
||||
.then(() => {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
title: '电子投保单列表',
|
||||
forbidSwipeBack: 1, //当前页面禁止右滑返回
|
||||
url: location.origin + `/#/sale/list`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/sale/list`,
|
||||
type: '1'
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
return
|
||||
})
|
||||
},
|
||||
//继续投保
|
||||
onConfirm(){
|
||||
let index = localStorage.getItem('evalateFrom') == 'toEvaluate' ? '-4' : '-3'
|
||||
console.log('onConfirm')
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index,
|
||||
},
|
||||
routerInfo: {
|
||||
type: 2,
|
||||
index,
|
||||
path: '/common/selectedProduct'+'/?orderNo=' + this.$route.query.orderNo
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.fit-wrapper{
|
||||
width:100%;
|
||||
height:100vh;
|
||||
display:flex;
|
||||
.fit-container{
|
||||
width:100%;
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
img{
|
||||
margin-bottom:20px;
|
||||
width:100px;
|
||||
height:100px;
|
||||
}
|
||||
}
|
||||
.footer-btn{
|
||||
position:fixed;
|
||||
bottom:0;
|
||||
width:100%;
|
||||
display:flex;
|
||||
justify-content:space-between;
|
||||
align-items:center;
|
||||
.van-button:first-child{
|
||||
flex:1;
|
||||
}
|
||||
.van-button:last-child{
|
||||
flex:2;
|
||||
}
|
||||
}
|
||||
/deep/ .riskDialog{
|
||||
.van-dialog__header{
|
||||
padding:20px 0;
|
||||
font-size:16px;
|
||||
}
|
||||
.van-dialog__content{
|
||||
padding:0 20px;
|
||||
margin-bottom:10px;
|
||||
font-size:14px;
|
||||
}
|
||||
.van-dialog__confirm{
|
||||
font-size:16px;
|
||||
color:#5ca7de;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user