Authored by 郭成尧

shop-base-frame

... ... @@ -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;
})();
}
... ...
... ... @@ -86,6 +86,16 @@
</div>
{{/isEqualOr}}
{{#isEqualOr type 'shopGroup'}}
{{#renderData}}
<div class="shop-container">
<div class="shop-box{{#isEqualOr ./displayStyle '0'}} shop-two{{^}} shop-three{{/isEqualOr}}">
<img src="{{image2 pic_popular q=95}}" alt="">
</div>
</div>
{{/renderData}}
{{/isEqualOr}}
{{#isEqualOr type 'productGroup'}}
{{! 商品池}}
<div class="product-container item{{numOfOneRow}}" {{#if proBgImg}}style="background:url({{image2 proBgImg q=95}}) repeat;background-size:100%;"{{/if}}>
... ...
... ... @@ -103,7 +103,7 @@ module.exports = {
maxQps: 1200,
maxQps10m: 2500,
geetestJs: '//static.geetest.com/static/tools/gt.js',
jsSdk: '//cdn.yoho.cn/js-sdk/1.2.2/jssdk.js',
jsSdk: '//cdn.yoho.cn/js-sdk/1.2.3/jssdk.js',
redis: {
connect: {
host: '127.0.0.1',
... ...
... ... @@ -3,3 +3,4 @@
@import "feature/anchor";
@import "feature/product";
@import "feature/swiper.min";
@import "feature/shop";
... ...
.shop-container {
width: 100%;
.shop-two {
width: 220px;
height: 200px;
}
.shop-three {
width: 193px;
height: 200px;
}
}
... ...