Coupon.php
41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
<?php
use Action\HuodongAction;
use Plugin\Helpers;
use LibModels\Wap\Cuxiao\ActivityData;
use Api\Sign;
use Api\Yohobuy;
/**
* 领券活动
*
* @name Coupon
* @package Cuxiao
* @copyright yoho.inc
* @version 1.0 (2015-11-25 13:08:58)
* @author fei.hong <fei.hong@yoho.cn>
*/
class CouponController extends HuodongAction
{
/* 用户会话ID */
const SESSION_UID = 'coupon_uid';
/**
正式活动ID(绑优惠券)
男生 364
女生 366
潮童 368
创意生活 370
正式活动share_ID
男生 406
女生 408
潮童 410
创意生活 412
*/
/**
* 男生的品牌领券
*/
public function boysbrandAction()
{
// 判断是否是应用访问, 拼接APP需要的URL参数
$isApp = null !== $this->get('app_version');
$isAppLogged = true;
if ($isApp) {
$isAppLogged = $this->checkIsLogin();
}
$urlBoys = Helpers::url('/cuxiao/coupon/boysbrand');
$urlGirls = Helpers::url('/cuxiao/coupon/girlsbrand');
$urlKids = Helpers::url('/cuxiao/coupon/kidsbrand');
$urlLifestyle = Helpers::url('/cuxiao/coupon/lifestylebrand');
$urlShare = Yohobuy::SERVICE_URL . '/operations/api/v5/webshare/getShare';
$urlEncode = strtr($urlBoys, array('/' => '\\/'));
$this->_view->display('boysbrand', array(
'activityId' => 75, // 活动ID
'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlBoys . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}',
'weixinShare' => $isApp ? false : true, // 是否需要微信分享
'shareLink' => $urlBoys,
'shareTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!',
'shareImg' => 'http://img12.static.yhbimg.com/couponImg/2015/11/26/09/0226ad7f8bcf5467a789e17b761c7557e0.jpg',
'shareDesc' => '2015感恩季!品牌专属优惠券限时送!先领券,再购物,让你乐享整个冬季!',
'url_boys' => $urlBoys . '?yohobuy={"action":"go.h5","params":{"id":"75","share":"' . $urlShare . '","shareparam":{"share_id":"406"},"islogin":"N","type":0,"url":"' . $urlBoys . '","param":{}}}',
'url_girls' => $urlGirls . '?yohobuy={"action":"go.h5","params":{"id":"76","share":"' . $urlShare . '","shareparam":{"share_id":"408"},"islogin":"N","type":0,"url":"' . $urlGirls . '","param":{}}}',
'url_kids' => $urlKids . '?yohobuy={"action":"go.h5","params":{"id":"77","share":"' . $urlShare . '","shareparam":{"share_id":"410"},"islogin":"N","type":0,"url":"' . $urlKids . '","param":{}}}',
'url_lifestyle' => $urlLifestyle . '?yohobuy={"action":"go.h5","params":{"id":"78","share":"' . $urlShare . '","shareparam":{"share_id":"412"},"islogin":"N","type":0,"url":"' . $urlLifestyle . '","param":{}}}',
'url_350' => 'http://list.m.yohobuy.com/?gender=1,3&brand=350&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"350","title":"MACROPUS"}}',
'url_160' => 'http://list.m.yohobuy.com/?gender=1,3&brand=60&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"60","title":"izzue"}}',
'url_341' => 'http://list.m.yohobuy.com/?gender=1,3&brand=341&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"341","title":"鬼洗"}}',
'url_710' => 'http://list.m.yohobuy.com/?gender=1,3&brand=710&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"710","title":"MADNESS"}}',
'url_471' => 'http://list.m.yohobuy.com/?gender=1,3&brand=471&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"471","title":"DUSTY"}}',
'url_495' => 'http://list.m.yohobuy.com/?gender=1,3&brand=495&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"495","title":"Lightning Bear"}}',
'url_235' => 'http://list.m.yohobuy.com/?gender=1,3&brand=235&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"235","title":"Creamsoda"}}',
'url_583' => 'http://list.m.yohobuy.com/?gender=1,3&brand=583&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"583","title":"Master Plan"}}',
'url_402' => 'http://list.m.yohobuy.com/?gender=1,3&brand=402&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"402","title":"PROTEST博特斯"}}',
'url_720' => 'http://list.m.yohobuy.com/?gender=1,3&brand=720&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"720","title":"NBA STYLE"}}',
'url_138' => 'http://list.m.yohobuy.com/?gender=1,3&brand=138&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"138","title":"THETHING"}}',
'url_506' => 'http://list.m.yohobuy.com/?gender=1,3&brand=506&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"506","title":"FUN"}}',
'url_419' => 'http://list.m.yohobuy.com/?gender=1,3&brand=419&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"419","title":"HASO"}}',
'url_581' => 'http://list.m.yohobuy.com/?gender=1,3&brand=581&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"581","title":"S.ANGELO"}}',
'url_722' => 'http://list.m.yohobuy.com/?gender=1,3&brand=722&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"722","title":"FAIRWHALE JEANS"}}',
'url_191' => 'http://list.m.yohobuy.com/?gender=1,3&brand=191&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"191","title":"Holymoly"}}',
'url_417' => 'http://list.m.yohobuy.com/?gender=1,3&brand=417&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"417","title":"DEPOT3"}}',
'url_672' => 'http://list.m.yohobuy.com/?gender=1,3&brand=672&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"672","title":"Shapeless"}}',
'url_589' => 'http://list.m.yohobuy.com/?gender=1,3&brand=589&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"589","title":"One Republic"}}',
'url_707' => 'http://list.m.yohobuy.com/?gender=1,3&brand=707&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"707","title":"Black Scale"}}',
'url_550' => 'http://list.m.yohobuy.com/?gender=1,3&brand=550&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"550","title":"SYS.tag"}}',
'url_600' => 'http://list.m.yohobuy.com/?gender=1,3&brand=600&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"600","title":"HAPPYATOMIC"}}',
'url_152' => 'http://list.m.yohobuy.com/?gender=1,3&brand=52&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"52","title":"HEART"}}',
'url_464' => 'http://list.m.yohobuy.com/?gender=1,3&brand=464&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"464","title":"Storm Stamps"}}',
'url_102' => 'http://list.m.yohobuy.com/?gender=1,3&brand=1021&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"1021","title":"GAS"}}',
'url_851' => 'http://list.m.yohobuy.com/?gender=1,3&brand=851&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"851","title":"Reshake"}}',
'url_699' => 'http://list.m.yohobuy.com/?gender=1,3&brand=699&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"699","title":"DGK"}}',
'url_103' => 'http://list.m.yohobuy.com/?gender=1,3&brand=1023&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"1023","title":"AGAMEMNON"}}',
'url_114' => 'http://list.m.yohobuy.com/?gender=1,3&brand=114&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"114","title":"5CM"}}',
'url_847' => 'http://list.m.yohobuy.com/?gender=1,3&brand=847&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"847","title":"Clarks ORIGINALS"}}',
'url_536' => 'http://list.m.yohobuy.com/?gender=1,3&brand=536&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"536","title":"ABLE JEANS"}}',
'url_230' => 'http://list.m.yohobuy.com/?gender=1,3&brand=230&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"230","title":"Dickies"}}',
'url_343' => 'http://list.m.yohobuy.com/?gender=1,3&brand=343&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"343","title":"DC"}}',
'url_692' => 'http://list.m.yohobuy.com/?gender=1,3&brand=692&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"692","title":"TRENDIANO"}}',
'url_870' => 'http://list.m.yohobuy.com/?gender=1,3&brand=870&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"870","title":"浮士绘"}}',
'url_444' => 'http://list.m.yohobuy.com/?gender=1,3&brand=444&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"444","title":"Evildoer"}}',
'url_676' => 'http://list.m.yohobuy.com/?gender=1,3&brand=676&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"676","title":"Filter017"}}',
'url_308' => 'http://list.m.yohobuy.com/?gender=1,3&brand=308&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"308","title":"SOLO"}}',
'url_199' => 'http://list.m.yohobuy.com/?gender=1,3&brand=199&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"199","title":"ZERONE"}}',
'url_714' => 'http://list.m.yohobuy.com/?gender=1,3&brand=714&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"714","title":"threeSociety"}}',
'url_553' => 'http://list.m.yohobuy.com/?gender=1,3&brand=553&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"553","title":"DUNKELVOLK"}}',
'url_194' => 'http://list.m.yohobuy.com/?gender=1,3&brand=194&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"194","title":"New Era"}}',
'url_462' => 'http://list.m.yohobuy.com/?gender=1,3&brand=462&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"462","title":"SPRAYGROUND"}}',
'url_136' => 'http://list.m.yohobuy.com/?gender=1,3&brand=136&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"136","title":"EASTPAK"}}',
'url_641' => 'http://list.m.yohobuy.com/?gender=1,3&brand=641&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"641","title":"inmix"}}',
'url_832' => 'http://list.m.yohobuy.com/?gender=1,3&brand=832&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"832","title":"CHUMS"}}',
'url_940' => 'http://list.m.yohobuy.com/?gender=1,3&brand=940&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"940","title":"Trenta"}}',
'url_719' => 'http://list.m.yohobuy.com/?gender=1,3&brand=719&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"719","title":"Rollie"}}',
));
}
/**
* 女生的品牌领券
*
* 上线时间 2015/12/1
*/
public function girlsbrandAction()
{
// 判断是否是应用访问, 拼接APP需要的URL参数
$isApp = null !== $this->get('app_version');
$isAppLogged = true;
if ($isApp) {
$isAppLogged = $this->checkIsLogin();
}
$urlBoys = Helpers::url('/cuxiao/coupon/boysbrand');
$urlGirls = Helpers::url('/cuxiao/coupon/girlsbrand');
$urlKids = Helpers::url('/cuxiao/coupon/kidsbrand');
$urlLifestyle = Helpers::url('/cuxiao/coupon/lifestylebrand');
$urlShare = Yohobuy::SERVICE_URL . '/operations/api/v5/webshare/getShare';
$urlEncode = strtr($urlGirls, array('/' => '\\/'));
$this->_view->display('girlsbrand', array(
'activityId' => 76, // 活动ID
'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlGirls . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}',
'weixinShare' => $isApp ? false : true, // 是否需要微信分享
'shareLink' => $urlGirls,
'shareTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!',
'shareImg' => 'http://img12.static.yhbimg.com/couponImg/2015/11/26/09/0226ad7f8bcf5467a789e17b761c7557e0.jpg',
'shareDesc' => '2015感恩季!品牌专属优惠券限时送!先领券,再购物,让你乐享整个冬季!',
'url_boys' => $urlBoys . '?yohobuy={"action":"go.h5","params":{"id":"75","share":"' . $urlShare . '","shareparam":{"share_id":"406"},"islogin":"N","type":0,"url":"' . $urlBoys . '","param":{}}}',
'url_girls' => $urlGirls . '?yohobuy={"action":"go.h5","params":{"id":"76","share":"' . $urlShare . '","shareparam":{"share_id":"408"},"islogin":"N","type":0,"url":"' . $urlGirls . '","param":{}}}',
'url_kids' => $urlKids . '?yohobuy={"action":"go.h5","params":{"id":"77","share":"' . $urlShare . '","shareparam":{"share_id":"410"},"islogin":"N","type":0,"url":"' . $urlKids . '","param":{}}}',
'url_lifestyle' => $urlLifestyle . '?yohobuy={"action":"go.h5","params":{"id":"78","share":"' . $urlShare . '","shareparam":{"share_id":"412"},"islogin":"N","type":0,"url":"' . $urlLifestyle . '","param":{}}}',
'url_570' => 'http://list.m.yohobuy.com/?gender=2,3&brand=570&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"570","title":"iyogurt"}}',
'url_864' => 'http://list.m.yohobuy.com/?gender=2,3&brand=868&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"868","title":"Mango"}}',
'url_824' => 'http://list.m.yohobuy.com/?gender=2,3&brand=824&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"824","title":"M.WOWL"}}',
'url_536' => 'http://list.m.yohobuy.com/?gender=2,3&brand=536&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"536","title":"ABLEJEANS"}}',
'url_257' => 'http://list.m.yohobuy.com/?gender=2,3&brand=257&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"257","title":"MYGESMART"}}',
'url_342' => 'http://list.m.yohobuy.com/?gender=2,3&brand=342&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"342","title":":CHOCOOLATE"}}',
'url_354' => 'http://list.m.yohobuy.com/?gender=2,3&brand=354&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"354","title":"CHEAPMONDAY"}}',
'url_60' => 'http://list.m.yohobuy.com/?gender=2,3&brand=60&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"60","title":"izzue"}}',
'url_324' => 'http://list.m.yohobuy.com/?gender=2,3&brand=324&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"324","title":"b+ab"}}',
'url_589' => 'http://list.m.yohobuy.com/?gender=2,3&brand=589&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"589","title":"One Republic"}}',
'url_191' => 'http://list.m.yohobuy.com/?gender=2,3&brand=191&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"191","title":"Holymoly"}}',
'url_4' => 'http://list.m.yohobuy.com/?gender=2,3&brand=4&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"4","title":"5cm"}}',
'url_768' => 'http://list.m.yohobuy.com/?gender=2,3&brand=768&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"768","title":"PH5"}}',
'url_649' => 'http://list.m.yohobuy.com/?gender=2,3&brand=649&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"649","title":"Jeffrey Campbell"}}',
'url_1026' => 'http://list.m.yohobuy.com/?gender=2,3&brand=1026&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"1026","title":"JNBY"}}',
'url_1027' => 'http://list.m.yohobuy.com/?gender=2,3&brand=1027&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"1027","title":"less"}}',
'url_481' => 'http://list.m.yohobuy.com/?gender=2,3&brand=481&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"481","title":"dresslab"}}',
'url_450' => 'http://list.m.yohobuy.com/?gender=2,3&brand=450&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"450","title":"IntoTheRainbow"}}',
'url_256' => 'http://list.m.yohobuy.com/?gender=2,3&brand=256&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"256","title":"BLACKJACK"}}',
'url_701' => 'http://list.m.yohobuy.com/?gender=2,3&brand=701&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"701","title":"Bearburry"}}',
'url_506' => 'http://list.m.yohobuy.com/?gender=2,3&brand=506&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"506","title":"FUN"}}',
'url_569' => 'http://list.m.yohobuy.com/?gender=2,3&brand=569&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"569","title":"Aline de rose"}}',
'url_981' => 'http://list.m.yohobuy.com/?gender=2,3&brand=981&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"981","title":"FUSIONCO"}}',
'url_402' => 'http://list.m.yohobuy.com/?gender=2,3&brand=402&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"402","title":"PROTEST博特斯"}}',
'url_1021' => 'http://list.m.yohobuy.com/?gender=2,3&brand=1021&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"1021","title":"GAS"}}',
'url_860' => 'http://list.m.yohobuy.com/?gender=2,3&brand=860&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"860","title":"VING"}}',
'url_435' => 'http://list.m.yohobuy.com/?gender=2,3&brand=435&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"435","title":"Dare To Dream"}}',
'url_327' => 'http://list.m.yohobuy.com/?gender=2,3&brand=327&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"327","title":"Arubafootwear"}}',
'url_505' => 'http://list.m.yohobuy.com/?gender=2,3&brand=505&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"505","title":"DEVIL NUT"}}',
'url_987' => 'http://list.m.yohobuy.com/?gender=2,3&brand=987&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"987","title":"RIBERA"}}',
'url_481' => 'http://list.m.yohobuy.com/?gender=2,3&brand=481&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"481","title":"dresslab"}}',
'url_450' => 'http://list.m.yohobuy.com/?gender=2,3&brand=450&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"450","title":"IntoTheRainbow"}}',
'url_256' => 'http://list.m.yohobuy.com/?gender=2,3&brand=256&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"256","title":"BLACKJACK"}}',
'url_738' => 'http://list.m.yohobuy.com/?gender=2,3&brand=738&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"738","title":"Juni&Juli"}}',
'url_947' => 'http://list.m.yohobuy.com/?gender=2,3&brand=947&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"947","title":"LONSDALE龙狮戴尔"}}',
'url_760' => 'http://list.m.yohobuy.com/?gender=2,3&brand=760&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"760","title":"bread n butter"}}',
'url_738' => 'http://list.m.yohobuy.com/?gender=2,3&brand=738&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"738","title":"Juni&Juli"}}',
'url_778' => 'http://list.m.yohobuy.com/?gender=2,3&brand=778&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"778","title":"SLY"}}',
'url_570' => 'http://list.m.yohobuy.com/?gender=2,3&brand=570&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"570","title":"iyogurt"}}',
'url_868' => 'http://list.m.yohobuy.com/?gender=2,3&brand=868&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"868","title":"Mango"}}',
'url_824' => 'http://list.m.yohobuy.com/?gender=2,3&brand=824&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"824","title":"M.WOWL"}}',
'url_1031' => 'http://list.m.yohobuy.com/?gender=2,3&brand=1031&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"1031","title":"WHERE WHAT WHO 互然"}}',
'url_734' => 'http://list.m.yohobuy.com/?gender=2,3&brand=734&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"734","title":"Dear栗"}}',
'url_713' => 'http://list.m.yohobuy.com/?gender=2,3&brand=713&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"713","title":"D-mop"}}',
'url_380' => 'http://list.m.yohobuy.com/?gender=2,3&brand=380&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"380","title":"supreme-lala"}}',
'url_909' => 'http://list.m.yohobuy.com/?gender=2,3&brand=909&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"909","title":"清茶 Clear Tea"}}',
'url_524' => 'http://list.m.yohobuy.com/?gender=2,3&brand=524&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"524","title":"I LOVE CHOC"}}',
'url_968' => 'http://list.m.yohobuy.com/?gender=2,3&brand=968&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"968","title":"Activate water"}}',
'url_517' => 'http://list.m.yohobuy.com/?gender=2,3&brand=517&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"517","title":"T.U.K"}}',
'url_419' => 'http://list.m.yohobuy.com/?gender=2,3&brand=419&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"419","title":"HASO"}}',
'url_1026' => 'http://list.m.yohobuy.com/?gender=2,3&brand=1026&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"1026","title":"JNBY"}}',
'url_1027' => 'http://list.m.yohobuy.com/?gender=2,3&brand=1027&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"1027","title":"less"}}',
));
}
/**
* 潮童的品牌领券
*
* 上线时间 2015/12/1
*/
public function kidsbrandAction()
{
// 判断是否是应用访问, 拼接APP需要的URL参数
$isApp = null !== $this->get('app_version');
$isAppLogged = true;
if ($isApp) {
$isAppLogged = $this->checkIsLogin();
}
$urlBoys = Helpers::url('/cuxiao/coupon/boysbrand');
$urlGirls = Helpers::url('/cuxiao/coupon/girlsbrand');
$urlKids = Helpers::url('/cuxiao/coupon/kidsbrand');
$urlLifestyle = Helpers::url('/cuxiao/coupon/lifestylebrand');
$urlShare = Yohobuy::SERVICE_URL . '/operations/api/v5/webshare/getShare';
$urlEncode = strtr($urlKids, array('/' => '\\/'));
$this->_view->display('kidsbrand', array(
'activityId' => 77, // 活动ID
'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlKids . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}',
'weixinShare' => $isApp ? false : true, // 是否需要微信分享
'shareLink' => $urlKids,
'shareTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!',
'shareImg' => 'http://img12.static.yhbimg.com/couponImg/2015/11/26/09/0226ad7f8bcf5467a789e17b761c7557e0.jpg',
'shareDesc' => '2015感恩季!品牌专属优惠券限时送!先领券,再购物,让你乐享整个冬季!',
'url_boys' => $urlBoys . '?yohobuy={"action":"go.h5","params":{"id":"75","share":"' . $urlShare . '","shareparam":{"share_id":"406"},"islogin":"N","type":0,"url":"' . $urlBoys . '","param":{}}}',
'url_girls' => $urlGirls . '?yohobuy={"action":"go.h5","params":{"id":"76","share":"' . $urlShare . '","shareparam":{"share_id":"408"},"islogin":"N","type":0,"url":"' . $urlGirls . '","param":{}}}',
'url_kids' => $urlKids . '?yohobuy={"action":"go.h5","params":{"id":"77","share":"' . $urlShare . '","shareparam":{"share_id":"410"},"islogin":"N","type":0,"url":"' . $urlKids . '","param":{}}}',
'url_lifestyle' => $urlLifestyle . '?yohobuy={"action":"go.h5","params":{"id":"78","share":"' . $urlShare . '","shareparam":{"share_id":"412"},"islogin":"N","type":0,"url":"' . $urlLifestyle . '","param":{}}}',
'url_907' => 'http://list.m.yohobuy.com/?msort=365&brand=907&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"907","title":"AMES BROS"}}',
'url_600' => 'http://list.m.yohobuy.com/?msort=365&brand=600&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"600","title":"HAPPYATOMIC"}}',
'url_888' => 'http://list.m.yohobuy.com/?msort=365&brand=888&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"888","title":"Am&ot"}}',
'url_855' => 'http://list.m.yohobuy.com/?msort=365&brand=855&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"855","title":"HOP"}}',
'url_203' => 'http://list.m.yohobuy.com/?msort=365&brand=203&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"203","title":"Native"}}',
'url_800' => 'http://list.m.yohobuy.com/?msort=365&brand=800&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"800","title":"MANAN"}}',
'url_784' => 'http://list.m.yohobuy.com/?msort=365&brand=784&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"784","title":"香水娜娜"}}',
'url_876' => 'http://list.m.yohobuy.com/?msort=365&brand=506&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"506","title":"Fun"}}',
));
}
/**
* 创意生活的品牌领券
*
* 上线时间 2015/12/1
*/
public function lifestylebrandAction()
{
// 判断是否是应用访问, 拼接APP需要的URL参数
$isApp = null !== $this->get('app_version');
$isAppLogged = true;
if ($isApp) {
$isAppLogged = $this->checkIsLogin();
}
$urlBoys = Helpers::url('/cuxiao/coupon/boysbrand');
$urlGirls = Helpers::url('/cuxiao/coupon/girlsbrand');
$urlKids = Helpers::url('/cuxiao/coupon/kidsbrand');
$urlLifestyle = Helpers::url('/cuxiao/coupon/lifestylebrand');
$urlShare = Yohobuy::SERVICE_URL . '/operations/api/v5/webshare/getShare';
$urlEncode = strtr($urlLifestyle, array('/' => '\\/'));
$this->_view->display('lifestylebrand', array(
'activityId' => 78, // 活动ID
'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlLifestyle . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}',
'weixinShare' => $isApp ? false : true, // 是否需要微信分享
'shareLink' => $urlLifestyle,
'shareTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!',
'shareImg' => 'http://img12.static.yhbimg.com/couponImg/2015/11/26/09/0226ad7f8bcf5467a789e17b761c7557e0.jpg',
'shareDesc' => '2015感恩季!品牌专属优惠券限时送!先领券,再购物,让你乐享整个冬季!',
'url_boys' => $urlBoys . '?yohobuy={"action":"go.h5","params":{"id":"75","share":"' . $urlShare . '","shareparam":{"share_id":"406"},"islogin":"N","type":0,"url":"' . $urlBoys . '","param":{}}}',
'url_girls' => $urlGirls . '?yohobuy={"action":"go.h5","params":{"id":"76","share":"' . $urlShare . '","shareparam":{"share_id":"408"},"islogin":"N","type":0,"url":"' . $urlGirls . '","param":{}}}',
'url_kids' => $urlKids . '?yohobuy={"action":"go.h5","params":{"id":"77","share":"' . $urlShare . '","shareparam":{"share_id":"410"},"islogin":"N","type":0,"url":"' . $urlKids . '","param":{}}}',
'url_lifestyle' => $urlLifestyle . '?yohobuy={"action":"go.h5","params":{"id":"78","share":"' . $urlShare . '","shareparam":{"share_id":"412"},"islogin":"N","type":0,"url":"' . $urlLifestyle . '","param":{}}}',
'url_166' => 'http://list.m.yohobuy.com/?msort=10&brand=166&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"166","title":"九口山"}}',
'url_201' => 'http://list.m.yohobuy.com/?msort=10&brand=201&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"201","title":"wesc"}}',
'url_626' => 'http://list.m.yohobuy.com/?msort=10&brand=626&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"626","title":"cliché"}}',
'url_1024' => 'http://list.m.yohobuy.com/?msort=10&brand=1024&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"1024","title":"SANRIO"}}',
'url_675' => 'http://list.m.yohobuy.com/?msort=10&brand=676&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"676","title":"Filter017"}}',
'url_801' => 'http://list.m.yohobuy.com/?msort=10&brand=801&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"801","title":"Miss Moda"}}',
'url_686' => 'http://list.m.yohobuy.com/?msort=10&brand=686&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"686","title":"H.DUE.O"}}',
'url_501' => 'http://list.m.yohobuy.com/?msort=10&brand=501&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"501","title":"OFESS"}}',
'url_925' => 'http://list.m.yohobuy.com/?msort=10&brand=925&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"925","title":"moshi 摩仕"}}',
'url_932' => 'http://list.m.yohobuy.com/?msort=10&brand=932&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"932","title":"YESHM永衡"}}',
'url_892' => 'http://list.m.yohobuy.com/?msort=10&brand=892&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"892","title":"I-MEGO"}}',
'url_849' => 'http://list.m.yohobuy.com/?msort=10&brand=849&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"849","title":"ZEUSE"}}',
'url_615' => 'http://list.m.yohobuy.com/?msort=10&brand=615&gender=1,2,3&openby:yohobuy={"action":"go.list","params":{"brand":"615","title":"PHILIPS"}}',
));
}
/**
* 新客领券
*
* 上线时间2015/12/2
*/
public function newuserAction()
{
// 判断是否是应用访问, 拼接APP需要的URL参数
$isApp = null !== $this->get('app_version');
$isAppLogged = true;
if ($isApp) {
$isAppLogged = $this->checkIsLogin();
}
$urlNewuser = Helpers::url('/cuxiao/coupon/newuser');
$urlYohope = Helpers::url('/cuxiao/coupon/yohope');
$urlHelp = Helpers::url('/cuxiao/coupon/help');
$urlMycoupon = Helpers::url('/home/coupons');
$urlEncode = strtr($urlNewuser, array('/' => '\\/'));
$this->_view->display('newuser', array(
'activityId' => 83, // 活动ID
'staticTitle' => '新人潮这看,超值惊喜等你领', // 标题
'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlNewuser . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{},"priority":"N"}}',
'url_mycoupon' => $urlMycoupon . '?yohobuy={"action":"go.coupon"}',
'url_yohope' => $urlYohope . '?yohobuy={"action":"go.h5","params":{"islogin":"Y","type":0,"url":"' . $urlYohope . '","param":{}}}',
'url_help' => $urlHelp . '?yohobuy={"action":"go.h5","params":{"islogin":"Y","type":0,"url":"' . $urlHelp . '","param":{}}}',
'url_more' => 'http://list.m.yohobuy.com/?msort=1&openby:yohobuy={"action":"go.list","params":{"msort":"1","title":"上衣"}}',
'url_60' => 'http://izzue.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"60"}}',
'url_710' => 'http://madness.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"710"}}',
'url_138' => 'http://thething.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"138"}}',
'url_495' => 'http://lightningbear.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"495"}}',
'url_419' => 'http://haso.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"419"}}',
'url_868' => 'http://mango.m.yohobuy.com/?gender=2,3&openby:yohobuy={"action":"go.brand","params":{"brand_id":"868"}}',
'url_1026' => 'http://jnby.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"1026"}}',
'url_1027' => 'http://less.m.yohobuy.com/?gender=2,3&openby:yohobuy={"action":"go.brand","params":{"brand_id":"1027"}}',
'url_324' => 'http://bjiaab.m.yohobuy.com/?gender=2,3&openby:yohobuy={"action":"go.brand","params":{"brand_id":"324"}}',
'url_649' => 'http://jeffreycampbell.m.yohobuy.com/?gender=2,3&openby:yohobuy={"action":"go.brand","params":{"brand_id":"649"}}',
));
}
/**
* 新客领券YOHOPE
*
* 上线时间2015/12/2
*/
public function yohopeAction()
{
$this->_view->display('newuser-yohope', array(
'staticTitle' => '新人潮这看,超值惊喜等你领', // 标题
'url_208' => 'http://lal.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"208"}}',
'url_256' => 'http://blackjack.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"256"}}',
'url_257' => 'http://mygesmart.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"257"}}',
'url_450' => 'http://intotherainbow.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"450"}}',
'url_444' => 'http://evildoer.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"444"}}',
'url_443' => 'http://preppyelite.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"443"}}',
'url_261' => 'http://teebacco.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"261"}}',
'url_350' => 'http://macropus.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"350"}}',
'url_302' => 'http://ivyboi.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"302"}}',
'url_852' => 'http://gawsfoot.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"852"}}',
'url_570' => 'http://iyogurt.m.yohobuy.com/?gender=2,3&openby:yohobuy={"action":"go.brand","params":{"brand_id":"570"}}',
'url_560' => 'http://gaws.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"560"}}',
'url_520' => 'http://gawscap.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"520"}}',
'url_562' => 'http://gawsdigi.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"562"}}',
'url_672' => 'http://shapeless.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"672"}}',
'url_678' => 'http://halfgirl.m.yohobuy.com/?gender=2,3&openby:yohobuy={"action":"go.brand","params":{"brand_id":"678"}}',
'url_396' => 'http://eightguys.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"396"}}',
'url_397' => 'http://pinealbody.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"397"}}',
'url_550' => 'http://systag.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"550"}}',
'url_591' => 'http://flyd.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"591"}}',
'url_583' => 'http://masterplan.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"583"}}',
'url_598' => 'http://dpk.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"598"}}',
'url_824' => 'http://mwowl.m.yohobuy.com/?gender=2,3&openby:yohobuy={"action":"go.brand","params":{"brand_id":"824"}}',
'url_481' => 'http://dresslab.m.yohobuy.com/?gender=2,3&openby:yohobuy={"action":"go.brand","params":{"brand_id":"481"}}',
'url_701' => 'http://bearburry.m.yohobuy.com/?gender=2,3&openby:yohobuy={"action":"go.brand","params":{"brand_id":"701"}}',
'url_464' => 'http://stormstamps.m.yohobuy.com/?openby:yohobuy={"action":"go.brand","params":{"brand_id":"464"}}',
));
}
/**
* 新客领券 - 如何使用优惠券帮助页
*
* 上线时间2015/12/2
*/
public function helpAction()
{
$this->_view->display('newuser-help', array(
'staticTitle' => '如何使用优惠券',
));
}
/**
* 领取指定的优惠券
*
* @param int activityId 活动ID
* @param int couponId 优惠券ID
* @return json
*/
public function getnamedAction()
{
$result = array('code' => 401, 'message' => '领取失败', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
/* 判断参数是否有效 */
$activityId = $this->post('activityId');
$couponId = $this->post('couponId');
if (!is_numeric($activityId) || !is_numeric($couponId)) {
break;
}
/* 判断用户是否登录 */
$uid = $this->getUid();
if (!$uid) {
$uid = $this->getSession(self::SESSION_UID);
if (!$uid) {
$result['code'] = 400;
$result['message'] = '请先登录';
$result['data'] = Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', '/')), 'default');
break;
}
}
/* 领取指定的优惠券操作 */
$result = ActivityData::getCouponNamed($uid, $activityId, $couponId);
} while (false);
$this->echoJson($result);
}
/**
* 领取所有的优惠券
*
* @param int activityId 活动ID
* @return json
*/
public function getallAction()
{
$result = array('code' => 401, 'message' => '领取失败', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
/* 判断参数是否有效 */
$activityId = $this->post('activityId');
if (!is_numeric($activityId)) {
break;
}
/* 判断用户是否登录 */
$uid = $this->getUid();
if (!$uid) {
$uid = $this->getSession(self::SESSION_UID);
if (!$uid) {
$result['code'] = 400;
$result['message'] = '请先登录';
$result['data'] = Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', '/')), 'default');
break;
}
}
/* 领取指定的优惠券操作 */
$result = ActivityData::getCouponAll($uid, $activityId);
} while (false);
$this->echoJson($result);
}
/**
* 检查用户是否登录
*
* @return bool (false:表示未登录,true:表示已登录)
*/
private function checkIsLogin()
{
do {
/* 判断是否有参数 */
$param = $this->get();
if (empty($param)) {
break;
}
/* 判断参数是否有效 */
if (!isset($param['client_secret']) || empty($param['uid'])) {
break;
}
/* 取消无用的参数 */
$uri = key($param);
if (false !== stripos($uri, 'cuxiao/')) {
unset($param[$uri]);
}
/* 验证公钥是否有效 */
$clientSecret = $param['client_secret'];
$publicParam = Yohobuy::param();
$param['private_key'] = $publicParam['private_key'];
unset($param['client_secret']);
if ($clientSecret !== Sign::makeSign($param)) {
break;
}
$this->setSession(self::SESSION_UID, $param['uid']);
return true;
} while (false);
return false;
}
}