Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
徐炜
2016-12-15 14:41:04 +0800
Commit
3eb0be8286fd1dba473f6e6ce948abdf121b9e78
2 parents
f4c4af51
a6f1806f
Merge branch 'feature/sale-optim' into release/wap-optim4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
5 deletions
apps/product/controllers/sale.js
doraemon/views/partial/resources/discount-activity.hbs
public/js/product/sale.page.js
public/scss/product/sale/_index.css
utils/helpers.js
apps/product/controllers/sale.js
View file @
3eb0be8
...
...
@@ -86,6 +86,7 @@ let index = (req, res, next) => {
}
res
.
render
(
'sale/index'
,
Object
.
assign
(
params
.
renderData
,
{
content
:
result
,
localCss
:
true
,
floorHeader
:
{
title
:
{
title
:
'最新降价'
...
...
doraemon/views/partial/resources/discount-activity.hbs
View file @
3eb0be8
{{#
data
}}
{{#if
..
/
discountActivity
}}
{{#if
..
/
discountActivity
}}
{{>
common
/
floor-header-more
}}
{{/if}}
<ul
class=
"discount-list"
>
{{/if}}
<ul
class=
"discount-list"
>
{{#
list
}}
<li>
<a
href=
"/product/sale/discount/detail?id=
{{
id
}}
&channel=
{{
@root
.
channel
}}
"
>
<img
class=
"lazy"
data-original=
"
{{
image2
cover_url
w
=
640
h
=
250
q
=
60
}}
"
/>
{{#
within
@index
3
}}
<img
src=
"
{{
image2
cover_url
w
=
640
h
=
250
q
=
60
}}
"
/>
{{^}}
<img
class=
"lazy"
data-original=
"
{{
image2
cover_url
w
=
640
h
=
250
q
=
60
}}
"
/>
{{/
within
}}
<p
class=
"discount-cont"
>
<span
class=
"discount-title"
>
{{
title
}}
</span>
<span
class=
"discount-time
{{#if
warn_color
}}
red-color
{{/if}}
"
>
{{
time
}}
</span>
...
...
@@ -14,5 +18,5 @@
</a>
</li>
{{/
list
}}
</ul>
</ul>
{{/
data
}}
...
...
public/js/product/sale.page.js
View file @
3eb0be8
...
...
@@ -4,6 +4,8 @@
* @date: 2016/5/17
*/
require
(
'../../scss/product/sale/_index.css'
);
var
$
=
require
(
'yoho-jquery'
),
Swiper
=
require
(
'yoho-swiper'
),
ellipsis
=
require
(
'yoho-mlellipsis'
),
...
...
public/scss/product/sale/_index.css
View file @
3eb0be8
...
...
@@ -3,3 +3,10 @@
@import
"sale"
;
@import
"discount"
;
@import
"discount-detail"
;
@import
"../../layout/_swiper.css"
;
@import
"../../channel/_banner-top.css"
;
@import
"../../channel/_floor-header.css"
;
@import
"../../channel/_discount-list.css"
;
@import
"../../common/_good.css"
;
@import
"../../common/_filter.css"
;
...
...
utils/helpers.js
View file @
3eb0be8
...
...
@@ -70,5 +70,19 @@ module.exports = {
}
else
{
return
opt
.
inverse
(
this
);
}
},
/**
* 小于某zhi
*
* @param variable
* @param number
*/
within
:
function
(
variable
,
number
,
opt
)
{
if
(
variable
<
number
)
{
return
opt
.
fn
(
this
);
}
else
{
return
opt
.
inverse
(
this
);
}
}
};
...
...
Please
register
or
login
to post a comment