Commit 23d445c22785c4ad24a31b1b60e7911ff6c0ed07

Authored by zhiyangdu
1 parent 53365a19

分页加载商品

src/components/tabBox/tabBox.vue
@@ -57,10 +57,6 @@ @@ -57,10 +57,6 @@
57 list: [] 57 list: []
58 }, 58 },
59 paging: { // 分页 59 paging: { // 分页
60 - boutique: {  
61 - loading: true,  
62 - page: 1  
63 - },  
64 commodity: { 60 commodity: {
65 loading: true, 61 loading: true,
66 page: 1 62 page: 1
@@ -173,6 +169,12 @@ @@ -173,6 +169,12 @@
173 169
174 // 设置还有需要加载的内容 170 // 设置还有需要加载的内容
175 this.$set(this.paging.commodity, "loading", false); 171 this.$set(this.paging.commodity, "loading", false);
  172 + // 页脚加成2
  173 + if(this.paging.commodity.page === 1){
  174 + this.$nextTick(() => {
  175 + this.paging.commodity.page = 2
  176 + });
  177 + }
176 } else { 178 } else {
177 179
178 // 没有需要加载的内容,停止上拉加载 180 // 没有需要加载的内容,停止上拉加载
@@ -198,12 +200,13 @@ @@ -198,12 +200,13 @@
198 loadCommodity() { 200 loadCommodity() {
199 // 判断是“精品推荐”页才加载 201 // 判断是“精品推荐”页才加载
200 if (this.tabbaromponents.title === '全部商品' && this.tabbaromponents.shop_id) { 202 if (this.tabbaromponents.title === '全部商品' && this.tabbaromponents.shop_id) {
  203 + if(this.paging.commodity.page!=1){
  204 + // 设置“精品推荐”页码
  205 + this.$set(this.paging.commodity, "page", ++this.paging.commodity.page);
201 206
202 - // 设置“精品推荐”页码  
203 - this.$set(this.paging.commodity, "page", ++this.paging.commodity.page);  
204 -  
205 - // 调用接口  
206 - this.shopRecommendGoods(this.paging.commodity.page); 207 + // 调用接口
  208 + this.shopRecommendGoods(this.paging.commodity.page);
  209 + }
207 } 210 }
208 }, 211 },
209 212