...
|
...
|
@@ -34,9 +34,24 @@ |
|
|
v-for="(item,i) in filter.itemList" @click="select({filterId:filter.filterId, itemId:item.itemId, row, itemName: item.itemName})">
|
|
|
{{item.itemName}}
|
|
|
</div>
|
|
|
<div class="item-text" v-if="filter.filterId === 'sort' || filter.filterId === 'gender'"
|
|
|
<div class="item-text" v-if="filter.filterId === 'maxSort' || filter.filterId === 'gender'"
|
|
|
:style="i===0 && 'margin-left:1rem'"
|
|
|
:class="(filterParams.sort.includes(item.itemId) || filterParams.gender.includes(item.itemId)) && 'item-text-selected'"
|
|
|
:class="(filterParams.maxSort.includes(item.itemId) || filterParams.gender.includes(item.itemId)) && 'item-text-selected'"
|
|
|
v-for="(item,i) in filter.itemList" @click="select({filterId:filter.filterId, itemId:item.itemId, row, itemName: item.itemName})">
|
|
|
{{item.itemName}}
|
|
|
</div>
|
|
|
|
|
|
<div class="item-text price-size"
|
|
|
v-if="filter.filterId === 'price'"
|
|
|
:style="i===0 && 'margin-left:1rem'"
|
|
|
:class="filterParams.price.includes(item.itemId) && 'item-text-selected'"
|
|
|
v-for="(item,i) in filter.itemList" @click="select({filterId:filter.filterId, itemId:item.itemId, row, itemName: item.itemName})">
|
|
|
{{item.itemName}}
|
|
|
</div>
|
|
|
<div class="item-text flag-size"
|
|
|
v-if="filter.filterId === 'preSaleFlag'"
|
|
|
:style="i===0 && 'margin-left:1rem'"
|
|
|
:class="filterParams.preSaleFlag.includes(item.itemId) && 'item-text-selected'"
|
|
|
v-for="(item,i) in filter.itemList" @click="select({filterId:filter.filterId, itemId:item.itemId, row, itemName: item.itemName})">
|
|
|
{{item.itemName}}
|
|
|
</div>
|
...
|
...
|
@@ -74,25 +89,26 @@ export default { |
|
|
filterData: [],
|
|
|
|
|
|
filterParams: {
|
|
|
sort: [], // 品类id
|
|
|
maxSort: [], // 品类id
|
|
|
preSaleFlag: [], //新旧程度
|
|
|
brand: [], // 品牌
|
|
|
gender: [], // 性别
|
|
|
size: [], // 尺码
|
|
|
price: [], // 价格
|
|
|
},
|
|
|
tempParams: {
|
|
|
sort: [], // 品类名称
|
|
|
maxSort: [], // 品类名称
|
|
|
preSaleFlag: [], //新旧程度
|
|
|
brand: [], // 品牌
|
|
|
gender: [], // 性别
|
|
|
size: [], // 尺码
|
|
|
price: [], // 价格
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
activated() {
|
|
|
let params = {...this.$route.query};
|
|
|
|
|
|
Object.assign(this.$data, this.$options.data());
|
|
|
!params.order && (params.order = 'sale_desc');
|
|
|
this.fetchData(params);
|
|
|
this.fetchData();
|
|
|
},
|
|
|
|
|
|
computed: {
|
...
|
...
|
@@ -103,40 +119,30 @@ export default { |
|
|
...mapActions(['fetchSecondFilterData']),
|
|
|
clear() {
|
|
|
let filterParams = {
|
|
|
sort: [],
|
|
|
brand: [],
|
|
|
gender: [],
|
|
|
size: [],
|
|
|
};
|
|
|
|
|
|
let tempParams = {
|
|
|
sort: [],
|
|
|
maxSort: [],
|
|
|
preSaleFlag: [],
|
|
|
price: [],
|
|
|
brand: [],
|
|
|
gender: [],
|
|
|
size: [],
|
|
|
};
|
|
|
|
|
|
for (let item of this.filterData) {
|
|
|
if (item.itemList && item.itemList.length === 1) {
|
|
|
filterParams[item.filterId].push(item.itemList[0].itemId);
|
|
|
tempParams[item.filterId].push(item.itemList[0].itemName);
|
|
|
}
|
|
|
}
|
|
|
this.setFilterParam(filterParams);
|
|
|
this.setTempParam(tempParams);
|
|
|
this.setTempParam(filterParams);
|
|
|
},
|
|
|
|
|
|
fetchData: async function(params) {
|
|
|
let filterData = await this.fetchSecondFilterData(params);
|
|
|
let filterData = await this.fetchSecondFilterData();
|
|
|
let filterParams = this.filterParams;
|
|
|
let tempParams = this.tempParams;
|
|
|
|
|
|
for (let item of filterData) {
|
|
|
if (item.itemList && item.itemList.length === 1) {
|
|
|
filterParams[item.filterId].push(item.itemList[0].itemId);
|
|
|
tempParams[item.filterId].push(item.itemList[0].itemName);
|
|
|
}
|
|
|
}
|
|
|
// for (let item of filterData) {
|
|
|
// if (item.itemList && item.itemList.length === 1) { //只有一个默认选中
|
|
|
// filterParams[item.filterId].push(item.itemList[0].itemId);
|
|
|
// tempParams[item.filterId].push(item.itemList[0].itemName);
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
this.filterData = filterData;
|
|
|
this.filterParams = filterParams;
|
|
|
this.tempParams = tempParams;
|
...
|
...
|
@@ -144,22 +150,24 @@ export default { |
|
|
|
|
|
submit() {
|
|
|
let params = {
|
|
|
sort: this.filterParams.sort.join(','),
|
|
|
maxSort: this.filterParams.maxSort.join(','),
|
|
|
brand: this.filterParams.brand.join(','),
|
|
|
gender: this.filterParams.gender.join(','),
|
|
|
size: this.filterParams.size.join(','),
|
|
|
preSaleFlag: this.filterParams.preSaleFlag.join(','),
|
|
|
price: this.filterParams.price.join(','),
|
|
|
};
|
|
|
|
|
|
this.filterData.length > 0 && this.filterData.map(row => {
|
|
|
if (row.itemList && row.itemList.length === 1) {
|
|
|
params[row.filterId] = row.itemList[0].itemId;
|
|
|
}
|
|
|
});
|
|
|
// this.filterData.length > 0 && this.filterData.map(row => {
|
|
|
// if (row.itemList && row.itemList.length === 1) {
|
|
|
// params[row.filterId] = row.itemList[0].itemId;
|
|
|
// }
|
|
|
// });
|
|
|
|
|
|
let ENT_PARAMS = {}, ENT_ID = [], ENT_NAME = [];
|
|
|
|
|
|
for (let key in params) {
|
|
|
if (key === 'sort' && params[key]) {
|
|
|
if (key === 'maxSort' && params[key]) {
|
|
|
ENT_PARAMS.category = params[key];
|
|
|
ENT_ID.push(params[key]);
|
|
|
ENT_NAME.push('品类');
|
...
|
...
|
@@ -179,6 +187,16 @@ export default { |
|
|
ENT_ID.push(params[key]);
|
|
|
ENT_NAME.push('性别');
|
|
|
}
|
|
|
if (key === 'preSaleFlag' && params[key]) {
|
|
|
ENT_PARAMS.flag = params[key];
|
|
|
ENT_ID.push(params[key]);
|
|
|
ENT_NAME.push('新旧程度');
|
|
|
}
|
|
|
if (key === 'price' && params[key]) {
|
|
|
ENT_PARAMS.price = params[key];
|
|
|
ENT_ID.push(params[key]);
|
|
|
ENT_NAME.push('价格');
|
|
|
}
|
|
|
}
|
|
|
this.yasParams.ENT_PARAMS = JSON.stringify(ENT_PARAMS);
|
|
|
this.yasParams.ENT_ID = ENT_ID.toString();
|
...
|
...
|
@@ -208,20 +226,33 @@ export default { |
|
|
|
|
|
let rowData = this.filterData[row];
|
|
|
|
|
|
if (rowData && rowData.itemList && rowData.itemList.length === 1) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// if (filterId === 'size') {
|
|
|
// this.lowPrice = itemName;
|
|
|
// if (rowData && rowData.itemList && rowData.itemList.length === 1) {
|
|
|
// return;
|
|
|
// }
|
|
|
|
|
|
if (filterItemArray.includes(itemId)) {
|
|
|
filterItemArray = filterItemArray.filter(item => item !== itemId);
|
|
|
filterTempArray = filterTempArray.filter(item => item !== itemName);
|
|
|
|
|
|
if (filterId === 'price') {
|
|
|
this.lowPrice = '';
|
|
|
this.highPrice = '';
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
filterItemArray.push(itemId);
|
|
|
filterTempArray.push(itemName);
|
|
|
|
|
|
if (filterId === 'price') {
|
|
|
if (itemName.search('-') != -1) {
|
|
|
let priceSplit = itemName.split('-');
|
|
|
this.lowPrice = priceSplit[0] ? priceSplit[0] : '';
|
|
|
this.highPrice = priceSplit[1] ? priceSplit[1] : '';
|
|
|
} else {
|
|
|
this.lowPrice = itemName.substring(0, itemName.length-2);
|
|
|
this.highPrice = '';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
tempParams[filterId] = filterTempArray;
|
...
|
...
|
@@ -270,17 +301,6 @@ export default { |
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.header {
|
|
|
width: 100%;
|
|
|
height: 45PX;
|
|
|
padding-left: 20PX;
|
|
|
padding-right: 20PX;
|
|
|
background-color: #fff;
|
|
|
display: flex;
|
|
|
align-items: stretch;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
.container {
|
|
|
position: absolute;
|
|
|
top: 0;
|
...
|
...
|
@@ -291,23 +311,6 @@ export default { |
|
|
z-index: 999;
|
|
|
}
|
|
|
|
|
|
.title {
|
|
|
font-size: 68px;
|
|
|
font-weight: bold;
|
|
|
color: #000;
|
|
|
height: 82px;
|
|
|
line-height: 82px;
|
|
|
margin: 40px;
|
|
|
flex-direction: row;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
|
|
|
.cancel {
|
|
|
font-size: 36px;
|
|
|
color: #888;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.item-price-input {
|
|
|
display: flex;
|
|
|
margin-left: 40px;
|
...
|
...
|
@@ -354,6 +357,9 @@ export default { |
|
|
|
|
|
.content-search {
|
|
|
margin-top: 80px;
|
|
|
max-height: calc(100%-140px);
|
|
|
overflow: auto;
|
|
|
-webkit-overflow-scrolling: touch;
|
|
|
|
|
|
.item {
|
|
|
margin-bottom: 60px;
|
...
|
...
|
@@ -402,6 +408,18 @@ export default { |
|
|
line-height: 80px;
|
|
|
}
|
|
|
|
|
|
.price-size {
|
|
|
width: 200px;
|
|
|
height: 80px;
|
|
|
line-height: 80px;
|
|
|
}
|
|
|
|
|
|
.flag-size {
|
|
|
width: 160px;
|
|
|
height: 80px;
|
|
|
line-height: 80px;
|
|
|
}
|
|
|
|
|
|
.item-img {
|
|
|
width: 140px;
|
|
|
height: 70px;
|
...
|
...
|
|