...
|
...
|
@@ -3,7 +3,6 @@ |
|
|
<cheader title="新品抢先看">
|
|
|
<i class="icon icon-filter" slot="right" @click="openFilter"></i>
|
|
|
</cheader>
|
|
|
<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>
|
...
|
...
|
@@ -17,7 +16,6 @@ |
|
|
const bus = require('common/vue-bus');
|
|
|
const tip = require('common/tip');
|
|
|
const cheader = require('component/header.vue');
|
|
|
const order = require('component/product/order.vue');
|
|
|
const list = require('component/product/list.vue');
|
|
|
const filter = require('component/product/filter.vue');
|
|
|
|
...
|
...
|
@@ -32,12 +30,10 @@ |
|
|
data: function() {
|
|
|
return {
|
|
|
sortName: locationQuery.sort_name,
|
|
|
orderConfig: [],
|
|
|
filterConfig: null,
|
|
|
|
|
|
// query
|
|
|
url: '/product/new.json',
|
|
|
order: '',
|
|
|
filter: {},
|
|
|
page: 0, // 未搜索 page=0; 全部加载完 page = totalPage; 无数据: page !=0 && productList.length=0
|
|
|
totalPage: null,
|
...
|
...
|
@@ -46,8 +42,7 @@ |
|
|
productList: [],
|
|
|
|
|
|
// state
|
|
|
inSearching: false, // 请求中
|
|
|
enableOrder: false
|
|
|
inSearching: false // 请求中
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
...
|
...
|
@@ -58,7 +53,6 @@ |
|
|
components: {
|
|
|
cheader,
|
|
|
list,
|
|
|
order,
|
|
|
filter
|
|
|
},
|
|
|
methods: {
|
...
|
...
|
@@ -78,7 +72,6 @@ |
|
|
|
|
|
this.inSearching = true;
|
|
|
return $.get(this.url, Object.assign({
|
|
|
order: this.order,
|
|
|
page: nextPage
|
|
|
}, this.filter, locationQuery))
|
|
|
.done(res => {
|
...
|
...
|
@@ -118,10 +111,6 @@ |
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
/* order 和 filter 改变 都会触发 重新搜索 */
|
|
|
order: function() {
|
|
|
this.research();
|
|
|
},
|
|
|
filter: function() {
|
|
|
this.research();
|
|
|
}
|
...
|
...
|
@@ -135,11 +124,6 @@ |
|
|
self.search();
|
|
|
});
|
|
|
|
|
|
bus.$on('order.change', function({val}) {
|
|
|
console.log(val);
|
|
|
self.order = val;
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 筛选组件 筛选值变更,触发 filter.change事件
|
|
|
* 1. 重新搜索
|
...
|
...
|
@@ -158,12 +142,7 @@ |
|
|
self.$refs.filter.isVisible = false;
|
|
|
});
|
|
|
|
|
|
this.search()
|
|
|
.then(()=>{
|
|
|
if (self.productList.length) {
|
|
|
self.enableOrder = true;
|
|
|
}
|
|
|
});
|
|
|
this.search();
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
|