|
|
var $tip, tipItime;
|
|
|
var $tip, tipItime, uid;
|
|
|
|
|
|
/* 领指定券 */
|
|
|
var activityId = $('#coupon-container').attr('param');
|
|
|
var userIsLogged = $('#coupon-container').attr('isLogged') === 'Y';
|
|
|
var isApp;
|
|
|
|
|
|
|
|
|
function GetQueryString(name) {
|
|
|
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
|
|
|
var r = window.location.search.substr(1).match(reg);
|
|
|
if(r!=null)return unescape(r[2]); return null;
|
|
|
}
|
|
|
|
|
|
$('.get-coupon').click(function () {
|
|
|
var couponId = $(this).attr('param');
|
|
|
isApp = $(this).attr('href') !== 'javascript:;';
|
|
|
|
|
|
if (isApp) {
|
|
|
uid = GetQueryString('uid');
|
|
|
}
|
|
|
|
|
|
if (!isNaN(activityId) && !isNaN(couponId)) {
|
|
|
getNamedCoupon(activityId, couponId, isApp, userIsLogged);
|
|
|
}
|
...
|
...
|
@@ -201,7 +213,7 @@ function getNamedCoupon(activityId, couponId, isApp, userIsLogged) |
|
|
{
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/cuxiao/coupon/getnamed',
|
|
|
url: !isApp ? '/cuxiao/coupon/getnamed' : '/cuxiao/coupon/getnamed?app_version=1&uid=' + uid,
|
|
|
data: 'activityId=' + activityId + '&couponId=' + couponId,
|
|
|
success: function (data) {
|
|
|
setCookie('_Coupon' + activityId, null, {
|
...
|
...
|
|