Merge branch 'feature/redshop' into release/5.7.1
Showing
3 changed files
with
15 additions
and
8 deletions
@@ -18,12 +18,12 @@ | @@ -18,12 +18,12 @@ | ||
18 | </a> | 18 | </a> |
19 | 19 | ||
20 | {{#ifor isGood four}} | 20 | {{#ifor isGood four}} |
21 | - {{#if showProductInfo}} | 21 | + {{#unless parent.noShowProductInfo}} |
22 | <div class="item-info"> | 22 | <div class="item-info"> |
23 | <div class="text">{{text}}</div> | 23 | <div class="text">{{text}}</div> |
24 | <div class="name">{{name}}</div> | 24 | <div class="name">{{name}}</div> |
25 | <div class="price">{{salesPrice}}</div> | 25 | <div class="price">{{salesPrice}}</div> |
26 | </div> | 26 | </div> |
27 | - {{/if}} | 27 | + {{/unless}} |
28 | {{/ifor}} | 28 | {{/ifor}} |
29 | </div> | 29 | </div> |
@@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
51 | {{#isEqual module_type 'SingleImage'}} | 51 | {{#isEqual module_type 'SingleImage'}} |
52 | <div class="items-s1 clearfix"> | 52 | <div class="items-s1 clearfix"> |
53 | {{#each ../pics}} | 53 | {{#each ../pics}} |
54 | - {{> reds-shop/item index=@../index single=true}} | 54 | + {{> reds-shop/item index=@../index single=true parent=../..}} |
55 | {{/each}} | 55 | {{/each}} |
56 | </div> | 56 | </div> |
57 | {{#if ../isModuleMargin}} | 57 | {{#if ../isModuleMargin}} |
@@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
61 | {{#isEqual module_type 'DoubleImage'}} | 61 | {{#isEqual module_type 'DoubleImage'}} |
62 | <div class="items-s2 clearfix"> | 62 | <div class="items-s2 clearfix"> |
63 | {{#each ../pics}} | 63 | {{#each ../pics}} |
64 | - {{> reds-shop/item index=@../index double=true}} | 64 | + {{> reds-shop/item index=@../index double=true parent=../..}} |
65 | {{/each}} | 65 | {{/each}} |
66 | </div> | 66 | </div> |
67 | {{#if ../isModuleMargin}} | 67 | {{#if ../isModuleMargin}} |
@@ -71,7 +71,7 @@ | @@ -71,7 +71,7 @@ | ||
71 | {{#isEqual module_type 'TripleImage'}} | 71 | {{#isEqual module_type 'TripleImage'}} |
72 | <div class="{{#isEqual ../displayType 1}}items-3-3{{/isEqual}}{{#isEqual ../displayType 2}}items-3-3 items-small{{/isEqual}}{{#isEqual ../displayType 3}}items-3-2 items-3-2-right{{/isEqual}}{{#isEqual ../displayType 4}}items-3-2 items-3-2-left{{/isEqual}} clearfix"> | 72 | <div class="{{#isEqual ../displayType 1}}items-3-3{{/isEqual}}{{#isEqual ../displayType 2}}items-3-3 items-small{{/isEqual}}{{#isEqual ../displayType 3}}items-3-2 items-3-2-right{{/isEqual}}{{#isEqual ../displayType 4}}items-3-2 items-3-2-left{{/isEqual}} clearfix"> |
73 | {{#each ../pics}} | 73 | {{#each ../pics}} |
74 | - {{> reds-shop/item index=@../index triple=true}} | 74 | + {{> reds-shop/item index=@../index triple=true parent=../..}} |
75 | {{/each}} | 75 | {{/each}} |
76 | </div> | 76 | </div> |
77 | {{#if ../isModuleMargin}} | 77 | {{#if ../isModuleMargin}} |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | * @Author: Targaryen | 2 | * @Author: Targaryen |
3 | * @Date: 2017-03-23 11:02:31 | 3 | * @Date: 2017-03-23 11:02:31 |
4 | * @Last Modified by: Targaryen | 4 | * @Last Modified by: Targaryen |
5 | - * @Last Modified time: 2017-05-02 11:09:37 | 5 | + * @Last Modified time: 2017-05-23 15:33:28 |
6 | */ | 6 | */ |
7 | /* 红人店铺数据处理 */ | 7 | /* 红人店铺数据处理 */ |
8 | 8 | ||
@@ -34,7 +34,8 @@ const _linkhandle = (linkParent) => { | @@ -34,7 +34,8 @@ const _linkhandle = (linkParent) => { | ||
34 | switch (parseInt(linkParent.linkType, 10)) { | 34 | switch (parseInt(linkParent.linkType, 10)) { |
35 | case 0: | 35 | case 0: |
36 | return helpers.urlFormat('', { | 36 | return helpers.urlFormat('', { |
37 | - filter_poolId: linkParent.resource | 37 | + filter_poolId: linkParent.resource, |
38 | + title: linkParent.text | ||
38 | }, 'list'); | 39 | }, 'list'); |
39 | case 1: | 40 | case 1: |
40 | return helpers.urlFormat('/product/' + linkParent.resource + '.html'); | 41 | return helpers.urlFormat('/product/' + linkParent.resource + '.html'); |
@@ -325,12 +326,18 @@ const pushGoodsInfo = (decorators, goodsList) => { | @@ -325,12 +326,18 @@ const pushGoodsInfo = (decorators, goodsList) => { | ||
325 | _.forEach(_.get(value, 'pics', []), (subValue, subKey) => { | 326 | _.forEach(_.get(value, 'pics', []), (subValue, subKey) => { |
326 | let hasGoods = _.get(goodsObj, `${subValue.skn}.default_images`, false); | 327 | let hasGoods = _.get(goodsObj, `${subValue.skn}.default_images`, false); |
327 | 328 | ||
329 | + if (!hasGoods) { | ||
330 | + decorators[key].noShowProductInfo = true; | ||
331 | + } | ||
332 | + | ||
328 | if (subValue.skn && hasGoods) { | 333 | if (subValue.skn && hasGoods) { |
329 | let salesPrice = _.get(goodsObj, `${subValue.skn}.sales_price`, ''); | 334 | let salesPrice = _.get(goodsObj, `${subValue.skn}.sales_price`, ''); |
330 | let marketPrice = _.get(goodsObj, `${subValue.skn}.market_price`, ''); | 335 | let marketPrice = _.get(goodsObj, `${subValue.skn}.market_price`, ''); |
331 | let imageSrc = _.get(goodsObj, `${subValue.skn}.default_images`, ''); | 336 | let imageSrc = _.get(goodsObj, `${subValue.skn}.default_images`, ''); |
332 | 337 | ||
333 | - decorators[key].pics[subKey].showProductInfo = salesPrice !== 0; | 338 | + if (salesPrice === 0) { |
339 | + decorators[key].noShowProductInfo = true; | ||
340 | + } | ||
334 | decorators[key].pics[subKey].name = _.get(goodsObj, `${subValue.skn}.product_name`, ''); | 341 | decorators[key].pics[subKey].name = _.get(goodsObj, `${subValue.skn}.product_name`, ''); |
335 | decorators[key].pics[subKey].salesPrice = salesPrice ? '¥' + salesPrice : ''; | 342 | decorators[key].pics[subKey].salesPrice = salesPrice ? '¥' + salesPrice : ''; |
336 | decorators[key].pics[subKey].marketPrice = marketPrice ? '¥' + marketPrice : ''; | 343 | decorators[key].pics[subKey].marketPrice = marketPrice ? '¥' + marketPrice : ''; |
-
Please register or login to post a comment