Authored by ccbikai

切换频道记录 cookie

@@ -15,8 +15,8 @@ module.exports = { @@ -15,8 +15,8 @@ module.exports = {
15 port: 6004, 15 port: 6004,
16 siteUrl: '//m.yohoblk.com', 16 siteUrl: '//m.yohoblk.com',
17 domains: { 17 domains: {
18 - api: 'http://devapi.yoho.cn:58078/',  
19 - service: 'http://devservice.yoho.cn:58077/' 18 + api: 'http://192.168.102.205:8080/gateway/',
  19 + service: 'http://192.168.102.205:8080/gateway/'
20 }, 20 },
21 subDomains: { 21 subDomains: {
22 host: '.m.yohoblk.com', 22 host: '.m.yohoblk.com',
@@ -19,8 +19,8 @@ @@ -19,8 +19,8 @@
19 }; 19 };
20 }, 20 },
21 components: { 21 components: {
22 - tab: tab,  
23 - resources: resources 22 + tab,
  23 + resources
24 }, 24 },
25 created() { 25 created() {
26 bus.$on('contentCode.change', (code) => { 26 bus.$on('contentCode.change', (code) => {
@@ -7,8 +7,14 @@ @@ -7,8 +7,14 @@
7 </template> 7 </template>
8 8
9 <script> 9 <script>
  10 + const cookie = require('yoho-cookie');
10 const bus = require('common/vue-bus'); 11 const bus = require('common/vue-bus');
11 - const channelMap = {}; 12 +
  13 + const channelMap = {
  14 + 301: 'men',
  15 + 302: 'women',
  16 + 303: 'lifestyle'
  17 + };
12 18
13 module.exports = { 19 module.exports = {
14 props: { 20 props: {
@@ -30,14 +36,14 @@ @@ -30,14 +36,14 @@
30 $.ajax({ 36 $.ajax({
31 url: '/channel/channel.json' 37 url: '/channel/channel.json'
32 }).then(res => { 38 }).then(res => {
33 - if (res.code === 200) { 39 + if (res.data.length) {
34 const channel = []; 40 const channel = [];
35 41
36 res.data.forEach(c => { 42 res.data.forEach(c => {
37 - channel.push[{ 43 + channel.push({
38 name: c.channelName, 44 name: c.channelName,
39 - channel: channelMap[c.channeId] || ''  
40 - }]; 45 + channel: channelMap[c.channelId] || ''
  46 + });
41 }); 47 });
42 48
43 this.channel = channel; 49 this.channel = channel;
@@ -48,6 +54,7 @@ @@ -48,6 +54,7 @@
48 changeChannel(index) { 54 changeChannel(index) {
49 this.current = index; 55 this.current = index;
50 bus.$emit('channel.change', this.page, this.channel[index].channel); 56 bus.$emit('channel.change', this.page, this.channel[index].channel);
  57 + cookie.set('_Channel', this.channel[index].channel);
51 } 58 }
52 } 59 }
53 }; 60 };