Authored by htoooth

fix

... ... @@ -866,7 +866,11 @@ const _getMaterialDataBySizeInfo = (sizeInfo) => {
name: value.caption,
enName: value.encaption,
text: value.remark
}))
})),
washTips: {
tip: _.get(sizeInfo, 'washRemindTipsBo.remindTips', ''),
img: _.get(sizeInfo, 'washRemindTipsBo.img', '')
}
};
};
... ... @@ -1425,33 +1429,32 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => {
result.productUrl = statGoodsInfo.productUrl;
// 商品的品牌信息
let bandInfo = {};
if (propOrigin('brand_info', '')) {
result.brandImg = helpers.image(propOrigin('brand_info.brand_ico', ''), 47, 47);
result.brandName = propOrigin('brand_info.brand_name', '');
bandInfo = _getBrandDataByProductBaseInfo(origin, additionalData);
bandInfo.isCollect = favoriteData.brand;
// 商品的店铺信息
let shopInfo = {
brandId: result.brandId,
bgColor: '#000000',
logo: '',
alt: '',
brandName: '',
brandDomain: '',
homeUrl: '',
bgImg: '',
isCollect: favoriteData.brand
};
if (result.shopId) {
let shopData = yield Promise.props({
bannerImg: shopService.getShopBannerAsync(result.shopId),
isShopOpen: shopService.queryShopByBrandIdAsync(result.brandId)
});
if (result.shopId) {
let shopData = yield Promise.props({
bannerImg: shopService.getShopBannerAsync(result.shopId),
shopInfo: shopService.queryShopByBrandIdAsync(result.shopId, result.brandId)
});
if (shopData.bannerImg) {
bandInfo.bgImg = shopData.bannerImg;
}
shopInfo.alt = shopInfo.brandName = shopData.shopInfo.brand_name;
shopInfo.brandDomain = shopData.shopInfo.brand_domain;
shopInfo.logo = helpers.image(shopData.shopInfo.brand_ico, 45, 45);
shopInfo.homeUrl = helpers.urlFormat('', {shopId: result.shopId}, shopInfo.brandDomain);
if (shopData.isShopOpen) {
bandInfo.homeUrl = helpers.urlFormat('',
{shopId: result.shopId},
propOrigin('brand_info.brand_domain')
);
} else {
result.shopId = '0';
}
if (shopData.bannerImg) {
shopInfo.bgImg = shopData.bannerImg;
}
}
... ... @@ -1462,7 +1465,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => {
return {
goodsInfo: result,
banner: _.isEmpty(bandInfo) ? null : bandInfo,
banner: _.isEmpty(shopInfo) ? null : shopInfo,
statGoodsInfo: statGoodsInfo
};
... ...
... ... @@ -42,9 +42,10 @@ exports.shopBannerAsync = (shopId) => {
});
};
exports.queryShopsByBrandId = (bid) => {
exports.queryShopsByBrandId = (sid, bid) => {
return api.get('', {
method: 'app.shop.queryShopsByBrandId',
brand_id: bid
method: 'app.product.queryShopsInfoById',
brand_id: bid,
shop_id: sid
});
};
... ...
... ... @@ -128,14 +128,14 @@ exports.getShopBannerAsync = (shopId) => {
});
};
exports.queryShopByBrandIdAsync = (bid) => {
exports.queryShopByBrandIdAsync = (sid, bid) => {
return co(function * () {
let result = yield api.queryShopsByBrandId(bid);
let result = yield api.queryShopsByBrandId(sid, bid);
if (_.get(result, 'code') !== 200) {
return false;
}
return _.some(_.get(result, 'data', []), i => _.has(i, 'shop_id'));
return _.get(result, 'data[0]', {});
})();
};
... ...
{{# banner}}
<div class="brand-banner" style="background:{{bgColor}}{{#if bgImg}} url({{image bgImg 1920 45}}){{/if}}">
<div class="center-content clearfix">
<a class="pull-left" href="{{homeUrl}}">
<img src="{{logo}}">
</a>
<div class="opt pull-right">
<a class="home" href="{{homeUrl}}" title="{{brandName}}">
<span class="iconfont">&#xe61a;</span>
{{#if homeUrl}}
<div class="center-content clearfix">
<a class="pull-left" href="{{homeUrl}}">
<img src="{{image logo 45 45}}">
</a>
<span id="brand-favour" class="brand-fav{{#if isCollect}} coled{{/if}}" data-id="{{brandId}}">
<i class="iconfont">&#xe641;</i>
<span class="fav-num"></span>
</span>
<div class="opt pull-right">
<a class="home" href="{{homeUrl}}" title="{{brandName}}">
<span class="iconfont">&#xe61a;</span>
</a>
<span id="brand-favour" class="brand-fav{{#if isCollect}} coled{{/if}}" data-id="{{brandId}}">
<i class="iconfont">&#xe641;</i>
<span class="fav-num"></span>
</span>
</div>
</div>
</div>
{{/if}}
</div>
{{/ banner}}
... ...
... ... @@ -29,6 +29,14 @@
{{/ wash}}
</ul>
{{/if}}
{{#if washTips.tip}}
<div class="wash-tip">
<img src="{{washTips.img}}" alt="">
<span>{{washTips.tip}}</span>
</div>
{{/if}}
{{/ material}}
</div>
</div>
... ...
... ... @@ -1849,6 +1849,9 @@ bindEvent.fire();
});
favorite.getFavNum(shopId, brandId).then(function(result) {
if (result === 0) {
return;
}
$('#brand-favour').find('span').html(result);
});
... ...
... ... @@ -838,7 +838,7 @@
position: relative;
height: 35px;
width: 96px;
&:hover {
.qrcode-box {
display: block;
... ... @@ -1229,6 +1229,25 @@
}
}
.wash-tip {
display: block;
height: 18px;
text-align: center;
margin-top: 30px;
img {
width: 16px;
height: 16px;
vertical-align: top;
}
span {
color: $theme-color;
font-size: 14px;
line-height: 18px;
height: 18px;
}
}
.size-info {
text-align: center;
}
... ...