...
|
...
|
@@ -2,7 +2,7 @@ |
|
|
* @Author: Targaryen
|
|
|
* @Date: 2017-03-23 11:02:31
|
|
|
* @Last Modified by: Targaryen
|
|
|
* @Last Modified time: 2017-03-24 11:08:38
|
|
|
* @Last Modified time: 2017-03-24 11:18:28
|
|
|
*/
|
|
|
/* 红人店铺数据处理 */
|
|
|
|
...
|
...
|
@@ -11,6 +11,21 @@ const _ = require('lodash'); |
|
|
let countCarouselImage = 0; // 轮播图模块统计
|
|
|
|
|
|
/**
|
|
|
* 图片处理
|
|
|
* @param {*} moduleData
|
|
|
*/
|
|
|
const _picsHandle = (moduleData) => {
|
|
|
let pics = [];
|
|
|
|
|
|
_.forEach(_.get(moduleData, 'data', []), value => {
|
|
|
pics.push({
|
|
|
src: value.pic
|
|
|
});
|
|
|
});
|
|
|
return pics;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 红人店铺楼层数据处理工具
|
|
|
*/
|
|
|
const _tools = {
|
...
|
...
|
@@ -45,18 +60,10 @@ const _tools = { |
|
|
* @param {*} moduleData
|
|
|
*/
|
|
|
carouselImage(moduleData) {
|
|
|
let pics = [];
|
|
|
|
|
|
_.forEach(_.get(moduleData, 'data', []), value => {
|
|
|
pics.push({
|
|
|
src: value.pic
|
|
|
});
|
|
|
});
|
|
|
|
|
|
return {
|
|
|
module_type: 'CarouselImage',
|
|
|
num: countCarouselImage,
|
|
|
pics: pics
|
|
|
pics: _picsHandle(moduleData)
|
|
|
};
|
|
|
},
|
|
|
|
...
|
...
|
@@ -81,22 +88,24 @@ const _tools = { |
|
|
* @param {*} moduleData
|
|
|
*/
|
|
|
doubleImage(moduleData) {
|
|
|
let pics = [];
|
|
|
|
|
|
_.forEach(_.get(moduleData, 'data', []), value => {
|
|
|
pics.push({
|
|
|
src: value.pic
|
|
|
});
|
|
|
});
|
|
|
|
|
|
return {
|
|
|
module_type: 'DoubleImage',
|
|
|
pics: pics,
|
|
|
pics: _picsHandle(moduleData),
|
|
|
isModuleMargin: _.get(moduleData, 'properties.isModuleMargin', false),
|
|
|
};
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 三张图片
|
|
|
* @param {*} moduleData
|
|
|
*/
|
|
|
tripleImage(moduleData) {
|
|
|
return moduleData;
|
|
|
return {
|
|
|
module_type: 'TripleImage',
|
|
|
pics: _picsHandle(moduleData),
|
|
|
isModuleMargin: _.get(moduleData, 'properties.isModuleMargin', false),
|
|
|
displayType: _.get(moduleData, 'properties.displayType', 1),
|
|
|
};
|
|
|
},
|
|
|
sknList(moduleData) {
|
|
|
return moduleData;
|
...
|
...
|
|