From a578f617cf853321a5aaecfdb4751cebc7ae5271 Mon Sep 17 00:00:00 2001 From: yuweiqi Date: Fri, 13 Mar 2020 20:56:19 +0800 Subject: [PATCH] =?UTF-8?q?[FIX]=E7=94=B5=E6=8A=95=E4=BC=98=E5=8C=96-?= =?UTF-8?q?=E5=8F=97=E7=9B=8A=E4=BA=BA=E9=A1=B5=E3=80=81=E5=91=8A=E7=9F=A5?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=A1=B5-=E5=B7=A6=E4=B8=8A=E8=A7=92?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=94=B9=E4=B8=BA=C3=97=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=90=8E=E7=9B=B4=E6=8E=A5=E8=BF=94=E5=9B=9E=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=EF=BC=9B=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/sale/Beneficiary.vue | 52 +++++++++++++++++------- src/views/ebiz/sale/NotifyingMessage.vue | 42 ++++++++++++++++--- 2 files changed, 75 insertions(+), 19 deletions(-) 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()