Authored by 郭成尧

shop-union

... ... @@ -226,90 +226,99 @@ const shop = {
}
/* 基础店铺返回程序内的跳转信号,跳转到基础店铺 */
if (shopInfoResult && shopInfoResult.shop_template_type &&
parseInt(shopInfoResult.shop_template_type, 10) === 1) {
return Promise.all([
listModel.getBaseShopData(req.query, shopInfo),
searchModel.getSearchData(searchParam)
]).then(fResult => {
let baseShop = fResult[0];
let newGoods = fResult[1];
baseShop.newGoods = newGoods.list;
if (baseShop && baseShop.baseShopHome && baseShop.baseShopHome.banner) {
if (baseShop.baseShopHome.banner.indexOf('?') < 0) {
baseShop.baseShopHome.banner += '?imageMogr2/auto-orient/strip/thumbnail/x150/crop/640x150';
if (shopInfoResult && shopInfoResult.shop_template_type) {
if (parseInt(shopInfoResult.shop_template_type, 10) === 1) {
return Promise.all([
listModel.getBaseShopData(req.query, shopInfo),
searchModel.getSearchData(searchParam)
]).then(fResult => {
let baseShop = fResult[0];
let newGoods = fResult[1];
baseShop.newGoods = newGoods.list;
if (baseShop && baseShop.baseShopHome && baseShop.baseShopHome.banner) {
if (baseShop.baseShopHome.banner.indexOf('?') < 0) {
baseShop.baseShopHome.banner +=
'?imageMogr2/auto-orient/strip/thumbnail/x150/crop/640x150';
}
}
}
let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"1","shop_id":"' +
shopId + '","shop_name":"' + baseShop.shopName + '"}}';
let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"1","shop_id":"' +
shopId + '","shop_name":"' + baseShop.shopName + '"}}';
if (shopInfoResult.is_red_shop === 1) {
appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"1","is_red_shop":"1","shop_id":"' +
shopId + '","shop_name":"' + baseShop.shopName + '"}}';
}
if (shopInfoResult.is_red_shop === 1) {
appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"1","is_red_shop":"1","shop_id":"' +
shopId + '","shop_name":"' + baseShop.shopName + '"}}';
}
res.render('newshop/shop-base', {
module: 'product',
page: 'shop.base',
pageHeader: headerModel.setNav({
navTitle: shopInfo.shop_name
}),
goodList: baseShop,
showDownloadApp: true,
pageFooter: true,
title: shopInfo.shop_name + '|' + shopInfo.shop_name + '潮流服装服饰-Yoho!Buy有货',
keywords: shopInfo.shop_name + ',' + shopInfo.shop_name + '服装服饰,' +
shopInfo.shop_name + '潮流服装服饰',
description: shopInfo.shop_name + '|Yoho!Buy有货' + shopInfo.shop_name +
'潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',
shopId: shopId,
shopPage: true,
_noLazy: true,
appPath: appPath,
localCss: true
});
});
} else {
// 经典装修店铺
return Promise.all([
listModel.getShopDecorator(shopId).then(),
listModel.getShopCategoryApi(shopId, channel)
]).then(fResult => {
let shopDeco = fResult[0];
let shopCategory = fResult[1];
let shopData = {
decorator: shopDeco, // 店铺装修资源数据
shopInfo: shopInfo, // 店铺信息
shopCategory: shopCategory
};
let result = listModel.formShopData(shopData, shopId, isApp);
result = _.assign(result, pageHeader,
{shopId: shopId, coverChannel: channel, seoResult: seoResult});
res.render('newshop/shop-classics', {
module: 'product',
page: 'shop.classics',
shopIndex: result,
shopHeadHide: true,
gender: req.query.gender,
channel: req.query.channel,
title: result.seoTitle + '|' + result.seoTitle + '潮流服装服饰-Yoho!Buy有货',
keywords: result.seoTitle + ',' + result.seoTitle + '服装服饰,' + result.seoTitle + '潮流服装服饰',
description: result.seoTitle + '|Yoho!Buy有货' + result.seoTitle + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',
shopId: shopId,
shopPage: true,
appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"2","shop_id":"' +
shopId + '","shop_name":"' + result.seoTitle + '"}}',
localCss: true
res.render('newshop/shop-base', {
module: 'product',
page: 'shop.base',
pageHeader: headerModel.setNav({
navTitle: shopInfo.shop_name
}),
goodList: baseShop,
showDownloadApp: true,
pageFooter: true,
title: shopInfo.shop_name + '|' + shopInfo.shop_name + '潮流服装服饰-Yoho!Buy有货',
keywords: shopInfo.shop_name + ',' + shopInfo.shop_name + '服装服饰,' +
shopInfo.shop_name + '潮流服装服饰',
description: shopInfo.shop_name + '|Yoho!Buy有货' + shopInfo.shop_name +
'潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',
shopId: shopId,
shopPage: true,
_noLazy: true,
appPath: appPath,
localCss: true
});
});
});
} else if (parseInt(shopInfoResult.shop_template_type, 10) === 2) {
// 经典装修店铺
return Promise.all([
listModel.getShopDecorator(shopId).then(),
listModel.getShopCategoryApi(shopId, channel)
]).then(fResult => {
let shopDeco = fResult[0];
let shopCategory = fResult[1];
let shopData = {
decorator: shopDeco, // 店铺装修资源数据
shopInfo: shopInfo, // 店铺信息
shopCategory: shopCategory
};
let result = listModel.formShopData(shopData, shopId, isApp);
result = _.assign(result, pageHeader,
{shopId: shopId, coverChannel: channel, seoResult: seoResult});
res.render('newshop/shop-classics', {
module: 'product',
page: 'shop.classics',
shopIndex: result,
shopHeadHide: true,
gender: req.query.gender,
channel: req.query.channel,
title: result.seoTitle + '|' + result.seoTitle + '潮流服装服饰-Yoho!Buy有货',
keywords: result.seoTitle + ',' + result.seoTitle + '服装服饰,' + result.seoTitle + '潮流服装服饰',
description: result.seoTitle + '|Yoho!Buy有货' + result.seoTitle +
'潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',
shopId: shopId,
shopPage: true,
appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"2","shop_id":"' +
shopId + '","shop_name":"' + result.seoTitle + '"}}',
localCss: true
});
});
} else {
shop.redShop(req, res, next);
}
} else {
shop.redShop(req, res, next);
}
}).catch(next);
},
... ...