Showing
1 changed file
with
17 additions
and
2 deletions
@@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
30 | </div> | 30 | </div> |
31 | <div class="list-wrap" :style="{minHeight: total + 'px'}"> | 31 | <div class="list-wrap" :style="{minHeight: total + 'px'}"> |
32 | <ProductList ref="product" :list="productList.list" :yasParams="listYasParams" v-if="productList.list.length > 0"></ProductList> | 32 | <ProductList ref="product" :list="productList.list" :yasParams="listYasParams" v-if="productList.list.length > 0"></ProductList> |
33 | - <UfoNoItem :tip="`暂无数据`" v-else></UfoNoItem> | 33 | + <UfoNoItem class="channel-no-item" :tip="`暂无数据`" v-else></UfoNoItem> |
34 | </div> | 34 | </div> |
35 | </div> | 35 | </div> |
36 | </Scroll> | 36 | </Scroll> |
@@ -106,6 +106,11 @@ export default { | @@ -106,6 +106,11 @@ export default { | ||
106 | page: null, // 当前页号 | 106 | page: null, // 当前页号 |
107 | coupon_token: null, // 优惠券token | 107 | coupon_token: null, // 优惠券token |
108 | }, | 108 | }, |
109 | + selectedCategory: { | ||
110 | + pagename: "productList", | ||
111 | + productPool: "66", | ||
112 | + title: "热门" | ||
113 | + } | ||
109 | }; | 114 | }; |
110 | }, | 115 | }, |
111 | computed: { | 116 | computed: { |
@@ -121,6 +126,7 @@ export default { | @@ -121,6 +126,7 @@ export default { | ||
121 | }, | 126 | }, |
122 | activated() { | 127 | activated() { |
123 | this.PAGE_URL = window.location.href; | 128 | this.PAGE_URL = window.location.href; |
129 | + this.fetchList(this.selectedCategory); | ||
124 | // 首页进入上报 | 130 | // 首页进入上报 |
125 | this.$store.dispatch('reportYas', { | 131 | this.$store.dispatch('reportYas', { |
126 | params: { | 132 | params: { |
@@ -237,6 +243,7 @@ export default { | @@ -237,6 +243,7 @@ export default { | ||
237 | } | 243 | } |
238 | }, | 244 | }, |
239 | getIndex({index,params}) { | 245 | getIndex({index,params}) { |
246 | + this.selectedCategory = params; | ||
240 | this.setYasParam({index,...params}); | 247 | this.setYasParam({index,...params}); |
241 | this.active = Number(index); | 248 | this.active = Number(index); |
242 | this.$refs.scroll.scrollTo(0, -this.navTop, 300); | 249 | this.$refs.scroll.scrollTo(0, -this.navTop, 300); |
@@ -271,7 +278,8 @@ export default { | @@ -271,7 +278,8 @@ export default { | ||
271 | // this.$refs.scroll.forceUpdate(); | 278 | // this.$refs.scroll.forceUpdate(); |
272 | // return; | 279 | // return; |
273 | // } | 280 | // } |
274 | - await this.fetchList(); | 281 | + |
282 | + await this.fetchList(this.selectedCategory); | ||
275 | this.$refs.scroll.forceUpdate(); | 283 | this.$refs.scroll.forceUpdate(); |
276 | }, | 284 | }, |
277 | 285 | ||
@@ -325,6 +333,9 @@ export default { | @@ -325,6 +333,9 @@ export default { | ||
325 | list[key] = data[key]; | 333 | list[key] = data[key]; |
326 | } | 334 | } |
327 | } | 335 | } |
336 | + if(!Object.keys(data).includes('product_list')) { | ||
337 | + list.list = [] | ||
338 | + } | ||
328 | this.productList = list; | 339 | this.productList = list; |
329 | } | 340 | } |
330 | }catch(e) { | 341 | }catch(e) { |
@@ -446,6 +457,10 @@ export default { | @@ -446,6 +457,10 @@ export default { | ||
446 | position: relative; | 457 | position: relative; |
447 | z-index: 1; | 458 | z-index: 1; |
448 | } | 459 | } |
460 | + | ||
461 | + .channel-no-item { | ||
462 | + padding-top: 200px; | ||
463 | + } | ||
449 | } | 464 | } |
450 | .yohoufo-channel-page { | 465 | .yohoufo-channel-page { |
451 | /deep/ .cube-pullup-wrapper { | 466 | /deep/ .cube-pullup-wrapper { |
-
Please register or login to post a comment