From 45df41648934f1e5eed0ec421109005c39d82e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BC=9F=E4=BD=B3?= <2797716443@qq.com> Date: Mon, 11 Apr 2022 13:11:24 +0800 Subject: [PATCH] =?UTF-8?q?52457=20=E3=80=90=E6=89=8B=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E3=80=91=E6=89=80=E6=9C=89=E6=B5=81=E7=A8=8B=20=E4=BB=BB?= =?UTF-8?q?=E6=84=8F=E8=8A=82=E7=82=B9=E5=A4=84=E7=90=86=E5=AE=8C=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E9=83=BD=E8=A6=81=E6=98=BE=E7=A4=BA=E4=B8=8B=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 33 +++++++++++++++++-- .../processCenter/pages/phone/bzrk/step2.vue | 4 +-- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/main.js b/src/main.js index 1d627a4fd..49cb5bd89 100644 --- a/src/main.js +++ b/src/main.js @@ -62,6 +62,7 @@ import { mapMutations, mapActions } from 'vuex' import isMobile from "./store/isMobile"; // 路由拦截 router.beforeEach(function (to, from, next) { + alert(to.name) let toName = to.name let token = store.state.token let path = to.path; @@ -113,7 +114,20 @@ router.beforeEach(function (to, from, next) { /** 判断是不是在手机端操作 */ if (isMobile()) { if(toName === 'processCenter'){ - hwh5.close(); + // hwh5.close(); + //关闭当前窗口 + let userAgent = navigator.userAgent; + if (userAgent.indexOf("Firefox") !== -1 || userAgent.indexOf("Chrome") !==-1) { + window.location.href="about:blank"; + }else if(userAgent.indexOf('Android') > -1 || userAgent.indexOf('Linux') > -1){ + window.opener=null;window.open('about:blank','_self','').close(); + }else { + window.opener = null; + window.open("about:blank", "_self"); + window.close(); + } + //如果是微信打开,关闭当前微信窗口 + weixinClosePage() }else { if ((token === null || token === '' ) && toName !== 'Login') { if(toName !== 'phoneIndex'){ @@ -177,7 +191,21 @@ router.beforeEach(function (to, from, next) { extractedVerify(token) } } - + function weixinClosePage() { + if (typeof WeixinJSBridge == "undefined") { + if (document.addEventListener) { + document.addEventListener('WeixinJSBridgeReady', weixin_ClosePage, false); + } else if (document.attachEvent) { + document.attachEvent('WeixinJSBridgeReady', weixin_ClosePage); + document.attachEvent('onWeixinJSBridgeReady', weixin_ClosePage); + } + } else { + weixin_ClosePage(); + } + } + function weixin_ClosePage() { + WeixinJSBridge.call('closeWindow'); + } function extractedVerify() { if (taskId !== undefined && taskId !== null && prcId !== undefined && prcId !== null) { get_verify_by_instance({ @@ -187,7 +215,6 @@ router.beforeEach(function (to, from, next) { let hisCount = res.hisCount === undefined ? 0 : res.hisCount; let commitStatus = res.commitStatus === undefined ? 0 : res.commitStatus; let isNotFinished = res.isNotFinished === undefined ? 0 : res.isNotFinished; - if ((hisCount && hisCount > 0)) { // 业务系统 当前节点已完成 if(isMobile()){ next('/processedPage') diff --git a/src/pages/processCenter/pages/phone/bzrk/step2.vue b/src/pages/processCenter/pages/phone/bzrk/step2.vue index cff7407d4..d42345e8d 100644 --- a/src/pages/processCenter/pages/phone/bzrk/step2.vue +++ b/src/pages/processCenter/pages/phone/bzrk/step2.vue @@ -3,7 +3,7 @@ - +
基础信息
@@ -966,7 +966,7 @@ export default { this.$message.warning("驳回成功") this.isSubmit = false // 流程提交之后,应该流转至待办任务页面 - this.$router.push({path: '/processCenter?tabsName=ProcessCenter'}) + this.$router.push("/processCenter"); } else { console.log("hello"); this.processCreateStand(json)