This commit is contained in:
shijingjing
2023-03-15 17:28:36 +08:00
parent 43cee8bd0f
commit c1ca841f28
2 changed files with 4 additions and 9 deletions

View File

@@ -170,7 +170,7 @@ export default {
uni.switchTab({ uni.switchTab({
url: '/pages/AppLegalLearning/AppLegalLearning', url: '/pages/AppLegalLearning/AppLegalLearning',
success: ()=> { success: ()=> {
uni.setStorageSync('inx', index) uni.$emit('update',{inx: index})
} }
}) })
}, },

View File

@@ -35,11 +35,9 @@ export default {
} }
}, },
onShow() { onShow() {
console.log(uni.getStorageSync('inx'),'index'); uni.$once('update',(data)=> {
if(uni.getStorageSync('inx')) { this.currIndex = data.inx
console.log(uni.getStorageSync('inx'), 'inx'); })
this.currIndex = uni.getStorageSync('inx')
}
if(this.currIndex == 0) { if(this.currIndex == 0) {
this.$refs.OnlineClass.getList(); this.$refs.OnlineClass.getList();
} else { } else {
@@ -52,9 +50,6 @@ export default {
} }
}); });
}, },
onHide() {
uni.removeStorageSync('inx')
},
components: { components: {
OnlineClass, OnlineClass,
GeneralLawExam GeneralLawExam