Authored by 郭成尧

品牌一览数据OK

@@ -54,7 +54,7 @@ module.exports = { @@ -54,7 +54,7 @@ module.exports = {
54 getBrandList: (req, res) => { 54 getBrandList: (req, res) => {
55 55
56 brandModel.getBrandListData({ 56 brandModel.getBrandListData({
57 - channel: req.query.channel || req.cookies._Channel || 'boys' 57 + channel: req.query.channel || req.cookies._Channel || 'men'
58 }).then(result => { 58 }).then(result => {
59 res.json(result); 59 res.json(result);
60 }); 60 });
@@ -8,15 +8,12 @@ @@ -8,15 +8,12 @@
8 const api = global.yoho.API; 8 const api = global.yoho.API;
9 9
10 const yhChannel = { 10 const yhChannel = {
11 - boys: { 11 + men: {
12 channel: '1' 12 channel: '1'
13 }, 13 },
14 - girls: { 14 + women: {
15 channel: '2' 15 channel: '2'
16 }, 16 },
17 - kids: {  
18 - channel: '3'  
19 - },  
20 lifestyle: { 17 lifestyle: {
21 channel: '4' 18 channel: '4'
22 } 19 }
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <tab v-bind:page="page"></tab> 2 <tab v-bind:page="page"></tab>
3 <resources v-bind:content-code.sync="contentCode"></resources> 3 <resources v-bind:content-code.sync="contentCode"></resources>
4 <letter-list></letter-list> 4 <letter-list></letter-list>
5 - <brand-list v-bind:channel="'boys'"></brand-list> 5 + <brand-list v-bind:channel="channel"></brand-list>
6 </template> 6 </template>
7 <script> 7 <script>
8 const contentCode = require('content-code'); 8 const contentCode = require('content-code');
@@ -18,7 +18,8 @@ @@ -18,7 +18,8 @@
18 data() { 18 data() {
19 return { 19 return {
20 page: 'brand', 20 page: 'brand',
21 - contentCode: contentCode.brand[qs.brand || 'men'] 21 + contentCode: contentCode.brand[qs.brand || 'men'],
  22 + channel: qs.channel
22 }; 23 };
23 }, 24 },
24 components: { 25 components: {
@@ -50,6 +50,7 @@ @@ -50,6 +50,7 @@
50 </style> 50 </style>
51 <script> 51 <script>
52 const $ = require('yoho-jquery'); 52 const $ = require('yoho-jquery');
  53 + const bus = require('common/vue-bus');
53 const tip = require('common/tip'); 54 const tip = require('common/tip');
54 55
55 module.exports = { 56 module.exports = {
@@ -83,6 +84,9 @@ @@ -83,6 +84,9 @@
83 }, 84 },
84 created() { 85 created() {
85 this.getBrandList(); 86 this.getBrandList();
  87 + bus.$on('channel.change', (page, channel) => {
  88 + this.channel = channel;
  89 + });
86 } 90 }
87 }; 91 };
88 </script> 92 </script>