...
|
...
|
@@ -191,10 +191,10 @@ const shop = { |
|
|
}
|
|
|
|
|
|
let brandId = _.get(brands, '[0].brand_id', 0);
|
|
|
let brandName = _.get(brands, '[0].brand_name', 0);
|
|
|
let brandName = encodeURIComponent(_.get(brands, '[0].brand_name', ''));
|
|
|
|
|
|
// param:品牌ID, name:品牌名称, miniQrType 1:商品 2 品牌,miniapp_type 0:有货,1:新与力
|
|
|
let miniPath = `${global.yoho.config.domains.api}wechat/miniapp/img-check.jpg?miniapp_type=0¶m=${brandId}&name=${brandName}&miniQrType=2`; // eslint-disable-line
|
|
|
let miniPath = `${global.yoho.config.domains.api}wechat/miniapp/img-check.jpg?miniapp_type=0¶m=${brandId}&name=${brandName}&miniQrType=2`.replace(/http:|https:/, ''); // eslint-disable-line
|
|
|
return {miniPath};
|
|
|
},
|
|
|
|
...
|
...
|
@@ -222,7 +222,6 @@ const shop = { |
|
|
let title = brandInfo.title;
|
|
|
let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', []));
|
|
|
|
|
|
|
|
|
res.render('newshop/shop-brand', _.assign({
|
|
|
module: 'product',
|
|
|
page: 'shop-brand',
|
...
|
...
|
@@ -236,7 +235,8 @@ const shop = { |
|
|
shopPage: true,
|
|
|
_noLazy: true,
|
|
|
localCss: true
|
|
|
}, _tdkProcess(title)));
|
|
|
}, _tdkProcess(title),
|
|
|
shop._getMiniAppPath([{brand_id: brandId, brand_name: brandInfo.title}])));
|
|
|
})().catch(next);
|
|
|
},
|
|
|
|
...
|
...
|
@@ -254,12 +254,13 @@ const shop = { |
|
|
}
|
|
|
|
|
|
co(function* () {
|
|
|
let [bannerData, favCountData, decoratorsData, categoryData, couponData] = yield Promise.all([
|
|
|
let [bannerData, favCountData, decoratorsData, categoryData, couponData, shopBrands] = yield Promise.all([
|
|
|
req.ctx(shopModel).getBanner(shopId),
|
|
|
req.ctx(shopModel).favCount(shopId, uid, channel, udid),
|
|
|
req.ctx(shopModel).getShopsdecorator(shopId),
|
|
|
req.ctx(shopModel).getShopCategory(shopId, channel),
|
|
|
req.ctx(couponModel).shopCouponsList({shop_id: shopId})
|
|
|
req.ctx(couponModel).shopCouponsList({shop_id: shopId}),
|
|
|
req.ctx(shopModel).getShopBrands(shopId)
|
|
|
]);
|
|
|
|
|
|
let banner = _.get(bannerData, 'data.banner');
|
...
|
...
|
@@ -314,9 +315,14 @@ const shop = { |
|
|
// 店铺收藏开关
|
|
|
let shppFavHide = _.get(req.app.locals.wap, 'shop.removeCollect', false);
|
|
|
|
|
|
res.render('newshop/shop-reds', _.assign(finalResult, {
|
|
|
shppFavHide: shppFavHide
|
|
|
}, _tdkProcess(shopInfo.shop_name)));
|
|
|
res.render('newshop/shop-reds', _.assign(
|
|
|
finalResult,
|
|
|
{
|
|
|
shppFavHide: shppFavHide
|
|
|
},
|
|
|
_tdkProcess(shopInfo.shop_name),
|
|
|
shop._getMiniAppPath(shopBrands)
|
|
|
));
|
|
|
})().catch(next);
|
|
|
},
|
|
|
|
...
|
...
|
@@ -337,9 +343,10 @@ const shop = { |
|
|
page: 1
|
|
|
};
|
|
|
|
|
|
let [goodsListApi, couponData] = yield Promise.all([
|
|
|
let [goodsListApi, couponData, shopBrands] = yield Promise.all([
|
|
|
req.ctx(searchModel).getShopGoods(searchParam),
|
|
|
req.ctx(couponModel).shopCouponsList({shop_id: shopId})
|
|
|
req.ctx(couponModel).shopCouponsList({shop_id: shopId}),
|
|
|
req.ctx(shopModel).getShopBrands(shopId)
|
|
|
]);
|
|
|
|
|
|
let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', []));
|
...
|
...
|
@@ -356,23 +363,27 @@ const shop = { |
|
|
let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"1","shop_id":"' +
|
|
|
shopId + '","shop_name":"' + shopInfo.shop_name + '"}}';
|
|
|
|
|
|
res.render('newshop/shop-list', _.assign({
|
|
|
module: 'product',
|
|
|
page: 'shop-list',
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: title
|
|
|
}),
|
|
|
showDownloadApp: true,
|
|
|
pageFooter: true,
|
|
|
shopId: shopId,
|
|
|
shopInfo: shopInfo,
|
|
|
goodsList: goodsList,
|
|
|
appPath: appPath,
|
|
|
shopPage: true,
|
|
|
_noLazy: true,
|
|
|
localCss: true,
|
|
|
couponData
|
|
|
}, _tdkProcess(title)));
|
|
|
res.render('newshop/shop-list', _.assign(
|
|
|
{
|
|
|
module: 'product',
|
|
|
page: 'shop-list',
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: title
|
|
|
}),
|
|
|
showDownloadApp: true,
|
|
|
pageFooter: true,
|
|
|
shopId: shopId,
|
|
|
shopInfo: shopInfo,
|
|
|
goodsList: goodsList,
|
|
|
appPath: appPath,
|
|
|
shopPage: true,
|
|
|
_noLazy: true,
|
|
|
localCss: true,
|
|
|
couponData
|
|
|
},
|
|
|
_tdkProcess(title),
|
|
|
shop._getMiniAppPath(shopBrands)
|
|
|
));
|
|
|
|
|
|
})().catch(next);
|
|
|
},
|
...
|
...
|
|