Authored by 陈轩

list 抖动

... ... @@ -3,7 +3,7 @@
<cheader :title="sortName" class="list-header">
<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" v-ref:filter></Filter>
</div>
... ... @@ -46,7 +46,8 @@
productList: [],
// state
inSearching: false // 请求中
inSearching: false, // 请求中
enableOrder: false
};
},
computed: {
... ... @@ -75,7 +76,7 @@
}
this.inSearching = true;
$.get(this.url, Object.assign({
return $.get(this.url, Object.assign({
order: this.order,
page: nextPage
}, this.filter, locationQuery))
... ... @@ -152,7 +153,12 @@
self.$refs.filter.isVisible = false;
});
this.search();
this.search()
.then(()=>{
if (self.productList.length) {
self.enableOrder = true;
}
});
}
};
... ...
... ... @@ -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,7 +77,7 @@
}
this.inSearching = true;
$.get(this.url, Object.assign({
return $.get(this.url, Object.assign({
order: this.order,
page: nextPage
}, this.filter, locationQuery))
... ... @@ -157,7 +158,12 @@
self.$refs.filter.isVisible = false;
});
this.search();
this.search()
.then(()=>{
if (self.productList.length) {
self.enableOrder = true;
}
});
}
};
... ...
<template>
<div>
<Order :config="orderConfig" :val="order" v-if="!empty">
<Order :config="orderConfig" :val="order" v-if="enableOrder">
</Order>
<List :data="productList" :empty="empty"></List>
</div>
... ... @@ -40,7 +40,8 @@
productList: [],
// state
inSearching: false // 请求中
inSearching: false, // 请求中
enableOrder: false
};
},
computed: {
... ... @@ -69,7 +70,7 @@
this.inSearching = true;
console.log(nextPage);
$.get(this.url, {
return $.get(this.url, {
order: this.order, // 排序 信息
query: this.query,
page: nextPage
... ... @@ -119,7 +120,12 @@
self.order = val;
});
this.search();
this.search()
.then(()=>{
if (self.productList.length) {
self.enableOrder = true;
}
});
}
};
... ...