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
Email Patches
Plain Diff
Browse Files
Authored by
王水玲
6 years ago
Commit
dacf4f7d6098c4ab3fcc956d4b8b752895dd1861
1 parent
2a1268be
活动模版秒杀
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
public/hbs/activity/feature/seckill-product.hbs
public/hbs/activity/feature/seckill-tab.hbs
public/js/activity/feature.page.js
public/hbs/activity/feature/seckill-product.hbs
View file @
dacf4f7
...
...
@@ -5,8 +5,9 @@
<img
class=
"lazy"
data-original=
"
{{
image2
defaultImages
w
=
160
h
=
216
}}
"
alt=
"
{{
productName
}}
"
>
<div
class=
"product-brand"
style=
"
{{#if
..
/
productStyle
.
brandBgColor
}}
background:
{{
..
/
productStyle
.
brandBgColor
}}
;
{{/if}}
{{#if
..
/
productStyle
.
brandFontColor
}}
color:
{{
..
/
productStyle
.
brandFontColor
}}
;
{{/if}}
"
>
{{
productName
}}
</div>
{{#if
..
/
productStyle
.
brandFontColor
}}
color:
{{
..
/
productStyle
.
brandFontColor
}}
;
{{/if}}
"
>
{{
productName
}}
</div>
</div>
<div
class=
"product-info"
>
<div
class=
"seckill-status
{{#if
over
}}
status-over
{{else
if
wait
}}
status-wait
{{else}}
status-go
{{/if}}
"
>
...
...
public/hbs/activity/feature/seckill-tab.hbs
View file @
dacf4f7
...
...
@@ -2,7 +2,7 @@
<div
class=
"tab-item
{{#if
focus
}}
actived
{{/if}}
"
data-time=
"
{{
startTime
}}
"
data-id=
"
{{
activityId
}}
"
style=
"
{{#if
tabFontColor
}}
color:
{{
tabFontColor
}}
;
{{/if}}{{#if
focus
}}{{#if
tabSelectColor
}}
background:
{{
tabSelectColor
}}
;
{{/if}}{{else}}{{#if
tabColor
}}
background:
{{
tabColor
}}
;
{{/if}}{{/if}}
"
>
style=
"
{{#if
@root
.
tabParams
.
tabFontColor
}}
color:
{{
@root
.
tabParams
.
tabFontColor
}}
;
{{/if}}{{#if
focus
}}{{#if
@root
.
tabParams
.
tabSelectColor
}}
background:
{{
@root
.
tabParams
.
tabSelectColor
}}
;
{{/if}}{{else}}{{#if
@root
.
tabParams
.
tabColor
}}
background:
{{
@root
.
tabParams
.
tabColor
}}
;
{{/if}}{{/if}}
"
>
<span
class=
"date"
>
{{
date
}}
</span><span
class=
"time"
>
{{
time
}}
</span>
</div>
{{/
dateList
}}
\ No newline at end of file
...
...
public/js/activity/feature.page.js
View file @
dacf4f7
...
...
@@ -739,11 +739,6 @@ function viewSeckillProduct(products) {
function
loadSeckillList
()
{
let
$tab
=
$
(
'.seckill-tab'
);
let
tabParams
=
{
tabColor
:
$tab
.
data
(
'tabColor'
),
tabFontColor
:
$tab
.
data
(
'tabFontColor'
),
tabSelectColor
:
$tab
.
data
(
'tabSelectColor'
)
};
$
.
ajax
({
url
:
'/product/seckill/list'
...
...
@@ -752,18 +747,27 @@ function loadSeckillList() {
if
(
result
&&
result
.
activitys
)
{
result
.
activitys
.
forEach
(
item
=>
{
dateList
.
push
(
Object
.
assign
(
{
dateList
.
push
({
startTime
:
item
.
startTime
,
date
:
formatTime
(
item
.
startTime
),
time
:
item
.
time
,
focus
:
item
.
focus
,
activityId
:
item
.
activityId
}
,
tabParams
)
);
});
});
$
(
'.seckill .seckill-tab'
).
html
(
seckillTabTpl
({
dateList
:
dateList
}));
$
(
'.seckill .seckill-tab'
).
each
((
key
,
item
)
=>
{
let
$curTab
=
$
(
$tab
[
key
]);
$
(
item
).
html
(
seckillTabTpl
({
dateList
:
dateList
,
tabParams
:
{
tabColor
:
$curTab
.
data
(
'tabColor'
),
tabFontColor
:
$curTab
.
data
(
'tabFontColor'
),
tabSelectColor
:
$curTab
.
data
(
'tabSelectColor'
)
}
}));
});
}
if
(
result
&&
result
.
products
)
{
...
...
Please
register
or
login
to post a comment