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
Email Patches
Plain Diff
Browse Files
Authored by
wenjiekong
9 years ago
Commit
2d67e4df85ee09834553b1aed2a3dcc8ec5c1488
1 parent
dd59dd28
添加优惠券状态判断
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
apps/product/controllers/students.js
apps/product/models/students.js
public/js/product/students.page.js
apps/product/controllers/students.js
View file @
2d67e4d
...
...
@@ -94,7 +94,7 @@ exports.userAcquireStatus = (req, res, next) => {
if
(
!
req
.
user
.
uid
)
{
uid
=
''
;
}
else
{
}
else
{
uid
=
req
.
user
.
uid
;
}
...
...
apps/product/models/students.js
View file @
2d67e4d
...
...
@@ -153,8 +153,8 @@ exports.verifyStudents = (params) => {
/**
* 获取优惠券领取状态
* @params
* @return
* @params
* @return
*/
exports
.
userAcquireStatus
=
(
uid
,
couponIds
)
=>
{
return
studentsApi
.
userAcquireStatus
(
uid
,
couponIds
).
...
...
public/js/product/students.page.js
View file @
2d67e4d
...
...
@@ -564,10 +564,10 @@ $('.ident-select-wrap').one('click', function() {
*埋点
*/
$
(
function
()
{
//加载优惠券状态
//
加载优惠券状态
var
couponIds
=
''
;
$
(
'.coupon > a'
).
each
(
function
(){
$
(
'.coupon > a'
).
each
(
function
()
{
couponIds
+=
$
(
this
).
attr
(
'data-id'
)
+
','
;
});
...
...
@@ -575,43 +575,45 @@ $(function() {
type
:
'GET'
,
url
:
'/product/students/userAcquireStatus'
,
data
:
{
couponIds
:
couponIds
.
substring
(
0
,
couponIds
.
length
-
1
)
couponIds
:
couponIds
.
substring
(
0
,
couponIds
.
length
-
1
)
},
success
:
function
(
res
)
{
var
code
=
res
.
code
;
var
code
=
res
.
code
,
i
,
text
;
console
.
info
(
res
);
if
(
code
==
200
)
{
for
(
var
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
var
text
=
''
;
if
(
code
===
200
)
{
for
(
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
text
=
''
;
if
(
res
.
data
[
i
].
status
===
1
)
{
text
=
'<div class="normal">'
+
text
=
'<div class="normal">'
+
'<p>点击</p>'
+
'<p>领取</p>'
+
'</div>'
;
}
if
(
res
.
data
[
i
].
status
===
2
)
{
text
=
'<div class="empty">'
+
text
=
'<div class="empty">'
+
'<p>已抢光</p>'
+
'<p class="guang">去逛逛</p>'
+
'</div>'
;
}
if
(
res
.
data
[
i
].
status
===
3
)
{
text
=
'<div class="got">'
+
text
=
'<div class="got">'
+
'<p>已领取</p>'
+
'<p class="guang">去使用</p>'
+
'</div>'
;
}
if
(
res
.
data
[
i
].
status
===
4
)
{
text
=
'<div class="normal">'
+
text
=
'<div class="normal">'
+
'<p>已过期</p>'
+
'<p class="guang">去逛逛</p>'
+
'</div>'
;
}
$
(
"[data-id='"
+
res
.
data
[
i
].
couponId
+
"']"
).
find
(
'.info'
).
html
(
text
);
$
(
'[data-id=\''
+
res
.
data
[
i
].
couponId
+
'\']'
).
find
(
'.info'
).
html
(
text
);
}
}
},
error
:
function
()
{
...
...
Please
register
or
login
to post a comment