Showing
2 changed files
with
37 additions
and
8 deletions
@@ -30,7 +30,10 @@ module.exports = { | @@ -30,7 +30,10 @@ module.exports = { | ||
30 | return api.get('', { | 30 | return api.get('', { |
31 | method: 'web.brand.byDomain', | 31 | method: 'web.brand.byDomain', |
32 | domain: params.domain | 32 | domain: params.domain |
33 | - }, {code: 200, cache: false}); | 33 | + }, { |
34 | + code: 200, | ||
35 | + cache: false | ||
36 | + }); | ||
34 | }, | 37 | }, |
35 | 38 | ||
36 | /** | 39 | /** |
@@ -49,7 +52,10 @@ module.exports = { | @@ -49,7 +52,10 @@ module.exports = { | ||
49 | }); | 52 | }); |
50 | } | 53 | } |
51 | 54 | ||
52 | - return api.get('', finalParams, {code: 200, cache: false}); | 55 | + return api.get('', finalParams, { |
56 | + code: 200, | ||
57 | + cache: false | ||
58 | + }); | ||
53 | }, | 59 | }, |
54 | 60 | ||
55 | /** | 61 | /** |
@@ -61,7 +67,10 @@ module.exports = { | @@ -61,7 +67,10 @@ module.exports = { | ||
61 | return api.get('', { | 67 | return api.get('', { |
62 | method: 'app.shopsdecorator.getList', | 68 | method: 'app.shopsdecorator.getList', |
63 | shop_id: params.shopId | 69 | shop_id: params.shopId |
64 | - }, {code: 200, cache: false}); | 70 | + }, { |
71 | + code: 200, | ||
72 | + cache: false | ||
73 | + }); | ||
65 | }, | 74 | }, |
66 | 75 | ||
67 | /** | 76 | /** |
@@ -93,7 +102,10 @@ module.exports = { | @@ -93,7 +102,10 @@ module.exports = { | ||
93 | } | 102 | } |
94 | }); | 103 | }); |
95 | 104 | ||
96 | - return api.get('', finalParams, {code: 200, cache: false}); | 105 | + return api.get('', finalParams, { |
106 | + code: 200, | ||
107 | + cache: false | ||
108 | + }); | ||
97 | }, | 109 | }, |
98 | 110 | ||
99 | /** | 111 | /** |
@@ -120,4 +132,4 @@ module.exports = { | @@ -120,4 +132,4 @@ module.exports = { | ||
120 | } | 132 | } |
121 | return api.get('', finalParams); | 133 | return api.get('', finalParams); |
122 | } | 134 | } |
123 | -}; | 135 | +}; |
@@ -67,10 +67,25 @@ const _getGoodsList = params => { | @@ -67,10 +67,25 @@ const _getGoodsList = params => { | ||
67 | shopId: params.shopId | 67 | shopId: params.shopId |
68 | })).then(subResult => { | 68 | })).then(subResult => { |
69 | if (subResult.data) { | 69 | if (subResult.data) { |
70 | + // java端不愿意将boys改为wen,所以没办法,只能在这边改了。 | ||
71 | + if (subResult.data.filter) { | ||
72 | + const gender = subResult.data.filter.gender || {}; | ||
73 | + | ||
74 | + for (let k in gender) { | ||
75 | + if (k.indexOf('1') > -1) { | ||
76 | + gender[k] = 'men'; | ||
77 | + } else if (k.indexOf('2') > -1) { | ||
78 | + gender[k] = 'women'; | ||
79 | + } | ||
80 | + } | ||
81 | + } | ||
82 | + | ||
70 | prettyFilter(subResult.data.filter); | 83 | prettyFilter(subResult.data.filter); |
71 | finalResult = { | 84 | finalResult = { |
72 | data: { | 85 | data: { |
73 | - productList: processProductList(subResult.data.product_list, { gender: params.gender }), | 86 | + productList: processProductList(subResult.data.product_list, { |
87 | + gender: params.gender | ||
88 | + }), | ||
74 | filter: subResult.data.filter, | 89 | filter: subResult.data.filter, |
75 | page: subResult.data.page, | 90 | page: subResult.data.page, |
76 | pageTotal: subResult.data.page_total | 91 | pageTotal: subResult.data.page_total |
@@ -121,7 +136,9 @@ const getShopData = params => { | @@ -121,7 +136,9 @@ const getShopData = params => { | ||
121 | isBlkShop: true, | 136 | isBlkShop: true, |
122 | shopId: result.data.shop_id | 137 | shopId: result.data.shop_id |
123 | }); | 138 | }); |
124 | - return _getShopInfoData(finalResult, Object.assign(params, {shopId: result.data.shop_id})); | 139 | + return _getShopInfoData(finalResult, Object.assign(params, { |
140 | + shopId: result.data.shop_id | ||
141 | + })); | ||
125 | } else { | 142 | } else { |
126 | 143 | ||
127 | /* 不是 BLK 的店铺 */ | 144 | /* 不是 BLK 的店铺 */ |
@@ -183,4 +200,4 @@ module.exports = { | @@ -183,4 +200,4 @@ module.exports = { | ||
183 | getShopData, | 200 | getShopData, |
184 | getBrandShopGoodsData, | 201 | getBrandShopGoodsData, |
185 | collectShopData | 202 | collectShopData |
186 | -}; | 203 | +}; |
-
Please register or login to post a comment