Merge remote-tracking branch 'origin/release/1.0' into release/1.0
Showing
9 changed files
with
40 additions
and
19 deletions
@@ -43,7 +43,6 @@ const _getBrandAdFloor = d => { | @@ -43,7 +43,6 @@ const _getBrandAdFloor = d => { | ||
43 | * @return {Object} 处理之后的数据 | 43 | * @return {Object} 处理之后的数据 |
44 | */ | 44 | */ |
45 | const _getNewArrivals = d => { | 45 | const _getNewArrivals = d => { |
46 | - console.log(d); | ||
47 | _.forEach(d, (data, index) => { | 46 | _.forEach(d, (data, index) => { |
48 | if (index === 0 || index === d.length - 1) { | 47 | if (index === 0 || index === d.length - 1) { |
49 | data.smallImg = true; | 48 | data.smallImg = true; |
1 | <div class="ad-container clearfix"> | 1 | <div class="ad-container clearfix"> |
2 | {{# brandsAd}} | 2 | {{# brandsAd}} |
3 | <div class="ad {{#if @first}}first{{/if}}"> | 3 | <div class="ad {{#if @first}}first{{/if}}"> |
4 | - <img class="lazy-img" data-original="{{image src 240 240}}" alt=""> | 4 | + <a href="{{url}}"> |
5 | + <img class="lazy-img" data-original="{{image src 240 240}}" alt=""> | ||
6 | + </a> | ||
5 | {{> brand-text-box}} | 7 | {{> brand-text-box}} |
6 | </div> | 8 | </div> |
7 | {{/ brandsAd}} | 9 | {{/ brandsAd}} |
@@ -5,21 +5,21 @@ | @@ -5,21 +5,21 @@ | ||
5 | <div class="arrival-item {{#if smallImg}}small-img{{/if}} {{#if @last}}last{{^}}normal{{/if}}"> | 5 | <div class="arrival-item {{#if smallImg}}small-img{{/if}} {{#if @last}}last{{^}}normal{{/if}}"> |
6 | {{#if even}} | 6 | {{#if even}} |
7 | <a href="{{url}}"> | 7 | <a href="{{url}}"> |
8 | - <img class="lazy-img" data-original="{{#if smallImg}}{{image src 223 490}}{{^}}{{image src 325 490}}{{/if}}" alt=""> | 8 | + <img class="lazy-img" data-original="{{#if smallImg}}{{image src 223 490}}{{^}}{{image src 325 490}}{{/if}}" alt="{{alt}}"> |
9 | </a> | 9 | </a> |
10 | <div class="brand-name"> | 10 | <div class="brand-name"> |
11 | <a href="{{url}}"> | 11 | <a href="{{url}}"> |
12 | - <span class="bottom">{{name}}</span> | 12 | + <span class="bottom">{{title}}</span> |
13 | </a> | 13 | </a> |
14 | </div> | 14 | </div> |
15 | {{^}} | 15 | {{^}} |
16 | <div class="brand-name"> | 16 | <div class="brand-name"> |
17 | <a href="{{url}}"> | 17 | <a href="{{url}}"> |
18 | - <span class="top">{{name}}</span> | 18 | + <span class="top">{{title}}</span> |
19 | </a> | 19 | </a> |
20 | </div> | 20 | </div> |
21 | <a href="{{url}}"> | 21 | <a href="{{url}}"> |
22 | - <img class="lazy-img" data-original="{{#if smallImg}}{{image src 223 490}}{{^}}{{image src 325 490}}{{/if}}" alt=""> | 22 | + <img class="lazy-img" data-original="{{#if smallImg}}{{image src 223 490}}{{^}}{{image src 325 490}}{{/if}}" alt="{{alt}}"> |
23 | </a> | 23 | </a> |
24 | {{/if}} | 24 | {{/if}} |
25 | </div> | 25 | </div> |
@@ -13,6 +13,7 @@ const item = require('../models/item'); | @@ -13,6 +13,7 @@ const item = require('../models/item'); | ||
13 | * @function index | 13 | * @function index |
14 | */ | 14 | */ |
15 | const index = (req, res, next) => { | 15 | const index = (req, res, next) => { |
16 | + req.params.channel = req.yoho.channel; | ||
16 | item.getProductItemData(req.params, req.url, req.user.uid).then(result => { | 17 | item.getProductItemData(req.params, req.url, req.user.uid).then(result => { |
17 | if (_.isEmpty(result)) { | 18 | if (_.isEmpty(result)) { |
18 | return next(); | 19 | return next(); |
@@ -166,21 +166,37 @@ const setSeoInfo = (goodInfo, nav) => { | @@ -166,21 +166,37 @@ const setSeoInfo = (goodInfo, nav) => { | ||
166 | * @param { string } name 商品名称 | 166 | * @param { string } name 商品名称 |
167 | * @return { Object } 面包屑导航数据 | 167 | * @return { Object } 面包屑导航数据 |
168 | */ | 168 | */ |
169 | -const setPathNav = (data, name) => { | 169 | +const setPathNav = (data, name, channel) => { |
170 | let resData = {}; | 170 | let resData = {}; |
171 | + let link = channel, | ||
172 | + gender; | ||
173 | + | ||
174 | + channel = channel || 'men'; | ||
175 | + | ||
176 | + switch (channel) { | ||
177 | + case 'men': // 男 | ||
178 | + link = ''; | ||
179 | + gender = '1,3'; | ||
180 | + break; | ||
181 | + case 'women': // 女 | ||
182 | + gender = '2,3'; | ||
183 | + break; | ||
184 | + default: // 其它 | ||
185 | + gender = '1,2,3'; | ||
186 | + break; | ||
187 | + } | ||
171 | 188 | ||
172 | if (!_.isEmpty(data)) { | 189 | if (!_.isEmpty(data)) { |
173 | let navs = [{ | 190 | let navs = [{ |
174 | - link: helpers.urlFormat(''), | ||
175 | - name: 'MEN首页' // 待处理 | 191 | + link: helpers.urlFormat(`/${link}`), |
192 | + name: `${_.toUpper(channel)}首页` | ||
176 | }]; | 193 | }]; |
177 | let sort = data.sort[0]; | 194 | let sort = data.sort[0]; |
178 | 195 | ||
179 | navs.push({ | 196 | navs.push({ |
180 | link: helpers.urlFormat('/list', { | 197 | link: helpers.urlFormat('/list', { |
181 | - msort: sort.sort_id | ||
182 | - | ||
183 | - // gender: '' // 待处理 | 198 | + msort: sort.sort_id, |
199 | + gender: gender | ||
184 | }), | 200 | }), |
185 | name: sort.sort_name, | 201 | name: sort.sort_name, |
186 | pathTitle: sort.sort_name | 202 | pathTitle: sort.sort_name |
@@ -191,9 +207,8 @@ const setPathNav = (data, name) => { | @@ -191,9 +207,8 @@ const setPathNav = (data, name) => { | ||
191 | navs.push({ | 207 | navs.push({ |
192 | link: helpers.urlFormat('/list', { | 208 | link: helpers.urlFormat('/list', { |
193 | msort: sort.sort_id, | 209 | msort: sort.sort_id, |
194 | - misort: sort.sub.sort_id | ||
195 | - | ||
196 | - // gender: '' // 待处理 | 210 | + misort: sort.sub.sort_id, |
211 | + gender: gender | ||
197 | }), | 212 | }), |
198 | name: sort.sub[0].sort_name, | 213 | name: sort.sub[0].sort_name, |
199 | pathTitle: sort.sub[0].sort_name | 214 | pathTitle: sort.sub[0].sort_name |
@@ -93,7 +93,7 @@ const getProductItemData = (params, url, uid) => { | @@ -93,7 +93,7 @@ const getProductItemData = (params, url, uid) => { | ||
93 | _.set(data, 'goodInfo.productFav', mulRes.productFav); | 93 | _.set(data, 'goodInfo.productFav', mulRes.productFav); |
94 | 94 | ||
95 | Object.assign(data, | 95 | Object.assign(data, |
96 | - itemFun.setPathNav(mulRes.sort, result.productName), // 面包屑导航 | 96 | + itemFun.setPathNav(mulRes.sort, result.productName, params.channel), // 面包屑导航 |
97 | itemFun.setDescriptionData(mulRes.sizeInfo, mulRes.comfort), // DESCRIPTION商品描述 | 97 | itemFun.setDescriptionData(mulRes.sizeInfo, mulRes.comfort), // DESCRIPTION商品描述 |
98 | itemFun.setMaterialData(mulRes.sizeInfo), // MATERIALS材料洗涤 | 98 | itemFun.setMaterialData(mulRes.sizeInfo), // MATERIALS材料洗涤 |
99 | itemFun.setSizeData(mulRes.sizeInfo, mulRes.modelTry), // SIZEINFO尺码信息 | 99 | itemFun.setSizeData(mulRes.sizeInfo, mulRes.modelTry), // SIZEINFO尺码信息 |
-
Please register or login to post a comment