H5首页更新

This commit is contained in:
hrx 2026-08-14 11:51:40 +08:00
parent f9b67254d9
commit 69c760421c
3 changed files with 15 additions and 14 deletions

View File

@ -295,14 +295,15 @@ export default {
init(config = {}) { init(config = {}) {
if (this._inited) return if (this._inited) return
this._inited = true this._inited = true
const isH5 = !!(vm.$route && vm.$route.path && vm.$route.path.startsWith('/h5HomePage'))
this._config = Object.assign({ this._config = Object.assign({
avatarUrl: '', avatarUrl: '',
name: vm.$t('yunbao.name'), name: vm.$t('yunbao.name'),
submitUrl: '', submitUrl: '',
products: vm.getYunbaoProducts(), products: vm.getYunbaoProducts(),
pages: { pages: {
contract: '/homePage/agentStore/contractCase', contract: isH5 ? '/h5HomePage/contract-case' : '/homePage/agentStore/contractCase',
decision: '/homePage/agentStore/decisionCase' decision: isH5 ? '/h5HomePage/decision-case' : '/homePage/agentStore/decisionCase'
} }
}, config) }, config)
this.injectCSS() this.injectCSS()
@ -431,7 +432,9 @@ export default {
return return
} }
if (action === 'goContract') { 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() this.close()
setTimeout(() => { setTimeout(() => {
this.addBotMsg(vm.$t('yunbao.openedContract'), this.getProductTags(), 'tags') this.addBotMsg(vm.$t('yunbao.openedContract'), this.getProductTags(), 'tags')
@ -446,7 +449,9 @@ export default {
return return
} }
if (action === 'goInvest') { 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() this.close()
setTimeout(() => { setTimeout(() => {
this.addBotMsg(vm.$t('yunbao.openedDecision'), this.getProductTags(), 'tags') this.addBotMsg(vm.$t('yunbao.openedDecision'), this.getProductTags(), 'tags')

View File

@ -122,11 +122,9 @@ export default {
}, },
methods: { methods: {
goBack() { goBack() {
if (window.history.length > 1) { this.$router.push('/h5HomePage/index').catch((error) => {
this.$router.back() if (!error || error.name !== 'NavigationDuplicated') throw error
return })
}
this.$router.push('/h5HomePage/index')
}, },
scrollTo(id) { scrollTo(id) {
this.activeTab = id this.activeTab = id

View File

@ -95,11 +95,9 @@ export default {
}, },
methods: { methods: {
goBack() { goBack() {
if (window.history.length > 1) { this.$router.push('/h5HomePage/index').catch((error) => {
this.$router.back() if (!error || error.name !== 'NavigationDuplicated') throw error
return })
}
this.$router.push('/h5HomePage/index')
}, },
scrollTo(id) { scrollTo(id) {
this.activeTab = id this.activeTab = id