Showing
1 changed file
with
11 additions
and
12 deletions
@@ -29,10 +29,17 @@ function getUrlParam(name) { | @@ -29,10 +29,17 @@ function getUrlParam(name) { | ||
29 | } | 29 | } |
30 | 30 | ||
31 | $receive.on('click', function() { | 31 | $receive.on('click', function() { |
32 | - var $curDom = $(this); | 32 | + var $curDom = $(this), |
33 | + req; | ||
34 | + | ||
35 | + if (getUrlParam('app_version')) { | ||
36 | + req = '?app_version=' + getUrlParam('app_version'); | ||
37 | + } else { | ||
38 | + req = ''; | ||
39 | + } | ||
33 | 40 | ||
34 | $.ajax({ | 41 | $.ajax({ |
35 | - url: '/coupon/receiveCoupon', | 42 | + url: '/coupon/receiveCoupon' + req, |
36 | data: { | 43 | data: { |
37 | couponID: $curDom.parents('.coupon-floor').attr('coupon-id') | 44 | couponID: $curDom.parents('.coupon-floor').attr('coupon-id') |
38 | }, | 45 | }, |
@@ -40,13 +47,7 @@ $receive.on('click', function() { | @@ -40,13 +47,7 @@ $receive.on('click', function() { | ||
40 | success: function(data) { | 47 | success: function(data) { |
41 | var msg = data.msg, | 48 | var msg = data.msg, |
42 | status = data.status, | 49 | status = data.status, |
43 | - newUrl; | ||
44 | - | ||
45 | - if (getUrlParam('app_version')) { | ||
46 | - newUrl = data.url + '?code=' + getUrlParam('code') + '&app_version=' + getUrlParam('app_version'); | ||
47 | - } else { | ||
48 | newUrl = data.url + '?code=' + getUrlParam('code'); | 50 | newUrl = data.url + '?code=' + getUrlParam('code'); |
49 | - } | ||
50 | 51 | ||
51 | if (data.noLogin === true) { | 52 | if (data.noLogin === true) { |
52 | if ($('#intimacy-link').length <= 0) { | 53 | if ($('#intimacy-link').length <= 0) { |
@@ -101,14 +102,12 @@ $('.coupon-message-op-rel').on('click', function() { | @@ -101,14 +102,12 @@ $('.coupon-message-op-rel').on('click', function() { | ||
101 | }); | 102 | }); |
102 | 103 | ||
103 | if ($('#noData').length > 0) { | 104 | if ($('#noData').length > 0) { |
104 | - if (location.href.indexOf('?openby:yohobuy=') <= 0){ | 105 | + if (location.href.indexOf('?openby:yohobuy=') <= 0) { |
105 | tip.show('网络异常!'); | 106 | tip.show('网络异常!'); |
106 | - }else{ | ||
107 | - console.log(location.href.indexOf('?openby:yohobuy=')) | ||
108 | } | 107 | } |
109 | } | 108 | } |
110 | 109 | ||
111 | -$mask.on('click',function () { | 110 | +$mask.on('click', function() { |
112 | $mask.hide(); | 111 | $mask.hide(); |
113 | $message.hide(); | 112 | $message.hide(); |
114 | }); | 113 | }); |
-
Please register or login to post a comment