...
|
...
|
@@ -83,7 +83,7 @@ exports.getCouponData = (channel, params) => { |
|
|
exports.getCouponStatus = (params) => {
|
|
|
return Promise.coroutine(function*() {
|
|
|
const coupon = yield api.get('', Object.assign(params, {
|
|
|
method: 'app.promotion.queryCouponCenter'
|
|
|
method: 'app.promotion.couponStatus'
|
|
|
}));
|
|
|
const result = {
|
|
|
code: coupon.code,
|
...
|
...
|
@@ -95,26 +95,21 @@ exports.getCouponStatus = (params) => { |
|
|
break;
|
|
|
}
|
|
|
|
|
|
coupon.data.forEach(function(val) {
|
|
|
if (val.template_name === 'getCoupon' && val.data.length) {
|
|
|
// 优惠券楼层
|
|
|
val.data.forEach(function(item) {
|
|
|
const status = Number(item.status);
|
|
|
coupon.data.forEach(function(item) {
|
|
|
const status = Number(item.status);
|
|
|
|
|
|
if ([2, 3].indexOf(status) > -1) {
|
|
|
const cou = {
|
|
|
id: crypto.encryption('yoho9646abcdefgh', item.couponID) // 加密优惠券号
|
|
|
};
|
|
|
if ([2, 3].indexOf(status) > -1) {
|
|
|
const cou = {
|
|
|
id: crypto.encryption('yoho9646abcdefgh', String(item.couponId)) // 加密优惠券号
|
|
|
};
|
|
|
|
|
|
if (status === 2) {
|
|
|
cou.empty = true; // 优惠券已抢光
|
|
|
} else if (status === 3) {
|
|
|
cou.got = true; // 优惠券已领取
|
|
|
}
|
|
|
if (status === 2) {
|
|
|
cou.empty = true; // 优惠券已抢光
|
|
|
} else if (status === 3) {
|
|
|
cou.got = true; // 优惠券已领取
|
|
|
}
|
|
|
|
|
|
result.categories.push(cou);
|
|
|
}
|
|
|
});
|
|
|
result.categories.push(cou);
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
|