diff --git a/apps/cart/models/cart-helper.js b/apps/cart/models/cart-helper.js index a1a9844..0f45d0f 100644 --- a/apps/cart/models/cart-helper.js +++ b/apps/cart/models/cart-helper.js @@ -131,6 +131,7 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys imgCover: it.goods_images ? helpers.image(it.goods_images, 64, 88) : '', productColor: it.factory_goods_name, productSize: it.size_name, + skuTitle: it.sku_title, productPrice: transPrice(it.sales_price), productNum: Number(it.buy_number), storageNum: Number(it.storage_number), diff --git a/apps/cart/models/cart-service.js b/apps/cart/models/cart-service.js index 88ed63d..6909bbd 100644 --- a/apps/cart/models/cart-service.js +++ b/apps/cart/models/cart-service.js @@ -346,6 +346,7 @@ module.exports = class extends global.yoho.BaseModel { result.isCollect = propOrigin('is_collect'); result.colors = skuData.skuGoods; + result.skuTitle = propOrigin('skuTitle'); return result; } diff --git a/apps/cart/views/action/order-ensure.hbs b/apps/cart/views/action/order-ensure.hbs index 4ef30d0..46e90f4 100644 --- a/apps/cart/views/action/order-ensure.hbs +++ b/apps/cart/views/action/order-ensure.hbs @@ -160,7 +160,7 @@ </td> <td class="border-top color-size"> 颜色:<span class="color">{{factory_goods_name}}</span> - 尺码:<span class="size">{{size_name}}</span> + {{sku_title}}:<span class="size">{{size_name}}</span> </td> <td class="border-top price"> <p class="red">¥ {{round productPrice 2}}</p> diff --git a/apps/home/models/orders-service.js b/apps/home/models/orders-service.js index 7674d14..6dcfe64 100644 --- a/apps/home/models/orders-service.js +++ b/apps/home/models/orders-service.js @@ -423,6 +423,7 @@ module.exports = class extends global.yoho.BaseModel { newGood.name = good.product_name; newGood.color = good.factory_color_name; newGood.size = good.size_name; + newGood.skuTitle = good.sku_title; newGood.price = that.transPrice(good.sales_price);// 默认显示销售价 newGood.isVipPrice = good.discount_tag === 'V'; newGood.isStuPrice = good.discount_tag === 'S'; @@ -859,6 +860,7 @@ module.exports = class extends global.yoho.BaseModel { name: good.product_name, color: good.factory_color_name, size: good.size_name, + skuTitle: good.sku_title, price: that.transPrice(good.sales_price), // 默认显示销售价 isVipPrice: good.discount_tag === 'V', isStuPrice: good.discount_tag === 'S', diff --git a/apps/home/models/returns.js b/apps/home/models/returns.js index 79a2669..c057690 100644 --- a/apps/home/models/returns.js +++ b/apps/home/models/returns.js @@ -56,6 +56,7 @@ module.exports = class extends global.yoho.BaseModel { name: value.product_name || '', color: value.color_name, size: value.size_name, + skuTitle: value.sku_title || '尺码', yoho_coin_cut_num: value.yoho_coin_cut_num, real_pay_price: transPrice(value.real_pay_price), price: transPrice(value.sales_price), @@ -81,7 +82,8 @@ module.exports = class extends global.yoho.BaseModel { name: good.product_name, goods_type: good.goods_type, color: good.color_name, - size: good.size_name + size: good.size_name, + skuTitle: good.sku_title || '尺码' }); }); @@ -209,6 +211,7 @@ module.exports = class extends global.yoho.BaseModel { name: value.product_name, color: value.factory_color_name, size: value.size_name, + skuTitle: value.sku_title || '尺码', price: transPrice(value.last_price), skn: value.product_skn, skc: value.product_skc, @@ -568,6 +571,7 @@ module.exports = class extends global.yoho.BaseModel { name: value.product_name, color: value.color_name, size: value.size_name, + skuTitle: value.sku_title || '尺码', price: value.last_price, skn: value.product_skn, skc: value.product_skc, diff --git a/apps/home/views/action/home/orders/order-detail.hbs b/apps/home/views/action/home/orders/order-detail.hbs index 411e8c0..645522c 100644 --- a/apps/home/views/action/home/orders/order-detail.hbs +++ b/apps/home/views/action/home/orders/order-detail.hbs @@ -250,7 +250,7 @@ {{/if}} {{#if size}} - 尺码:{{size}} + {{skuTitle}}:{{size}} {{/if}} {{#if date}} diff --git a/apps/home/views/action/returns/returns-apply.hbs b/apps/home/views/action/returns/returns-apply.hbs index 5bdf84f..924823e 100644 --- a/apps/home/views/action/returns/returns-apply.hbs +++ b/apps/home/views/action/returns/returns-apply.hbs @@ -57,7 +57,7 @@ </td> <td class="return-goods-info"> <a href="{{href}}">{{name}}</a> - <span style="display: block;">颜色:{{color}} 尺码:{{size}}</span> + <span style="display: block;">颜色:{{color}} {{skuTitle}}:{{size}}</span> {{#if specialNoticeBo}} <div> <div class="special-tip"> @@ -115,9 +115,9 @@ {{/ colorSize}} </p> <p> - 尺码要换成: + {{skuTitle}}要换成: <select class="exchange-size" data-sku="{{sku}}" data-skc="{{skc}}" {{#if isLimitSkn}}disabled{{/if}}> - <option value="0">请选择尺码</option> + <option value="0">请选择{{skuTitle}}</option> </select> </p> </td> @@ -220,7 +220,7 @@ </td> <td class="return-goods-info"> <a href="{{href}}">{{name}}</a> - <span>颜色:{{color}} 尺码:{{size}}</span> + <span>颜色:{{color}} {{skuTitle}}:{{size}}</span> {{#if specialNoticeBo}} <div> <div class="special-tip"> diff --git a/apps/home/views/action/returns/returns-detail.hbs b/apps/home/views/action/returns/returns-detail.hbs index c109aff..d98b0b8 100644 --- a/apps/home/views/action/returns/returns-detail.hbs +++ b/apps/home/views/action/returns/returns-detail.hbs @@ -119,7 +119,7 @@ <p class="name-color-size"> <a class="name" href="{{href}}" target="_blank">{{name}}</a> - 颜色:{{color}} 尺码:{{size}} + 颜色:{{color}} {{skuTitle}}:{{size}} {{> home/orders/order-goods-tags}} </p> </td> diff --git a/apps/home/views/action/returns/returns.hbs b/apps/home/views/action/returns/returns.hbs index 6c55eb3..7352a63 100644 --- a/apps/home/views/action/returns/returns.hbs +++ b/apps/home/views/action/returns/returns.hbs @@ -49,7 +49,7 @@ {{/if}} {{#if size}} - 尺码:{{size}} + {{skuTitle}}:{{size}} {{/if}} </span> </div> diff --git a/apps/home/views/partial/home/orders/order-block.hbs b/apps/home/views/partial/home/orders/order-block.hbs index 8e82dc9..326c21e 100644 --- a/apps/home/views/partial/home/orders/order-block.hbs +++ b/apps/home/views/partial/home/orders/order-block.hbs @@ -50,7 +50,7 @@ {{/if}} {{#if size}} - 尺码:{{size}} + {{skuTitle}}:{{size}} {{/if}} {{#if arrivalDate}} diff --git a/apps/product/models/detail-service.js b/apps/product/models/detail-service.js index 16e100b..208e56a 100644 --- a/apps/product/models/detail-service.js +++ b/apps/product/models/detail-service.js @@ -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', ''); diff --git a/apps/product/views/partial/product/description.hbs b/apps/product/views/partial/product/description.hbs index 800e170..d81fc43 100644 --- a/apps/product/views/partial/product/description.hbs +++ b/apps/product/views/partial/product/description.hbs @@ -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> diff --git a/apps/product/views/partial/product/size-list.hbs b/apps/product/views/partial/product/size-list.hbs index 5fb2966..f4fc7c7 100644 --- a/apps/product/views/partial/product/size-list.hbs +++ b/apps/product/views/partial/product/size-list.hbs @@ -1,6 +1,6 @@ <div class="chose-size row clearfix"> - <span class="title pull-left"> 尺 码: </span> + <span class="title pull-left"><i class="sku-label">{{skuTitle}}</i>:</span> <div id="sizes" class="size-wrapper pull-left"> {{#each colors}} diff --git a/mix/mix/cart/cart-item.hbs b/mix/mix/cart/cart-item.hbs index 89c3adb..cf9eb3e 100644 --- a/mix/mix/cart/cart-item.hbs +++ b/mix/mix/cart/cart-item.hbs @@ -47,7 +47,7 @@ <em class="{{#unless isOffShelve}}pay-pro-detail{{/unless}}"> <span> <b title="{{productColor}}">颜色:{{productColor}}</b> - 尺码:{{productSize}}<i class="iconfont"></i> + {{skuTitle}}:{{productSize}}<i class="iconfont"></i> </span> </em> {{#and isAdvance preSellDate}} diff --git a/public/hbs/cart/select-color-panel.hbs b/public/hbs/cart/select-color-panel.hbs index 013f171..ac1d270 100644 --- a/public/hbs/cart/select-color-panel.hbs +++ b/public/hbs/cart/select-color-panel.hbs @@ -17,7 +17,7 @@ </div> </div> <div class="dl choose-size"> - <div class="dd">尺码:</div> + <div class="dd">{{skuTitle}}:</div> {{#each colors}} <div class="size-row {{#unless active}} hide{{/unless}}"> <div class="choose-size-detail"> diff --git a/public/js/cart/cart-api.js b/public/js/cart/cart-api.js index 9e41e99..fb5dfa6 100644 --- a/public/js/cart/cart-api.js +++ b/public/js/cart/cart-api.js @@ -359,7 +359,8 @@ function parseProductInfo(productInfo, defaultInfo) { colors: filterSet, defaultColor: defaultColor, defaultSize: defaultSize, - defaultImg: defaultImg + defaultImg: defaultImg, + skuTitle: productInfo.skuTitle }; } diff --git a/public/js/product/detail.page.js b/public/js/product/detail.page.js index 3316708..b2cf35f 100644 --- a/public/js/product/detail.page.js +++ b/public/js/product/detail.page.js @@ -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); } }); diff --git a/public/scss/product/_detail.css b/public/scss/product/_detail.css index ae85d44..58af340 100644 --- a/public/scss/product/_detail.css +++ b/public/scss/product/_detail.css @@ -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;