Authored by 郭成尧

double-images-goods-handle

<div class="item">
{{#if link}}
<a href="{{link}}">
<img class="item-pic" src="{{#ifand isGood triple}}{{image2 src w=235 h=314}}{{^}}{{image2 src}}{{/ifand}}" alt="">
</a>
{{^}}
<img class="item-pic" src="{{#ifand isGood triple}}{{image2 src w=235 h=314}}{{^}}{{image2 src}}{{/ifand}}" alt="">
{{/if}}
<a href="{{link}}">
{{#if isGood}}
{{#if triple}}
<img class="item-pic" src="{{image2 src w=235 h=314}}" alt="">
{{/if}}
{{#if double}}
<img class="item-pic" src="{{image2 src w=235 h=235}}" alt="">
{{/if}}
{{^}}
<img class="item-pic" src="{{image2 src}}" alt="">
{{/if}}
</a>
{{#if showProductInfo}}
<div class="item-info">
<div class="text">{{text}}</div>
<div class="name">{{name}}</div>
<div class="price">{{salesPrice}}</div>
</div>
{{/if}}
{{#ifor isGood four}}
{{#if showProductInfo}}
<div class="item-info">
<div class="text">{{text}}</div>
<div class="name">{{name}}</div>
<div class="price">{{salesPrice}}</div>
</div>
{{/if}}
{{/ifor}}
</div>
... ...
... ... @@ -61,7 +61,7 @@
{{#isEqual module_type 'DoubleImage'}}
<div class="items-s2 clearfix">
{{#each ../pics}}
{{> reds-shop/item}}
{{> reds-shop/item double=true}}
{{/each}}
</div>
{{#if ../isModuleMargin}}
... ... @@ -81,7 +81,7 @@
{{#isEqual module_type 'FourImage'}}
<div class="items-s4 clearfix">
{{#each ../pics}}
{{> reds-shop/item}}
{{> reds-shop/item four=true}}
{{/each}}
</div>
{{#if ../isModuleMargin}}
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-23 17:12:53
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-18 16:04:40
* @Last Modified time: 2017-04-20 10:19:41
*/
// 红人店铺首页
... ... @@ -92,6 +92,7 @@
width: 50%;
height: 375px;
float: left;
overflow: hidden;
}
.item-info {
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-23 11:02:31
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-18 16:28:28
* @Last Modified time: 2017-04-20 10:58:29
*/
/* 红人店铺数据处理 */
... ... @@ -326,7 +326,9 @@ const pushGoodsInfo = (decorators, goodsList) => {
_.forEach(decorators, (value, key) => {
_.forEach(_.get(value, 'pics', []), (subValue, subKey) => {
if (subValue.skn) {
let hasGoods = _.get(goodsObj, `${subValue.skn}.default_images`, false);
if (subValue.skn && hasGoods) {
let salesPrice = _.get(goodsObj, `${subValue.skn}.sales_price`, '');
let marketPrice = _.get(goodsObj, `${subValue.skn}.market_price`, '');
let imageSrc = _.get(goodsObj, `${subValue.skn}.default_images`, '');
... ... @@ -336,7 +338,7 @@ const pushGoodsInfo = (decorators, goodsList) => {
decorators[key].pics[subKey].marketPrice = marketPrice ? '¥' + marketPrice : '';
decorators[key].pics[subKey].isGood = true;
if (value.module_type === 'TripleImage') {
if (value.module_type === 'TripleImage' || value.module_type === 'DoubleImage') {
decorators[key].pics[subKey].src = imageSrc;
} else {
decorators[key].pics[subKey].src = imageSrc.split('?')[0];
... ...