Authored by ccbikai

切换频道记录 cookie

... ... @@ -15,8 +15,8 @@ module.exports = {
port: 6004,
siteUrl: '//m.yohoblk.com',
domains: {
api: 'http://devapi.yoho.cn:58078/',
service: 'http://devservice.yoho.cn:58077/'
api: 'http://192.168.102.205:8080/gateway/',
service: 'http://192.168.102.205:8080/gateway/'
},
subDomains: {
host: '.m.yohoblk.com',
... ...
... ... @@ -19,8 +19,8 @@
};
},
components: {
tab: tab,
resources: resources
tab,
resources
},
created() {
bus.$on('contentCode.change', (code) => {
... ...
... ... @@ -7,8 +7,14 @@
</template>
<script>
const cookie = require('yoho-cookie');
const bus = require('common/vue-bus');
const channelMap = {};
const channelMap = {
301: 'men',
302: 'women',
303: 'lifestyle'
};
module.exports = {
props: {
... ... @@ -30,14 +36,14 @@
$.ajax({
url: '/channel/channel.json'
}).then(res => {
if (res.code === 200) {
if (res.data.length) {
const channel = [];
res.data.forEach(c => {
channel.push[{
channel.push({
name: c.channelName,
channel: channelMap[c.channeId] || ''
}];
channel: channelMap[c.channelId] || ''
});
});
this.channel = channel;
... ... @@ -48,6 +54,7 @@
changeChannel(index) {
this.current = index;
bus.$emit('channel.change', this.page, this.channel[index].channel);
cookie.set('_Channel', this.channel[index].channel);
}
}
};
... ...