Authored by wenjiekong

添加优惠券状态判断

... ... @@ -94,7 +94,7 @@ exports.userAcquireStatus = (req, res, next) => {
if (!req.user.uid) {
uid = '';
}else {
} else {
uid = req.user.uid;
}
... ...
... ... @@ -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,15 +575,17 @@ $(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">' +
... ... @@ -609,7 +611,7 @@ $(function() {
'<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);
}
}
... ...