Authored by 梁志锋

Merge remote-tracking branch 'remotes/origin/feature/product-detail' into release/4.9

@@ -75,9 +75,9 @@ const getSizeInfo = (sizeInfo) => { @@ -75,9 +75,9 @@ const getSizeInfo = (sizeInfo) => {
75 dest.sizeInfo.detail.list = []; 75 dest.sizeInfo.detail.list = [];
76 76
77 // 参考尺码 77 // 参考尺码
78 - let boyReference = !_.isEmpty(sizeInfo.productExtra.boyReference);  
79 - let girlReference = !_.isEmpty(sizeInfo.productExtra.girlReference);  
80 - let gender = !_.isEmpty(sizeInfo.productDescBo.gender) ? sizeInfo.productDescBo.gender : 3; 78 + let boyReference = sizeInfo.productExtra.boyReference;
  79 + let girlReference = sizeInfo.productExtra.girlReference;
  80 + let gender = sizeInfo.productDescBo.gender ? sizeInfo.productDescBo.gender : 3;
81 let referenceName = '参考尺码'; 81 let referenceName = '参考尺码';
82 82
83 if ((gender === 1 && boyReference) || (gender === 2 && girlReference)) { 83 if ((gender === 1 && boyReference) || (gender === 2 && girlReference)) {
@@ -102,12 +102,14 @@ const getSizeInfo = (sizeInfo) => { @@ -102,12 +102,14 @@ const getSizeInfo = (sizeInfo) => {
102 102
103 if (!_.isEmpty(sizeInfo.sizeInfoBo.sizeAttributeBos)) { 103 if (!_.isEmpty(sizeInfo.sizeInfoBo.sizeAttributeBos)) {
104 104
  105 + // [{param: attrName}] th
105 let sizeNameList = []; 106 let sizeNameList = [];
106 107
107 temp = {}; 108 temp = {};
108 temp.param = '吊牌尺码'; 109 temp.param = '吊牌尺码';
109 sizeNameList.push(temp); 110 sizeNameList.push(temp);
110 111
  112 + // {id: [{param: str},......]} sizeBoGroup[id][0] 属性名, sizeBoGroup[id][index] 属性值
111 let sizeBoGroup = {}; 113 let sizeBoGroup = {};
112 114
113 _.forEach(sizeInfo.sizeInfoBo.sizeAttributeBos, function(attr) { 115 _.forEach(sizeInfo.sizeInfoBo.sizeAttributeBos, function(attr) {
@@ -126,13 +128,11 @@ const getSizeInfo = (sizeInfo) => { @@ -126,13 +128,11 @@ const getSizeInfo = (sizeInfo) => {
126 128
127 if (boyReference && (gender === 1 || gender === 3)) { 129 if (boyReference && (gender === 1 || gender === 3)) {
128 temp = {}; 130 temp = {};
129 - temp.param = _.isEmpty(value.boyReferSize.referenceName) ?  
130 - ' ' : value.boyReferSize.referenceName; 131 + temp.param = value.boyReferSize.referenceName || '';
131 referenceList.push(temp); 132 referenceList.push(temp);
132 } else if (girlReference && (gender === 2 || gender === 3)) { 133 } else if (girlReference && (gender === 2 || gender === 3)) {
133 temp = {}; 134 temp = {};
134 - temp.param = _.isEmpty(value.girlReferSize.referenceName) ?  
135 - ' ' : value.girlReferSize.referenceName; 135 + temp.param = value.girlReferSize.referenceName || '';
136 referenceList.push(temp); 136 referenceList.push(temp);
137 } else { 137 } else {
138 showReference = false; 138 showReference = false;
@@ -140,7 +140,7 @@ const getSizeInfo = (sizeInfo) => { @@ -140,7 +140,7 @@ const getSizeInfo = (sizeInfo) => {
140 140
141 _.forEach(value.sortAttributes, function(attr) { 141 _.forEach(value.sortAttributes, function(attr) {
142 temp = {}; 142 temp = {};
143 - temp.param = _.isEmpty(attr.sizeValue) ? ' ' : attr.sizeValue; 143 + temp.param = attr.sizeValue || ' ';
144 sizeBoGroup[attr.id].push(temp); 144 sizeBoGroup[attr.id].push(temp);
145 }); 145 });
146 }); 146 });
@@ -149,6 +149,7 @@ const getSizeInfo = (sizeInfo) => { @@ -149,6 +149,7 @@ const getSizeInfo = (sizeInfo) => {
149 dest.sizeInfo.detail.list[0] = {}; 149 dest.sizeInfo.detail.list[0] = {};
150 dest.sizeInfo.detail.list[0].params = sizeNameList; 150 dest.sizeInfo.detail.list[0].params = sizeNameList;
151 if (showReference) { 151 if (showReference) {
  152 + dest.sizeInfo.detail.list[1] = {};
152 dest.sizeInfo.detail.list[1].params = referenceList; 153 dest.sizeInfo.detail.list[1].params = referenceList;
153 } 154 }
154 _.forEach(sizeBoGroup, function(value) { 155 _.forEach(sizeBoGroup, function(value) {
@@ -709,23 +709,26 @@ $basicBtnC: #eb0313; @@ -709,23 +709,26 @@ $basicBtnC: #eb0313;
709 709
710 a { 710 a {
711 display: inline-block; 711 display: inline-block;
  712 + }
712 713
713 - &.num-incart { 714 + .num-incart {
  715 + position: relative;
714 color: #444; 716 color: #444;
715 font-size: 47px; 717 font-size: 47px;
716 } 718 }
717 719
718 - &.favorite { 720 + .favorite {
719 color: #ccc; 721 color: #ccc;
720 font-size: 34px; 722 font-size: 34px;
  723 + background-color: transparent;
721 } 724 }
722 725
723 - &.favorite.liked { 726 + .favorite.liked {
724 color: $basicBtnC; 727 color: $basicBtnC;
725 } 728 }
726 729
727 - &.addto-cart,  
728 - &.sold-out { 730 + .addto-cart,
  731 + .sold-out {
729 margin: 0 100px 0 115px; 732 margin: 0 100px 0 115px;
730 width: 260px; 733 width: 260px;
731 height: 80px; 734 height: 80px;
@@ -736,15 +739,14 @@ $basicBtnC: #eb0313; @@ -736,15 +739,14 @@ $basicBtnC: #eb0313;
736 line-height: 80px; 739 line-height: 80px;
737 } 740 }
738 741
739 - &.sold-out { 742 + .sold-out {
740 background-color: #f58189; 743 background-color: #f58189;
741 } 744 }
742 - }  
743 745
744 .num-tag { 746 .num-tag {
745 position: absolute; 747 position: absolute;
746 top: 0; 748 top: 0;
747 - left: 48px; 749 + right: -15px;
748 display: block; 750 display: block;
749 width: 30px; 751 width: 30px;
750 height: 30px; 752 height: 30px;