Showing
1 changed file
with
3 additions
and
1 deletions
| @@ -121,14 +121,16 @@ Page({ | @@ -121,14 +121,16 @@ Page({ | ||
| 121 | let list = res.data; | 121 | let list = res.data; |
| 122 | let couponArr = []; | 122 | let couponArr = []; |
| 123 | list.forEach(item => { | 123 | list.forEach(item => { |
| 124 | + item.aexpiration = item.aexpiration ? util.determine(item.aexpiration) : ''; | ||
| 124 | // 如果送券的数量大于剩余券的数量,设置送券的数量=剩余券的数量 | 125 | // 如果送券的数量大于剩余券的数量,设置送券的数量=剩余券的数量 |
| 125 | if (type == '1' && amount > item.grant_last && item.grant_last > 0) { | 126 | if (type == '1' && amount > item.grant_last && item.grant_last > 0) { |
| 126 | item.amountA = item.grant_last | 127 | item.amountA = item.grant_last |
| 127 | } else { | 128 | } else { |
| 128 | item.amountA = amount | 129 | item.amountA = amount |
| 129 | } | 130 | } |
| 131 | + console.log('券信息---',{...item}); | ||
| 130 | // 只留下开启状态 && 在券的有效期内 && 可领取数量大于0的 | 132 | // 只留下开启状态 && 在券的有效期内 && 可领取数量大于0的 |
| 131 | - if (item.is_open == '1' && this.data.dataStr < item.etime * 1 && ((type == '1' && item.grant_last >= item.amountA) || (type == '2' && item.grant_last > 0))) { | 133 | + 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))) { |
| 132 | console.log('可领取的券', item.aname, { | 134 | console.log('可领取的券', item.aname, { |
| 133 | ...item | 135 | ...item |
| 134 | }); | 136 | }); |
-
Please register or login to post a comment