Commit 3c59bbbb140a58aa080cf152ca215afa5b099260

Authored by zhiyangdu
1 parent 4b4a5255

全部商品数据绑定

src/components/tabBox/tabBox.vue
@@ -89,7 +89,7 @@ @@ -89,7 +89,7 @@
89 return item.title === title 89 return item.title === title
90 }); 90 });
91 if(title==='全部商品'){ 91 if(title==='全部商品'){
92 - // 店铺商品推荐 92 + // 爱心屋项目全部商品
93 this.shopRecommendGoods(this.paging.commodity.page); 93 this.shopRecommendGoods(this.paging.commodity.page);
94 } 94 }
95 95
@@ -123,13 +123,12 @@ @@ -123,13 +123,12 @@
123 this.toDetail(item); 123 this.toDetail(item);
124 }, 124 },
125 /** 125 /**
126 - * 店铺商品推荐 126 + * 爱心屋项目全部商品
127 * @param {int} page [页码] 127 * @param {int} page [页码]
128 */ 128 */
129 shopRecommendGoods(page) { 129 shopRecommendGoods(page) {
130 - console.log(this.tabbaromponents)  
131 // 判断必要参数 130 // 判断必要参数
132 - if (this.tabbaromponents.ads[0].id) { 131 + if (this.tabbaromponents.shop_id) {
133 132
134 // 加载中 133 // 加载中
135 this.$set(this.paging.commodity, "loading", true); 134 this.$set(this.paging.commodity, "loading", true);
@@ -139,7 +138,7 @@ @@ -139,7 +138,7 @@
139 138
140 // 请求接口 139 // 请求接口
141 this.http("/Api/" + (this.getApiVersion().index) + "/shopGoodsList", { 140 this.http("/Api/" + (this.getApiVersion().index) + "/shopGoodsList", {
142 - shop_id: this.tabbaromponents.ads[0].id, 141 + shop_id: this.tabbaromponents.shop_id,
143 page: page 142 page: page
144 }, this.shopRecommendGoodsCallback, { 143 }, this.shopRecommendGoodsCallback, {
145 method: "POST" 144 method: "POST"
@@ -148,7 +147,7 @@ @@ -148,7 +147,7 @@
148 }, 147 },
149 148
150 /** 149 /**
151 - * 店铺商品推荐回调 150 + * 爱心屋项目全部商品回调
152 * @param {object} res [服务器返回数据] 151 * @param {object} res [服务器返回数据]
153 * @param {object} ext [扩展参数] 152 * @param {object} ext [扩展参数]
154 */ 153 */
@@ -192,12 +191,12 @@ @@ -192,12 +191,12 @@
192 }, 191 },
193 192
194 /** 193 /**
195 - * 上拉加载“商品推荐 194 + * 上拉加载“爱心屋项目全部商品
196 */ 195 */
197 loadCommodity() { 196 loadCommodity() {
198 197
199 // 判断是“精品推荐”页才加载 198 // 判断是“精品推荐”页才加载
200 - if (this.activeTabIndex === 2 && this.shopId) { 199 + if (this.tabbaromponents.title === '全部商品' && this.tabbaromponents.shop_id) {
201 200
202 // 设置“精品推荐”页码 201 // 设置“精品推荐”页码
203 this.$set(this.paging.commodity, "page", ++this.paging.commodity.page); 202 this.$set(this.paging.commodity, "page", ++this.paging.commodity.page);