diff --git a/src/views/ebiz/sale/Beneficiary.vue b/src/views/ebiz/sale/Beneficiary.vue index fe083df91..980d72141 100644 --- a/src/views/ebiz/sale/Beneficiary.vue +++ b/src/views/ebiz/sale/Beneficiary.vue @@ -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', //是否返回后刷新0:否,1:是 - // 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' }, diff --git a/src/views/ebiz/sale/NotifyingMessage.vue b/src/views/ebiz/sale/NotifyingMessage.vue index 0c194206e..5bd23f5fa 100644 --- a/src/views/ebiz/sale/NotifyingMessage.vue +++ b/src/views/ebiz/sale/NotifyingMessage.vue @@ -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()