...
|
...
|
@@ -204,49 +204,34 @@ |
|
|
<script>
|
|
|
const bus = require('common/vue-bus');
|
|
|
|
|
|
const channelTrans = {
|
|
|
men: {
|
|
|
key: 'MEN男士',
|
|
|
code: '1,3'
|
|
|
},
|
|
|
women: {
|
|
|
key: 'WOMEN女士',
|
|
|
code: '2,3'
|
|
|
},
|
|
|
lifestyle: {
|
|
|
key: 'LIFESTYLE生活',
|
|
|
code: '1,2,3'
|
|
|
}
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
props: {
|
|
|
category: {
|
|
|
type: Object
|
|
|
type: Array
|
|
|
},
|
|
|
jump: {
|
|
|
type: Boolean
|
|
|
},
|
|
|
gender: {
|
|
|
type: String
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
brandCate: [], // 频道切换时取数据使用
|
|
|
cateNavLeftData: [], // 左侧分类数据
|
|
|
cateNavRightData: [], // 右侧分类数据
|
|
|
leftcurrent: 0, // 标记当前左侧选中条目
|
|
|
gender: '1,2,3', // 跳转到商品列表页的参数
|
|
|
rightAll: {} // 全部XX
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
category() {
|
|
|
this.$set('brandCate', this.category);
|
|
|
this.$set('cateNavLeftData', this.category['MEN男士']);
|
|
|
this.$set('cateNavRightData', this.category['MEN男士'] ? this.category['MEN男士'][0].sub : []);
|
|
|
this.$set('cateNavLeftData', this.category);
|
|
|
this.$set('cateNavRightData', this.cateNavLeftData ? this.cateNavLeftData[0].sub : []);
|
|
|
|
|
|
this.$set('rightAll', this.category['MEN男士'] ? {
|
|
|
sortId: this.category['MEN男士'][0].relationParameter.sort,
|
|
|
categoryName: this.category['MEN男士'][0].categoryName
|
|
|
this.$set('rightAll', this.cateNavLeftData ? {
|
|
|
sortId: this.cateNavLeftData[0].relationParameter.sort,
|
|
|
categoryName: this.cateNavLeftData[0].categoryName
|
|
|
} : {});
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -267,17 +252,6 @@ |
|
|
name: categoryName
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
bus.$on('channel.change', (page, channel) => {
|
|
|
this.gender = channelTrans[channel].code;
|
|
|
this.cateNavLeftData = this.brandCate[channelTrans[channel].key];
|
|
|
this.cateNavRightData = this.cateNavLeftData ? this.cateNavLeftData[0].sub : [];
|
|
|
this.rightAll = {
|
|
|
sortId: this.cateNavLeftData[0].relationParameter.sort,
|
|
|
categoryName: this.cateNavLeftData[0].categoryName
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
</script> |
...
|
...
|
|