|
...
|
...
|
@@ -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
|
|
|
|
});
|
...
|
...
|
|