Authored by 周少峰

Merge branch 'feature/specialLimit'

... ... @@ -51,7 +51,7 @@ const homeNav = [
const getHomeNav = (req, res, next) => {
res.locals.homeNav = homeNav;
res.locals.userThumb = '//img10.static.yhbimg.com/headimg/2013/11/28/09/' +
res.locals.userThumb = '//img10.static.yhbimg.com/headimg/2013/11/28/09/' +
'01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100';
next();
};
... ...
... ... @@ -24,6 +24,14 @@ const sizeInfoAsync = skn => {
};
// 退换支持
const isSupportReturnedSale = skn => {
return api.get('', {
method: 'app.product.refundExchange',
product_skn: skn
});
};
const getProductComfortAsync = pid => {
return api.get('', {
method: 'web.productComfort.data',
... ... @@ -77,7 +85,8 @@ module.exports = {
getProductComfortAsync,
getProductModelCardAsync,
getProductModelTryAsync,
getProductAsync
getProductAsync,
isSupportReturnedSale
};
... ...
... ... @@ -1339,7 +1339,8 @@ const showMainAsync = (data) => {
let currentUserProductInfo = _.partial(_detailDataPkg, _, data.uid, data.vipLevel);
// 获取商品信息
let productInfo = yield productAPI.getProductAsync(data.pid, data.uid, data.isStudent, data.vipLevel).then(currentUserProductInfo);
let productInfo = yield productAPI.getProductAsync(data.pid, data.uid, data.isStudent, data.vipLevel)
.then(currentUserProductInfo);
if (_.isEmpty(productInfo) || _.isEmpty(productInfo.goodsInfo)) {
return Promise.reject({
... ... @@ -1349,7 +1350,8 @@ const showMainAsync = (data) => {
let requestData = yield Promise.all([
_getSortNavAsync(productInfo.goodsInfo.smallSortId, data.gender),
HeaderModel.requestHeaderData(data.channel)
HeaderModel.requestHeaderData(data.channel),
productAPI.isSupportReturnedSale(productInfo.goodsInfo.skn)
]);
// 分类导航 ,seo
... ... @@ -1373,6 +1375,10 @@ const showMainAsync = (data) => {
productInfo.statGoodsInfo
);
// 是否支持退换货,true 支持,false 不支持
result.detail.supportSaleReturnedService =
_.get(requestData, `[2].data.${productInfo.goodsInfo.skn}`, 'N') === 'N';
// 导航
result.detail.pathNav = _.concat(
homeService.getHomeChannelNav(data.channel),
... ...
... ... @@ -632,6 +632,12 @@
</div>
</div>
{{#if supportSaleReturnedService}}
<div class="support-saleReturned-service"></div>
{{^}}
<div class="not-support-saleReturned-service"></div>
{{/if}}
<div class="service"></div>
{{#if latestWalk}}
<div class="info-block latest-walk">
... ...
... ... @@ -984,7 +984,7 @@
}
}
.service {
.support-saleReturned-service {
$service: product/service.png;
width: width($service);
... ... @@ -993,6 +993,14 @@
background: resolve($service);
}
.not-support-saleReturned-service {
$service: product/limit.png;
width: width($service);
height: height($service);
margin: 45px auto;
background: resolve($service);
}
.latest-walk {
overflow: inherit;
... ...