Showing
2 changed files
with
40 additions
and
27 deletions
@@ -51,7 +51,8 @@ | @@ -51,7 +51,8 @@ | ||
51 | orderCode = $('#orderCode').html(), | 51 | orderCode = $('#orderCode').html(), |
52 | oldUserCouponPic = $('#oldUserCouponPic').html(), | 52 | oldUserCouponPic = $('#oldUserCouponPic').html(), |
53 | newUserCouponPic = $('#newUserCouponPic').html(), | 53 | newUserCouponPic = $('#newUserCouponPic').html(), |
54 | - tipMessage = $('#tipMessage').html(); | 54 | + tipMessage = $('#tipMessage').html(), |
55 | + activityID = $('#activityID').html(); | ||
55 | 56 | ||
56 | $('#phone').bind('input propertychange', function() { | 57 | $('#phone').bind('input propertychange', function() { |
57 | if ($(this).val().length === 11) { | 58 | if ($(this).val().length === 11) { |
@@ -93,11 +94,11 @@ | @@ -93,11 +94,11 @@ | ||
93 | reg = /[0-9]{11}/; | 94 | reg = /[0-9]{11}/; |
94 | if (!reg.test(phone)) { | 95 | if (!reg.test(phone)) { |
95 | $('#dialog').removeClass('hidden'); | 96 | $('#dialog').removeClass('hidden'); |
96 | - $('.keep-out').removeClass('hidden'); | 97 | + $('.mask').removeClass('hidden'); |
97 | $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>'); | 98 | $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>'); |
98 | setTimeout(function() { | 99 | setTimeout(function() { |
99 | $('.messages').addClass('hidden'); | 100 | $('.messages').addClass('hidden'); |
100 | - $('.keep-out').addClass('hidden'); | 101 | + $('.mask').addClass('hidden'); |
101 | $('#dialog .content').html(' '); | 102 | $('#dialog .content').html(' '); |
102 | }, 1400); | 103 | }, 1400); |
103 | return; | 104 | return; |
@@ -111,6 +112,12 @@ | @@ -111,6 +112,12 @@ | ||
111 | dataType: 'json', | 112 | dataType: 'json', |
112 | success: function(data) { | 113 | success: function(data) { |
113 | if (data.result.code === 200) { | 114 | if (data.result.code === 200) { |
115 | + if (window._yas) { | ||
116 | + window._yas.sendCustomInfo({ | ||
117 | + activityID: activityID, | ||
118 | + returnCode: data.result.returnCode | ||
119 | + }, false); | ||
120 | + } | ||
114 | if (!data.result.newUser) { | 121 | if (!data.result.newUser) { |
115 | $('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic); | 122 | $('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic); |
116 | } else { | 123 | } else { |
@@ -122,48 +129,48 @@ | @@ -122,48 +129,48 @@ | ||
122 | } else if (data.result.geted) { | 129 | } else if (data.result.geted) { |
123 | $('.page .gain-coupon-centent').removeClass('hidden'); | 130 | $('.page .gain-coupon-centent').removeClass('hidden'); |
124 | $('.page .coupon-centent').addClass('hidden'); | 131 | $('.page .coupon-centent').addClass('hidden'); |
125 | - $('#mobile').html('优惠券已发放至账户' + data.result.mobile); | 132 | + $('#mobile').html('优惠券已放至' + data.result.mobile); |
126 | } else if (data.result.newUser) { | 133 | } else if (data.result.newUser) { |
127 | $('.coupon-centent .phone-input-content').addClass('hidden'); | 134 | $('.coupon-centent .phone-input-content').addClass('hidden'); |
128 | $('.coupon-centent .vertify-input-content').removeClass('hidden'); | 135 | $('.coupon-centent .vertify-input-content').removeClass('hidden'); |
129 | } else if (data.result.wrongNumb) { | 136 | } else if (data.result.wrongNumb) { |
130 | $('#dialog').removeClass('hidden'); | 137 | $('#dialog').removeClass('hidden'); |
131 | - $('.keep-out').removeClass('hidden'); | 138 | + $('.mask').removeClass('hidden'); |
132 | $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>'); | 139 | $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>'); |
133 | setTimeout(function() { | 140 | setTimeout(function() { |
134 | $('.messages').addClass('hidden'); | 141 | $('.messages').addClass('hidden'); |
135 | - $('.keep-out').addClass('hidden'); | 142 | + $('.mask').addClass('hidden'); |
136 | $('#dialog .content').html(' '); | 143 | $('#dialog .content').html(' '); |
137 | }, 1400); | 144 | }, 1400); |
138 | return; | 145 | return; |
139 | } else if (data.result.oldUserAskCouponOnceMore) { | 146 | } else if (data.result.oldUserAskCouponOnceMore) { |
140 | $('#dialog').removeClass('hidden'); | 147 | $('#dialog').removeClass('hidden'); |
141 | - $('.keep-out').removeClass('hidden'); | 148 | + $('.mask').removeClass('hidden'); |
142 | $('#dialog .content').html('<p class="phone-error">您今天已经领过咯,速度去有货购潮流!<p>'); | 149 | $('#dialog .content').html('<p class="phone-error">您今天已经领过咯,速度去有货购潮流!<p>'); |
143 | setTimeout(function() { | 150 | setTimeout(function() { |
144 | $('.messages').addClass('hidden'); | 151 | $('.messages').addClass('hidden'); |
145 | - $('.keep-out').addClass('hidden'); | 152 | + $('.mask').addClass('hidden'); |
146 | $('#dialog .content').html(' '); | 153 | $('#dialog .content').html(' '); |
147 | $('.page .gain-coupon-centent').removeClass('hidden'); | 154 | $('.page .gain-coupon-centent').removeClass('hidden'); |
148 | $('.page .coupon-centent').addClass('hidden'); | 155 | $('.page .coupon-centent').addClass('hidden'); |
149 | - $('#mobile').html('优惠券已发放至账户' + data.result.mobile); | 156 | + $('#mobile').html('优惠券已放至' + data.result.mobile); |
150 | }, 2500); | 157 | }, 2500); |
151 | return; | 158 | return; |
152 | } | 159 | } |
153 | } else { | 160 | } else { |
154 | $('#dialog').removeClass('hidden'); | 161 | $('#dialog').removeClass('hidden'); |
155 | - $('.keep-out').removeClass('hidden'); | 162 | + $('.mask').removeClass('hidden'); |
156 | $('#dialog .content').html('<p class="phone-error">网络错误<p>'); | 163 | $('#dialog .content').html('<p class="phone-error">网络错误<p>'); |
157 | setTimeout(function() { | 164 | setTimeout(function() { |
158 | $('.messages').addClass('hidden'); | 165 | $('.messages').addClass('hidden'); |
159 | - $('.keep-out').addClass('hidden'); | 166 | + $('.mask').addClass('hidden'); |
160 | $('#dialog .content').html(' '); | 167 | $('#dialog .content').html(' '); |
161 | }, 1400); | 168 | }, 1400); |
162 | } | 169 | } |
163 | }, | 170 | }, |
164 | error: function(data) { | 171 | error: function(data) { |
165 | $('#dialog').removeClass('hidden'); | 172 | $('#dialog').removeClass('hidden'); |
166 | - $('.keep-out').removeClass('hidden'); | 173 | + $('.mask').removeClass('hidden'); |
167 | $('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>'); | 174 | $('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>'); |
168 | console.log(data); | 175 | console.log(data); |
169 | } | 176 | } |
@@ -182,6 +189,12 @@ | @@ -182,6 +189,12 @@ | ||
182 | dataType: 'json', | 189 | dataType: 'json', |
183 | success: function(data) { | 190 | success: function(data) { |
184 | if (data.result.code === 200) { | 191 | if (data.result.code === 200) { |
192 | + if (window._yas) { | ||
193 | + window._yas.sendCustomInfo({ | ||
194 | + activityID: activityID, | ||
195 | + returnCode: data.result.returnCode | ||
196 | + }, false); | ||
197 | + } | ||
185 | if (!data.result.newUser) { | 198 | if (!data.result.newUser) { |
186 | $('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic); | 199 | $('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic); |
187 | } else { | 200 | } else { |
@@ -199,31 +212,31 @@ | @@ -199,31 +212,31 @@ | ||
199 | $('.coupon-centent .vertify-input-content').removeClass('hidden'); | 212 | $('.coupon-centent .vertify-input-content').removeClass('hidden'); |
200 | } else if (data.result.wrongNumb) { | 213 | } else if (data.result.wrongNumb) { |
201 | $('#dialog').removeClass('hidden'); | 214 | $('#dialog').removeClass('hidden'); |
202 | - $('.keep-out').removeClass('hidden'); | 215 | + $('.mask').removeClass('hidden'); |
203 | $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>'); | 216 | $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>'); |
204 | setTimeout(function() { | 217 | setTimeout(function() { |
205 | $('.messages').addClass('hidden'); | 218 | $('.messages').addClass('hidden'); |
206 | - $('.keep-out').addClass('hidden'); | 219 | + $('.mask').addClass('hidden'); |
207 | $('#dialog .content').html(' '); | 220 | $('#dialog .content').html(' '); |
208 | }, 1400); | 221 | }, 1400); |
209 | return; | 222 | return; |
210 | } else if (data.result.vertifyWrong) { | 223 | } else if (data.result.vertifyWrong) { |
211 | $('#dialog').removeClass('hidden'); | 224 | $('#dialog').removeClass('hidden'); |
212 | - $('.keep-out').removeClass('hidden'); | 225 | + $('.mask').removeClass('hidden'); |
213 | $('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>'); | 226 | $('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>'); |
214 | setTimeout(function() { | 227 | setTimeout(function() { |
215 | $('.messages').addClass('hidden'); | 228 | $('.messages').addClass('hidden'); |
216 | - $('.keep-out').addClass('hidden'); | 229 | + $('.mask').addClass('hidden'); |
217 | $('#dialog .content').html(' '); | 230 | $('#dialog .content').html(' '); |
218 | }, 1400); | 231 | }, 1400); |
219 | return; | 232 | return; |
220 | } else if (data.result.oldUserAskCouponOnceMore) { | 233 | } else if (data.result.oldUserAskCouponOnceMore) { |
221 | $('#dialog').removeClass('hidden'); | 234 | $('#dialog').removeClass('hidden'); |
222 | - $('.keep-out').removeClass('hidden'); | 235 | + $('.mask').removeClass('hidden'); |
223 | $('#dialog .content').html('<p class="phone-error">您今天已经领过咯,速度去有货购潮流!<p>'); | 236 | $('#dialog .content').html('<p class="phone-error">您今天已经领过咯,速度去有货购潮流!<p>'); |
224 | setTimeout(function() { | 237 | setTimeout(function() { |
225 | $('.messages').addClass('hidden'); | 238 | $('.messages').addClass('hidden'); |
226 | - $('.keep-out').addClass('hidden'); | 239 | + $('.mask').addClass('hidden'); |
227 | $('#dialog .content').html(' '); | 240 | $('#dialog .content').html(' '); |
228 | $('.page .gain-coupon-centent').removeClass('hidden'); | 241 | $('.page .gain-coupon-centent').removeClass('hidden'); |
229 | $('.page .coupon-centent').addClass('hidden'); | 242 | $('.page .coupon-centent').addClass('hidden'); |
@@ -235,51 +248,51 @@ | @@ -235,51 +248,51 @@ | ||
235 | // oldUserAskCouponOnceMore | 248 | // oldUserAskCouponOnceMore |
236 | } else { | 249 | } else { |
237 | $('#dialog').removeClass('hidden'); | 250 | $('#dialog').removeClass('hidden'); |
238 | - $('.keep-out').removeClass('hidden'); | 251 | + $('.mask').removeClass('hidden'); |
239 | $('#dialog .content').html('<p class="phone-error">' + data.result.message + '<p>'); | 252 | $('#dialog .content').html('<p class="phone-error">' + data.result.message + '<p>'); |
240 | setTimeout(function() { | 253 | setTimeout(function() { |
241 | $('.messages').addClass('hidden'); | 254 | $('.messages').addClass('hidden'); |
242 | - $('.keep-out').addClass('hidden'); | 255 | + $('.mask').addClass('hidden'); |
243 | $('#dialog .content').html(' '); | 256 | $('#dialog .content').html(' '); |
244 | }, 1400); | 257 | }, 1400); |
245 | } | 258 | } |
246 | }, | 259 | }, |
247 | error: function(data) { | 260 | error: function(data) { |
248 | $('#dialog').removeClass('hidden'); | 261 | $('#dialog').removeClass('hidden'); |
249 | - $('.keep-out').removeClass('hidden'); | 262 | + $('.mask').removeClass('hidden'); |
250 | $('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>'); | 263 | $('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>'); |
251 | console.log(data); | 264 | console.log(data); |
252 | } | 265 | } |
253 | }); | 266 | }); |
254 | } else { | 267 | } else { |
255 | $('#dialog').removeClass('hidden'); | 268 | $('#dialog').removeClass('hidden'); |
256 | - $('.keep-out').removeClass('hidden'); | 269 | + $('.mask').removeClass('hidden'); |
257 | $('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>'); | 270 | $('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>'); |
258 | setTimeout(function() { | 271 | setTimeout(function() { |
259 | $('.messages').addClass('hidden'); | 272 | $('.messages').addClass('hidden'); |
260 | - $('.keep-out').addClass('hidden'); | 273 | + $('.mask').addClass('hidden'); |
261 | $('#dialog .content').html(' '); | 274 | $('#dialog .content').html(' '); |
262 | }, 1400); | 275 | }, 1400); |
263 | } | 276 | } |
264 | }); | 277 | }); |
265 | $('.close').on('click', function() { | 278 | $('.close').on('click', function() { |
266 | $('.dialog').addClass('hidden'); | 279 | $('.dialog').addClass('hidden'); |
267 | - $('.keep-out').addClass('hidden'); | 280 | + $('.mask').addClass('hidden'); |
268 | $('#dialog .content').html(' '); | 281 | $('#dialog .content').html(' '); |
269 | }); | 282 | }); |
270 | $('.coupon-description span').on('click', function() { | 283 | $('.coupon-description span').on('click', function() { |
271 | $('#message').removeClass('hidden'); | 284 | $('#message').removeClass('hidden'); |
272 | - $('.keep-out').removeClass('hidden'); | 285 | + $('.mask').removeClass('hidden'); |
273 | }); | 286 | }); |
274 | $('.description').on('click', function() { | 287 | $('.description').on('click', function() { |
275 | $('#message').removeClass('hidden'); | 288 | $('#message').removeClass('hidden'); |
276 | - $('.keep-out').removeClass('hidden'); | 289 | + $('.mask').removeClass('hidden'); |
277 | }); | 290 | }); |
278 | 291 | ||
279 | $('.input-content').on('click', '.get', function() { | 292 | $('.input-content').on('click', '.get', function() { |
280 | if (window._yas) { | 293 | if (window._yas) { |
281 | window._yas.sendCustomInfo({ | 294 | window._yas.sendCustomInfo({ |
282 | - receiveCoupon: 'Y' | 295 | + activityID: activityID |
283 | }, true); | 296 | }, true); |
284 | } | 297 | } |
285 | }); | 298 | }); |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment