...
|
...
|
@@ -3,6 +3,7 @@ |
|
|
<cheader title="新品抢先看"></cheader>
|
|
|
<list-filter :val="order" :filter="filterConfig" v-if="enableOrder"></list-filter>
|
|
|
<List :data="productList" :state="listState" class="list-items"></List>
|
|
|
<shopping-bag :cart-count="cartCount" v-if="isApp"></shopping-bag>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
...
|
...
|
@@ -16,6 +17,7 @@ |
|
|
const tip = require('common/tip');
|
|
|
const cheader = require('component/header.vue');
|
|
|
const list = require('component/product/list.vue');
|
|
|
const shoppingBag = require('component/product/shopping-bag.vue');
|
|
|
const listFilter = require('component/product/filter/index.vue');
|
|
|
|
|
|
let locationQuery = qs(decodeURIComponent(location.search.replace(/^\?/, '')));
|
...
|
...
|
@@ -29,6 +31,7 @@ |
|
|
el: '#product-new',
|
|
|
data: function() {
|
|
|
return {
|
|
|
isApp: yoho.isApp,
|
|
|
isiOS: yoho.isiOS,
|
|
|
sortName: locationQuery.sort_name,
|
|
|
filterConfig: null,
|
...
|
...
|
@@ -45,7 +48,8 @@ |
|
|
// state
|
|
|
inSearching: false, // 请求中
|
|
|
enableOrder: false,
|
|
|
order: ''
|
|
|
order: '',
|
|
|
cartCount: 0
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
...
|
...
|
@@ -70,7 +74,8 @@ |
|
|
components: {
|
|
|
cheader,
|
|
|
list,
|
|
|
listFilter
|
|
|
listFilter,
|
|
|
shoppingBag
|
|
|
},
|
|
|
methods: {
|
|
|
search: function() {
|
...
|
...
|
@@ -124,6 +129,14 @@ |
|
|
this.page = 0;
|
|
|
this.$set('productList', []);
|
|
|
this.search();
|
|
|
},
|
|
|
|
|
|
refreshCart: function() {
|
|
|
$.get('/product/cart-count.json').then(result=> {
|
|
|
if (result.code === 200) {
|
|
|
this.cartCount = result.data.cart_goods_count;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
...
|
...
|
@@ -150,6 +163,11 @@ |
|
|
self.$set('filter', val);
|
|
|
});
|
|
|
|
|
|
// 读取购物车数量
|
|
|
if (this.isApp) {
|
|
|
this.refreshCart();
|
|
|
}
|
|
|
|
|
|
this.search();
|
|
|
}
|
|
|
};
|
...
|
...
|
|