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
yyq
8 years ago
Commit
f90057cd1d15759be1b1ac964910278b27ab2ea3
2 parents
4e4cc859
881c0216
Merge branch 'hotfix/shopCoupon' into gray
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
apps/product/controllers/list.js
public/js/product/index/top-coupon.js
apps/product/controllers/list.js
View file @
f90057c
...
...
@@ -183,8 +183,8 @@ exports.isFavoriteBrand = (req, res, next) => {
return
next
();
}
if
(
!
req
.
body
.
brandId
||
!
uid
)
{
return
res
.
json
({
code
:
400
,
message
:
'用户未登录或缺少参数'
});
if
(
!
req
.
body
.
brandId
)
{
return
res
.
json
({
code
:
400
,
message
:
'缺少参数'
});
}
req
.
ctx
(
searchApi
).
isFavoriteBrand
(
uid
,
brandId
).
then
(
result
=>
{
...
...
@@ -207,8 +207,8 @@ exports.shopCouponSync = (req, res, next) => {
return
next
();
}
if
(
!
id
||
!
uid
)
{
return
res
.
json
({
code
:
400
,
message
:
'用户未登录或缺少参数'
});
if
(
!
id
)
{
return
res
.
json
({
code
:
400
,
message
:
'缺少参数'
});
}
req
.
ctx
(
list
).
getUserCoupunStatus
(
id
,
uid
,
'shop'
).
then
(
result
=>
{
...
...
public/js/product/index/top-coupon.js
View file @
f90057c
...
...
@@ -137,18 +137,18 @@ function syncCouponStatus() {
for
(
i
=
0
;
i
<
info
.
length
;
i
++
)
{
asyncObj
[
info
[
i
].
coupon_id
]
=
info
[
i
];
}
}
for
(
i
in
couponObj
)
{
if
(
couponObj
.
hasOwnProperty
(
i
))
{
coup
=
asyncObj
[
i
];
if
(
coup
&&
(
coup
.
status
===
1
||
coup
.
status
===
3
))
{
couponObj
[
i
].
status
=
coup
.
status
;
coup
.
status
===
3
?
setPicked
(
couponObj
[
i
])
:
false
;
}
else
{
couponObj
[
i
].
status
=
2
;
// 券不存在设置领取状态为已抢光
couponObj
[
i
].
dom
.
text
(
'已抢光'
);
for
(
i
in
couponObj
)
{
if
(
couponObj
.
hasOwnProperty
(
i
))
{
coup
=
asyncObj
[
i
];
if
(
coup
&&
(
coup
.
status
===
1
||
coup
.
status
===
3
))
{
couponObj
[
i
].
status
=
coup
.
status
;
coup
.
status
===
3
?
setPicked
(
couponObj
[
i
])
:
false
;
}
else
{
couponObj
[
i
].
status
=
2
;
// 券不存在设置领取状态为已抢光
couponObj
[
i
].
dom
.
text
(
'已抢光'
);
}
}
}
}
...
...
Please
register
or
login
to post a comment