Authored by hf

do modify cuxiao coupon huodong js add checkout is logged

@@ -18,9 +18,12 @@ $('#get-all-coupon').click(function() { @@ -18,9 +18,12 @@ $('#get-all-coupon').click(function() {
18 }); 18 });
19 19
20 /* 检查是否有在领取中的券,有则直接领取 */ 20 /* 检查是否有在领取中的券,有则直接领取 */
21 -var cookieCouponId = cookie('_Coupon' + activityId);  
22 -if (cookieCouponId && !isNaN(cookieCouponId)) {  
23 - getNamedCoupon(activityId, cookieCouponId, isApp); 21 +var userIsLogged = $('#coupon-container').attr('isLogged');
  22 +if (userIsLogged === 'Y') {
  23 + var cookieCouponId = cookie('_Coupon' + activityId);
  24 + if (cookieCouponId && !isNaN(cookieCouponId)) {
  25 + getNamedCoupon(activityId, cookieCouponId, isApp);
  26 + }
24 } 27 }
25 28
26 /** 29 /**
1 -<!DOCTYPE html> 1 +<!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta charset="UTF-8"> 4 <meta charset="UTF-8">
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 </script> 25 </script>
26 </head> 26 </head>
27 <body> 27 <body>
28 - <div class="coupon-container" id="coupon-container" param="{{activityId}}"> 28 + <div class="coupon-container" id="coupon-container" param="{{activityId}}" isLogged="{{isLogged}}">
29 <div class="coupon-hd"></div> 29 <div class="coupon-hd"></div>
30 <div class="coupon-bd"> 30 <div class="coupon-bd">
31 <div class="bd-top"></div> 31 <div class="bd-top"></div>
1 -<!DOCTYPE html> 1 +<!DOCTYPE html>
2 <html lang="en"> 2 <html lang="en">
3 <head> 3 <head>
4 <meta charset="UTF-8"> 4 <meta charset="UTF-8">
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 </script> 25 </script>
26 </head> 26 </head>
27 <body> 27 <body>
28 - <div class="coupon-container" id="coupon-container" param="{{activityId}}"> 28 + <div class="coupon-container" id="coupon-container" param="{{activityId}}" isLogged="{{isLogged}}">
29 <div class="coupon-hd"></div> 29 <div class="coupon-hd"></div>
30 <div class="coupon-bd"> 30 <div class="coupon-bd">
31 <div class="bd-top"></div> 31 <div class="bd-top"></div>
1 -<!DOCTYPE html> 1 +<!DOCTYPE html>
2 <html lang="en"> 2 <html lang="en">
3 <head> 3 <head>
4 <meta charset="UTF-8"> 4 <meta charset="UTF-8">
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 </script> 25 </script>
26 </head> 26 </head>
27 <body> 27 <body>
28 - <div class="coupon-container" id="coupon-container" param="{{activityId}}"> 28 + <div class="coupon-container" id="coupon-container" param="{{activityId}}" isLogged="{{isLogged}}">
29 <div class="coupon-hd hd2"></div> 29 <div class="coupon-hd hd2"></div>
30 <div class="coupon-bd"> 30 <div class="coupon-bd">
31 <div class="bd-top"></div> 31 <div class="bd-top"></div>
1 -<!DOCTYPE html> 1 +<!DOCTYPE html>
2 <html lang="en"> 2 <html lang="en">
3 <head> 3 <head>
4 <meta charset="UTF-8"> 4 <meta charset="UTF-8">
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 </script> 25 </script>
26 </head> 26 </head>
27 <body> 27 <body>
28 - <div class="coupon-container" id="coupon-container" param="{{activityId}}"> 28 + <div class="coupon-container" id="coupon-container" param="{{activityId}}" isLogged="{{isLogged}}">
29 <div class="coupon-hd hd2"></div> 29 <div class="coupon-hd hd2"></div>
30 <div class="coupon-bd"> 30 <div class="coupon-bd">
31 <div class="bd-top"></div> 31 <div class="bd-top"></div>
@@ -43,7 +43,10 @@ class CouponController extends HuodongAction @@ -43,7 +43,10 @@ class CouponController extends HuodongAction
43 $isApp = null !== $this->get('app_version'); 43 $isApp = null !== $this->get('app_version');
44 $isAppLogged = true; 44 $isAppLogged = true;
45 if ($isApp) { 45 if ($isApp) {
  46 + $isLogged = $this->get('uid') !== null;
46 $isAppLogged = $this->checkIsLogin(); 47 $isAppLogged = $this->checkIsLogin();
  48 + } else {
  49 + $isLogged = $this->getUid();
47 } 50 }
48 51
49 $urlBoys = Helpers::url('/cuxiao/coupon/boysbrand'); 52 $urlBoys = Helpers::url('/cuxiao/coupon/boysbrand');
@@ -57,6 +60,7 @@ class CouponController extends HuodongAction @@ -57,6 +60,7 @@ class CouponController extends HuodongAction
57 'activityId' => 75, // 活动ID 60 'activityId' => 75, // 活动ID
58 'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题 61 'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
59 62
  63 + 'isLogged' => $isLogged ? 'Y' : 'N', // 标识是否登录
60 'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlBoys . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}', 64 'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlBoys . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}',
61 'weixinShare' => $isApp ? false : true, // 是否需要微信分享 65 'weixinShare' => $isApp ? false : true, // 是否需要微信分享
62 'shareLink' => $urlBoys, 66 'shareLink' => $urlBoys,
@@ -131,8 +135,12 @@ class CouponController extends HuodongAction @@ -131,8 +135,12 @@ class CouponController extends HuodongAction
131 $isApp = null !== $this->get('app_version'); 135 $isApp = null !== $this->get('app_version');
132 $isAppLogged = true; 136 $isAppLogged = true;
133 if ($isApp) { 137 if ($isApp) {
  138 + $isLogged = $this->get('uid') !== null;
134 $isAppLogged = $this->checkIsLogin(); 139 $isAppLogged = $this->checkIsLogin();
  140 + } else {
  141 + $isLogged = $this->getUid();
135 } 142 }
  143 +
136 $urlBoys = Helpers::url('/cuxiao/coupon/boysbrand'); 144 $urlBoys = Helpers::url('/cuxiao/coupon/boysbrand');
137 $urlGirls = Helpers::url('/cuxiao/coupon/girlsbrand'); 145 $urlGirls = Helpers::url('/cuxiao/coupon/girlsbrand');
138 $urlKids = Helpers::url('/cuxiao/coupon/kidsbrand'); 146 $urlKids = Helpers::url('/cuxiao/coupon/kidsbrand');
@@ -144,6 +152,7 @@ class CouponController extends HuodongAction @@ -144,6 +152,7 @@ class CouponController extends HuodongAction
144 'activityId' => 76, // 活动ID 152 'activityId' => 76, // 活动ID
145 'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题 153 'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
146 'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlGirls . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}', 154 'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlGirls . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}',
  155 + 'isLogged' => $isLogged ? 'Y' : 'N', // 标识是否登录
147 156
148 'weixinShare' => $isApp ? false : true, // 是否需要微信分享 157 'weixinShare' => $isApp ? false : true, // 是否需要微信分享
149 'shareLink' => $urlGirls, 158 'shareLink' => $urlGirls,
@@ -222,7 +231,10 @@ class CouponController extends HuodongAction @@ -222,7 +231,10 @@ class CouponController extends HuodongAction
222 $isApp = null !== $this->get('app_version'); 231 $isApp = null !== $this->get('app_version');
223 $isAppLogged = true; 232 $isAppLogged = true;
224 if ($isApp) { 233 if ($isApp) {
  234 + $isLogged = $this->get('uid') !== null;
225 $isAppLogged = $this->checkIsLogin(); 235 $isAppLogged = $this->checkIsLogin();
  236 + } else {
  237 + $isLogged = $this->getUid();
226 } 238 }
227 $urlBoys = Helpers::url('/cuxiao/coupon/boysbrand'); 239 $urlBoys = Helpers::url('/cuxiao/coupon/boysbrand');
228 $urlGirls = Helpers::url('/cuxiao/coupon/girlsbrand'); 240 $urlGirls = Helpers::url('/cuxiao/coupon/girlsbrand');
@@ -236,6 +248,7 @@ class CouponController extends HuodongAction @@ -236,6 +248,7 @@ class CouponController extends HuodongAction
236 'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题 248 'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
237 249
238 'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlKids . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}', 250 'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlKids . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}',
  251 + 'isLogged' => $isLogged ? 'Y' : 'N', // 标识是否登录
239 252
240 'weixinShare' => $isApp ? false : true, // 是否需要微信分享 253 'weixinShare' => $isApp ? false : true, // 是否需要微信分享
241 'shareLink' => $urlKids, 254 'shareLink' => $urlKids,
@@ -269,7 +282,10 @@ class CouponController extends HuodongAction @@ -269,7 +282,10 @@ class CouponController extends HuodongAction
269 $isApp = null !== $this->get('app_version'); 282 $isApp = null !== $this->get('app_version');
270 $isAppLogged = true; 283 $isAppLogged = true;
271 if ($isApp) { 284 if ($isApp) {
  285 + $isLogged = $this->get('uid') !== null;
272 $isAppLogged = $this->checkIsLogin(); 286 $isAppLogged = $this->checkIsLogin();
  287 + } else {
  288 + $isLogged = $this->getUid();
273 } 289 }
274 290
275 $urlBoys = Helpers::url('/cuxiao/coupon/boysbrand'); 291 $urlBoys = Helpers::url('/cuxiao/coupon/boysbrand');
@@ -284,6 +300,7 @@ class CouponController extends HuodongAction @@ -284,6 +300,7 @@ class CouponController extends HuodongAction
284 'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题 300 'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
285 301
286 'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlLifestyle . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}', 302 'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlLifestyle . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}',
  303 + 'isLogged' => $isLogged ? 'Y' : 'N', // 标识是否登录
287 304
288 'weixinShare' => $isApp ? false : true, // 是否需要微信分享 305 'weixinShare' => $isApp ? false : true, // 是否需要微信分享
289 'shareLink' => $urlLifestyle, 306 'shareLink' => $urlLifestyle,