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