Authored by hf

code review by fei.hong : do format yuanxiao huodong codes check call app login

@@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
5 <div class="flower flower-l"></div> 5 <div class="flower flower-l"></div>
6 <div class="flower flower-r"></div> 6 <div class="flower flower-r"></div>
7 </div> 7 </div>
8 - <a class="start" href="/cuxiao/yuanxiao/info"></a> 8 + <a class="start" href="{{playUrl}}"></a>
9 <div class="footer"> 9 <div class="footer">
10 - <a class="arrow animated infinite pulse" href="/cuxiao/yuanxiao/info"></a> 10 + <a class="arrow animated infinite pulse" href="{{playUrl}}"></a>
11 <div class="yohobuy"></div> 11 <div class="yohobuy"></div>
12 </div> 12 </div>
13 </div> 13 </div>
@@ -30,12 +30,16 @@ class YuanxiaoController extends HuodongAction @@ -30,12 +30,16 @@ class YuanxiaoController extends HuodongAction
30 */ 30 */
31 public function indexAction() 31 public function indexAction()
32 { 32 {
  33 + $playUrl = Helpers::url('/cuxiao/yuanxiao/info');
  34 + $playUrlEncode = strtr($playUrl, array('/' => '\\/'));
  35 +
33 $this->_view->display('index', array( 36 $this->_view->display('index', array(
34 'staticTitle' => '元宵抽签', 37 'staticTitle' => '元宵抽签',
35 'staticFile' => self::STATIC_FILE, 38 'staticFile' => self::STATIC_FILE,
36 'staticJS' => array( 39 'staticJS' => array(
37 'home.js' 40 'home.js'
38 - ) 41 + ),
  42 + 'playUrl' => $this->isApp() ? $playUrl . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $playUrlEncode . '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}': $playUrl,
39 )); 43 ));
40 } 44 }
41 45
@@ -44,10 +48,11 @@ class YuanxiaoController extends HuodongAction @@ -44,10 +48,11 @@ class YuanxiaoController extends HuodongAction
44 */ 48 */
45 public function infoAction() 49 public function infoAction()
46 { 50 {
47 - // 审判跳转登录页  
48 - $this->auditJumpLogin(); 51 + $uid = $this->getLoggedUid();
  52 + if (!$uid) {
  53 + $this->go(Helpers::url('/signin.html', array('refer' => Helpers::url('/cuxiao/yuanxiao/info')), 'default'));
  54 + }
49 55
50 - $uid = $this->getUid();  
51 // POST提交请求 56 // POST提交请求
52 $posts = $this->post(); 57 $posts = $this->post();
53 if (!empty($posts)) { 58 if (!empty($posts)) {
@@ -223,6 +228,16 @@ class YuanxiaoController extends HuodongAction @@ -223,6 +228,16 @@ class YuanxiaoController extends HuodongAction
223 } 228 }
224 229
225 /** 230 /**
  231 + * 判断是否是APP访问
  232 + *
  233 + * @return bool
  234 + */
  235 + private function isApp()
  236 + {
  237 + return (null !== $this->get('app_version'));
  238 + }
  239 +
  240 + /**
226 * 判断是否需要微信分享 241 * 判断是否需要微信分享
227 * @return bool 242 * @return bool
228 */ 243 */