...
|
...
|
@@ -14,7 +14,7 @@ const _ = require('lodash'); |
|
|
const helpers = global.yoho.helpers;
|
|
|
const productProcess = require(`${utils}/product-process`);
|
|
|
const redShopPrcs = require(`${utils}/redshop-process`);
|
|
|
|
|
|
const co = require('bluebird').coroutine;
|
|
|
|
|
|
/**
|
|
|
* 从 useragent 获取 uid
|
...
|
...
|
@@ -388,17 +388,16 @@ const shop = { |
|
|
redShop(req, res, next) {
|
|
|
let shopId = req.query.shop_id || 792; // test3
|
|
|
|
|
|
Promise.all([
|
|
|
redsShopModel.getBanner(shopId), // 0: 获取红人店 banner
|
|
|
redsShopModel.getShopsBrands(shopId), // 1: 获取店铺品牌数据
|
|
|
redsShopModel.getIntro(shopId), // 2. 获取店铺介绍
|
|
|
redsShopModel.getShopsdecorator(shopId) // 3. 获取店铺装修元素
|
|
|
]).then(valArr => {
|
|
|
let banner = _.get(valArr[0], 'data.banner');
|
|
|
co(function* () {
|
|
|
let bannerData = yield redsShopModel.getBanner(shopId);
|
|
|
let brandData = yield redsShopModel.getShopsBrands(shopId);
|
|
|
let shopIntroData = yield redsShopModel.getIntro(shopId);
|
|
|
let decoratorsData = yield redsShopModel.getShopsdecorator(shopId);
|
|
|
|
|
|
let brand = _.get(valArr[1], 'data[0]', {});
|
|
|
let shopIntro = redShopPrcs.shopIntro(_.get(valArr[2], 'data', {}));
|
|
|
let decoratorsData = redShopPrcs.floor(_.get(valArr[3], 'data.modules', []));
|
|
|
let banner = _.get(bannerData, 'data.banner');
|
|
|
let brand = _.get(brandData, 'data[0]', {});
|
|
|
let shopIntro = redShopPrcs.shopIntro(_.get(shopIntroData, 'data', {}));
|
|
|
let decorators = redShopPrcs.floor(_.get(decoratorsData, 'data.modules', []));
|
|
|
|
|
|
res.render('newshop/shop-reds', {
|
|
|
pageHeader: headerModel.setNav({
|
...
|
...
|
@@ -409,11 +408,9 @@ const shop = { |
|
|
module: 'product',
|
|
|
page: 'reds-shop',
|
|
|
shopId,
|
|
|
banner, brand, shopIntro, decoratorsData,
|
|
|
time3: [0, 1, 2]
|
|
|
banner, brand, shopIntro, decorators
|
|
|
});
|
|
|
}).catch(next);
|
|
|
|
|
|
})().catch(next);
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
|