...
|
...
|
@@ -79,13 +79,7 @@ export default { |
|
|
isFetch: true,
|
|
|
scrollY: 0,
|
|
|
isShowEmpty: false,
|
|
|
yasParams: {
|
|
|
P_NAME: 'XY_UFOSecondList',
|
|
|
TYPE_ID: 5,
|
|
|
TAB_ID: '',
|
|
|
TAB_NAME: '',
|
|
|
P_PARAM: [].toString()
|
|
|
},
|
|
|
yasParams: { P_NAME: 'XY_UFOSecondList', TYPE_ID: 5, P_PARAM: [].toString() },
|
|
|
selectedType: 2, // tab类型高亮,1价格,2推荐
|
|
|
priceDesc: true,
|
|
|
|
...
|
...
|
@@ -248,7 +242,7 @@ export default { |
|
|
this.$refs.scroll.scrollTo(0, 0, 300);
|
|
|
},
|
|
|
|
|
|
// 点击Tab, 1:价格,2:默认
|
|
|
// 点击Tab, 1:价格,2:推荐
|
|
|
async pressType(flag) {
|
|
|
if (flag === this.selectedType && flag !== 1) {
|
|
|
return;
|
...
|
...
|
@@ -270,9 +264,11 @@ export default { |
|
|
}
|
|
|
|
|
|
if (flag === 1) {
|
|
|
this.setYasParam({tab: {index: 2, name: '价格'}});
|
|
|
this.priceDesc = !this.priceDesc;
|
|
|
params.order = this.priceDesc ? 'price:asc' : 'price:desc';
|
|
|
} else if (flag === 2) {
|
|
|
this.setYasParam({tab: {index: 5, name: '推荐'}});
|
|
|
this.priceDesc = true;
|
|
|
params.order = 'id:desc';
|
|
|
}
|
...
|
...
|
@@ -282,6 +278,8 @@ export default { |
|
|
params.isReset = true;
|
|
|
await this.fetchList(params);
|
|
|
|
|
|
this.yasTab();
|
|
|
|
|
|
this.$refs.scroll.scrollTo(0, 0, 300);
|
|
|
this.yasShowPage();
|
|
|
},
|
...
|
...
|
@@ -426,6 +424,7 @@ export default { |
|
|
},
|
|
|
|
|
|
goFilter() {
|
|
|
this.yasTab(true);
|
|
|
this.$refs.filtrate.show();
|
|
|
this.$refs.filtrate.setFilterParam(this.seletedFilterParams);
|
|
|
this.$refs.filtrate.setTempParam(this.selectedFilterNameParams);
|
...
|
...
|
@@ -449,6 +448,27 @@ export default { |
|
|
}
|
|
|
});
|
|
|
},
|
|
|
setYasParam: function({tab}) {
|
|
|
if (tab && typeof tab === 'object' && Object.keys(tab).length) {
|
|
|
this.yasParams.TAB_ID = tab.index;
|
|
|
this.yasParams.TAB_NAME = tab.name;
|
|
|
}
|
|
|
},
|
|
|
yasTab(isFilter = false) {
|
|
|
let param = {...this.yasParams};
|
|
|
|
|
|
if (isFilter) {
|
|
|
param.TAB_ID = 4;
|
|
|
param.TAB_NAME = '筛选';
|
|
|
}
|
|
|
|
|
|
this.$store.dispatch('reportYas', {
|
|
|
params: {
|
|
|
param,
|
|
|
appop: 'XY_UFO_PRD_LIST_TAB_C'
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
beforeRouteLeave (to, from, next) {
|
|
|
this.isFetch = to.name !== 'SecondProductDetail'
|
...
|
...
|
@@ -476,6 +496,8 @@ export default { |
|
|
}
|
|
|
this.filterParams = filterParams;
|
|
|
|
|
|
this.setYasParam({tab: {index: 5, name: '推荐'}});
|
|
|
|
|
|
} else {
|
|
|
this.scrollY && this.$refs.scroll.scrollTo(this.scrollY);
|
|
|
}
|
...
|
...
|
|