Showing
1 changed file
with
11 additions
and
21 deletions
@@ -584,9 +584,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -584,9 +584,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
584 | } | 584 | } |
585 | 585 | ||
586 | // 商品促销短语 | 586 | // 商品促销短语 |
587 | - if (origin.salesPhrase) { | ||
588 | - dest.goodsSubtitle = origin.salesPhrase; | ||
589 | - } | 587 | + origin.salesPhrase && (dest.goodsSubtitle = origin.salesPhrase); |
590 | 588 | ||
591 | // 促销信息 TODO: 换新接口 | 589 | // 促销信息 TODO: 换新接口 |
592 | if (origin.promotionBoList) { | 590 | if (origin.promotionBoList) { |
@@ -598,11 +596,9 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -598,11 +596,9 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
598 | }); | 596 | }); |
599 | }); | 597 | }); |
600 | 598 | ||
601 | - if (discountList.length) { | ||
602 | - dest.goodsDiscount = { | ||
603 | - list: discountList | ||
604 | - }; | ||
605 | - } | 599 | + discountList.length && (dest.goodsDiscount = { |
600 | + list: discountList | ||
601 | + }); | ||
606 | } | 602 | } |
607 | 603 | ||
608 | // 商品标签 | 604 | // 商品标签 |
@@ -628,9 +624,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -628,9 +624,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
628 | dest.goodsPrice = goodsPrice; | 624 | dest.goodsPrice = goodsPrice; |
629 | 625 | ||
630 | // 商品返回 YOHO 币 | 626 | // 商品返回 YOHO 币 |
631 | - if (origin.yohoCoinNum) { | ||
632 | - dest.commodityReturn = origin.yohoCoinNum; | ||
633 | - } | 627 | + origin.yohoCoinNum && (dest.commodityReturn = origin.yohoCoinNum); |
634 | 628 | ||
635 | // VIP 商品价格 | 629 | // VIP 商品价格 |
636 | if (origin.vip) { | 630 | if (origin.vip) { |
@@ -649,18 +643,14 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -649,18 +643,14 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
649 | }); | 643 | }); |
650 | }); | 644 | }); |
651 | 645 | ||
652 | - if (vipList.length) { | ||
653 | - dest.vipLevel = { | ||
654 | - list: vipList | ||
655 | - }; | ||
656 | - } | 646 | + vipList.length && (dest.vipLevel = { |
647 | + list: vipList | ||
648 | + }); | ||
657 | 649 | ||
658 | } | 650 | } |
659 | 651 | ||
660 | // 上市期 | 652 | // 上市期 |
661 | - if (origin.expectArrivalTime) { | ||
662 | - dest.periodOfMarket = `${origin.expectArrivalTime}月`; | ||
663 | - } | 653 | + origin.expectArrivalTime && (dest.periodOfMarket = `${origin.expectArrivalTime}月`); |
664 | 654 | ||
665 | // 商品咨询 | 655 | // 商品咨询 |
666 | dest.feedbacks = { | 656 | dest.feedbacks = { |
@@ -743,8 +733,8 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -743,8 +733,8 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
743 | storage: size.storageNumber | 733 | storage: size.storageNumber |
744 | }; | 734 | }; |
745 | 735 | ||
746 | - allSizeList[sizeName] = (allSizeList[sizeName] === null || | ||
747 | - typeof allSizeList[sizeName] === 'undefined') ? build : allSizeList[sizeName]; | 736 | + allSizeList[sizeName] = (allSizeList[sizeName] === null || |
737 | + typeof allSizeList[sizeName] === 'undefined') ? build : allSizeList[sizeName]; | ||
748 | colorStorageNum += parseInt(size.storageNumber, 10); | 738 | colorStorageNum += parseInt(size.storageNumber, 10); |
749 | colorStorageGroup[value.productSkc][sizeName] = parseInt(size.storageNumber, 10); | 739 | colorStorageGroup[value.productSkc][sizeName] = parseInt(size.storageNumber, 10); |
750 | }); | 740 | }); |
-
Please register or login to post a comment