[FIX]电投优化-账户信息页、附件上传页-拦截原生返回事件

This commit is contained in:
yuweiqi
2020-03-20 17:10:05 +08:00
parent 682515de17
commit 449e848298
2 changed files with 83 additions and 25 deletions

View File

@@ -234,18 +234,45 @@ export default {
}
})
},
appCallBack() {
this.isclear = true
// 筛选按钮的点击事件
this.isclear = true
this.$jump({
flag: 'navigation',
extra: {
title: '账户管理',
hiddenRight: '1'
}
})
this.isScan = false
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: '电子投保单列表',
url: location.origin + `/#/sale/list`
},
routerInfo: {
path: `/sale/list`,
type: '1'
}
})
})
.catch(() => {
return
})
} else {
this.isclear = true
// 筛选按钮的点击事件
this.isclear = true
this.$jump({
flag: 'navigation',
extra: {
title: '账户管理',
hiddenRight: '1'
}
})
this.isScan = false
}
},
// 单选框选中
clickRadio(val) {
@@ -373,7 +400,6 @@ export default {
}
saveInformation(data).then(res => {
if (res.result == '0') {
localStorage.salePageFlag = '8' //当前后台接口及前端代码不完善,仅调试观察现象使用,调试完成后删除
window.localStorage.setItem('accountInformationRadio', that.radio)
that.$jump({
@@ -425,6 +451,8 @@ export default {
localStorage.setItem('isAutoPay', res.orderDTO.orderAccountDTO.isAutoPay)
localStorage.setItem('isAutoRenewal', res.orderDTO.orderAccountDTO.isAutoRenewal)
localStorage.setItem('isRenew', res.orderDTO.orderAccountDTO.isRenew)
} else {
localStorage.setItem('salePageFlag', this.salePageFlag)
}
this.productNo = res.orderDTO.insuredDTOs[0].riskDTOLst[0].mainRiskCode
//计算年龄
@@ -462,19 +490,14 @@ export default {
},
mounted() {
document.body.style.backgroundColor = '#F5F5F5'
setTimeout(() => {
EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close@3x.png',
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
}, 100)
// 筛选按钮的点击事件
window.appCallBack = this.appCallBack
if (!this.$route.query.edit) {
//如果不是编辑/导航条跳转进来的
localStorage.setItem('salePageFlag', this.salePageFlag)
} else if (this.$route.query.edit && !this.$route.query.salePageFlag) {
//如果从保单列表点击编辑按钮进入
this.salePageFlag = '6'
localStorage.setItem('salePageFlag', this.salePageFlag)
} else if (this.$route.query.salePageFlag) {
//如果是从导航栏点击进入
this.salePageFlag = localStorage.salePageFlag
}
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''

View File

@@ -385,6 +385,13 @@ export default {
}
},
mounted() {
setTimeout(() => {
EWebBridge.webCallAppInJs('webview_left_button', {
// img: this.$assetsUrl + 'images/del-close@3x.png',
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
}, 100)
window.appCallBack = this.appCallBack
if (!this.$route.query.edit) {
//如果不是编辑/导航条跳转进来的
localStorage.setItem('salePageFlag', this.salePageFlag)
@@ -534,6 +541,35 @@ export default {
next()
},
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: '电子投保单列表',
url: location.origin + `/#/sale/list`
},
routerInfo: {
path: `/sale/list`,
type: '1'
}
})
})
.catch(() => {
return
})
}
},
// 删除图片前
beforeDelete(file, detail) {
let that = this
@@ -971,7 +1007,6 @@ export default {
window.localStorage.removeItem('bankCardUrlPath')
window.localStorage.removeItem('bankCardUrlInsured')
window.localStorage.removeItem('bankCardUrlInsuredPath')
localStorage.salePageFlag = '8' //当前后台接口及前端代码不完善,仅调试观察现象使用,调试完成后删除
that.$jump({
flag: 'h5',
extra: {