...
|
...
|
@@ -70,7 +70,7 @@ var couponPickConfig = { |
|
|
}]
|
|
|
},
|
|
|
over: {
|
|
|
content: '<i class="iconfont"></i>优惠券已领光',
|
|
|
content: '<i class="iconfont"></i>优惠券已抢光',
|
|
|
subContents: ['尝试领取其它优惠券吧'],
|
|
|
className: 'top-coupon-dialog',
|
|
|
btns: [{
|
...
|
...
|
@@ -103,7 +103,7 @@ function getCouponInfo() { |
|
|
money: data.money || 0,
|
|
|
name: data.name || '',
|
|
|
time: data.time || '',
|
|
|
status: 1 // 1:可领取,2:已领光,3:已领取
|
|
|
status: 1 // 1:可领取,2:已抢光,3:已领取
|
|
|
};
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -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];
|
|
|
|
|
|
for (i in couponObj) {
|
|
|
if (couponObj.hasOwnProperty(i)) {
|
|
|
coup = asyncObj[i];
|
|
|
|
|
|
if (coup) {
|
|
|
couponObj[i].status = coup.status;
|
|
|
coup.status === 3 ? setPicked(couponObj[i]) : false;
|
|
|
} else {
|
|
|
couponObj[i].status = 2; // 券不存在设置领取状态为已领光
|
|
|
couponObj[i].dom.text('已领光');
|
|
|
}
|
|
|
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('已抢光');
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -245,7 +245,7 @@ if ($couponWrap && $couponWrap.length) { |
|
|
|
|
|
if (!couponInfo) { // 优惠券号异常错误提示
|
|
|
return couponAlert(couponPickConfig.failed);
|
|
|
} else if (couponInfo.status === 2) { // 优惠券已领光提示
|
|
|
} else if (couponInfo.status === 2) { // 优惠券已抢光提示
|
|
|
return couponAlert(couponPickConfig.over);
|
|
|
} else if (couponInfo.status === 3) { // 优惠券已领取提示
|
|
|
return couponAlert(couponPickConfig.got);
|
...
|
...
|
|