Authored by htoooth

add shopId

... ... @@ -1126,6 +1126,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => {
result.skn = propOrigin('product_skn');
result.productId = propOrigin('product_id');
result.shopId = propOrigin('shop_id', 0);
result.brandId = propOrigin('brand_info.brand_id', '');
result.maxSortId = propOrigin('maxSortId', '');
result.smallSortId = propOrigin('smallSortId', '');
... ... @@ -1462,17 +1463,25 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => {
result.brandImg = helpers.image(propOrigin('brand_info.brand_ico', ''), 47, 47);
result.brandName = propOrigin('brand_info.brand_name', '');
bandInfo = _getBrandDataByProductBaseInfo(origin, additionalData);
bandInfo.homeUrl = helpers.urlFormat('',
result.shopId ? {shopId: result.shopId} : null,
propOrigin('brand_info.brand_domain')
);
bandInfo.isCollect = favoriteData.brand;
if (result.shopId) {
let bannerImg = yield shopService.getShopBannerAsync(result.shopId);
let shopData = yield Promise.props({
bannerImg: shopService.getShopBannerAsync(result.shopId),
isShopOpen: shopService.queryShopByBrandIdAsync(result.brandId)
});
if (shopData.bannerImg) {
bandInfo.bgImg = shopData.bannerImg;
}
if (bannerImg) {
bandInfo.bgImg = bannerImg;
if (shopData.isShopOpen) {
bandInfo.homeUrl = helpers.urlFormat('',
{shopId: result.shopId},
propOrigin('brand_info.brand_domain')
);
} else {
result.shopId = '0';
}
}
}
... ...
... ... @@ -41,3 +41,10 @@ exports.shopBannerAsync = (shopId) => {
shop_id: shopId
});
};
exports.queryShopsByBrandId = (bid) => {
return api.get('', {
method: 'app.shop.queryShopsByBrandId',
brand_id: bid
});
};
... ...
... ... @@ -126,3 +126,15 @@ exports.getShopBannerAsync = (shopId) => {
}
});
};
exports.queryShopByBrandIdAsync = (bid) => {
return co(function * () {
let result = yield api.queryShopsByBrandId(bid);
if (_.get(result, 'code') !== 200) {
return false;
}
return _.some(_.get(result, 'data', []), i => _.has(i, 'shop_id'));
})();
};
... ...
... ... @@ -17,13 +17,13 @@ module.exports = {
cookieDomain: '.yohobuy.com',
domains: {
// test3
singleApi: 'http://api-test3.yohops.com:9999/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
//singleApi: 'http://api-test3.yohops.com:9999/',
//api: 'http://api-test3.yohops.com:9999/',
//service: 'http://service-test3.yohops.com:9999/',
//singleApi: 'http://single.yohops.com/',
//api: 'http://api.yoho.cn/',
//service: 'http://service.yoho.cn/',
singleApi: 'http://single.gray.yohops.com/',
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
// api: 'http://dev-api.yohops.com:9999/',
// service: 'http://dev-service.yohops.com:9999/',
... ...
... ... @@ -1827,9 +1827,14 @@
.name {
display: block;
margin: 15px auto;
color: #222;
max-width: 150px;
height: 18px;
line-height: 16px;
margin: 5px auto;
color: #222;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.price {
... ...