|
|
<template>
|
|
|
<tab v-bind:page="'cate'"></tab>
|
|
|
<div class="cate-page" id='cate-page'>
|
|
|
<div class="cate-nav clearfix">
|
|
|
<ul>
|
|
|
<li v-for="(index, cate) in brandCate" v-on:click='cateNavTopFun(index)' v-bind:class="{focus: index === topcurrent}" v-bind:style="{width: widthli + '%'}">
|
|
|
<span>{{index}}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<!--<div class="cate-nav clearfix">-->
|
|
|
<!--<ul>-->
|
|
|
<!--<li v-for="(index, cate) in brandCate" v-on:click='cateNavTopFun(index)' v-bind:class="{focus: index === topcurrent}" v-bind:style="{width: widthli + '%'}">-->
|
|
|
<!--<span>{{index}}</span>-->
|
|
|
<!--</li>-->
|
|
|
<!--</ul>-->
|
|
|
<!--</div>-->
|
|
|
<div class="cate-container clearfix">
|
|
|
<div class="content" style="height: 522px;">
|
|
|
<ul class="primary-level">
|
...
|
...
|
@@ -31,6 +32,10 @@ |
|
|
font-size: 36px;
|
|
|
font-family: helvetica, Arial, "黑体";
|
|
|
|
|
|
.cate-container {
|
|
|
margin-top: 80px;
|
|
|
}
|
|
|
|
|
|
ul,
|
|
|
li {
|
|
|
margin: 0;
|
...
|
...
|
@@ -202,11 +207,21 @@ |
|
|
const tab = require('channel/tab.vue');
|
|
|
const contentCode = require('content-code');
|
|
|
const qs = require('yoho-qs');
|
|
|
const bus = require('common/vue-bus');
|
|
|
|
|
|
const genderCode = {
|
|
|
MEN男士: '1,3',
|
|
|
WOMEN女士: '2,3',
|
|
|
LIFESTYLE生活: '1,2,3'
|
|
|
const channelTrans = {
|
|
|
men: {
|
|
|
key: 'MEN男士',
|
|
|
code: '1,3'
|
|
|
},
|
|
|
women: {
|
|
|
key: 'WOMEN女士',
|
|
|
code: '2,3'
|
|
|
},
|
|
|
lifestyle: {
|
|
|
key: 'LIFESTYLE生活',
|
|
|
code: '1,2,3'
|
|
|
}
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
...
|
...
|
@@ -226,6 +241,8 @@ |
|
|
},
|
|
|
methods: {
|
|
|
getCateList() {
|
|
|
let self = this;
|
|
|
|
|
|
let data = {
|
|
|
channel: ''
|
|
|
};
|
...
|
...
|
@@ -235,20 +252,14 @@ |
|
|
data: data
|
|
|
}).then(result => {
|
|
|
if (result) {
|
|
|
this.brandCate = result;
|
|
|
this.cateNavLeftData = result['MEN男士'];
|
|
|
this.cateNavRightData = result['MEN男士'][0].sub;
|
|
|
self.$set('brandCate', result);
|
|
|
self.$set('cateNavLeftData', result['MEN男士']);
|
|
|
self.$set('cateNavRightData', result['MEN男士'][0].sub);
|
|
|
}
|
|
|
}).fail(() => {
|
|
|
tip('网络错误');
|
|
|
});
|
|
|
},
|
|
|
cateNavTopFun(index) {
|
|
|
this.topcurrent = index;
|
|
|
this.gender = genderCode[index];
|
|
|
this.cateNavLeftData = this.brandCate[index];
|
|
|
this.cateNavRightData = this.cateNavLeftData[0].sub;
|
|
|
},
|
|
|
cateNavLeftFun(index) {
|
|
|
this.leftcurrent = index;
|
|
|
this.cateNavRightData = this.cateNavLeftData[index].sub;
|
...
|
...
|
@@ -258,7 +269,15 @@ |
|
|
tab
|
|
|
},
|
|
|
created() {
|
|
|
const self = this;
|
|
|
|
|
|
this.getCateList();
|
|
|
|
|
|
bus.$on('channel.change', function(page, channel) {
|
|
|
self.gender = channelTrans[channel].code;
|
|
|
self.cateNavLeftData = self.brandCate[channelTrans[channel].key];
|
|
|
self.cateNavRightData = self.cateNavLeftData[0].sub;
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
</script> |
...
|
...
|
|