...
|
...
|
@@ -8,26 +8,37 @@ use LibModels\Wap\Cuxiao\ActivityData; |
|
|
* 领券活动
|
|
|
*
|
|
|
* @name Coupon
|
|
|
* @package
|
|
|
* @package Cuxiao
|
|
|
* @copyright yoho.inc
|
|
|
* @version 1.0 (2015-11-25 13:08:58)
|
|
|
* @author fei.hong <fei.hong@yoho.cn>
|
|
|
*/
|
|
|
class CouponController extends AbstractAction
|
|
|
{
|
|
|
|
|
|
const SESSION_UID = 'coupon_uid';
|
|
|
|
|
|
/**
|
|
|
* 男生的品牌领券-上线时间 2015/12/1
|
|
|
*/
|
|
|
public function boysbrandAction()
|
|
|
{
|
|
|
// 判断是否是应用访问
|
|
|
$isApp = null !== $this->get('app_version');
|
|
|
if ($isApp) {
|
|
|
$uid = $this->get('uid');
|
|
|
if ($uid && is_numeric($uid)) {
|
|
|
$this->setSession(self::SESSION_UID, $uid);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->_view->display('boysbrand', array(
|
|
|
'staticCss' => 'http://static.dev.yohobuy.com/css/cuxiao/coupon.mobile.css',
|
|
|
'staticJs' => 'http://static.dev.yohobuy.com/js/cuxiao/coupon.mobile.js',
|
|
|
'jqueryJs' => 'http://static.dev.yohobuy.com/js/cuxiao/jquery.min.js',
|
|
|
|
|
|
'title' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!',
|
|
|
'shareImg' => '',
|
|
|
'activityId' => 3, // 活动ID
|
|
|
'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
|
|
|
'staticCss' => 'http://static.dev.yohobuy.com/css/cuxiao/coupon.mobile.css', // CSS
|
|
|
'staticJs' => 'http://static.dev.yohobuy.com/js/cuxiao/coupon.mobile.js', // JS
|
|
|
'jqueryJs' => 'http://static.dev.yohobuy.com/js/cuxiao/jquery.min.js', // JQUERY
|
|
|
'weixinShare' => $isApp ? false : true, // 是否需要微信分享
|
|
|
|
|
|
'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=160&openby:yohobuy={"action":"go.list","params":{"gender":"1,3","brand":"160","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":"鬼洗"}}',
|
...
|
...
|
@@ -84,10 +95,22 @@ class CouponController extends AbstractAction |
|
|
*/
|
|
|
public function girlsbrandAction()
|
|
|
{
|
|
|
// 判断是否是应用访问
|
|
|
$isApp = null !== $this->get('app_version');
|
|
|
if ($isApp) {
|
|
|
$uid = $this->get('uid');
|
|
|
if ($uid && is_numeric($uid)) {
|
|
|
$this->setSession(self::SESSION_UID, $uid);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->_view->display('girlsbrand', array(
|
|
|
'staticCss' => 'http://static.dev.yohobuy.com/css/cuxiao/coupon.mobile.css',
|
|
|
'staticJs' => 'http://static.dev.yohobuy.com/js/cuxiao/coupon.mobile.js',
|
|
|
'jqueryJs' => 'http://static.dev.yohobuy.com/js/cuxiao/jquery.min.js',
|
|
|
'activityId' => 4, // 活动ID
|
|
|
'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
|
|
|
'staticCss' => 'http://static.dev.yohobuy.com/css/cuxiao/coupon.mobile.css', // CSS
|
|
|
'staticJs' => 'http://static.dev.yohobuy.com/js/cuxiao/coupon.mobile.js', // JS
|
|
|
'jqueryJs' => 'http://static.dev.yohobuy.com/js/cuxiao/jquery.min.js', // JQUERY
|
|
|
'weixinShare' => $isApp ? false : true, // 是否需要微信分享
|
|
|
|
|
|
'title' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!',
|
|
|
'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"}}',
|
...
|
...
|
@@ -150,10 +173,22 @@ class CouponController extends AbstractAction |
|
|
*/
|
|
|
public function kidsbrandAction()
|
|
|
{
|
|
|
// 判断是否是应用访问
|
|
|
$isApp = null !== $this->get('app_version');
|
|
|
if ($isApp) {
|
|
|
$uid = $this->get('uid');
|
|
|
if ($uid && is_numeric($uid)) {
|
|
|
$this->setSession(self::SESSION_UID, $uid);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->_view->display('kidsbrand', array(
|
|
|
'staticCss' => 'http://static.dev.yohobuy.com/css/cuxiao/coupon.mobile.css',
|
|
|
'staticJs' => 'http://static.dev.yohobuy.com/js/cuxiao/coupon.mobile.js',
|
|
|
'jqueryJs' => 'http://static.dev.yohobuy.com/js/cuxiao/jquery.min.js',
|
|
|
'activityId' => 5, // 活动ID
|
|
|
'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
|
|
|
'staticCss' => 'http://static.dev.yohobuy.com/css/cuxiao/coupon.mobile.css', // CSS
|
|
|
'staticJs' => 'http://static.dev.yohobuy.com/js/cuxiao/coupon.mobile.js', // JS
|
|
|
'jqueryJs' => 'http://static.dev.yohobuy.com/js/cuxiao/jquery.min.js', // JQUERY
|
|
|
'weixinShare' => $isApp ? false : true, // 是否需要微信分享
|
|
|
|
|
|
'title' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!',
|
|
|
'url_907' => 'http://list.m.yohobuy.com/?msort=365&brand=907&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"907","title":"AMES BROS"}}',
|
...
|
...
|
@@ -172,10 +207,22 @@ class CouponController extends AbstractAction |
|
|
*/
|
|
|
public function lifestylebrandAction()
|
|
|
{
|
|
|
// 判断是否是应用访问
|
|
|
$isApp = null !== $this->get('app_version');
|
|
|
if ($isApp) {
|
|
|
$uid = $this->get('uid');
|
|
|
if ($uid && is_numeric($uid)) {
|
|
|
$this->setSession(self::SESSION_UID, $uid);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->_view->display('lifestylebrand', array(
|
|
|
'staticCss' => 'http://static.dev.yohobuy.com/css/cuxiao/coupon.mobile.css',
|
|
|
'staticJs' => 'http://static.dev.yohobuy.com/js/cuxiao/coupon.mobile.js',
|
|
|
'jqueryJs' => 'http://static.dev.yohobuy.com/js/cuxiao/jquery.min.js',
|
|
|
'activityId' => 6, // 活动ID
|
|
|
'staticTitle' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!', // 标题
|
|
|
'staticCss' => 'http://static.dev.yohobuy.com/css/cuxiao/coupon.mobile.css', // CSS
|
|
|
'staticJs' => 'http://static.dev.yohobuy.com/js/cuxiao/coupon.mobile.js', // JS
|
|
|
'jqueryJs' => 'http://static.dev.yohobuy.com/js/cuxiao/jquery.min.js', // JQUERY
|
|
|
'weixinShare' => $isApp ? false : true, // 是否需要微信分享
|
|
|
|
|
|
'title' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!',
|
|
|
'url_166' => 'http://list.m.yohobuy.com/?msort=10&brand=166&openby:yohobuy={"action":"go.list","params":{"gender":"2,3","brand":"166","title":"九口山"}}',
|
...
|
...
|
@@ -203,7 +250,7 @@ class CouponController extends AbstractAction |
|
|
*/
|
|
|
public function getnamedAction()
|
|
|
{
|
|
|
$result = array('code' => 400, 'message' => '领取失败', 'data' => '');
|
|
|
$result = array('code' => 401, 'message' => '领取失败', 'data' => '');
|
|
|
|
|
|
do {
|
|
|
/* 判断是不是AJAX请求 */
|
...
|
...
|
@@ -220,12 +267,16 @@ class CouponController extends AbstractAction |
|
|
|
|
|
/* 判断用户是否登录 */
|
|
|
$uid = $this->getUid();
|
|
|
if (!$uid || !is_numeric($uid)) {
|
|
|
$result['data'] = Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', '/')));
|
|
|
if (!$uid) {
|
|
|
$uid = $this->getSession(self::SESSION_UID);
|
|
|
if (!$uid) {
|
|
|
$result['data'] = Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', '/')));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* 领取指定的优惠券操作 */
|
|
|
$result = ActivityData::getCouponNamed($uid, $activityId, $couponId);
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
$this->echoJson($result);
|
...
|
...
|
@@ -239,7 +290,7 @@ class CouponController extends AbstractAction |
|
|
*/
|
|
|
public function getallAction()
|
|
|
{
|
|
|
$result = array('code' => 400, 'message' => '领取失败', 'data' => '');
|
|
|
$result = array('code' => 401, 'message' => '领取失败', 'data' => '');
|
|
|
|
|
|
do {
|
|
|
/* 判断是不是AJAX请求 */
|
...
|
...
|
@@ -255,16 +306,43 @@ class CouponController extends AbstractAction |
|
|
|
|
|
/* 判断用户是否登录 */
|
|
|
$uid = $this->getUid();
|
|
|
if (!$uid || !is_numeric($uid)) {
|
|
|
$result['data'] = Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', '/')));
|
|
|
if (!$uid) {
|
|
|
$uid = $this->getSession(self::SESSION_UID);
|
|
|
if (!$uid) {
|
|
|
$result['data'] = Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', '/')));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* 领取指定的优惠券操作 */
|
|
|
$result = ActivityData::getCouponAll($uid, $activityId);
|
|
|
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取分享链接
|
|
|
*
|
|
|
* @param int id 活动ID
|
|
|
*/
|
|
|
public function getshareAction()
|
|
|
{
|
|
|
$id = $this->get('id');
|
|
|
|
|
|
$result = array(
|
|
|
'code' => 200,
|
|
|
'message' => '领券活动分享',
|
|
|
'data' => array(
|
|
|
'title' => 'Yoho!Buy有货2015感恩季,1000万元+品牌专属优惠券大派送!',
|
|
|
'content' => '2015感恩季!品牌专属优惠券限时送!先领券,再购物,让你乐享整个冬季!',
|
|
|
'pic' => '',
|
|
|
'url' => '',
|
|
|
),
|
|
|
);
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|