...
|
...
|
@@ -19,12 +19,14 @@ |
|
|
</div>
|
|
|
</div>
|
|
|
<Scroll ref="scroll" class="product-list" v-show="!productList.isEmpty"
|
|
|
:scroll-events="['scroll-end']"
|
|
|
:options="scrollOptions"
|
|
|
:data="productList.list"
|
|
|
@scroll-end="scrollHandler"
|
|
|
@pulling-up="onPullingUp">
|
|
|
<ProductList :list="productList.list"></ProductList>
|
|
|
<ProductList ref="product" :list="productList.list" :param="yasParams"></ProductList>
|
|
|
</Scroll>
|
|
|
<EmptyList class="empty-wrapper product-list" :tip="`暂无数据`" v-show="productList.isEmpty" >
|
|
|
<EmptyList class="empty-wrapper product-list" :tip="`暂无数据`" v-show="productList.isEmpty">
|
|
|
</EmptyList>
|
|
|
</LayoutApp>
|
|
|
<Filtrate ref="filtrate"></Filtrate>
|
...
|
...
|
@@ -48,19 +50,21 @@ export default { |
|
|
Filtrate,
|
|
|
EmptyList
|
|
|
},
|
|
|
data() {
|
|
|
data: function () {
|
|
|
return {
|
|
|
scrollOptions: {
|
|
|
bounce: {
|
|
|
top: false
|
|
|
},
|
|
|
pullUpLoad: true
|
|
|
pullUpLoad: true,
|
|
|
pullDownRefresh: false
|
|
|
},
|
|
|
fixed: false,
|
|
|
selectedType: 2, // tab类型高亮
|
|
|
priceDesc: true,
|
|
|
arrowImage: '',
|
|
|
title: '',
|
|
|
yasParams: {P_NAME: 'XY_UFOSearchList', TYPE_ID: 1},
|
|
|
productList: {
|
|
|
showErrorPage: false,
|
|
|
isFetching: false,
|
...
|
...
|
@@ -98,6 +102,7 @@ export default { |
|
|
this.changeArrow();
|
|
|
let params = {...this.$route.query};
|
|
|
|
|
|
this.setYasParam({param: params, tab: {index: 1, name: '人气'}});
|
|
|
if (params.title) {
|
|
|
this.title = params.title;
|
|
|
delete params.title;
|
...
|
...
|
@@ -120,6 +125,12 @@ export default { |
|
|
await this.fetchList();
|
|
|
},
|
|
|
|
|
|
scrollHandler({y}) {
|
|
|
let height = -y;
|
|
|
|
|
|
this.$refs.product.yasShowEvent(height);
|
|
|
},
|
|
|
|
|
|
// 查询商品列表
|
|
|
fetchList: async function(params) {
|
|
|
let searchParams = this.searchParams;
|
...
|
...
|
@@ -190,18 +201,21 @@ export default { |
|
|
|
|
|
this.selectedType = flag;
|
|
|
if (flag === 1) {
|
|
|
this.setYasParam({tab: {index: 2, name: '价格'}});
|
|
|
this.priceDesc = !this.priceDesc;
|
|
|
params.order = this.priceDesc ? 'p_desc' : 'p_asc';
|
|
|
params.order = this.priceDesc ? 'availableNowPrice:asc' : 'availableNowPrice:desc';
|
|
|
} else if (flag === 2) {
|
|
|
this.setYasParam({tab: {index: 1, name: '人气'}});
|
|
|
this.priceDesc = true;
|
|
|
params.order = 'sale_desc';
|
|
|
} else if (flag === 3) {
|
|
|
this.setYasParam({tab: {index: 3, name: '新品'}});
|
|
|
this.priceDesc = true;
|
|
|
params.order = 'st_desc';
|
|
|
}
|
|
|
params.isReset = true;
|
|
|
this.fetchList(params);
|
|
|
this.$refs.scroll.scrollTo(0, 0, 300)
|
|
|
this.$refs.scroll.scrollTo(0, 0, 300);
|
|
|
this.changeArrow();
|
|
|
},
|
|
|
goSearch() {
|
...
|
...
|
@@ -215,7 +229,43 @@ export default { |
|
|
},
|
|
|
goFilter() {
|
|
|
this.$refs.filtrate.show();
|
|
|
}
|
|
|
},
|
|
|
setYasParam: function({param, tab}) {
|
|
|
if (param && typeof param === 'object' && Object.keys(param).length) {
|
|
|
let P_NAME = 'XY_UFOSearchList', TYPE_ID = 1;
|
|
|
|
|
|
for (let key in param) {
|
|
|
if (key === 'brand' && param[key] && param.type !== 6) {
|
|
|
P_NAME = 'XY_UFOBrandList';
|
|
|
TYPE_ID = 3;
|
|
|
}
|
|
|
if (key === 'series' && param[key] && param.type !== 6) {
|
|
|
P_NAME = 'XY_UFOSeriesList';
|
|
|
TYPE_ID = 2;
|
|
|
}
|
|
|
if (key === 'productPool' && param[key] && param.type !== 6) {
|
|
|
P_NAME = 'XY_UFOProductPoolList';
|
|
|
TYPE_ID = 4;
|
|
|
}
|
|
|
if (!param[key]) {
|
|
|
delete param[key];
|
|
|
}
|
|
|
}
|
|
|
Object.assign(this.yasParams, {
|
|
|
P_NAME,
|
|
|
P_PARAM: JSON.stringify(param),
|
|
|
TYPE_ID,
|
|
|
TAB_ID: this.tabIndex || '',
|
|
|
TAB_NAME: this.tabName || ''
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if(tab && typeof tab === 'object' && Object.keys(tab).length) {
|
|
|
this.yasParams.TAB_ID = tab.index;
|
|
|
this.yasParams.TAB_NAME = tab.name;
|
|
|
}
|
|
|
},
|
|
|
|
|
|
}
|
|
|
};
|
|
|
</script>
|
...
|
...
|
|