Showing
3 changed files
with
50 additions
and
1 deletions
1 | 'use strict'; | 1 | 'use strict'; |
2 | +const _ = require('lodash'); | ||
2 | 3 | ||
3 | let _getProduct = function(o) { | 4 | let _getProduct = function(o) { |
4 | - return { | 5 | + let plan = o.product_price_plan_list; |
6 | + let res = { | ||
5 | small_sort_id: o.small_sort_id, | 7 | small_sort_id: o.small_sort_id, |
6 | middle_sort_id: o.middle_sort_id, | 8 | middle_sort_id: o.middle_sort_id, |
7 | max_sort_id: o.max_sort_id, | 9 | max_sort_id: o.max_sort_id, |
@@ -21,6 +23,29 @@ let _getProduct = function(o) { | @@ -21,6 +23,29 @@ let _getProduct = function(o) { | ||
21 | default_images: o.default_images, | 23 | default_images: o.default_images, |
22 | goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : void 0 | 24 | goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : void 0 |
23 | }; | 25 | }; |
26 | + | ||
27 | + plan = _.sortBy(plan, item => { | ||
28 | + return +item.show_begin_time; | ||
29 | + }); | ||
30 | + | ||
31 | + if (plan.length) { | ||
32 | + let time = Math.round(new Date() / 1000); | ||
33 | + let effectPlan = []; | ||
34 | + | ||
35 | + plan.forEach(planItem => { | ||
36 | + if (planItem.effect_time > time) { | ||
37 | + effectPlan.push(planItem); | ||
38 | + } | ||
39 | + }); | ||
40 | + | ||
41 | + if (effectPlan.length && time > effectPlan[0].show_begin_time && effectPlan[0].show_status === '1') { // eslint-disable-line | ||
42 | + o.curPlanPrice = effectPlan[0].current_saleprice; | ||
43 | + | ||
44 | + _.assign({curPlanPrice: effectPlan[0].current_saleprice}, res); | ||
45 | + } | ||
46 | + } | ||
47 | + | ||
48 | + return res; | ||
24 | }; | 49 | }; |
25 | 50 | ||
26 | const gender = { | 51 | const gender = { |
@@ -22,6 +22,17 @@ | @@ -22,6 +22,17 @@ | ||
22 | <a class="new-brand-name {{#isEqualOr showBrandUrl '1'}}product-brand{{else}}product-detail{{/isEqualOr}}" href=""> | 22 | <a class="new-brand-name {{#isEqualOr showBrandUrl '1'}}product-brand{{else}}product-detail{{/isEqualOr}}" href=""> |
23 | <span class="brand-name" {{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span> | 23 | <span class="brand-name" {{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span> |
24 | </a> | 24 | </a> |
25 | + <div class="sales-imgs-new"> | ||
26 | + {{#if leftDownImg}} | ||
27 | + <img class="leftdownimg lazy" data-original="{{image2 leftDownImg q=85}}"> | ||
28 | + {{/if}} | ||
29 | + {{#isEqualOr isAdvance '1'}} | ||
30 | + <div class="advance" style="background-image: url({{advanceBgImg}});"> | ||
31 | + <img src="{{advanceBgImg}}" class="img-seat"> | ||
32 | + <span class="advance-price"></span> | ||
33 | + </div> | ||
34 | + {{/isEqualOr}} | ||
35 | + </div> | ||
25 | </div> | 36 | </div> |
26 | </a> | 37 | </a> |
27 | {{#if brandImg}} | 38 | {{#if brandImg}} |
@@ -176,6 +176,19 @@ | @@ -176,6 +176,19 @@ | ||
176 | z-index: 1; | 176 | z-index: 1; |
177 | } | 177 | } |
178 | 178 | ||
179 | + .sales-imgs-new { | ||
180 | + position: absolute; | ||
181 | + right: 0; | ||
182 | + bottom: 55px; | ||
183 | + width: 100%; | ||
184 | + height: auto; | ||
185 | + z-index: 1; | ||
186 | + | ||
187 | + .advance { | ||
188 | + display: none; | ||
189 | + } | ||
190 | + } | ||
191 | + | ||
179 | .leftdownimg { | 192 | .leftdownimg { |
180 | width: auto; | 193 | width: auto; |
181 | max-width: 100%; | 194 | max-width: 100%; |
-
Please register or login to post a comment