feat: 手机端国内/海外/企标-页面缓存

This commit is contained in:
zyn
2023-11-27 17:12:58 +08:00
parent 87346b9b6c
commit 6c6814a4b9
4 changed files with 62 additions and 27 deletions
+4 -1
View File
@@ -13,7 +13,10 @@
<customerService v-if="customerServiceShow"></customerService>
<!-- <router-view v-if="!isBoolean"/>-->
<span v-if="this.$route.name === 'Login'|| !isBoolean">
<router-view/>
<keep-alive>
<router-view v-if="$route.meta.keepAlive"/>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"/>
</span>
<span v-else>
<div class="content-box" v-if="isCollapse">
@@ -85,9 +85,7 @@ export default {
this.bs.finishPullUp()
})
this.bs.on('scroll', (x, y ,z) => {
console.log(x,y,z)
})
this.bs.on('scroll', ({x, y}) => { })
} else {
this.bs.refresh()
+53 -22
View File
@@ -127,23 +127,54 @@ export default {
lawsMap:{},
}
},
beforeRouteEnter (to, from, next) {
next(vm => {
// 首页进入 重新加载
if (from.name === 'phoneHome') {
switch (to.query.standType) {
case 'INLAND':
vm.titleName = '国内标准法规库'
break
case 'FOREIGN':
vm.titleName = '海外标准法规库'
break
case 'bussstand':
vm.titleName = '企业标准'
break
case 'POLICY':
vm.titleName = '国内外政策库'
break
}
vm.searchQuery.page = 1
vm.$refs.standardSystemPopupRef.popupShow = true
vm.$refs.scroll.scrollTo(0, 0)
vm.getData()
}
})
},
activated () {
console.log('activated')
},
deactivated () {
console.log('deactivated')
},
created() {
switch (this.$route.query.standType) {
case 'INLAND':
this.titleName = '国内标准法规库'
break
case 'FOREIGN':
this.titleName = '海外标准法规库'
break
case 'bussstand':
this.titleName = '企业标准'
break
case 'POLICY':
this.titleName = '国内外政策库'
break
}
// switch (this.$route.query.standType) {
// case 'INLAND':
// this.titleName = '国内标准法规库'
// break
// case 'FOREIGN':
// this.titleName = '海外标准法规库'
// break
// case 'bussstand':
// this.titleName = '企业标准'
// break
// case 'POLICY':
// this.titleName = '国内外政策库'
// break
// }
this.getDicTypeListCode()
this.getData()
// this.getData()
},
methods: {
pullingUpHandler () {
@@ -269,14 +300,14 @@ export default {
line-height: 40px;
font-size: 18px;
.left-title {
margin-left: 10px;
}
.left-title {
margin-left: 10px;
}
.right-title {
float: right;
margin-right: 34%;
}
.right-title {
float: right;
margin-right: 34%;
}
}
.van-search {
+4 -1
View File
@@ -114,7 +114,10 @@ const routes = [
{
path: '/domesticStand',
name: 'domesticStand',
component: () => import('@/pages/phone/domesticStand/index')
component: () => import('@/pages/phone/domesticStand/index'),
meta: {
keepAlive: true
}
/*
component: () =>
import('@/pages/phone/domesticStand')