mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-16 23:45:53 +08:00
refactor: 🎨 优化我的收藏和足迹代码
This commit is contained in:
@@ -107,20 +107,33 @@
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.getGoodList();
|
||||
this.getStoreList();
|
||||
this.fetchReloadOrNextPage('reload')
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.tabCurrentIndex == 0) {
|
||||
this.navList[0].params.pageNumber++;
|
||||
this.getGoodList();
|
||||
} else {
|
||||
this.navList[1].params.pageNumber++;
|
||||
this.getStoreList();
|
||||
}
|
||||
this.fetchReloadOrNextPage('next')
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 刷新或者下一页
|
||||
fetchReloadOrNextPage(type) {
|
||||
if(type == 'next'){
|
||||
this.navList[this.tabCurrentIndex].params.pageNumber ++;
|
||||
if (this.tabCurrentIndex == 0) {
|
||||
this.getGoodList();
|
||||
} else {
|
||||
this.getStoreList();
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.navList[0].params.pageNumber = 1;
|
||||
this.navList[1].params.pageNumber = 1;
|
||||
this.goodList = [];
|
||||
this.storeList = [];
|
||||
this.getGoodList();
|
||||
this.getStoreList();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 打开商品左侧取消收藏
|
||||
*/
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
this.getList();
|
||||
},
|
||||
onShow() {
|
||||
this.params.pageNumber = 1
|
||||
this.trackList = [];
|
||||
this.getList();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user