Authored by 陈轩

fix

... ... @@ -202,8 +202,6 @@
}
</style>
<script>
const bus = require('common/vue-bus');
module.exports = {
props: {
category: {
... ... @@ -226,13 +224,7 @@
},
watch: {
category() {
this.$set('cateNavLeftData', this.category);
this.$set('cateNavRightData', this.cateNavLeftData ? this.cateNavLeftData[0].sub : []);
this.$set('rightAll', this.cateNavLeftData ? {
sortId: this.cateNavLeftData[0].relationParameter.sort,
categoryName: this.cateNavLeftData[0].categoryName
} : {});
this.categoryChangeHandler();
}
},
methods: {
... ... @@ -247,11 +239,28 @@
/* 筛选列表使用返回值 */
noJumpReturn(categoryId, categoryName) {
bus.$emit('category.result', {
this.$dispatch('select', {
id: categoryId,
name: categoryName
});
},
categoryChangeHandler() {
if (!this.category.length) {
return;
}
this.$set('cateNavLeftData', this.category);
this.$set('cateNavRightData', this.cateNavLeftData ? this.cateNavLeftData[0].sub : []);
this.$set('rightAll', this.cateNavLeftData ? {
sortId: this.cateNavLeftData[0].relationParameter.sort,
categoryName: this.cateNavLeftData[0].categoryName
} : {});
}
},
created() {
this.categoryChangeHandler();
}
};
</script>
... ...
... ... @@ -23,12 +23,15 @@
const bus = require('common/vue-bus');
const Overlay = require('common/overlay');
const filterSub = require('./filter/filter-sub.vue');
const qs = require('yoho-qs/parse');
let locationQuery = qs(decodeURIComponent(location.search.replace(/^\?/, '')));
let hasSort = !!locationQuery.sort;
module.exports = {
props: {
config: Object,
isVisible: Boolean,
action: '',
action: ''
},
data: function() {
return {
... ... @@ -60,8 +63,7 @@
showCate: function(cateName, cateVals) {
if (toString.call(cateVals) === '[object Array]') {
if (cateName === 'groupSort') {
// TODO
return true;
return !hasSort;
} else if (cateVals.length >= 1) {
return true;
}
... ... @@ -93,7 +95,12 @@
* @param {[type]} val [description]
*/
setParams: function(item) {
this.$set(`params.${this.subType}`, item);
let sortType = this.subType;
if (this.subType === 'groupSort') {
sortType = 'sort';
}
this.$set(`params.${sortType}`, item);
},
showLabel: function(key) {
... ...
... ... @@ -3,10 +3,10 @@
<c-header class="filter-sub-header" :title="type | filter-cn '选择'">
<i class="icon icon-left" slot="left" @click="hide"></i>
</c-header>
<div>
<brand-filter v-if="type === 'brand'" :data="data" :val.sync="val" @select="selectItem"></brand-filter>
<normal-filter v-if="type !== 'brand' && type !== 'groupSort'" :data="data" :type="type" :val.sync="val" @select="selectItem"></normal-filter>
<sort-filter v-if="type === 'groupSort'" :category="data" :val.sync="val" @select="selectItem"></sort-filter>
<div class="filter-sub-select">
<brand-filter v-if="type === 'brand'" :data="data" @select="selectItem"></brand-filter>
<normal-filter v-if="type !== 'brand' && type !== 'groupSort'" :data="data" :type="type" @select="selectItem"></normal-filter>
<sort-filter class="filter-detail filter-sort" v-if="type === 'groupSort'" :category="data" @select="selectItem"></sort-filter>
</div>
</div>
</template>
... ... @@ -49,7 +49,6 @@
transform: translate3d(100%, 0, 0);
background-color: $white;
z-index: 2010;
overflow: auto;
&.filter-sub-open {
transform: translate3d(0, 0, 0);
... ... @@ -92,4 +91,30 @@
}
}
.filter-sub-select {
position: absolute;
top: 90px;
left: 0;
right: 0;
bottom: 0;
}
.filter-detail {
height: 100%;
overflow: auto;
}
.filter-sort {
.cate-container {
margin-top: 0;
height: 100%;
}
.content {
height: 100% !important;
}
.sub-level-container {
overflow: auto;
}
}
</style>
\ No newline at end of file
... ...