Authored by yangyang

app访问时,所有链接加入appversion参数

... ... @@ -31,11 +31,11 @@ class StarClassModel
* @param $uid
* @return array
*/
public static function getStarClass($uid)
public static function getStarClass($uid, $appVersion)
{
$result = array();
//头部导航
$result['headTab'] = self::getHeadTab('index');
$result['headTab'] = self::getHeadTab('index', $appVersion);
//组装调资源位URL(获取星潮教室首页数据)
$res['starClassIndex'] = StarClassData::getResourceDataUrl(self::CODE_FLOOR_STARCLASS_INDEX);
... ... @@ -100,11 +100,11 @@ class StarClassModel
* 星专题
* @return array
*/
public static function getspecial()
public static function getspecial($appVersion)
{
$result = array();
//头部导航
$result['headTab'] = self::getHeadTab('special');
$result['headTab'] = self::getHeadTab('special', $appVersion);
//组装资源位获取星潮教室首页数据URL
$data = StarClassData::getResourceData(self::CODE_FLOOR_STARCLASS_SPECIAL);
... ... @@ -139,11 +139,11 @@ class StarClassModel
/**
* 星搭配页面
*/
public static function getCollocation()
public static function getCollocation($appVersion)
{
$result = array();
//头部导航
$result['headTab'] = self::getHeadTab('collocation');
$result['headTab'] = self::getHeadTab('collocation', $appVersion);
return $result;
}
... ... @@ -257,20 +257,20 @@ class StarClassModel
/**
* 获取headTab
*/
public static function getHeadTab($tab)
public static function getHeadTab($tab, $appVersion)
{
$result = array(
array(
'name' => '全部',
'url' => Helpers::url('/guang/starclass/index'),
'url' => Helpers::url('/guang/starclass/index', $appVersion),
),
array(
'name' => '星专题',
'url' => Helpers::url('/guang/starclass/special')
'url' => Helpers::url('/guang/starclass/special', $appVersion)
),
array(
'name' => '星搭配',
'url' => Helpers::url('/guang/starclass/collocation')
'url' => Helpers::url('/guang/starclass/collocation', $appVersion)
),
// array(
// 'name' => '星鲜事',
... ... @@ -403,6 +403,6 @@ class StarClassModel
return $result;
}
}
\ No newline at end of file
... ...
... ... @@ -21,13 +21,16 @@ class StarClassController extends AbstractAction
{
//获取uid
$uid = self::getLoggedUid();
$appVersion = array();
if (!$this->_isApp) {
//设置头部公共导航
$this->setNavHeader('星潮教室', true, false);
}else{
$appVersion = array('app_version'=>1);
}
$this->setTitle('星潮教室');
//调用模型获得星潮教室首页数据
$data = StarClassModel::getStarClass($uid);
$data = StarClassModel::getStarClass($uid, $appVersion);
//渲染模板
$this->_view->display('index', array(
'trendClassHome' => $data,
... ... @@ -44,14 +47,17 @@ class StarClassController extends AbstractAction
{
//获取uid
$uid = self::getLoggedUid();
$appVersion = array();
if (!$this->_isApp) {
//设置头部公共导航
$this->setNavHeader('星潮教室', true, false);
}else{
$appVersion = array('app_version'=>1);
}
$this->setTitle('星潮教室');
//调用模型获得星专题数据
$data = StarClassModel::getspecial();
$data = StarClassModel::getspecial($appVersion);
//渲染模板
$this->_view->display('subject', array(
... ... @@ -68,14 +74,17 @@ class StarClassController extends AbstractAction
{
//获取uid
$uid = self::getLoggedUid();
$appVersion = array();
if (!$this->_isApp) {
//设置头部公共导航
$this->setNavHeader('星潮教室', true, false);
}else{
$appVersion = array('app_version'=>1);
}
$this->setTitle('星潮教室');
//调用模板获得星搭配数据
$data = StarClassModel::getCollocation();
$data = StarClassModel::getCollocation($appVersion);
//渲染模板
$this->_view->display('collocation', array(
... ... @@ -115,16 +124,21 @@ class StarClassController extends AbstractAction
*/
public function topAction()
{
//获取uid
$uid = self::getLoggedUid();
$appVersion = array();
//设置头部公共导航(此处返回键调转星潮教室首页)
$url = Helpers::url('/guang/starclass/index');
if (!$this->_isApp) {
$url = Helpers::url('/guang/starclass/index');
//设置头部公共导航
$this->setNavHeader('星潮粉丝榜', $url, false);
}else{
$appVersion = array('app_version'=>1);
$url = Helpers::url('/guang/starclass/index', $appVersion);
}
$this->setTitle('星潮粉丝榜');
//根据客户端类型,进行未登录跳转
$uid = $this->getLoggedUid();
if (!$uid) {
$refer = Helpers::url('/guang/starclass/top');
if (!$this->_isApp) {
... ...