...
|
...
|
@@ -33,6 +33,19 @@ const _getProductBySkns = function(productObj) { |
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取店铺组店铺数据
|
|
|
*/
|
|
|
const _getShopGroup = (shopRawData) => {
|
|
|
return api.get('', {
|
|
|
method: 'app.shops.batchGetShops',
|
|
|
shop_ids: shopRawData.defaultShopIds,
|
|
|
order: 'pools_id_asc' // pools_id_desc
|
|
|
}).then(result => {
|
|
|
shopRawData.renderData = _.get(result, 'data', []);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
index: function(params) {
|
|
|
return Promise.coroutine(function*() {
|
...
|
...
|
@@ -42,6 +55,7 @@ module.exports = { |
|
|
|
|
|
let data,
|
|
|
sknsArr = [];
|
|
|
let shopGroups = [];
|
|
|
|
|
|
if (params.type === 'preview') { // 开发/预览模式
|
|
|
data = yield api.get('', {
|
...
|
...
|
@@ -75,6 +89,10 @@ module.exports = { |
|
|
}, f.component[0].searchCondition || {});
|
|
|
}
|
|
|
|
|
|
if (_.get(f, 'component[0].type') === 'shopGroup') {
|
|
|
shopGroups.push(_getShopGroup(f.component[0]));
|
|
|
}
|
|
|
|
|
|
_.forEach(f.component, function(component) {
|
|
|
if (component.persenal_enable === '1') {
|
|
|
f.hide = true; // 个性化券楼层先不展示,前端异步查询到的时候,再展示
|
...
|
...
|
@@ -87,6 +105,10 @@ module.exports = { |
|
|
yield Promise.all(sknsArr);
|
|
|
}
|
|
|
|
|
|
if (shopGroups.length) {
|
|
|
yield Promise.all(shopGroups);
|
|
|
}
|
|
|
|
|
|
return data;
|
|
|
})();
|
|
|
}
|
...
|
...
|
|