Merge branch 'feature/sale-optim' into release/wap-optim4
Showing
5 changed files
with
33 additions
and
5 deletions
@@ -86,6 +86,7 @@ let index = (req, res, next) => { | @@ -86,6 +86,7 @@ let index = (req, res, next) => { | ||
86 | } | 86 | } |
87 | res.render('sale/index', Object.assign(params.renderData, { | 87 | res.render('sale/index', Object.assign(params.renderData, { |
88 | content: result, | 88 | content: result, |
89 | + localCss: true, | ||
89 | floorHeader: { | 90 | floorHeader: { |
90 | title: { | 91 | title: { |
91 | title: '最新降价' | 92 | title: '最新降价' |
1 | {{#data}} | 1 | {{#data}} |
2 | -{{#if ../discountActivity}} | 2 | + {{#if ../discountActivity}} |
3 | {{> common/floor-header-more}} | 3 | {{> common/floor-header-more}} |
4 | -{{/if}} | ||
5 | -<ul class="discount-list"> | 4 | + {{/if}} |
5 | + <ul class="discount-list"> | ||
6 | {{#list}} | 6 | {{#list}} |
7 | <li> | 7 | <li> |
8 | <a href="/product/sale/discount/detail?id={{id}}&channel={{@root.channel}}"> | 8 | <a href="/product/sale/discount/detail?id={{id}}&channel={{@root.channel}}"> |
9 | - <img class="lazy" data-original="{{image2 cover_url w=640 h=250 q=60}}" /> | 9 | + {{#within @index 3}} |
10 | + <img src="{{image2 cover_url w=640 h=250 q=60}}"/> | ||
11 | + {{^}} | ||
12 | + <img class="lazy" data-original="{{image2 cover_url w=640 h=250 q=60}}"/> | ||
13 | + {{/within}} | ||
10 | <p class="discount-cont"> | 14 | <p class="discount-cont"> |
11 | <span class="discount-title">{{title}}</span> | 15 | <span class="discount-title">{{title}}</span> |
12 | <span class="discount-time {{#if warn_color}}red-color{{/if}}">{{time}}</span> | 16 | <span class="discount-time {{#if warn_color}}red-color{{/if}}">{{time}}</span> |
@@ -14,5 +18,5 @@ | @@ -14,5 +18,5 @@ | ||
14 | </a> | 18 | </a> |
15 | </li> | 19 | </li> |
16 | {{/list}} | 20 | {{/list}} |
17 | -</ul> | 21 | + </ul> |
18 | {{/data}} | 22 | {{/data}} |
@@ -4,6 +4,8 @@ | @@ -4,6 +4,8 @@ | ||
4 | * @date: 2016/5/17 | 4 | * @date: 2016/5/17 |
5 | */ | 5 | */ |
6 | 6 | ||
7 | +require('../../scss/product/sale/_index.css'); | ||
8 | + | ||
7 | var $ = require('yoho-jquery'), | 9 | var $ = require('yoho-jquery'), |
8 | Swiper = require('yoho-swiper'), | 10 | Swiper = require('yoho-swiper'), |
9 | ellipsis = require('yoho-mlellipsis'), | 11 | ellipsis = require('yoho-mlellipsis'), |
@@ -3,3 +3,10 @@ | @@ -3,3 +3,10 @@ | ||
3 | @import "sale"; | 3 | @import "sale"; |
4 | @import "discount"; | 4 | @import "discount"; |
5 | @import "discount-detail"; | 5 | @import "discount-detail"; |
6 | + | ||
7 | +@import "../../layout/_swiper.css"; | ||
8 | +@import "../../channel/_banner-top.css"; | ||
9 | +@import "../../channel/_floor-header.css"; | ||
10 | +@import "../../channel/_discount-list.css"; | ||
11 | +@import "../../common/_good.css"; | ||
12 | +@import "../../common/_filter.css"; |
@@ -70,5 +70,19 @@ module.exports = { | @@ -70,5 +70,19 @@ module.exports = { | ||
70 | } else { | 70 | } else { |
71 | return opt.inverse(this); | 71 | return opt.inverse(this); |
72 | } | 72 | } |
73 | + }, | ||
74 | + | ||
75 | + /** | ||
76 | + * 小于某zhi | ||
77 | + * | ||
78 | + * @param variable | ||
79 | + * @param number | ||
80 | + */ | ||
81 | + within: function(variable, number, opt) { | ||
82 | + if (variable < number) { | ||
83 | + return opt.fn(this); | ||
84 | + } else { | ||
85 | + return opt.inverse(this); | ||
86 | + } | ||
73 | } | 87 | } |
74 | }; | 88 | }; |
-
Please register or login to post a comment