Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
周少峰
8 years ago
Commit
5092d09a32c0c64b4d16b4b0a16f4083e5dc62a6
2 parents
bb9d9c46
164e1d4a
Merge branch 'release/5.6.1' of git.yoho.cn:fe/yohobuy-node into release/5.6.1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
32 deletions
apps/activity/models/coupon.js
apps/activity/views/action/coupon.hbs
apps/activity/models/coupon.js
View file @
5092d09
...
...
@@ -5,6 +5,7 @@
*/
'use strict'
;
const
_
=
require
(
'lodash'
);
const
Promise
=
require
(
'bluebird'
);
const
api
=
global
.
yoho
.
API
;
const
crypto
=
global
.
yoho
.
crypto
;
...
...
@@ -55,15 +56,15 @@ exports.getCouponData = (channel, params) => {
});
}
else
if
(
val
.
template_name
===
'getCoupon'
&&
val
.
data
.
length
)
{
// 优惠券楼层
if
(
!
coupon
.
data
[
index
-
1
].
data
||
!
coupon
.
data
[
index
-
1
].
data
.
text
)
{
return
;
}
const
obj
=
{
title
:
coupon
.
data
[
index
-
1
].
data
.
text
,
// 楼层标题
coupons
:
[]
};
// 楼层标题
if
(
_
.
get
(
coupon
,
`
data
[
$
{
index
-
1
}].
template_name
`
,
''
)
===
'text'
)
{
obj
.
title
=
_
.
get
(
coupon
,
`
data
[
$
{
index
-
1
}].
data
.
text
`
,
''
);
}
val
.
data
.
forEach
(
function
(
item
)
{
obj
.
coupons
.
push
({
id
:
crypto
.
encryption
(
'yoho9646abcdefgh'
,
item
.
couponID
),
// 加密优惠券号
...
...
apps/activity/views/action/coupon.hbs
View file @
5092d09
...
...
@@ -2,33 +2,37 @@
{{>
common
/
path-nav
}}
{{>
common
/
slide-banner
}}
{{#
categories
}}
<div
class=
"title clearfix"
>
<span>
{{
title
}}
</span>
</div>
{{#
coupons
}}
<div
class=
"coupon"
>
<a
href=
"
{{
url
}}
"
target=
"_blank"
href=
"javascript:void(0);"
data-id=
"
{{
id
}}
"
>
<img
src=
"
{{
image2
img
}}
"
>
{{#if
empty
}}
<div
class=
"coupon-mask"
></div>
{{/if}}
<div
class=
"enable info"
id=
"
{{
id
}}
"
>
<div
class=
"normal"
>
<p>
点击
</p>
<p>
领取
</p>
</div>
<div
class=
"got hidden"
>
<p>
已领取
</p>
<p
class=
"guang"
>
去使用
</p>
</div>
<div
class=
"empty hidden"
>
<p>
已抢光
</p>
<p
class=
"guang"
>
去逛逛
</p>
</div>
</div>
</a>
{{#if
title
}}
<div
class=
"title clearfix"
>
<span>
{{
title
}}
</span>
</div>
{{/
coupons
}}
{{/if}}
<div
class=
"clearfix"
>
{{#
coupons
}}
<div
class=
"coupon"
>
<a
href=
"
{{
url
}}
"
target=
"_blank"
href=
"javascript:void(0);"
data-id=
"
{{
id
}}
"
>
<img
src=
"
{{
image2
img
}}
"
>
{{#if
empty
}}
<div
class=
"coupon-mask"
></div>
{{/if}}
<div
class=
"enable info"
id=
"
{{
id
}}
"
>
<div
class=
"normal"
>
<p>
点击
</p>
<p>
领取
</p>
</div>
<div
class=
"got hidden"
>
<p>
已领取
</p>
<p
class=
"guang"
>
去使用
</p>
</div>
<div
class=
"empty hidden"
>
<p>
已抢光
</p>
<p
class=
"guang"
>
去逛逛
</p>
</div>
</div>
</a>
</div>
{{/
coupons
}}
</div>
{{/
categories
}}
</div>
\ No newline at end of file
</div>
...
...
Please
register
or
login
to post a comment