Merge branch 'release/6.0.2' of http://git.yoho.cn/fe/yohobuy-node into release/6.0.2
Showing
1 changed file
with
14 additions
and
14 deletions
@@ -70,7 +70,7 @@ var couponPickConfig = { | @@ -70,7 +70,7 @@ var couponPickConfig = { | ||
70 | }] | 70 | }] |
71 | }, | 71 | }, |
72 | over: { | 72 | over: { |
73 | - content: '<i class="iconfont"></i>优惠券已领光', | 73 | + content: '<i class="iconfont"></i>优惠券已抢光', |
74 | subContents: ['尝试领取其它优惠券吧'], | 74 | subContents: ['尝试领取其它优惠券吧'], |
75 | className: 'top-coupon-dialog', | 75 | className: 'top-coupon-dialog', |
76 | btns: [{ | 76 | btns: [{ |
@@ -103,7 +103,7 @@ function getCouponInfo() { | @@ -103,7 +103,7 @@ function getCouponInfo() { | ||
103 | money: data.money || 0, | 103 | money: data.money || 0, |
104 | name: data.name || '', | 104 | name: data.name || '', |
105 | time: data.time || '', | 105 | time: data.time || '', |
106 | - status: 1 // 1:可领取,2:已领光,3:已领取 | 106 | + status: 1 // 1:可领取,2:已抢光,3:已领取 |
107 | }; | 107 | }; |
108 | }); | 108 | }); |
109 | } | 109 | } |
@@ -137,18 +137,18 @@ function syncCouponStatus() { | @@ -137,18 +137,18 @@ function syncCouponStatus() { | ||
137 | for (i = 0; i < info.length; i++) { | 137 | for (i = 0; i < info.length; i++) { |
138 | asyncObj[info[i].coupon_id] = info[i]; | 138 | asyncObj[info[i].coupon_id] = info[i]; |
139 | } | 139 | } |
140 | + } | ||
141 | + | ||
142 | + for (i in couponObj) { | ||
143 | + if (couponObj.hasOwnProperty(i)) { | ||
144 | + coup = asyncObj[i]; | ||
140 | 145 | ||
141 | - for (i in couponObj) { | ||
142 | - if (couponObj.hasOwnProperty(i)) { | ||
143 | - coup = asyncObj[i]; | ||
144 | - | ||
145 | - if (coup && (coup.status === 1 || coup.status === 3)) { | ||
146 | - couponObj[i].status = coup.status; | ||
147 | - coup.status === 3 ? setPicked(couponObj[i]) : false; | ||
148 | - } else { | ||
149 | - couponObj[i].status = 2; // 券不存在设置领取状态为已领光 | ||
150 | - couponObj[i].dom.text('已领光'); | ||
151 | - } | 146 | + if (coup && (coup.status === 1 || coup.status === 3)) { |
147 | + couponObj[i].status = coup.status; | ||
148 | + coup.status === 3 ? setPicked(couponObj[i]) : false; | ||
149 | + } else { | ||
150 | + couponObj[i].status = 2; // 券不存在设置领取状态为已抢光 | ||
151 | + couponObj[i].dom.text('已抢光'); | ||
152 | } | 152 | } |
153 | } | 153 | } |
154 | } | 154 | } |
@@ -245,7 +245,7 @@ if ($couponWrap && $couponWrap.length) { | @@ -245,7 +245,7 @@ if ($couponWrap && $couponWrap.length) { | ||
245 | 245 | ||
246 | if (!couponInfo) { // 优惠券号异常错误提示 | 246 | if (!couponInfo) { // 优惠券号异常错误提示 |
247 | return couponAlert(couponPickConfig.failed); | 247 | return couponAlert(couponPickConfig.failed); |
248 | - } else if (couponInfo.status === 2) { // 优惠券已领光提示 | 248 | + } else if (couponInfo.status === 2) { // 优惠券已抢光提示 |
249 | return couponAlert(couponPickConfig.over); | 249 | return couponAlert(couponPickConfig.over); |
250 | } else if (couponInfo.status === 3) { // 优惠券已领取提示 | 250 | } else if (couponInfo.status === 3) { // 优惠券已领取提示 |
251 | return couponAlert(couponPickConfig.got); | 251 | return couponAlert(couponPickConfig.got); |
-
Please register or login to post a comment