Authored by yyq

birth coupon

@@ -261,8 +261,8 @@ const getMessageDetail = (uid, params, limit) => { @@ -261,8 +261,8 @@ const getMessageDetail = (uid, params, limit) => {
261 coupons.push({ 261 coupons.push({
262 id: value.id, 262 id: value.id,
263 remark: value.couponName || '', 263 remark: value.couponName || '',
264 - useTime: _.get(value, 'body.use_time', ''),  
265 - pickTime: _.get(value, 'body.collar_time', ''), 264 + useTime: _.get(msg, 'body.use_time', ''),
  265 + pickTime: _.get(msg, 'body.collar_time', ''),
266 canPick: true 266 canPick: true
267 }); 267 });
268 }); 268 });
@@ -62,6 +62,7 @@ $pickBtn.click(function() { @@ -62,6 +62,7 @@ $pickBtn.click(function() {
62 if (pickBusy) { 62 if (pickBusy) {
63 return; 63 return;
64 } 64 }
  65 +
65 pickBusy = true; 66 pickBusy = true;
66 $.ajax({ 67 $.ajax({
67 type: 'GET', 68 type: 'GET',
@@ -70,13 +71,13 @@ $pickBtn.click(function() { @@ -70,13 +71,13 @@ $pickBtn.click(function() {
70 }).then(function(jsonData) { 71 }).then(function(jsonData) {
71 var msg = jsonData.message; 72 var msg = jsonData.message;
72 73
73 - if (jsonData.code === 200) { 74 + if (+jsonData.code === 200) {
74 msg = '领取成功'; 75 msg = '领取成功';
75 - $(this).removeClass('pick-coupon-btn');  
76 - }  
77 - 76 + $pickBtn.removeClass('pick-coupon-btn');
  77 + } else {
78 pickBusy = false; 78 pickBusy = false;
  79 + }
79 80
80 - new Alert(msg); 81 + new Alert(msg).show();
81 }); 82 });
82 }); 83 });