Authored by 王水玲

食品类目设置

@@ -536,6 +536,18 @@ function _getBasicDescription(productDescBo) { @@ -536,6 +536,18 @@ function _getBasicDescription(productDescBo) {
536 value: sex 536 value: sex
537 }]; 537 }];
538 538
  539 + if (productDescBo.guaranteeDay) {
  540 + basic.push({key: '保质期', value: productDescBo.guaranteeDay});
  541 + }
  542 +
  543 + if (productDescBo.releaseTime) {
  544 + basic.push({key: '过期时间', value: productDescBo.releaseTime});
  545 + }
  546 +
  547 + if (productDescBo.productionTime) {
  548 + basic.push({key: '生产日期', value: productDescBo.productionTime});
  549 + }
  550 +
539 return _.get(productDescBo, 'standardBos', []).reduce((all, value) => { 551 return _.get(productDescBo, 'standardBos', []).reduce((all, value) => {
540 all.push({ 552 all.push({
541 key: value.standardName, 553 key: value.standardName,
@@ -1042,6 +1054,7 @@ function _detailDataPkg(origin, uid, vipLevel, cookies) { @@ -1042,6 +1054,7 @@ function _detailDataPkg(origin, uid, vipLevel, cookies) {
1042 result.shopId = propOrigin('shop_id', 0); 1054 result.shopId = propOrigin('shop_id', 0);
1043 result.brandId = propOrigin('brand_info.brand_id', ''); 1055 result.brandId = propOrigin('brand_info.brand_id', '');
1044 result.brandName = propOrigin('brand_info.brand_name', ''); 1056 result.brandName = propOrigin('brand_info.brand_name', '');
  1057 + result.skuTitle = propOrigin('skuTitle', '尺码');
1045 1058
1046 result.maxSortId = propOrigin('maxSortId', ''); 1059 result.maxSortId = propOrigin('maxSortId', '');
1047 result.smallSortId = propOrigin('smallSortId', ''); 1060 result.smallSortId = propOrigin('smallSortId', '');
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <span class="keySpace">{{{escapeType key}}}: </span> 14 <span class="keySpace">{{{escapeType key}}}: </span>
15 <span id="desc-color" title="{{value}}" class="value-space">{{value}}</span> 15 <span id="desc-color" title="{{value}}" class="value-space">{{value}}</span>
16 {{^}} 16 {{^}}
17 - <span class="keySpace">{{{escapeType key}}}: </span> 17 + <span class="keySpace" data-key="{{{escapeType key}}}">{{{escapeType key}}}: </span>
18 <span class="value-space">{{value}}</span> 18 <span class="value-space">{{value}}</span>
19 {{/if}} 19 {{/if}}
20 </em> 20 </em>
1 1
2 <div class="chose-size row clearfix"> 2 <div class="chose-size row clearfix">
3 - <span class="title pull-left">&nbsp;&nbsp;码: </span> 3 + <span class="title pull-left"><i class="sku-label">{{skuTitle}}</i></span>
4 4
5 <div id="sizes" class="size-wrapper pull-left"> 5 <div id="sizes" class="size-wrapper pull-left">
6 {{#each colors}} 6 {{#each colors}}
@@ -2022,14 +2022,42 @@ $(function() { @@ -2022,14 +2022,42 @@ $(function() {
2022 $(function() { 2022 $(function() {
2023 $('.size-table tbody tr:odd td').css('background-color', '#f9f9f9'); 2023 $('.size-table tbody tr:odd td').css('background-color', '#f9f9f9');
2024 2024
  2025 + // 调整食品类商品信息的间距
  2026 + let $productionTime = $('.description-content .basic span[data-key=生产日期]').parents('.justpostion');
  2027 + let $releaseTime = $('.description-content .basic span[data-key=过期时间]').parents('.justpostion');
  2028 + let releaseTimeIndex = $releaseTime.parents('li').index();
  2029 + let postionLeft1 = '70px';
  2030 + let postionLeft2 = '56px';
  2031 +
  2032 + if ($releaseTime.length) {
  2033 + if ((releaseTimeIndex + 1) % 3 === 1 && $productionTime.width() > 285) {
  2034 + postionLeft2 = 0;
  2035 + }
  2036 +
  2037 + if ((releaseTimeIndex + 1) % 3 === 2) {
  2038 + if ($releaseTime.width() > 285) {
  2039 + postionLeft2 = 0;
  2040 + }
  2041 +
  2042 + if ($productionTime.width() > 285) {
  2043 + postionLeft1 = 0;
  2044 + postionLeft2 = 0;
  2045 + }
  2046 + }
  2047 +
  2048 + if ((releaseTimeIndex + 1) % 3 === 0 && $releaseTime.width() > 285) {
  2049 + postionLeft1 = 0;
  2050 + }
  2051 + }
  2052 +
2025 // 调整商品信息的间距 2053 // 调整商品信息的间距
2026 $('.description-content .basic li').each(function(i) { 2054 $('.description-content .basic li').each(function(i) {
2027 - if ((i + 1) % 4 === 0) {  
2028 - $(this).find('.justpostion').css({display: 'inline-block', 'margin-left': '70px'});  
2029 - } else if ((i + 1) % 4 === 1) { 2055 + if ((i + 1) % 3 === 0) {
  2056 + $(this).find('.justpostion').css({display: 'inline-block', 'margin-left': postionLeft1});
  2057 + } else if ((i + 1) % 3 === 1) {
2030 return; 2058 return;
2031 } else { 2059 } else {
2032 - $(this).find('.justpostion').css('margin-left', '56px'); 2060 + $(this).find('.justpostion').css('margin-left', postionLeft2);
2033 } 2061 }
2034 }); 2062 });
2035 2063
@@ -1037,8 +1037,8 @@ @@ -1037,8 +1037,8 @@
1037 1037
1038 .info-block { 1038 .info-block {
1039 margin-top: 55px; 1039 margin-top: 55px;
1040 - margin-left: 175px;  
1041 - margin-right: 175px; 1040 + margin-left: 135px;
  1041 + margin-right: 135px;
1042 color: #999; 1042 color: #999;
1043 border-top: 1px solid #e0e0e0; 1043 border-top: 1px solid #e0e0e0;
1044 font-size: 12px; 1044 font-size: 12px;
@@ -1054,7 +1054,7 @@ @@ -1054,7 +1054,7 @@
1054 1054
1055 li { 1055 li {
1056 float: left; 1056 float: left;
1057 - width: 25%; 1057 + width: 33.33%;
1058 margin-top: 10px; 1058 margin-top: 10px;
1059 font-size: 14px; 1059 font-size: 14px;
1060 line-height: 22px; 1060 line-height: 22px;
@@ -2686,6 +2686,15 @@ @@ -2686,6 +2686,15 @@
2686 margin-top: 3px; 2686 margin-top: 3px;
2687 } 2687 }
2688 2688
  2689 + .sku-label {
  2690 + letter-spacing: 22px;
  2691 + width: 54px;
  2692 + display: inline-block;
  2693 + overflow: hidden;
  2694 + white-space: nowrap;
  2695 + vertical-align: middle;
  2696 + }
  2697 +
2689 li { 2698 li {
2690 float: left; 2699 float: left;
2691 display: block; 2700 display: block;