...
|
...
|
@@ -365,7 +365,45 @@ const _formShopData = (data, shopId, isApp) => { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 新店铺首页
|
|
|
* 使用基础模板的店铺首页
|
|
|
* @param params
|
|
|
* @returns {*|Promise.<TResult>}
|
|
|
*/
|
|
|
const getBaseShopData = (params) => {
|
|
|
let finalResult = {
|
|
|
cartUrl: helpers.urlFormat('/cart/index/index')
|
|
|
};
|
|
|
|
|
|
return api.all([
|
|
|
_getShopDecorator(params.shop_id),
|
|
|
getShopBrands(params.shop_id)
|
|
|
]).then(result => {
|
|
|
result[0] = result[0] || {};
|
|
|
|
|
|
_.forEach(result[0].list, item => {
|
|
|
if (item.resourceName === 'shopTopBanner_base') {
|
|
|
let banner = JSON.parse(item.resourceData);
|
|
|
|
|
|
finalResult = _.assign(finalResult, {
|
|
|
shopBanner: {
|
|
|
banner: banner[0].shopSrc
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (params.multBrandShopType === '2') {
|
|
|
// 转义店铺
|
|
|
finalResult.shop_id = params.shop_id;
|
|
|
} else {
|
|
|
finalResult.brand = result[1];
|
|
|
}
|
|
|
return finalResult;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 使用经典模板的店铺首页
|
|
|
* @param {object} req
|
|
|
* @param {int} shopId 店铺id
|
|
|
* @param {int} uid 用户id
|
...
|
...
|
@@ -397,7 +435,7 @@ const getShopData = (req, shopId, uid, isApp) => { |
|
|
};
|
|
|
|
|
|
// 店铺使用基础模板,返回品牌页面
|
|
|
if (shopData.shopInfo.shopTemplateType && shopData.shopInfo.shopTemplateType === '1') {
|
|
|
if (shopData.shopInfo.shopTemplateType && parseInt(shopData.shopInfo.shopTemplateType, 10) === 1) {
|
|
|
return {
|
|
|
goBrand: shopData.shopInfo
|
|
|
};
|
...
|
...
|
@@ -607,6 +645,7 @@ const getShopBrands = (shopId) => { |
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
getBaseShopData,
|
|
|
getShopData,
|
|
|
getBrandLogoByDomain,
|
|
|
getBrandIntro,
|
...
|
...
|
|