diff --git a/common/api/shop.js b/common/api/shop.js index 3e49ee4..683b544 100644 --- a/common/api/shop.js +++ b/common/api/shop.js @@ -276,8 +276,8 @@ export default { }); }, // 获取直播列表 - tabLiveList(){ - return vm.$u.post('Specialci/tabLiveList') + tabLiveList({page}){ + return vm.$u.post('Specialci/tabLiveList',{page}) }, // 商城-活动广告 getStoreActivity() { diff --git a/pages/index/index.vue b/pages/index/index.vue index c9ec856..1f7e47e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -41,7 +41,7 @@ - + + @@ -302,9 +303,26 @@ }, // 直播列表 tabLiveList() { - this.$u.api.tabLiveList().then((res) => { - console.log(res) - this.tabLiveLists = res.data; + this.$u.api.tabLiveList({page:this.page}).then((res) => { + // uni.stopPullDownRefresh(); + this.status = "loading"; + if (res.errCode == 0) { + uni.hideLoading(); + if (this.page == 1) { + this.tabLiveLists = res.data.data; + this.status = "loadmore"; + } else if (res.data.length == 0 && this.page > 1) { + this.status = "nomore"; + } else { + this.tabLiveLists = this.tabLiveLists.push(...res.data.data); + } + if (res.data.length == 0 && this.page > 1) { + } else { + this.page++; + } + } else { + this.status = "nomore" + } }) }, // 轮播图 @@ -352,6 +370,7 @@ this.getArticlelist(); this.getSwiper(); } else if (this.num == 1) { + this.page = 1; this.getZhiBoSwiper(); // 直播轮播 this.tabLiveList(); } else if (this.num == 2) { @@ -402,7 +421,12 @@ }, // 发现下拉加载 swiperBottom(e) { - this.getArticlelist(); + if(this.num == 0 ){ + this.getArticlelist(); + + }else if(this.num == 1){ + this.tabLiveList() + } // console.log(e); }, swiperTop() {