Authored by hf

code review by fei.hong: do merge huodong girlday the four times

<?php return function ($in, $debugopt = 1) {
$cx = array(
'flags' => array(
'jstrue' => false,
'jsobj' => false,
'spvar' => true,
'prop' => false,
'method' => false,
'mustlok' => true,
'echo' => false,
'debug' => $debugopt,
),
'constants' => array(),
'helpers' => array(),
'blockhelpers' => array(),
'hbhelpers' => array(),
'partials' => array(),
'scopes' => array(),
'sp_vars' => array('root' => $in),
'lcrun' => 'Plugin\LCRun3',
);
return ''.'<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('staticTitle')), ENT_QUOTES, 'UTF-8').'</title>
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="grey">
<script type="text/javascript">
(function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=640){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/640)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window);
</script>
<link rel="stylesheet" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('jsUrl')), ENT_QUOTES, 'UTF-8').'/2016xinshili-3/css/style.css">
</head>
<body class="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('pageType')), ENT_QUOTES, 'UTF-8').'">
'.' <div class="main-wrap home">
<div class="header">
</div>
'.Plugin\LCRun3::ifv($cx, Plugin\LCRun3::v($cx, $in, array('tab')), $in, function($cx, $in) {return ' <div class="tab type">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('tab')), $in, false, function($cx, $in) {return ' <div class="tab-item" data-type="'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'"></div>
';}).' <input type="hidden" id="more-brand" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('moreBrand')), ENT_QUOTES, 'UTF-8').'">
</div>
';}).' <div class="content">
</div>
<script type="text/tmpl" id="tmpl">
<div class="coupons">
{{#coupons}}
<a class="coupon" href="{{../jumpUrl}}" data-id="{{id}}">
<img class="lazy" src="" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('imgUrl')), ENT_QUOTES, 'UTF-8').'/{{img}}">
</a>
{{/coupons}}
</div>
<div class="brands clearfix">
{{#brands}}
<a class="brand" href=\'{{url}}\'>
<img class="lazy" src="" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('imgUrl')), ENT_QUOTES, 'UTF-8').'/{{img}}">
</a>
{{/brands}}
<div class="after"></div>
</div>
<div class="more">
<div class="more-title">
</div>
<a class="link" href=\'{{more.url}}\'>
<img class="lazy" src="" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('imgUrl')), ENT_QUOTES, 'UTF-8').'/{{more.img}}">
</a>
</div>
</script>
</div>
<div class="footer">
</div>
<div class="tip-wrap hide">
<div class="tip hide fail">
<div class="title">
领取失败<br>
请刷新重新领取
</div>
<a class="button" href="">
刷新
</a>
</div>
</div>
<div class="tip-wrap hide">
<div class="tip hide success">
<div class="title">
领取成功
</div>
<div class="sub-title">
快去分享给更多<br>
喜爱<span class="title">潮流</span>的小伙伴吧!
</div>
<a class="button close" href="">
返回
</a>
</div>
</div>
<div class="tip-wrap hide">
<div class="tip hide geted">
<div class="title">
您已领取过了
</div>
<div class="sub-title">
快去分享给更多<br>
喜爱<span class="title">潮流</span>的小伙伴吧!
</div>
<a class="button close" href="">
返回
</a>
</div>
</div>
<div class="loading-mask hide">
<div class="loading">
<div></div>
<div></div>
<div></div>
</div>
</div>
<input type="hidden" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('pageType')), ENT_QUOTES, 'UTF-8').'" id="page-type">
<input type="hidden" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('activityId')), ENT_QUOTES, 'UTF-8').'" id="activity-id">
<input type="hidden" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('jumpUrl')), ENT_QUOTES, 'UTF-8').'" id="jump-url">
'.Plugin\LCRun3::ifv($cx, Plugin\LCRun3::v($cx, $in, array('isApp')), $in, function($cx, $in) {return ' <input type="hidden" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('getCouponUrl')), ENT_QUOTES, 'UTF-8').'" id="getCouponUrl">
';}).' <script type="text/javascript">
var isOnline = '.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('isOnline')), ENT_QUOTES, 'UTF-8').';
'.Plugin\LCRun3::ifv($cx, Plugin\LCRun3::v($cx, $in, array('isApp')), $in, function($cx, $in) {return ' var isApp = 1;
'.Plugin\LCRun3::ifv($cx, Plugin\LCRun3::v($cx, $in, array('isAppLogin')), $in, function($cx, $in) {return ' var isAppLogin = 1;
';}).'';}).'
</script>
'.'<input type="hidden" id="shareTitle" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('shareTitle')), ENT_QUOTES, 'UTF-8').'">
<input type="hidden" id="shareDesc" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('shareDesc')), ENT_QUOTES, 'UTF-8').'">
<input type="hidden" id="shareImg" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('shareImg')), ENT_QUOTES, 'UTF-8').'">
<input type="hidden" id="shareLink" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('shareLink')), ENT_QUOTES, 'UTF-8').'">
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
<script type="text/javascript" src="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('jsUrl')), ENT_QUOTES, 'UTF-8').'/2016xinshili-3/js/libs.js"></script>
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('staticJS')), $in, false, function($cx, $in) {return '<script type="text/javascript" src="'.htmlentities((string)Plugin\LCRun3::v($cx, $cx['scopes'][count($cx['scopes'])-1], array('jsUrl')), ENT_QUOTES, 'UTF-8').'/2016xinshili-3/js/'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'"></script>
';}).'</body>
'.'';
}
?>
\ No newline at end of file
... ...
<?php return function ($in, $debugopt = 1) {
$cx = array(
'flags' => array(
'jstrue' => false,
'jsobj' => false,
'spvar' => true,
'prop' => false,
'method' => false,
'mustlok' => true,
'echo' => false,
'debug' => $debugopt,
),
'constants' => array(),
'helpers' => array(),
'blockhelpers' => array(),
'hbhelpers' => array(),
'partials' => array(),
'scopes' => array(),
'sp_vars' => array('root' => $in),
'lcrun' => 'Plugin\LCRun3',
);
return ''.'<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('staticTitle')), ENT_QUOTES, 'UTF-8').'</title>
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="grey">
<script type="text/javascript">
(function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=640){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/640)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window);
</script>
<link rel="stylesheet" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('jsUrl')), ENT_QUOTES, 'UTF-8').'/2016xinshili-4/css/style.css">
</head>
<body class="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('pageType')), ENT_QUOTES, 'UTF-8').'">
'.' <div class="main-wrap home">
<div class="header">
</div>
'.Plugin\LCRun3::ifv($cx, Plugin\LCRun3::v($cx, $in, array('tab')), $in, function($cx, $in) {return ' <div class="tab type">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('tab')), $in, false, function($cx, $in) {return ' <div class="tab-item" data-type="'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'"></div>
';}).' <input type="hidden" id="more-brand" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('moreBrand')), ENT_QUOTES, 'UTF-8').'">
</div>
';}).' <div class="content">
</div>
<script type="text/tmpl" id="tmpl">
<div class="coupons">
{{#coupons}}
<a class="coupon" href="{{../jumpUrl}}" data-id="{{id}}">
<img class="lazy" src="" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('imgUrl')), ENT_QUOTES, 'UTF-8').'/{{img}}">
</a>
{{/coupons}}
</div>
<div class="brands clearfix">
{{#brands}}
<a class="brand" href=\'{{url}}\'>
<img class="lazy" src="" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('imgUrl')), ENT_QUOTES, 'UTF-8').'/{{img}}">
</a>
{{/brands}}
<div class="after"></div>
</div>
<div class="more">
<div class="more-title">
</div>
<a class="link" href=\'{{more.url}}\'>
<img class="lazy" src="" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('imgUrl')), ENT_QUOTES, 'UTF-8').'/{{more.img}}">
</a>
</div>
</script>
</div>
<div class="footer">
</div>
<div class="tip-wrap hide">
<div class="tip hide fail">
<div class="title">
领取失败<br>
请刷新重新领取
</div>
<a class="button" href="">
刷新
</a>
</div>
</div>
<div class="tip-wrap hide">
<div class="tip hide success">
<div class="title">
领取成功
</div>
<div class="sub-title">
快去分享给更多<br>
喜爱<span class="title">潮流</span>的小伙伴吧!
</div>
<a class="button close" href="">
返回
</a>
</div>
</div>
<div class="tip-wrap hide">
<div class="tip hide geted">
<div class="title">
您已领取过了
</div>
<div class="sub-title">
快去分享给更多<br>
喜爱<span class="title">潮流</span>的小伙伴吧!
</div>
<a class="button close" href="">
返回
</a>
</div>
</div>
<div class="loading-mask hide">
<div class="loading">
<div></div>
<div></div>
<div></div>
</div>
</div>
<input type="hidden" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('pageType')), ENT_QUOTES, 'UTF-8').'" id="page-type">
<input type="hidden" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('activityId')), ENT_QUOTES, 'UTF-8').'" id="activity-id">
<input type="hidden" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('jumpUrl')), ENT_QUOTES, 'UTF-8').'" id="jump-url">
'.Plugin\LCRun3::ifv($cx, Plugin\LCRun3::v($cx, $in, array('isApp')), $in, function($cx, $in) {return ' <input type="hidden" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('getCouponUrl')), ENT_QUOTES, 'UTF-8').'" id="getCouponUrl">
';}).' <script type="text/javascript">
var isOnline = '.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('isOnline')), ENT_QUOTES, 'UTF-8').';
'.Plugin\LCRun3::ifv($cx, Plugin\LCRun3::v($cx, $in, array('isApp')), $in, function($cx, $in) {return ' var isApp = 1;
'.Plugin\LCRun3::ifv($cx, Plugin\LCRun3::v($cx, $in, array('isAppLogin')), $in, function($cx, $in) {return ' var isAppLogin = 1;
';}).'';}).'
</script>
'.'<input type="hidden" id="shareTitle" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('shareTitle')), ENT_QUOTES, 'UTF-8').'">
<input type="hidden" id="shareDesc" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('shareDesc')), ENT_QUOTES, 'UTF-8').'">
<input type="hidden" id="shareImg" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('shareImg')), ENT_QUOTES, 'UTF-8').'">
<input type="hidden" id="shareLink" value="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('shareLink')), ENT_QUOTES, 'UTF-8').'">
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
<script type="text/javascript" src="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('jsUrl')), ENT_QUOTES, 'UTF-8').'/2016xinshili-4/js/libs.js"></script>
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('staticJS')), $in, false, function($cx, $in) {return '<script type="text/javascript" src="'.htmlentities((string)Plugin\LCRun3::v($cx, $cx['scopes'][count($cx['scopes'])-1], array('jsUrl')), ENT_QUOTES, 'UTF-8').'/2016xinshili-4/js/'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'"></script>
';}).'</body>
'.'';
}
?>
\ No newline at end of file
... ...
<?php return function ($in, $debugopt = 1) {
$cx = array(
'flags' => array(
'jstrue' => false,
'jsobj' => false,
'spvar' => true,
'prop' => false,
'method' => false,
'mustlok' => true,
'echo' => false,
'debug' => $debugopt,
),
'constants' => array(),
'helpers' => array(),
'blockhelpers' => array(),
'hbhelpers' => array(),
'partials' => array(),
'scopes' => array(),
'sp_vars' => array('root' => $in),
'lcrun' => 'Plugin\LCRun3',
);
return '<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>'.Plugin\LCRun3::debug('[staticTitle]', 'encq', $cx, Plugin\LCRun3::debug('[staticTitle]', 'v', $cx, $in, array('staticTitle'))).'</title>
<link rel="stylesheet" href="'.Plugin\LCRun3::debug('[imgUrl]', 'encq', $cx, Plugin\LCRun3::debug('[imgUrl]', 'v', $cx, $in, array('imgUrl'))).'/2016xinshili-4/css/style.css">
</head>
<body class="'.Plugin\LCRun3::debug('[pageType]', 'encq', $cx, Plugin\LCRun3::debug('[pageType]', 'v', $cx, $in, array('pageType'))).'">
<div class="header-wrap">
<div class="header">
</div>
'.Plugin\LCRun3::debug('if [tab]', 'ifv', $cx, Plugin\LCRun3::debug('[tab]', 'v', $cx, $in, array('tab')), $in, function($cx, $in) {return ' <div class="tab-wrap">
<div class="tab">
'.Plugin\LCRun3::debug('[tab]', 'sec', $cx, Plugin\LCRun3::debug('[tab]', 'v', $cx, $in, array('tab')), $in, false, function($cx, $in) {return ' <div class="tab-item tab-'.Plugin\LCRun3::debug('@[index]', 'encq', $cx, Plugin\LCRun3::debug('@[index]', 'v', $cx, $cx['sp_vars'], array('index'))).'" data-type="'.Plugin\LCRun3::debug('this', 'encq', $cx, $in).'">
<div class="before"></div>
</div>
';}).' </div>
</div>
';}).' </div>
<div class="main-wrap home">
<div class="content">
</div>
<script type="text/tmpl" id="tmpl">
<div class="coupons">
{{#coupons}}
<img class="lazy coupon" src="" data-original="'.Plugin\LCRun3::debug('[imgUrl]', 'encq', $cx, Plugin\LCRun3::debug('[imgUrl]', 'v', $cx, $in, array('imgUrl'))).'/{{img}}" data-id="{{id}}">
{{/coupons}}
</div>
<div class="brands clearfix">
{{#brands}}
<a class="brand" target="_blank" href=\'{{url}}\'>
<img class="lazy" src="" data-original="'.Plugin\LCRun3::debug('[imgUrl]', 'encq', $cx, Plugin\LCRun3::debug('[imgUrl]', 'v', $cx, $in, array('imgUrl'))).'/{{img}}">
</a>
{{/brands}}
<div class="after"></div>
</div>
<div class="more">
<div class="more-title">
</div>
<a class="link" target="_blank" href=\'{{more.url}}\'>
<img class="lazy" src="" data-original="'.Plugin\LCRun3::debug('[imgUrl]', 'encq', $cx, Plugin\LCRun3::debug('[imgUrl]', 'v', $cx, $in, array('imgUrl'))).'/{{more.img}}">
</a>
</div>
</script>
<div class="footer">
</div>
</div>
<div class="tip hide fail">
<div class="title">
领取失败<br>
请刷新重新领取
</div>
<div class="desc">
如多次领取失败,请联系客服人员<br>
带来不便敬请谅解
</div>
<a class="button" href="">
刷新
</a>
</div>
<div class="tip hide success">
<div class="title">
领取成功
</div>
<div class="sub-title">
快去分享给更多<br>
喜爱<span class="title">潮流</span>的小伙伴吧!
</div>
<a class="button close" href="">
返回
</a>
</div>
<div class="tip hide geted">
<div class="title">
您已领取过了
</div>
<div class="sub-title">
快去分享给更多<br>
喜爱<span class="title">潮流</span>的小伙伴吧!
</div>
<a class="button close" href="">
返回
</a>
</div>
<input type="hidden" value="'.Plugin\LCRun3::debug('[pageType]', 'encq', $cx, Plugin\LCRun3::debug('[pageType]', 'v', $cx, $in, array('pageType'))).'" id="page-type">
<input type="hidden" value="'.Plugin\LCRun3::debug('[activityId]', 'encq', $cx, Plugin\LCRun3::debug('[activityId]', 'v', $cx, $in, array('activityId'))).'" id="activity-id">
<script type="text/javascript">
var isOnline = '.Plugin\LCRun3::debug('[isOnline]', 'encq', $cx, Plugin\LCRun3::debug('[isOnline]', 'v', $cx, $in, array('isOnline'))).';
</script>
<script type="text/javascript" src="'.Plugin\LCRun3::debug('[jsUrl]', 'encq', $cx, Plugin\LCRun3::debug('[jsUrl]', 'v', $cx, $in, array('jsUrl'))).'/2016xinshili-4/js/libs.js"></script>
'.Plugin\LCRun3::debug('[staticJS]', 'sec', $cx, Plugin\LCRun3::debug('[staticJS]', 'v', $cx, $in, array('staticJS')), $in, false, function($cx, $in) {return '<script type="text/javascript" src="'.Plugin\LCRun3::debug('../[jsUrl]', 'encq', $cx, Plugin\LCRun3::debug('../[jsUrl]', 'v', $cx, $cx['scopes'][count($cx['scopes'])-1], array('jsUrl'))).'/2016xinshili-4/js/'.Plugin\LCRun3::debug('this', 'encq', $cx, $in).'"></script>
';}).'</body>
';
}
?>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>{{staticTitle}}</title>
<link rel="stylesheet" href="{{imgUrl}}/2016xinshili-4/css/style.css">
</head>
<body class="{{pageType}}">
<div class="header-wrap">
<div class="header">
</div>
{{#if tab}}
<div class="tab-wrap">
<div class="tab">
{{#tab}}
<div class="tab-item tab-{{@index}}" data-type="{{.}}">
<div class="before"></div>
</div>
{{/tab}}
</div>
</div>
{{/if}}
</div>
<div class="main-wrap home">
<div class="content">
</div>
<script type="text/tmpl" id="tmpl">
<div class="coupons">
\{{#coupons}}
<img class="lazy coupon" src="" data-original="{{imgUrl}}/\{{img}}" data-id="\{{id}}">
\{{/coupons}}
</div>
<div class="brands clearfix">
\{{#brands}}
<a class="brand" target="_blank" href='\{{url}}'>
<img class="lazy" src="" data-original="{{imgUrl}}/\{{img}}">
</a>
\{{/brands}}
<div class="after"></div>
</div>
<div class="more">
<div class="more-title">
</div>
<a class="link" target="_blank" href='\{{more.url}}'>
<img class="lazy" src="" data-original="{{imgUrl}}/\{{more.img}}">
</a>
</div>
</script>
<div class="footer">
</div>
</div>
<div class="tip hide fail">
<div class="title">
领取失败<br>
请刷新重新领取
</div>
<div class="desc">
如多次领取失败,请联系客服人员<br>
带来不便敬请谅解
</div>
<a class="button" href="">
刷新
</a>
</div>
<div class="tip hide success">
<div class="title">
领取成功
</div>
<div class="sub-title">
快去分享给更多<br>
喜爱<span class="title">潮流</span>的小伙伴吧!
</div>
<a class="button close" href="">
返回
</a>
</div>
<div class="tip hide geted">
<div class="title">
您已领取过了
</div>
<div class="sub-title">
快去分享给更多<br>
喜爱<span class="title">潮流</span>的小伙伴吧!
</div>
<a class="button close" href="">
返回
</a>
</div>
<input type="hidden" value="{{pageType}}" id="page-type">
<input type="hidden" value="{{activityId}}" id="activity-id">
<script type="text/javascript">
var isOnline = {{isOnline}};
</script>
<script type="text/javascript" src="{{jsUrl}}/2016xinshili-4/js/libs.js"></script>
{{# staticJS}}
<script type="text/javascript" src="{{../jsUrl}}/2016xinshili-4/js/{{.}}"></script>
{{/ staticJS}}
</body>
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2016/3/18
* Time: 13:27
*/
use Action\HuodongAction;
use WebPlugin\Helpers;
use LibModels\Wap\Cuxiao\ActivityData;
use Plugin\Cache;
use Configs\CacheConfig;
class GirlfourController extends HuodongAction
{
/**
* 女生节第四波领券活动-男生品牌页面控制器
*/
public function boyAction()
{
$this->_view->display('index', array(
'staticTitle' => 'YOHO!BUY有货【春潮新势力】',
'staticJS' => array(
'main.js'
),
'pageType' => 'boy',
'isOnline' => $this->getisOnline(),
'tab' => array('jp', 'hk', 'cn', 'trousers'),
));
}
/**
* 女生节第四波领券活动-女生品牌页面控制器
*/
public function girlAction()
{
$this->_view->display('index', array(
'staticTitle' => 'YOHO!BUY有货【春潮新势力】',
'staticJS' => array(
'main.js'
),
'pageType' => 'girl',
'isOnline' => $this->getisOnline(),
'tab' => array('hk', 'yohope', 'jean', 'shoes'),
));
}
/**
* 女生节第四波领券活动-童品牌页面控制器
*/
public function kidAction()
{
$this->_view->display('index', array(
'staticTitle' => 'YOHO!BUY有货【春潮新势力】',
'staticJS' => array(
'main.js'
),
'isOnline' => $this->getisOnline(),
'pageType' => 'kid',
));
}
/**
* 女生节第四波领券活动-创意生活品牌页面控制器
*/
public function lifestyleAction()
{
$this->_view->display('index', array(
'staticTitle' => 'YOHO!BUY有货【春潮新势力】',
'staticJS' => array(
'main.js'
),
'isOnline' => $this->getisOnline(),
'pageType' => 'lifestyle',
'tab' => array('us', 'hot'),
));
}
/**
* 领取指定的优惠券
*
* @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->getActivityId();
$couponId = $this->post('couponId');
if (!is_numeric($activityId) || !is_numeric($couponId)) {
break;
}
$uid = $this->getUid();
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);
if ($uid && isset($result['code']) && intval($result['code'])==200) {
$couponuid = 'couponnvshengjiedisibo' . $uid;
$status = Cache::get($couponuid);
if (!$status) {
$this->sendMessage($uid, '【优惠券】您已成功领取春潮新势力-品牌优惠券。', '尊敬的客户:恭喜您成功获得春潮新势力-品牌优惠券 !您可以在个人中心查看优惠券详情。');
Cache::set($couponuid, true, 3600 * 24 * 5);
}
}
} while (false);
$this->echoJson($result);
}
/**
* 检测登录状态
*
* @return int
*/
private function getLoggedUid()
{
if ($this->_isApp) {
$uid = $this->get('uid');
} else {
$uid = $this->getUid();
}
return $uid;
}
/**
* 根据环境来获取活动ID
*
* @return int
*/
private function getActivityId()
{
// 设置环境变量
switch (APPLICATION_ENV) {
case 'production': // 生产
return 558;
case 'preview': // 预览
case 'testing': // 测试
case 'develop': // 开发
default:
return 496;
}
}
/**
* 发送站内信
*
* @param int $uid 用户ID
*/
private function sendMessage($uid, $title, $content)
{
try {
ActivityData::message($uid, $title, $content);
} catch (Exception $e) {
// do nothing
}
}
/**
* 根据环境来获取线上线下
*
* @return int
*/
private function getisOnline()
{
// 设置环境变量
switch (APPLICATION_ENV) {
case 'production': // 生产
return 1;
case 'preview': // 预览
case 'testing': // 测试
case 'develop': // 开发
default:
return 0;
}
}
}
?>
... ...
<?php
use Action\WebAction;
/**
* 公共
*/
class CommonController extends WebAction
{
/**
* 默认
*/
public function indexAction()
{
exit();
}
}
... ...