Authored by 郭成尧

doubleImage

... ... @@ -81,6 +81,22 @@
</div>
</div>
{{/isEqual}}
{{#isEqual module_type 'SingleImage'}}
<div class="items-s1">
<div class="item">
<img class="item-pic" src="{{../pic}}" alt="">
</div>
</div>
{{/isEqual}}
{{#isEqual module_type 'DoubleImage'}}
<div class="items-s2">
{{#each ../pics}}
<div class="item">
<img class="item-pic" src="{{src}}" alt="">
</div>
{{/each}}
</div>
{{/isEqual}}
{{/each}}
</div>
{{!--shop-tab: 全部商品--}}
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-23 17:12:53
* @Last Modified by: Targaryen
* @Last Modified time: 2017-03-24 10:37:26
* @Last Modified time: 2017-03-24 11:07:28
*/
// 红人店铺首页
... ... @@ -84,7 +84,7 @@
}
}
.shop-hot {
.red-shop-index {
.item {
position: relative;
}
... ... @@ -121,7 +121,9 @@
position: relative;
.item {
width: 50%;
height: 234px;
float: left;
}
.item-info {
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-23 11:02:31
* @Last Modified by: Targaryen
* @Last Modified time: 2017-03-24 10:32:59
* @Last Modified time: 2017-03-24 11:08:38
*/
/* 红人店铺数据处理 */
... ... @@ -23,7 +23,7 @@ const _tools = {
return {
module_type: 'Title',
text: _.get(moduleData, 'data[0].text', ''),
margin: _.get(moduleData, 'properties.isModuleMargin', false)
isModuleMargin: _.get(moduleData, 'properties.isModuleMargin', false)
};
},
... ... @@ -39,6 +39,11 @@ const _tools = {
pic: _.get(moduleData, 'data[0].pic', ''),
};
},
/**
* 轮播图
* @param {*} moduleData
*/
carouselImage(moduleData) {
let pics = [];
... ... @@ -54,11 +59,41 @@ const _tools = {
pics: pics
};
},
/**
* 一张图片
* @param {*} moduleData
*/
singleImage(moduleData) {
return moduleData;
return {
module_type: 'SingleImage',
pic: _.get(moduleData, 'data[0].pic', ''),
text: _.get(moduleData, 'data[0].text', ''),
width: _.get(moduleData, 'properties.width', ''),
height: _.get(moduleData, 'data[0].text', ''),
moduleHeight: _.get(moduleData, 'properties.moduleHeight', ''),
isModuleMargin: _.get(moduleData, 'properties.isModuleMargin', false),
};
},
/**
* 两张图片
* @param {*} moduleData
*/
doubleImage(moduleData) {
return moduleData;
let pics = [];
_.forEach(_.get(moduleData, 'data', []), value => {
pics.push({
src: value.pic
});
});
return {
module_type: 'DoubleImage',
pics: pics,
isModuleMargin: _.get(moduleData, 'properties.isModuleMargin', false),
};
},
tripleImage(moduleData) {
return moduleData;
... ...