Browse Source

直播列表tab页切换bug

zyh
xuwenbo 4 years ago
parent
commit
68680e38b1
  1. 32
      pages/shop/Live/LiveList/index.vue

32
pages/shop/Live/LiveList/index.vue

@ -79,10 +79,28 @@
methods: {
// tab
selTab(tab) {
console.log(tab)
this.tabCur = tab.title;
this.liveStatus = tab.code;
this.liveList = [];
this.getLiveList();
this.loaded=false;
this.loading=false;
this.getLiveListTab();
},
//
getLiveListTab() {
let that = this;
yxWechatLive({
liveStatus: that.liveStatus,
page: 0,
size: that.size
}).then(res => {
that.liveList = [...that.liveList, ...res.data.content];
that.lastPage = res.data.lastPage;
this.loaded = res.data.content.length < that.size;
this.loading = false;
});
},
//
getLiveList() {
@ -90,20 +108,14 @@
if (this.loading || this.loaded) return;
this.loading = true;
yxWechatLive({
liveStatus: that.liveStatus,
page: that.currentPage,
size: that.size
liveStatus: this.liveStatus,
page: this.currentPage,
size: this.size
}).then(res => {
that.liveList = that.liveList.concat(res.data.content)
this.currentPage++;
this.loaded = res.data.content.length < that.size;
this.loading = false;
// if (that.currentPage < res.data.lastPage) {
// that.loadStatus = '';
// } else {
// that.loadStatus = 'over';
// }
});
}
},

Loading…
Cancel
Save