Authored by 王水玲

活动模版商品组预告添加

'use strict';
const _ = require('lodash');
let _getProduct = function(o) {
return {
let plan = o.product_price_plan_list;
let res = {
small_sort_id: o.small_sort_id,
middle_sort_id: o.middle_sort_id,
max_sort_id: o.max_sort_id,
... ... @@ -21,6 +23,29 @@ let _getProduct = function(o) {
default_images: o.default_images,
goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : void 0
};
plan = _.sortBy(plan, item => {
return +item.show_begin_time;
});
if (plan.length) {
let time = Math.round(new Date() / 1000);
let effectPlan = [];
plan.forEach(planItem => {
if (planItem.effect_time > time) {
effectPlan.push(planItem);
}
});
if (effectPlan.length && time > effectPlan[0].show_begin_time && effectPlan[0].show_status === '1') { // eslint-disable-line
o.curPlanPrice = effectPlan[0].current_saleprice;
_.assign({curPlanPrice: effectPlan[0].current_saleprice}, res);
}
}
return res;
};
const gender = {
... ...
... ... @@ -22,6 +22,17 @@
<a class="new-brand-name {{#isEqualOr showBrandUrl '1'}}product-brand{{else}}product-detail{{/isEqualOr}}" href="">
<span class="brand-name" {{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
</a>
<div class="sales-imgs-new">
{{#if leftDownImg}}
<img class="leftdownimg lazy" data-original="{{image2 leftDownImg q=85}}">
{{/if}}
{{#isEqualOr isAdvance '1'}}
<div class="advance" style="background-image: url({{advanceBgImg}});">
<img src="{{advanceBgImg}}" class="img-seat">
<span class="advance-price"></span>
</div>
{{/isEqualOr}}
</div>
</div>
</a>
{{#if brandImg}}
... ...
... ... @@ -176,6 +176,19 @@
z-index: 1;
}
.sales-imgs-new {
position: absolute;
right: 0;
bottom: 55px;
width: 100%;
height: auto;
z-index: 1;
.advance {
display: none;
}
}
.leftdownimg {
width: auto;
max-width: 100%;
... ...