Authored by Rock Zhang

修复app中分享有关

@@ -67,7 +67,7 @@ class HuodongAction extends Controller_Abstract @@ -67,7 +67,7 @@ class HuodongAction extends Controller_Abstract
67 } 67 }
68 68
69 // 判断是否是应用访问, 拼接APP需要的URL参数 69 // 判断是否是应用访问, 拼接APP需要的URL参数
70 - $this->_isApp = (null !== $this->get('app_version') || null !== $this->get('uid')); 70 + $this->_isApp = (null !== $this->get('app_version'));
71 } 71 }
72 72
73 /** 73 /**
@@ -34,12 +34,12 @@ class YuanxiaoController extends HuodongAction @@ -34,12 +34,12 @@ class YuanxiaoController extends HuodongAction
34 $playUrlEncode = strtr($playUrl, array('/' => '\\/')); 34 $playUrlEncode = strtr($playUrl, array('/' => '\\/'));
35 35
36 $this->_view->display('index', array( 36 $this->_view->display('index', array(
37 - 'staticTitle' => '2016潮流运势测试', 37 + 'staticTitle' => '2016潮流运势测试',
38 'staticFile' => self::STATIC_FILE, 38 'staticFile' => self::STATIC_FILE,
39 'staticJS' => array( 39 'staticJS' => array(
40 'home.js' 40 'home.js'
41 ), 41 ),
42 - 'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!', 42 + 'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!',
43 'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png', 43 'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png',
44 'shareUrl' => Helpers::url('/cuxiao/yuanxiao/index'), 44 'shareUrl' => Helpers::url('/cuxiao/yuanxiao/index'),
45 'playUrl' => $this->isApp() ? $playUrl . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $playUrlEncode . '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}': $playUrl, 45 'playUrl' => $this->isApp() ? $playUrl . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $playUrlEncode . '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}': $playUrl,
@@ -72,6 +72,7 @@ class YuanxiaoController extends HuodongAction @@ -72,6 +72,7 @@ class YuanxiaoController extends HuodongAction
72 72
73 // 调用接口 73 // 调用接口
74 $result = YuanxiaoModel::getChouqianInfo($uid, $nickName, $FormatBirthday, $gender); 74 $result = YuanxiaoModel::getChouqianInfo($uid, $nickName, $FormatBirthday, $gender);
  75 +
75 if ($result['code'] === 200) { // 处理成功就跳转到等待页 76 if ($result['code'] === 200) { // 处理成功就跳转到等待页
76 // 将返回的结果存入cookeie中15分钟 77 // 将返回的结果存入cookeie中15分钟
77 $cookieData = array( 78 $cookieData = array(
@@ -79,10 +80,14 @@ class YuanxiaoController extends HuodongAction @@ -79,10 +80,14 @@ class YuanxiaoController extends HuodongAction
79 'type' => $result['data']['randomCode'] 80 'type' => $result['data']['randomCode']
80 ); 81 );
81 $this->setCookie('yuanxiaochouqian', json_encode($cookieData), time() + 15 * 60); 82 $this->setCookie('yuanxiaochouqian', json_encode($cookieData), time() + 15 * 60);
82 - $this->go(Helpers::url('/cuxiao/yuanxiao/wait')); 83 +
  84 + $waitUrl = Helpers::url('/cuxiao/yuanxiao/wait');
  85 + $this->go($this->_isApp ? $waitUrl . '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N"}}' : $waitUrl);
  86 +
83 } else { // 不成功就显示返回的错误信息 87 } else { // 不成功就显示返回的错误信息
  88 +
84 $this->_view->display('info', array( 89 $this->_view->display('info', array(
85 - 'staticTitle' => '2016潮流运势测试', 90 + 'staticTitle' => '2016潮流运势测试',
86 'staticFile' => self::STATIC_FILE, 91 'staticFile' => self::STATIC_FILE,
87 'staticJS' => array( 92 'staticJS' => array(
88 'info.js' 93 'info.js'
@@ -101,12 +106,12 @@ class YuanxiaoController extends HuodongAction @@ -101,12 +106,12 @@ class YuanxiaoController extends HuodongAction
101 $userData = YuanxiaoModel::getUserProfileData($uid); 106 $userData = YuanxiaoModel::getUserProfileData($uid);
102 107
103 $this->_view->display('info', array( 108 $this->_view->display('info', array(
104 - 'staticTitle' => '2016潮流运势测试', 109 + 'staticTitle' => '2016潮流运势测试',
105 'staticFile' => self::STATIC_FILE, 110 'staticFile' => self::STATIC_FILE,
106 'staticJS' => array( 111 'staticJS' => array(
107 'info.js' 112 'info.js'
108 ), 113 ),
109 - 'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!', 114 + 'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!',
110 'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png', 115 'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png',
111 'shareUrl' => Helpers::url('/cuxiao/yuanxiao/index'), 116 'shareUrl' => Helpers::url('/cuxiao/yuanxiao/index'),
112 'birthday' => date_format(date_create($userData['birthday']), 'Y年m月d日'), 117 'birthday' => date_format(date_create($userData['birthday']), 'Y年m月d日'),
@@ -124,15 +129,16 @@ class YuanxiaoController extends HuodongAction @@ -124,15 +129,16 @@ class YuanxiaoController extends HuodongAction
124 { 129 {
125 // 审判跳转登录页 130 // 审判跳转登录页
126 // $this->auditJumpLogin(); 131 // $this->auditJumpLogin();
  132 + $activityUrl = Helpers::url('/cuxiao/yuanxiao/result');
127 133
128 $this->_view->display('wait', array( 134 $this->_view->display('wait', array(
129 - 'staticTitle' => '2016潮流运势测试', 135 + 'staticTitle' => '2016潮流运势测试',
130 'staticFile' => self::STATIC_FILE, 136 'staticFile' => self::STATIC_FILE,
131 - 'activityUrl' => Helpers::url('/cuxiao/yuanxiao/result'), 137 + 'activityUrl' => $this->_isApp ? $activityUrl . '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","share":"'.$activityUrl.'", shareparam:":{"share_id":"1"}}}' : $activityUrl,
132 'staticJS' => array( 138 'staticJS' => array(
133 'wait.js' 139 'wait.js'
134 ), 140 ),
135 - 'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!', 141 + 'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!',
136 'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png', 142 'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png',
137 'shareUrl' => Helpers::url('/cuxiao/yuanxiao/index'), 143 'shareUrl' => Helpers::url('/cuxiao/yuanxiao/index'),
138 )); 144 ));
@@ -159,12 +165,12 @@ class YuanxiaoController extends HuodongAction @@ -159,12 +165,12 @@ class YuanxiaoController extends HuodongAction
159 )); 165 ));
160 166
161 $this->_view->display('result', array( 167 $this->_view->display('result', array(
162 - 'staticTitle' => '2016潮流运势测试', 168 + 'staticTitle' => '2016潮流运势测试',
163 'needShare' => $this->checkNeedShare(), // 是否需要微信分享 169 'needShare' => $this->checkNeedShare(), // 是否需要微信分享
164 'staticFile' => self::STATIC_FILE, 170 'staticFile' => self::STATIC_FILE,
165 'result' => $result, 171 'result' => $result,
166 'shareTitle' => $result['name'] . '的2016年潮流运势是' . $this->getChouqianTitle($result['type']), 172 'shareTitle' => $result['name'] . '的2016年潮流运势是' . $this->getChouqianTitle($result['type']),
167 - 'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!', 173 + 'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!',
168 'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png', 174 'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png',
169 'shareUrl' => $shareUrl, 175 'shareUrl' => $shareUrl,
170 'staticJS' => array( 176 'staticJS' => array(
@@ -190,7 +196,7 @@ class YuanxiaoController extends HuodongAction @@ -190,7 +196,7 @@ class YuanxiaoController extends HuodongAction
190 $result = YuanxiaoModel::getChoujiangShareInfo($uid); 196 $result = YuanxiaoModel::getChoujiangShareInfo($uid);
191 197
192 $this->_view->display('share', array( 198 $this->_view->display('share', array(
193 - 'staticTitle' => '2016潮流运势测试', 199 + 'staticTitle' => '2016潮流运势测试',
194 'staticFile' => self::STATIC_FILE, 200 'staticFile' => self::STATIC_FILE,
195 'result' => array( 201 'result' => array(
196 'name' => $result['name'], 202 'name' => $result['name'],
@@ -200,7 +206,7 @@ class YuanxiaoController extends HuodongAction @@ -200,7 +206,7 @@ class YuanxiaoController extends HuodongAction
200 'staticJS' => array( 206 'staticJS' => array(
201 'share.js' 207 'share.js'
202 ), 208 ),
203 - 'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!', 209 + 'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!',
204 'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png' 210 'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png'
205 )); 211 ));
206 } 212 }