Authored by 周少峰

Merge branch 'hotfix/detail-error'

@@ -373,7 +373,7 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => { @@ -373,7 +373,7 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => {
373 // dis //失效 373 // dis //失效
374 // buyNow //是否立即购买 374 // buyNow //是否立即购买
375 let result = { 375 let result = {
376 - getLimitedCode: true, 376 + getLimitedCode: false,
377 hadLimitedCode: false, 377 hadLimitedCode: false,
378 limitedCodeSoldOut: false, 378 limitedCodeSoldOut: false,
379 openSoon: false, 379 openSoon: false,
@@ -393,17 +393,16 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => { @@ -393,17 +393,16 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => {
393 result.openSoon = true; 393 result.openSoon = true;
394 result.hadLimitedCode = false; 394 result.hadLimitedCode = false;
395 } 395 }
  396 + result.getLimitedCode = true;
396 break; 397 break;
397 case 2: // 开售后,限购码已抢光(用户未领取限购码) 398 case 2: // 开售后,限购码已抢光(用户未领取限购码)
398 result.buyNow = true; 399 result.buyNow = true;
399 result.dis = true; 400 result.dis = true;
400 result.limitedCodeSoldOut = true; 401 result.limitedCodeSoldOut = true;
401 - result.getLimitedCode = false;  
402 result.hadLimitedCode = false; 402 result.hadLimitedCode = false;
403 break; 403 break;
404 case 3: // 开售后,商品已经售罄 404 case 3: // 开售后,商品已经售罄
405 result.soldOut = true; 405 result.soldOut = true;
406 - result.getLimitedCode = false;  
407 break; 406 break;
408 case 4:// 开售后,立即购买(用户已领取限购码) 407 case 4:// 开售后,立即购买(用户已领取限购码)
409 result.buyNow = true; 408 result.buyNow = true;
@@ -417,7 +416,6 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => { @@ -417,7 +416,6 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => {
417 result.openSoon = true; 416 result.openSoon = true;
418 result.hadLimitedCode = true; 417 result.hadLimitedCode = true;
419 result.limitedCodeSoldOut = true; 418 result.limitedCodeSoldOut = true;
420 - result.getLimitedCode = false;  
421 break; 419 break;
422 case 6: // 开售前,即将开售(用户已领取限购码) 420 case 6: // 开售前,即将开售(用户已领取限购码)
423 result.openSoon = true; 421 result.openSoon = true;
@@ -1102,21 +1100,22 @@ const _detailDataPkg = (origin, uid, vipLevel) => { @@ -1102,21 +1100,22 @@ const _detailDataPkg = (origin, uid, vipLevel) => {
1102 result.vipPrice = _getVipDataByProductBaseInfo(origin, vipLevel, uid); 1100 result.vipPrice = _getVipDataByProductBaseInfo(origin, vipLevel, uid);
1103 } 1101 }
1104 1102
1105 - // 促销活动banner,虚拟商品无促销 1103 + // 促销活动banner,虚拟商品无促销
1106 if (propOrigin('attribute') !== 3) { 1104 if (propOrigin('attribute') !== 3) {
1107 result.activity = _getActivityDataByProductBaseInfo(promotionData, additionalData); 1105 result.activity = _getActivityDataByProductBaseInfo(promotionData, additionalData);
1108 } 1106 }
1109 1107
1110 - const C_VALUE = {  
1111 - type: '返有货币',  
1112 - des: '每件返 ',  
1113 - rest: '个 有货币'  
1114 - }; 1108 + // 有货币
  1109 + if (!_.includes(['', '0'], propOrigin('yohoCoinNum'))) {
  1110 + const C_VALUE = {
  1111 + type: '返有货币',
  1112 + des: '每件返 ',
  1113 + rest: '个 有货币'
  1114 + };
1115 1115
1116 - if (propOrigin('yoho_coin_num', '0') !== '0') {  
1117 result.activity.push({ 1116 result.activity.push({
1118 type: C_VALUE.type, 1117 type: C_VALUE.type,
1119 - des: `${C_VALUE.des}${propOrigin('yoho_coin_num')}${C_VALUE.rest}` 1118 + des: `${C_VALUE.des}${propOrigin('yohoCoinNum')}${C_VALUE.rest}`
1120 }); 1119 });
1121 } 1120 }
1122 1121
@@ -1152,12 +1151,12 @@ const _detailDataPkg = (origin, uid, vipLevel) => { @@ -1152,12 +1151,12 @@ const _detailDataPkg = (origin, uid, vipLevel) => {
1152 // 是否收藏 1151 // 是否收藏
1153 result.isCollect = favoriteData.product; 1152 result.isCollect = favoriteData.product;
1154 1153
1155 - if (propOrigin('is_limit_buy', false)) { 1154 + if (propOrigin('isLimitBuy', false)) {
1156 // 是否开售 1155 // 是否开售
1157 - let isBeginSale = propOrigin('sale_status', 0) === 1; 1156 + let isBeginSale = propOrigin('saleStatus', 0) === 1;
1158 1157
1159 // 限购商品有关的展示状态 1158 // 限购商品有关的展示状态
1160 - let showStatus = propOrigin('show_status', 1); 1159 + let showStatus = propOrigin('showStatus', 1);
1161 1160
1162 let fashTopGoods = _getFashionTopGoodsStatus(uid, showStatus, isBeginSale); 1161 let fashTopGoods = _getFashionTopGoodsStatus(uid, showStatus, isBeginSale);
1163 1162
@@ -1237,8 +1236,13 @@ const _detailDataPkg = (origin, uid, vipLevel) => { @@ -1237,8 +1236,13 @@ const _detailDataPkg = (origin, uid, vipLevel) => {
1237 statGoodsInfo.productId = propOrigin('product_id'); 1236 statGoodsInfo.productId = propOrigin('product_id');
1238 statGoodsInfo.productName = result.name.replace('\'', '’'); 1237 statGoodsInfo.productName = result.name.replace('\'', '’');
1239 statGoodsInfo.brandName = (result.brandName || '').replace('\'', '’'); 1238 statGoodsInfo.brandName = (result.brandName || '').replace('\'', '’');
1240 - statGoodsInfo.marketPrice = result.marketPrice;  
1241 - statGoodsInfo.salePrice = result.salePrice ? result.salePrice : result.marketPrice; 1239 + statGoodsInfo.marketPrice = result.marketPrice.replace('¥', ''); // 数字
  1240 + statGoodsInfo.salePrice = (result.salePrice ? result.salePrice : result.marketPrice).replace('¥', ''); // 数字
  1241 + statGoodsInfo.imageUrl = 'http:' + result.img.split('?')[0];
  1242 + statGoodsInfo.productUrl = 'http:' +
  1243 + helpers.urlFormat(url.parse(propOrigin('product_url')).pathname, null, 'item');
  1244 + statGoodsInfo.smallSortId = result.smallSortId;
  1245 + statGoodsInfo.soldOut = soldOut ? 1 : 0;
1242 1246
1243 if (banner.brandId) { 1247 if (banner.brandId) {
1244 let domainBrand = yield brandService.getBrandByDomainAsync(banner.brandDomain); 1248 let domainBrand = yield brandService.getBrandByDomainAsync(banner.brandDomain);
@@ -1258,11 +1262,6 @@ const _detailDataPkg = (origin, uid, vipLevel) => { @@ -1258,11 +1262,6 @@ const _detailDataPkg = (origin, uid, vipLevel) => {
1258 } 1262 }
1259 } 1263 }
1260 1264
1261 - statGoodsInfo.imageUrl = 'http:' + result.img.split('?')[0];  
1262 - statGoodsInfo.productUrl = 'http:' +  
1263 - helpers.urlFormat(url.parse(propOrigin('product_url')).pathname, null, 'item');  
1264 - statGoodsInfo.smallSortId = result.smallSortId;  
1265 - statGoodsInfo.soldOut = soldOut ? 1 : 0;  
1266 1265
1267 // 获取商品尺寸相关 1266 // 获取商品尺寸相关
1268 let sizeInfo = _getSizeInfo(result, result.maxSortId, additionalData); 1267 let sizeInfo = _getSizeInfo(result, result.maxSortId, additionalData);