Authored by ccbikai

Merge branch 'release/1.0' into develop

@@ -7,10 +7,14 @@ @@ -7,10 +7,14 @@
7 'use strict'; 7 'use strict';
8 8
9 const api = global.yoho.API; 9 const api = global.yoho.API;
10 -const helpers = global.yoho.helpers;  
11 const brandApi = require('./brand-api'); 10 const brandApi = require('./brand-api');
12 const logger = global.yoho.logger; 11 const logger = global.yoho.logger;
13 const _ = require('lodash'); 12 const _ = require('lodash');
  13 +const querystring = require('querystring');
  14 +
  15 +const urlFormat = (path, qs) => {
  16 + return path + '?' + querystring.stringify(qs);
  17 +};
14 18
15 /** 19 /**
16 * 处理品牌一览品牌列表数据 20 * 处理品牌一览品牌列表数据
@@ -101,7 +105,7 @@ const getCateListData = params => { @@ -101,7 +105,7 @@ const getCateListData = params => {
101 sub: [] 105 sub: []
102 }; 106 };
103 if (_.isEmpty(cate.sub)) { 107 if (_.isEmpty(cate.sub)) {
104 - item.url = helpers.urlFormat('/list', { 108 + item.url = urlFormat('/list', {
105 sort: item.sort, 109 sort: item.sort,
106 sort_name: item.name, 110 sort_name: item.name,
107 gender: genderArr[categorykey] 111 gender: genderArr[categorykey]
@@ -115,7 +119,7 @@ const getCateListData = params => { @@ -115,7 +119,7 @@ const getCateListData = params => {
115 id: item.id, 119 id: item.id,
116 name: '全部' + item.name, 120 name: '全部' + item.name,
117 sort: item.sort, 121 sort: item.sort,
118 - url: helpers.urlFormat('/list', { 122 + url: urlFormat('/list', {
119 sort: item.sort, 123 sort: item.sort,
120 sort_name: item.name, 124 sort_name: item.name,
121 gender: genderArr[categorykey] 125 gender: genderArr[categorykey]
@@ -130,7 +134,7 @@ const getCateListData = params => { @@ -130,7 +134,7 @@ const getCateListData = params => {
130 sort: sub.relation_parameter.sort, 134 sort: sub.relation_parameter.sort,
131 url: '' 135 url: ''
132 }; 136 };
133 - subitem.url = helpers.urlFormat('/list', { 137 + subitem.url = urlFormat('/list', {
134 sort: subitem.sort, 138 sort: subitem.sort,
135 sort_name: subitem.name, 139 sort_name: subitem.name,
136 gender: genderArr[categorykey] 140 gender: genderArr[categorykey]
@@ -10,6 +10,8 @@ const search = { @@ -10,6 +10,8 @@ const search = {
10 method: 'app.search.li' 10 method: 'app.search.li'
11 }, params); 11 }, params);
12 12
  13 + delete data.client_type;
  14 + delete data.client_secret;
13 return api.post('', data, { 15 return api.post('', data, {
14 cache: true, 16 cache: true,
15 code: 200 17 code: 200
@@ -24,7 +24,7 @@ const titleMap = { @@ -24,7 +24,7 @@ const titleMap = {
24 action: '' 24 action: ''
25 }, 25 },
26 title: { 26 title: {
27 - des: 'BLK', 27 + des: '',
28 action: '' 28 action: ''
29 } 29 }
30 }, 30 },
@@ -34,7 +34,7 @@ const titleMap = { @@ -34,7 +34,7 @@ const titleMap = {
34 action: '' 34 action: ''
35 }, 35 },
36 title: { 36 title: {
37 - des: 'BLK', 37 + des: '',
38 action: '' 38 action: ''
39 }, 39 },
40 right: { 40 right: {
@@ -48,7 +48,7 @@ const titleMap = { @@ -48,7 +48,7 @@ const titleMap = {
48 action: '' 48 action: ''
49 }, 49 },
50 title: { 50 title: {
51 - des: 'BLK', 51 + des: '',
52 action: '' 52 action: ''
53 }, 53 },
54 right: { 54 right: {
@@ -89,7 +89,7 @@ const titleMap = { @@ -89,7 +89,7 @@ const titleMap = {
89 6: { 89 6: {
90 headerid: '6', 90 headerid: '6',
91 title: { 91 title: {
92 - des: '资讯6', 92 + des: '资讯',
93 action: '' 93 action: ''
94 } 94 }
95 } 95 }
@@ -97,10 +97,16 @@ const titleMap = { @@ -97,10 +97,16 @@ const titleMap = {
97 97
98 const matchHeader = (url) => { 98 const matchHeader = (url) => {
99 let header = { 99 let header = {
100 - headerid: '-1' // 默认不显示头部 100 + headerid: '-1'
101 }; 101 };
102 let path = url.split('?')[0]; 102 let path = url.split('?')[0];
103 103
  104 + if (/\/cate-all$/.test(path)) {
  105 + header = titleMap[1];
  106 + header.title.des = '全部分类';
  107 + return header;
  108 + }
  109 +
104 if (/\/me\/mydetails$/.test(path)) { 110 if (/\/me\/mydetails$/.test(path)) {
105 header = titleMap[1]; 111 header = titleMap[1];
106 header.title.des = '个人信息'; 112 header.title.des = '个人信息';