...
|
...
|
@@ -3,7 +3,7 @@ |
|
|
<cheader title="新品抢先看">
|
|
|
<i class="icon icon-filter" slot="right" @click="openFilter"></i>
|
|
|
</cheader>
|
|
|
<order :config="orderConfig" :val="order" v-if="!empty"></order>
|
|
|
<order :config="orderConfig" :val="order" v-if="enableOrder"></order>
|
|
|
<List :data="productList" :empty="empty"></List>
|
|
|
<Filter :config="filterConfig" action="/product/list.json" v-ref:filter></Filter>
|
|
|
</div>
|
...
|
...
|
@@ -46,7 +46,8 @@ |
|
|
productList: [],
|
|
|
|
|
|
// state
|
|
|
inSearching: false // 请求中
|
|
|
inSearching: false, // 请求中
|
|
|
enableOrder: false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
...
|
...
|
@@ -76,27 +77,27 @@ |
|
|
}
|
|
|
|
|
|
this.inSearching = true;
|
|
|
$.get(this.url, Object.assign({
|
|
|
return $.get(this.url, Object.assign({
|
|
|
order: this.order,
|
|
|
page: nextPage
|
|
|
}, this.filter, locationQuery))
|
|
|
.done(res => {
|
|
|
if (res.code === 200) {
|
|
|
self.page = res.data.page;
|
|
|
self.totalPage = res.data.pageTotal;
|
|
|
self.$set('productList', self.productList.concat(res.data.productList));
|
|
|
|
|
|
if (!self.filterConfig) {
|
|
|
self.$set('filterConfig', res.data.filter);
|
|
|
.done(res => {
|
|
|
if (res.code === 200) {
|
|
|
self.page = res.data.page;
|
|
|
self.totalPage = res.data.pageTotal;
|
|
|
self.$set('productList', self.productList.concat(res.data.productList));
|
|
|
|
|
|
if (!self.filterConfig) {
|
|
|
self.$set('filterConfig', res.data.filter);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
.fail(error => {
|
|
|
tip('网络出错~');
|
|
|
})
|
|
|
.always(() => {
|
|
|
self.inSearching = false;
|
|
|
});
|
|
|
})
|
|
|
.fail(error => {
|
|
|
tip('网络出错~');
|
|
|
})
|
|
|
.always(() => {
|
|
|
self.inSearching = false;
|
|
|
});
|
|
|
},
|
|
|
|
|
|
openFilter() {
|
...
|
...
|
@@ -157,7 +158,12 @@ |
|
|
self.$refs.filter.isVisible = false;
|
|
|
});
|
|
|
|
|
|
this.search();
|
|
|
this.search()
|
|
|
.then(()=>{
|
|
|
if (self.productList.length) {
|
|
|
self.enableOrder = true;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
|