1
|
-var $tip, tipItime;
|
1
|
+var $tip, tipItime, uid;
|
2
|
|
2
|
|
3
|
/* 领指定券 */
|
3
|
/* 领指定券 */
|
4
|
var activityId = $('#coupon-container').attr('param');
|
4
|
var activityId = $('#coupon-container').attr('param');
|
5
|
var userIsLogged = $('#coupon-container').attr('isLogged') === 'Y';
|
5
|
var userIsLogged = $('#coupon-container').attr('isLogged') === 'Y';
|
6
|
var isApp;
|
6
|
var isApp;
|
7
|
|
7
|
|
|
|
8
|
+
|
|
|
9
|
+function GetQueryString(name) {
|
|
|
10
|
+ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
|
|
|
11
|
+ var r = window.location.search.substr(1).match(reg);
|
|
|
12
|
+ if(r!=null)return unescape(r[2]); return null;
|
|
|
13
|
+}
|
|
|
14
|
+
|
8
|
$('.get-coupon').click(function () {
|
15
|
$('.get-coupon').click(function () {
|
9
|
var couponId = $(this).attr('param');
|
16
|
var couponId = $(this).attr('param');
|
10
|
isApp = $(this).attr('href') !== 'javascript:;';
|
17
|
isApp = $(this).attr('href') !== 'javascript:;';
|
|
|
18
|
+
|
|
|
19
|
+ if (isApp) {
|
|
|
20
|
+ uid = GetQueryString('uid');
|
|
|
21
|
+ }
|
|
|
22
|
+
|
11
|
if (!isNaN(activityId) && !isNaN(couponId)) {
|
23
|
if (!isNaN(activityId) && !isNaN(couponId)) {
|
12
|
getNamedCoupon(activityId, couponId, isApp, userIsLogged);
|
24
|
getNamedCoupon(activityId, couponId, isApp, userIsLogged);
|
13
|
}
|
25
|
}
|
|
@@ -201,7 +213,7 @@ function getNamedCoupon(activityId, couponId, isApp, userIsLogged) |
|
@@ -201,7 +213,7 @@ function getNamedCoupon(activityId, couponId, isApp, userIsLogged) |
201
|
{
|
213
|
{
|
202
|
$.ajax({
|
214
|
$.ajax({
|
203
|
type: 'POST',
|
215
|
type: 'POST',
|
204
|
- url: '/cuxiao/coupon/getnamed',
|
216
|
+ url: !isApp ? '/cuxiao/coupon/getnamed' : '/cuxiao/coupon/getnamed?app_version=1&uid=' + uid,
|
205
|
data: 'activityId=' + activityId + '&couponId=' + couponId,
|
217
|
data: 'activityId=' + activityId + '&couponId=' + couponId,
|
206
|
success: function (data) {
|
218
|
success: function (data) {
|
207
|
setCookie('_Coupon' + activityId, null, {
|
219
|
setCookie('_Coupon' + activityId, null, {
|