...
|
...
|
@@ -38,13 +38,7 @@ class YuanxiaoController extends HuodongAction |
|
|
'staticFile' => self::STATIC_FILE,
|
|
|
'staticJS' => array(
|
|
|
'home.js'
|
|
|
),
|
|
|
'weixinShare' => $this->_isApp ? false : true, // 是否需要微信分享
|
|
|
'shareLink' => 'http://feature.yoho.cn/2016lishifeng/index.html',
|
|
|
'shareTitle' => 'YOHO!BUY有货新年寻宝大作战,千元利是等你赢!',
|
|
|
'shareDesc' => 'YOHO!BUY有货,全球800+潮流品牌每日上新!',
|
|
|
'shareImg' => 'http://img12.static.yhbimg.com/couponImg/2015/12/30/12/02008a9724b898dee56852de9f1a3978bf.jpg',
|
|
|
'showPopupFlag' => $showPopupFlag,
|
|
|
)
|
|
|
));
|
|
|
}
|
|
|
|
...
|
...
|
@@ -62,15 +56,17 @@ class YuanxiaoController extends HuodongAction |
|
|
if (!empty($posts)) {
|
|
|
$nickName = $this->post('nick', '');
|
|
|
$birthday = $this->post('birthday', '');
|
|
|
$gender = $this->post('gender', 0);
|
|
|
$gender = $this->post('gender', 1);
|
|
|
|
|
|
// 调用接口
|
|
|
$result = YuanxiaoModel::getChouqianInfo($uid, $nickName, $birthday, $gender);
|
|
|
$result['code'] = 200;
|
|
|
$result['data'] = array('name' => $nickName, 'type' => 'M2');
|
|
|
if ($result['code'] === 200) { // 处理成功就跳转到等待页
|
|
|
// 将返回的结果存入cookeie中15分钟
|
|
|
$this->setCookie('yuanxiaochouqian', json_encode($result['data']), time() + 15*60);
|
|
|
$cookieData = array(
|
|
|
'name' => $nickName,
|
|
|
'type' => $result['data']['randomCode']
|
|
|
);
|
|
|
$this->setCookie('yuanxiaochouqian', json_encode($cookieData), time() + 15*60);
|
|
|
$this->go(Helpers::url('/cuxiao/yuanxiao/wait'));
|
|
|
} else { // 不成功就显示返回的错误信息
|
|
|
$this->_view->display('info', array(
|
...
|
...
|
@@ -131,13 +127,12 @@ class YuanxiaoController extends HuodongAction |
|
|
// cookie中存的结果
|
|
|
$result = json_decode($result, true);
|
|
|
$shareUrl = Helpers::url('/cuxiao/yuanxiao/share', array(
|
|
|
'name' => $this->encrypt($result['name']),
|
|
|
'hash' => $this->encrypt($this->getUid())
|
|
|
));
|
|
|
$result['type'] = $this->get('type', 'M2');
|
|
|
|
|
|
$this->_view->display('result', array(
|
|
|
'staticTitle' => '元宵抽签',
|
|
|
'weixinShare' => $this->_isApp ? false : true, // 是否需要微信分享
|
|
|
'staticFile' => self::STATIC_FILE,
|
|
|
'result' => $result,
|
|
|
'shareUrl' => $shareUrl,
|
...
|
...
|
@@ -152,22 +147,23 @@ class YuanxiaoController extends HuodongAction |
|
|
*/
|
|
|
public function shareAction()
|
|
|
{
|
|
|
// 昵称从url中解析
|
|
|
$name = $this->decrypt($this->get('name', ''));
|
|
|
// 用户UID
|
|
|
$uid = $this->decrypt($this->get('hash', ''));
|
|
|
if (empty($uid)) {
|
|
|
$this->go(Helpers::url('/cuxiao/yuanxiao/index'));
|
|
|
}
|
|
|
|
|
|
// 调用接口获取type和count
|
|
|
$result = array('type' => 'M1', 'count' => 9887);
|
|
|
$result = YuanxiaoModel::getChoujiangShareInfo($uid);
|
|
|
|
|
|
$this->_view->display('share', array(
|
|
|
'staticTitle' => '元宵抽签',
|
|
|
'staticFile' => self::STATIC_FILE,
|
|
|
'result' => array(
|
|
|
'name' => $name,
|
|
|
'name' => $result['name'],
|
|
|
'type' => $result['type']
|
|
|
),
|
|
|
'count' => $result['count'],
|
|
|
'count' => $result['total'],
|
|
|
'staticJS' => array(
|
|
|
'share.js'
|
|
|
)
|
...
|
...
|
|