From 68680e38b1caec664403145cd8234b0441ef1db8 Mon Sep 17 00:00:00 2001 From: xuwenbo <717567226@qq.com> Date: Mon, 14 Sep 2020 07:58:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E5=88=97=E8=A1=A8tab?= =?UTF-8?q?=E9=A1=B5=E5=88=87=E6=8D=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/shop/Live/LiveList/index.vue | 32 ++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/pages/shop/Live/LiveList/index.vue b/pages/shop/Live/LiveList/index.vue index bcc8936..a55d47d 100644 --- a/pages/shop/Live/LiveList/index.vue +++ b/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'; - // } }); } },