Authored by 郭成尧

fourimages-handle

... ... @@ -6,11 +6,10 @@
{{^}}
<img class="item-pic" src="{{src}}" alt="">
{{/if}}
{{#if showProductInfo}}
<div class="item-info">
<div class="">ABCDEFG ABCDEFG</div>
<div>
<span class="new-price">¥199.00</span>
<span class="price">¥299.00</span>
</div>
<div>{{text}}</div>
</div>
{{/if}}
</div>
... ...
... ... @@ -78,6 +78,16 @@
<div class="margin-bottom"></div>
{{/if}}
{{/isEqual}}
{{#isEqual module_type 'FourImage'}}
<div class="items-s4">
{{#each ../pics}}
{{> reds-shop/item}}
{{/each}}
</div>
{{#if ../isModuleMargin}}
<div class="margin-bottom"></div>
{{/if}}
{{/isEqual}}
{{#isEqual module_type 'SknList'}}
<div class="index-goods-container" data-skns="{{../skns}}"></div>
{{#if ../isModuleMargin}}
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-23 17:12:53
* @Last Modified by: Targaryen
* @Last Modified time: 2017-03-28 17:08:45
* @Last Modified time: 2017-03-30 11:22:56
*/
// 红人店铺首页
... ... @@ -67,7 +67,7 @@
.item {
width: 50%;
height: 234px;
height: 375px;
float: left;
}
... ... @@ -126,6 +126,24 @@
}
}
.items-s4 {
.item {
float: left;
width: 25%;
height: 227.5px;
}
.item > a > img {
height: 187.5px;
}
.item-info {
text-align: center;
color: #000;
position: relative;
}
}
.items-small {
.item {
height: 250px;
... ... @@ -169,7 +187,9 @@
.shop-swiper {
position: relative;
width: 750px;
height: 234px;
overflow: hidden;
ul {
width: 100%;
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-23 11:02:31
* @Last Modified by: Targaryen
* @Last Modified time: 2017-03-28 17:57:48
* @Last Modified time: 2017-03-30 11:29:07
*/
/* 红人店铺数据处理 */
... ... @@ -43,10 +43,19 @@ const _picsHandle = (moduleData) => {
let pics = [];
_.forEach(_.get(moduleData, 'data', []), value => {
let showProductInfo = false;
if (_.has(value, 'text') && value.text) {
if (_.has(value, 'showProductInfo')) {
showProductInfo = value.showProductInfo;
}
}
pics.push({
src: value.pic,
link: _linkhandle(value),
text: value.text
text: value.text,
showProductInfo: showProductInfo
});
});
return pics;
... ... @@ -89,7 +98,6 @@ const _tools = {
* @param {*} moduleData
*/
carouselImage(moduleData) {
console.log(moduleData);
return {
module_type: 'CarouselImage',
num: countCarouselImage,
... ... @@ -144,6 +152,18 @@ const _tools = {
},
/**
* 四张图片
* @param {*} moduleData
*/
fourImage(moduleData) {
return {
module_type: 'FourImage',
pics: _picsHandle(moduleData),
isModuleMargin: _.get(moduleData, 'properties.isModuleMargin', 0)
};
},
/**
* 商品列表
* @param {*} moduleData
*/
... ... @@ -196,6 +216,9 @@ const floor = (decoratorsData) => {
case 'TripleImage':
finalData.push(_tools.tripleImage(value.module_data));
break;
case 'FourImage':
finalData.push(_tools.fourImage(value.module_data));
break;
case 'SknList':
finalData.push(_tools.sknList(value.module_data));
break;
... ...