[FIX]电投优化-受益人页面-导航跳转条件、拦截原生返回事件

This commit is contained in:
yuweiqi
2020-03-20 17:11:23 +08:00
parent 449e848298
commit ea2a671174

View File

@@ -86,13 +86,14 @@ export default {
this.beneficiaries = this.beneficiaries.concat(JSON.parse(localStorage.beneficiaryInfo))
this.type = '2'
console.log(this.beneficiaries)
}
//如果是从编辑/导航进来
if (this.$route.query.edit) {
} else {
getOrderDetail({ orderNo: localStorage.orderNo }).then(res => {
if (res.result == 0) {
this.$utils.intLocalStorage(res)
this.type = res.orderDTO.orderInfoDTO.bnfFlag == '1' ? '2' : '1' //bnfFlag 0-法定受益人 1-指定受益人
if (res.orderDTO.orderInfoDTO.bnfFlag == null) {
localStorage.setItem('salePageFlag', this.salePageFlag)
}
if (res.orderDTO.insuredDTOs[0].bnfDTOs !== null) {
this.beneficiaries = this.beneficiaries.concat(res.orderDTO.insuredDTOs[0].bnfDTOs)
localStorage.beneficiaryInfo = JSON.stringify(res.orderDTO.insuredDTOs[0].bnfDTOs)
@@ -101,25 +102,16 @@ export default {
}
}
})
} else {
localStorage.setItem('salePageFlag', this.salePageFlag)
}
if (this.$route.query.edit && !this.$route.query.salePageFlag) {
//如果从保单列表点击编辑按钮进入
this.salePageFlag = '4'
localStorage.setItem('salePageFlag', this.salePageFlag)
} else if (this.$route.query.salePageFlag) {
//如果是从导航栏点击进入
this.salePageFlag = localStorage.salePageFlag
}
this.insuredPerson = JSON.parse(localStorage.saleInsuredPersonInfo).name
},
mounted() {
EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close@3x.png',
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
setTimeout(() => {
EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close@3x.png',
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
}, 100)
window.appCallBack = this.appCallBack
document.body.style.backgroundColor = '#fff'
},
@@ -193,20 +185,16 @@ export default {
if (res.result == 0) {
localStorage.removeItem('applicant')
localStorage.removeItem('fromAddBeneficiaryInfo')
if (!this.$route.query.salePageFlag) {
//不是从导航栏进入
localStorage.salePageFlag = '5'
}
//页面跳转
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + '/#/sale/notifyingMessage',
url: location.origin + `/#/sale/notifyingMessage`,
needRefresh: '1'
},
routerInfo: {
path: '/sale/notifyingMessage'
path: `/sale/notifyingMessage`
}
})
} else {