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)