Commit f2b83d8e authored by mengcuiguang's avatar mengcuiguang

代码优化

parent fd7181ce
......@@ -83,23 +83,23 @@
}
},
onShow() {
if (app.globalData.resetLogin && !this.isFirstLoad) {
// this.wxLogin()
}
this.isFirstLoad = false
// if (app.globalData.resetLogin && !this.isFirstLoad) {
// // this.wxLogin()
// }
// this.isFirstLoad = false
try {
// 在子组件重写show()代替onShow()
if (this.currentPage == 0) {
this.$refs.index.show();
} else if (this.currentPage == 1) {
this.$refs.recommend.show();
} else if (this.currentPage == 2) {
this.$refs.user.show();
}
} catch (e) {
// try {
// // 在子组件重写show()代替onShow()
// if (this.currentPage == 0) {
// this.$refs.index.show();
// } else if (this.currentPage == 1) {
// this.$refs.recommend.show();
// } else if (this.currentPage == 2) {
// this.$refs.user.show();
// }
// } catch (e) {
}
// }
},
mounted() {
// 渲染完成 初始化首页数据
......@@ -119,10 +119,14 @@
if (this.currentPage == 0) {
this.$refs.index.show();
this.$refs.recommend.hide();
this.$refs.user.hide();
} else if (this.currentPage == 1) {
this.$refs.recommend.show();
this.$refs.index.hide();
this.$refs.user.hide();
} else if (this.currentPage == 2) {
this.$refs.user.show();
this.$refs.index.hide();
this.$refs.recommend.hide();
}
},
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment