Authored by ccbikai

Merge branch 'feature/product-detail' of git.yoho.cn:fe/yohobuywap-node into feature/product-detail

@@ -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,37 +709,38 @@ $basicBtnC: #eb0313; @@ -709,37 +709,38 @@ $basicBtnC: #eb0313;
709 709
710 a { 710 a {
711 display: inline-block; 711 display: inline-block;
  712 + }
712 713
713 - &.num-incart {  
714 - position: relative;  
715 - color: #444;  
716 - font-size: 47px;  
717 - } 714 + .num-incart {
  715 + position: relative;
  716 + color: #444;
  717 + font-size: 47px;
  718 + }
718 719
719 - &.favorite {  
720 - color: #ccc;  
721 - font-size: 34px;  
722 - } 720 + .favorite {
  721 + color: #ccc;
  722 + font-size: 34px;
  723 + background-color: transparent;
  724 + }
723 725
724 - &.favorite.liked {  
725 - color: $basicBtnC;  
726 - } 726 + .favorite.liked {
  727 + color: $basicBtnC;
  728 + }
727 729
728 - &.addto-cart,  
729 - &.sold-out {  
730 - margin: 0 100px 0 115px;  
731 - width: 260px;  
732 - height: 80px;  
733 - background-color: $basicBtnC;  
734 - color: #fff;  
735 - text-align: center;  
736 - font-size: 32px;  
737 - line-height: 80px;  
738 - } 730 + .addto-cart,
  731 + .sold-out {
  732 + margin: 0 100px 0 115px;
  733 + width: 260px;
  734 + height: 80px;
  735 + background-color: $basicBtnC;
  736 + color: #fff;
  737 + text-align: center;
  738 + font-size: 32px;
  739 + line-height: 80px;
  740 + }
739 741
740 - &.sold-out {  
741 - background-color: #f58189;  
742 - } 742 + .sold-out {
  743 + background-color: #f58189;
743 } 744 }
744 745
745 .num-tag { 746 .num-tag {