Commit 74a7e9f6c98aa011f7983b7326652d1b1ffa334d

Authored by pengye
1 parent a8941617

免费券支付后送永久券问题处理

... ... @@ -121,14 +121,16 @@ Page({
let list = res.data;
let couponArr = [];
list.forEach(item => {
item.aexpiration = item.aexpiration ? util.determine(item.aexpiration) : '';
// 如果送券的数量大于剩余券的数量,设置送券的数量=剩余券的数量
if (type == '1' && amount > item.grant_last && item.grant_last > 0) {
item.amountA = item.grant_last
} else {
item.amountA = amount
}
console.log('券信息---',{...item});
// 只留下开启状态 && 在券的有效期内 && 可领取数量大于0的
if (item.is_open == '1' && this.data.dataStr < item.etime * 1 && ((type == '1' && item.grant_last >= item.amountA) || (type == '2' && item.grant_last > 0))) {
if (item.is_open == '1' && (this.data.dataStr < item.etime * 1 || item.aexpiration.valid_forever == '1') && ((type == '1' && item.grant_last >= item.amountA) || (type == '2' && item.grant_last > 0))) {
console.log('可领取的券', item.aname, {
...item
});
... ...