From 69c760421cbd8447fcb22c9446a8d409dd6ea065 Mon Sep 17 00:00:00 2001 From: hrx <18603305412@163.com> Date: Fri, 14 Aug 2026 11:51:40 +0800 Subject: [PATCH] =?UTF-8?q?H5=E9=A6=96=E9=A1=B5=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/FloatingBox/FloatingBox.vue | 13 +++++++++---- f/web-kboss/src/views/H5/contractCase/index.vue | 8 +++----- f/web-kboss/src/views/H5/decisionCase/index.vue | 8 +++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/f/web-kboss/src/components/FloatingBox/FloatingBox.vue b/f/web-kboss/src/components/FloatingBox/FloatingBox.vue index 90e235a..ce2ef33 100644 --- a/f/web-kboss/src/components/FloatingBox/FloatingBox.vue +++ b/f/web-kboss/src/components/FloatingBox/FloatingBox.vue @@ -295,14 +295,15 @@ export default { init(config = {}) { if (this._inited) return this._inited = true + const isH5 = !!(vm.$route && vm.$route.path && vm.$route.path.startsWith('/h5HomePage')) this._config = Object.assign({ avatarUrl: '', name: vm.$t('yunbao.name'), submitUrl: '', products: vm.getYunbaoProducts(), pages: { - contract: '/homePage/agentStore/contractCase', - decision: '/homePage/agentStore/decisionCase' + contract: isH5 ? '/h5HomePage/contract-case' : '/homePage/agentStore/contractCase', + decision: isH5 ? '/h5HomePage/decision-case' : '/homePage/agentStore/decisionCase' } }, config) this.injectCSS() @@ -431,7 +432,9 @@ export default { return } if (action === 'goContract') { - vm.$router.push(this._config.pages.contract || '/homePage/agentStore/contractCase').catch(() => {}) + const isH5 = !!(vm.$route && vm.$route.path && vm.$route.path.startsWith('/h5HomePage')) + const path = isH5 ? '/h5HomePage/contract-case' : (this._config.pages.contract || '/homePage/agentStore/contractCase') + vm.$router.push(path).catch(() => {}) this.close() setTimeout(() => { this.addBotMsg(vm.$t('yunbao.openedContract'), this.getProductTags(), 'tags') @@ -446,7 +449,9 @@ export default { return } if (action === 'goInvest') { - vm.$router.push(this._config.pages.decision || '/homePage/agentStore/decisionCase').catch(() => {}) + const isH5 = !!(vm.$route && vm.$route.path && vm.$route.path.startsWith('/h5HomePage')) + const path = isH5 ? '/h5HomePage/decision-case' : (this._config.pages.decision || '/homePage/agentStore/decisionCase') + vm.$router.push(path).catch(() => {}) this.close() setTimeout(() => { this.addBotMsg(vm.$t('yunbao.openedDecision'), this.getProductTags(), 'tags') diff --git a/f/web-kboss/src/views/H5/contractCase/index.vue b/f/web-kboss/src/views/H5/contractCase/index.vue index dfea752..ef1ae61 100644 --- a/f/web-kboss/src/views/H5/contractCase/index.vue +++ b/f/web-kboss/src/views/H5/contractCase/index.vue @@ -122,11 +122,9 @@ export default { }, methods: { goBack() { - if (window.history.length > 1) { - this.$router.back() - return - } - this.$router.push('/h5HomePage/index') + this.$router.push('/h5HomePage/index').catch((error) => { + if (!error || error.name !== 'NavigationDuplicated') throw error + }) }, scrollTo(id) { this.activeTab = id diff --git a/f/web-kboss/src/views/H5/decisionCase/index.vue b/f/web-kboss/src/views/H5/decisionCase/index.vue index 1cc558d..768a84c 100644 --- a/f/web-kboss/src/views/H5/decisionCase/index.vue +++ b/f/web-kboss/src/views/H5/decisionCase/index.vue @@ -95,11 +95,9 @@ export default { }, methods: { goBack() { - if (window.history.length > 1) { - this.$router.back() - return - } - this.$router.push('/h5HomePage/index') + this.$router.push('/h5HomePage/index').catch((error) => { + if (!error || error.name !== 'NavigationDuplicated') throw error + }) }, scrollTo(id) { this.activeTab = id