优化message
This commit is contained in:
parent
10294c3939
commit
7a8e0455ba
|
@ -39,6 +39,7 @@ export default {
|
|||
return {
|
||||
utils: this.$utils,
|
||||
bodyPt: 0,
|
||||
loaded: false,
|
||||
timer: null,
|
||||
tabIndex: 0,
|
||||
tabHeight: 0,
|
||||
|
@ -53,12 +54,13 @@ export default {
|
|||
messageTabIndex: (state) => state.system.messageTabIndex,
|
||||
}),
|
||||
},
|
||||
onLoad() {},
|
||||
async onShow() {
|
||||
if (this.messageTabIndex != this.tabIndex || (this.messageTabIndex == 0 && this.tabIndex == 0)) {
|
||||
this.tabList = [];
|
||||
async onLoad() {
|
||||
await this.loadCate();
|
||||
this.switchTab(this.messageTabIndex);
|
||||
this.switchTab(this.tabIndex);
|
||||
},
|
||||
onShow() {
|
||||
if (this.messageTabIndex != this.tabIndex) {
|
||||
this.tabIndex = this.messageTabIndex;
|
||||
}
|
||||
this.$store.commit("system/refreshOrder", true);
|
||||
},
|
||||
|
@ -80,10 +82,11 @@ export default {
|
|||
currentTab.page = 1;
|
||||
currentTab.list = [];
|
||||
currentTab.more = true;
|
||||
clearTimeout(this.timer);
|
||||
this.timer = setTimeout(() => {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 0,
|
||||
});
|
||||
this.loadList(index);
|
||||
}, 100);
|
||||
},
|
||||
setTabHeight() {
|
||||
let query = uni.createSelectorQuery().in(this);
|
||||
|
@ -98,6 +101,7 @@ export default {
|
|||
* 加载分类
|
||||
*/
|
||||
async loadCate() {
|
||||
if (this.loaded) return;
|
||||
await this.$models.system.notifyCate().then((cate) => {
|
||||
cate.forEach((item) => {
|
||||
this.tabList.push({
|
||||
|
@ -108,6 +112,7 @@ export default {
|
|||
list: [],
|
||||
});
|
||||
});
|
||||
this.loaded = true;
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue