Authored by 陈轩

fix BLK-964

... ... @@ -27,6 +27,10 @@
let locationQuery = qs(decodeURIComponent(location.search.replace(/^\?/, '')));
let hasSort = !!locationQuery.sort;
const aliasMap = {
groupSort: 'sort'
};
module.exports = {
props: {
config: Object,
... ... @@ -97,13 +101,14 @@
setParams: function(item) {
let sortType = this.subType;
if (this.subType === 'groupSort') {
sortType = 'sort';
}
aliasMap[this.subType] && (sortType = aliasMap[this.subType]);
this.$set(`params.${sortType}`, item);
},
showLabel: function(key) {
aliasMap[key] && (key = aliasMap[key]);
const newSelected = this.params[key];
const oldSelected = this.selected[key];
... ... @@ -114,24 +119,6 @@
}
}
},
filters: {
unifyTxt: function(val, category) {
let txt = '';
let arr = [];
let foo = $.noop;
if ($.isArray(val)) { // [{categoryName,..},{}..]
foo = (index, obj) => {
arr.push(obj[category + 'Name']);
};
}
$.each(val, foo);
txt = arr.join(',');
return txt;
}
},
created() {
const self = this;
... ...
... ... @@ -4,7 +4,7 @@
<li class="card" v-for="item in data">
<div class="card-pic">
<a href="{{item.productId | goodsUrl}}">
<img v-lazy="item.goodsList[0].imagesUrl | resize 372 499" alt="{{item.productName}}">
<img v-lazy="item.defaultImages | resize 372 499" alt="{{item.productName}}">
</a>
</div>
<div class="card-bd">
... ...