参数存本地

This commit is contained in:
shijingjing
2023-03-15 16:51:26 +08:00
parent 17543b1fca
commit 43b7aa757b
2 changed files with 10 additions and 7 deletions

View File

@@ -167,8 +167,11 @@ export default {
} }
}, },
clickLaw(index) { clickLaw(index) {
uni.relaunch({ uni.switchTab({
url: '/pages/AppLegalLearning/AppLegalLearning?inx=' + index url: '/pages/AppLegalLearning/AppLegalLearning',
success: ()=> {
uni.setStorageSync('inx', index)
}
}) })
}, },
handleActive({type, appId, url}) { handleActive({type, appId, url}) {

View File

@@ -35,6 +35,9 @@ export default {
} }
}, },
onShow() { onShow() {
if(uni.getStorageSync('inx')) {
this.currIndex = uni.getStorageSync('inx')
}
if(this.currIndex == 0) { if(this.currIndex == 0) {
this.$refs.OnlineClass.getList(); this.$refs.OnlineClass.getList();
} else { } else {
@@ -47,11 +50,8 @@ export default {
} }
}); });
}, },
onLoad(o) { onUnload() {
if(o) { uni.removeStorageSync('inx')
console.log(o);
this.currIndex = o.inx
}
}, },
components: { components: {
OnlineClass, OnlineClass,