Authored by 郝肖肖

去除小数点,店铺优惠券

@@ -6,9 +6,9 @@ var $ = require('jquery'), @@ -6,9 +6,9 @@ var $ = require('jquery'),
6 var isCouponClick = true, 6 var isCouponClick = true,
7 appVersion = $('input[name="app_version"]').val(); 7 appVersion = $('input[name="app_version"]').val();
8 8
9 -$(".coupon-content .receive-btn").on('touchstart', function(e) { 9 +$(".coupon-content .receive-btn").closest('.swiper-slide').on('touchstart', function(e) {
10 var that = this, 10 var that = this,
11 - code = $(this).closest('.swiper-slide').data('id') || ''; 11 + code = $(this).data('id') || '';
12 12
13 if (isCouponClick === false) { 13 if (isCouponClick === false) {
14 return false; 14 return false;
@@ -32,7 +32,7 @@ $(".coupon-content .receive-btn").on('touchstart', function(e) { @@ -32,7 +32,7 @@ $(".coupon-content .receive-btn").on('touchstart', function(e) {
32 32
33 if (data.code === 200) { 33 if (data.code === 200) {
34 tip.show('领取成功'); 34 tip.show('领取成功');
35 - $(that).addClass('padding-20').html('已领取'); 35 + $(that).find('.receive-btn').addClass('padding-20').html('已领取');
36 $(that).unbind('touchstart');//移除绑定事件 36 $(that).unbind('touchstart');//移除绑定事件
37 return true; 37 return true;
38 } else if (data.code === 4401) { 38 } else if (data.code === 4401) {
@@ -514,7 +514,7 @@ class ListModel @@ -514,7 +514,7 @@ class ListModel
514 'id' => Encryption::encrypt($value['coupon_id']), 514 'id' => Encryption::encrypt($value['coupon_id']),
515 'name' => $value['coupon_name'], 515 'name' => $value['coupon_name'],
516 'pic' => $value['coupon_pic'], 516 'pic' => $value['coupon_pic'],
517 - 'money' => $value['money'], 517 + 'money' => intval($value['money']),
518 'status' => $value['status'] === 1 518 'status' => $value['status'] === 1
519 ); 519 );
520 } 520 }