Browse Source

直播列表tab页切换bug

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

Loading…
Cancel
Save