...
|
...
|
@@ -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);
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
|