Authored by 周少峰

Merge branch 'hotfix/detail-error'

... ... @@ -373,7 +373,7 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => {
// dis //失效
// buyNow //是否立即购买
let result = {
getLimitedCode: true,
getLimitedCode: false,
hadLimitedCode: false,
limitedCodeSoldOut: false,
openSoon: false,
... ... @@ -393,17 +393,16 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => {
result.openSoon = true;
result.hadLimitedCode = false;
}
result.getLimitedCode = true;
break;
case 2: // 开售后,限购码已抢光(用户未领取限购码)
result.buyNow = true;
result.dis = true;
result.limitedCodeSoldOut = true;
result.getLimitedCode = false;
result.hadLimitedCode = false;
break;
case 3: // 开售后,商品已经售罄
result.soldOut = true;
result.getLimitedCode = false;
break;
case 4:// 开售后,立即购买(用户已领取限购码)
result.buyNow = true;
... ... @@ -417,7 +416,6 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => {
result.openSoon = true;
result.hadLimitedCode = true;
result.limitedCodeSoldOut = true;
result.getLimitedCode = false;
break;
case 6: // 开售前,即将开售(用户已领取限购码)
result.openSoon = true;
... ... @@ -1102,21 +1100,22 @@ const _detailDataPkg = (origin, uid, vipLevel) => {
result.vipPrice = _getVipDataByProductBaseInfo(origin, vipLevel, uid);
}
// 促销活动banner,虚拟商品无促销
// 促销活动banner,虚拟商品无促销
if (propOrigin('attribute') !== 3) {
result.activity = _getActivityDataByProductBaseInfo(promotionData, additionalData);
}
const C_VALUE = {
type: '返有货币',
des: '每件返 ',
rest: '个 有货币'
};
// 有货币
if (!_.includes(['', '0'], propOrigin('yohoCoinNum'))) {
const C_VALUE = {
type: '返有货币',
des: '每件返 ',
rest: '个 有货币'
};
if (propOrigin('yoho_coin_num', '0') !== '0') {
result.activity.push({
type: C_VALUE.type,
des: `${C_VALUE.des}${propOrigin('yoho_coin_num')}${C_VALUE.rest}`
des: `${C_VALUE.des}${propOrigin('yohoCoinNum')}${C_VALUE.rest}`
});
}
... ... @@ -1152,12 +1151,12 @@ const _detailDataPkg = (origin, uid, vipLevel) => {
// 是否收藏
result.isCollect = favoriteData.product;
if (propOrigin('is_limit_buy', false)) {
if (propOrigin('isLimitBuy', false)) {
// 是否开售
let isBeginSale = propOrigin('sale_status', 0) === 1;
let isBeginSale = propOrigin('saleStatus', 0) === 1;
// 限购商品有关的展示状态
let showStatus = propOrigin('show_status', 1);
let showStatus = propOrigin('showStatus', 1);
let fashTopGoods = _getFashionTopGoodsStatus(uid, showStatus, isBeginSale);
... ... @@ -1237,8 +1236,13 @@ const _detailDataPkg = (origin, uid, vipLevel) => {
statGoodsInfo.productId = propOrigin('product_id');
statGoodsInfo.productName = result.name.replace('\'', '’');
statGoodsInfo.brandName = (result.brandName || '').replace('\'', '’');
statGoodsInfo.marketPrice = result.marketPrice;
statGoodsInfo.salePrice = result.salePrice ? result.salePrice : result.marketPrice;
statGoodsInfo.marketPrice = result.marketPrice.replace('¥', ''); // 数字
statGoodsInfo.salePrice = (result.salePrice ? result.salePrice : result.marketPrice).replace('¥', ''); // 数字
statGoodsInfo.imageUrl = 'http:' + result.img.split('?')[0];
statGoodsInfo.productUrl = 'http:' +
helpers.urlFormat(url.parse(propOrigin('product_url')).pathname, null, 'item');
statGoodsInfo.smallSortId = result.smallSortId;
statGoodsInfo.soldOut = soldOut ? 1 : 0;
if (banner.brandId) {
let domainBrand = yield brandService.getBrandByDomainAsync(banner.brandDomain);
... ... @@ -1258,11 +1262,6 @@ const _detailDataPkg = (origin, uid, vipLevel) => {
}
}
statGoodsInfo.imageUrl = 'http:' + result.img.split('?')[0];
statGoodsInfo.productUrl = 'http:' +
helpers.urlFormat(url.parse(propOrigin('product_url')).pathname, null, 'item');
statGoodsInfo.smallSortId = result.smallSortId;
statGoodsInfo.soldOut = soldOut ? 1 : 0;
// 获取商品尺寸相关
let sizeInfo = _getSizeInfo(result, result.maxSortId, additionalData);
... ...