Authored by 王水玲

食品类目设置

... ... @@ -536,6 +536,18 @@ function _getBasicDescription(productDescBo) {
value: sex
}];
if (productDescBo.guaranteeDay) {
basic.push({key: '保质期', value: productDescBo.guaranteeDay});
}
if (productDescBo.releaseTime) {
basic.push({key: '过期时间', value: productDescBo.releaseTime});
}
if (productDescBo.productionTime) {
basic.push({key: '生产日期', value: productDescBo.productionTime});
}
return _.get(productDescBo, 'standardBos', []).reduce((all, value) => {
all.push({
key: value.standardName,
... ... @@ -1042,6 +1054,7 @@ function _detailDataPkg(origin, uid, vipLevel, cookies) {
result.shopId = propOrigin('shop_id', 0);
result.brandId = propOrigin('brand_info.brand_id', '');
result.brandName = propOrigin('brand_info.brand_name', '');
result.skuTitle = propOrigin('skuTitle', '尺码');
result.maxSortId = propOrigin('maxSortId', '');
result.smallSortId = propOrigin('smallSortId', '');
... ...
... ... @@ -14,7 +14,7 @@
<span class="keySpace">{{{escapeType key}}}: </span>
<span id="desc-color" title="{{value}}" class="value-space">{{value}}</span>
{{^}}
<span class="keySpace">{{{escapeType key}}}: </span>
<span class="keySpace" data-key="{{{escapeType key}}}">{{{escapeType key}}}: </span>
<span class="value-space">{{value}}</span>
{{/if}}
</em>
... ...
<div class="chose-size row clearfix">
<span class="title pull-left">&nbsp;&nbsp;码: </span>
<span class="title pull-left"><i class="sku-label">{{skuTitle}}</i></span>
<div id="sizes" class="size-wrapper pull-left">
{{#each colors}}
... ...
... ... @@ -2022,14 +2022,42 @@ $(function() {
$(function() {
$('.size-table tbody tr:odd td').css('background-color', '#f9f9f9');
// 调整食品类商品信息的间距
let $productionTime = $('.description-content .basic span[data-key=生产日期]').parents('.justpostion');
let $releaseTime = $('.description-content .basic span[data-key=过期时间]').parents('.justpostion');
let releaseTimeIndex = $releaseTime.parents('li').index();
let postionLeft1 = '70px';
let postionLeft2 = '56px';
if ($releaseTime.length) {
if ((releaseTimeIndex + 1) % 3 === 1 && $productionTime.width() > 285) {
postionLeft2 = 0;
}
if ((releaseTimeIndex + 1) % 3 === 2) {
if ($releaseTime.width() > 285) {
postionLeft2 = 0;
}
if ($productionTime.width() > 285) {
postionLeft1 = 0;
postionLeft2 = 0;
}
}
if ((releaseTimeIndex + 1) % 3 === 0 && $releaseTime.width() > 285) {
postionLeft1 = 0;
}
}
// 调整商品信息的间距
$('.description-content .basic li').each(function(i) {
if ((i + 1) % 4 === 0) {
$(this).find('.justpostion').css({display: 'inline-block', 'margin-left': '70px'});
} else if ((i + 1) % 4 === 1) {
if ((i + 1) % 3 === 0) {
$(this).find('.justpostion').css({display: 'inline-block', 'margin-left': postionLeft1});
} else if ((i + 1) % 3 === 1) {
return;
} else {
$(this).find('.justpostion').css('margin-left', '56px');
$(this).find('.justpostion').css('margin-left', postionLeft2);
}
});
... ...
... ... @@ -1037,8 +1037,8 @@
.info-block {
margin-top: 55px;
margin-left: 175px;
margin-right: 175px;
margin-left: 135px;
margin-right: 135px;
color: #999;
border-top: 1px solid #e0e0e0;
font-size: 12px;
... ... @@ -1054,7 +1054,7 @@
li {
float: left;
width: 25%;
width: 33.33%;
margin-top: 10px;
font-size: 14px;
line-height: 22px;
... ... @@ -2686,6 +2686,15 @@
margin-top: 3px;
}
.sku-label {
letter-spacing: 22px;
width: 54px;
display: inline-block;
overflow: hidden;
white-space: nowrap;
vertical-align: middle;
}
li {
float: left;
display: block;
... ...