[FIX]电投优化-受益人页、告知信息页-左上角按钮改为×,点击后直接返回列表页;页面跳转条件限制

This commit is contained in:
yuweiqi
2020-03-13 20:56:19 +08:00
parent a305279f63
commit a578f617cf
2 changed files with 75 additions and 19 deletions

View File

@@ -109,10 +109,11 @@ export default {
this.insuredPerson = JSON.parse(localStorage.saleInsuredPersonInfo).name
},
mounted() {
// EWebBridge.webCallAppInJs('webview_left_button', {
// intercept: '1' //是否拦截原生返回事件 1是 其他否
// })
// window.appCallBack = this.appCallBack
EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close@3x.png',
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
window.appCallBack = this.appCallBack
document.body.style.backgroundColor = '#fff'
},
beforeRouteLeave(to, from, next) {
@@ -120,15 +121,34 @@ export default {
next()
},
methods: {
// appCallBack() {
// this.$jump({
// flag: 'goBack',
// extra: {
// refresh: '1', //是否返回后刷新01
// index: '-1'
// }
// })
// },
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
})
}
},
//告知信息
nextStep() {
if (this.type == 2 && this.beneficiaries.length == 0) {
@@ -165,11 +185,15 @@ export default {
// console.log(res)
if (res.result == 0) {
localStorage.removeItem('applicant')
localStorage.salePageFlag = '8' //当前后台接口及前端代码不完善,仅调试观察现象使用,调试完成后删除
if (!this.$route.query.salePageFlag) {
//不是从导航栏进入
localStorage.salePageFlag = '5'
}
//页面跳转
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + '/#/sale/notifyingMessage',
needRefresh: '1'
},

View File

@@ -185,6 +185,11 @@ export default {
//this.information()
},
mounted() {
EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close@3x.png',
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
document.body.style.backgroundColor = '#F5F5F5'
if (!this.$route.query.edit) {
//如果不是编辑/导航条跳转进来的
localStorage.setItem('salePageFlag', this.salePageFlag)
@@ -198,6 +203,34 @@ export default {
}
},
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
})
}
},
// 一键全否
allFalse() {
let that = this
@@ -490,7 +523,10 @@ export default {
saveInformation(data).then(res => {
if (res.result == '0') {
localStorage.removeItem('changeCard')
localStorage.salePageFlag = '8' //当前后台接口及前端代码不完善,仅调试观察现象使用,调试完成后删除
if (!this.$route.query.salePageFlag) {
//不是从导航栏进入
localStorage.salePageFlag = '6'
}
that.$jump({
flag: 'h5',
extra: {
@@ -580,10 +616,6 @@ export default {
}
},
mounted() {
document.body.style.backgroundColor = '#F5F5F5'
// this.$toast('11111')
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()