Authored by 沈志敏

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

@@ -7,18 +7,21 @@ @@ -7,18 +7,21 @@
7 <script> 7 <script>
8 const contentCode = require('content-code'); 8 const contentCode = require('content-code');
9 const qs = require('yoho-qs'); 9 const qs = require('yoho-qs');
  10 + const cookie = require('yoho-cookie');
10 11
11 const tab = require('channel/tab.vue'); 12 const tab = require('channel/tab.vue');
12 const resources = require('component/resources/index.vue'); 13 const resources = require('component/resources/index.vue');
13 const brandList = require('channel/brand-list.vue'); 14 const brandList = require('channel/brand-list.vue');
14 const brandSearch = require('channel/brand-search.vue'); 15 const brandSearch = require('channel/brand-search.vue');
15 16
  17 + const detaultChannel = qs.channel || cookie.get('_Channel') || 'men';
16 18
17 module.exports = { 19 module.exports = {
18 data() { 20 data() {
19 return { 21 return {
20 page: 'brand', 22 page: 'brand',
21 - contentCode: contentCode.brand[qs.channel || 'men'] 23 + channel: detaultChannel,
  24 + contentCode: contentCode.brand[detaultChannel]
22 }; 25 };
23 }, 26 },
24 components: { 27 components: {
@@ -22,15 +22,18 @@ @@ -22,15 +22,18 @@
22 <script> 22 <script>
23 const contentCode = require('content-code'); 23 const contentCode = require('content-code');
24 const qs = require('yoho-qs'); 24 const qs = require('yoho-qs');
  25 + const cookie = require('yoho-cookie');
25 26
26 const tab = require('channel/tab.vue'); 27 const tab = require('channel/tab.vue');
27 const resources = require('component/resources/index.vue'); 28 const resources = require('component/resources/index.vue');
28 29
  30 + const detaultChannel = qs.channel || cookie.get('_Channel') || 'men';
  31 +
29 module.exports = { 32 module.exports = {
30 data() { 33 data() {
31 return { 34 return {
32 page: 'cate', 35 page: 'cate',
33 - contentCode: contentCode.cate[qs.channel || 'men'] 36 + contentCode: contentCode.cate[detaultChannel]
34 }; 37 };
35 }, 38 },
36 components: { 39 components: {
@@ -5,17 +5,20 @@ @@ -5,17 +5,20 @@
5 5
6 <script> 6 <script>
7 const qs = require('yoho-qs'); 7 const qs = require('yoho-qs');
  8 + const cookie = require('yoho-cookie');
8 const contentCode = require('content-code'); 9 const contentCode = require('content-code');
9 const bus = require('common/vue-bus'); 10 const bus = require('common/vue-bus');
10 11
11 const tab = require('channel/tab.vue'); 12 const tab = require('channel/tab.vue');
12 const resources = require('component/resources/index.vue'); 13 const resources = require('component/resources/index.vue');
13 14
  15 + const detaultChannel = qs.channel || cookie.get('_Channel') || 'men';
  16 +
14 module.exports = { 17 module.exports = {
15 data() { 18 data() {
16 return { 19 return {
17 page: 'channel', 20 page: 'channel',
18 - contentCode: contentCode.channel[qs.channel || 'men'] 21 + contentCode: contentCode.channel[detaultChannel]
19 }; 22 };
20 }, 23 },
21 components: { 24 components: {
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 props: { 22 props: {
23 current: { 23 current: {
24 type: Number, 24 type: Number,
25 - default: 0 25 + default: +cookie.get('_ChannelIndex') || 0
26 }, 26 },
27 page: { 27 page: {
28 type: String, 28 type: String,
@@ -62,6 +62,7 @@ @@ -62,6 +62,7 @@
62 this.current = index; 62 this.current = index;
63 bus.$emit('channel.change', this.page, this.channel[index].channel); 63 bus.$emit('channel.change', this.page, this.channel[index].channel);
64 cookie.set('_Channel', this.channel[index].channel); 64 cookie.set('_Channel', this.channel[index].channel);
  65 + cookie.set('_ChannelIndex', index);
65 } 66 }
66 } 67 }
67 }; 68 };