Authored by hf

do fixes bug to nav bar and guang home page show one tab data

... ... @@ -15,6 +15,7 @@ namespace Action;
use Yaf\Controller_Abstract;
use Yaf\Dispatcher;
use Plugin\Cache;
use Plugin\Helpers;
class AbstractAction extends Controller_Abstract
{
... ... @@ -327,6 +328,24 @@ class AbstractAction extends Controller_Abstract
if (!empty($homeUrl)) {
$header['navHome'] = $homeUrl;
}
// 根据COOKIE记录的频道进行导航定位
$channel = Helpers::getChannelByCookie();
switch ($channel) {
default:
case 1:
$header['boys'] = true;
break;
case 2:
$header['girls'] = true;
break;
case 3:
$header['kids'] = true;
break;
case 4:
$header['lifeStyle'] = true;
break;
}
$this->_view->assign('pageHeader', $header);
}
... ...
... ... @@ -17,7 +17,19 @@ use Api\Sign;
class SearchData
{
/**
* 阿里云外网
*
* @var string
*/
protected static $_searchurl = 'http://101.200.31.165/yohosearch/search.json';
// /**
// * 阿里云内网
// *
// * @var string
// */
// protected static $_searchurl = 'http://100.98.132.63/yohosearch/search.json';
/**
* 模糊搜索提供的关键词
... ...
... ... @@ -91,7 +91,82 @@ class IndexModel
$data['guang']['gender'] = $gender;
$category = array();
return $data;
}
/**
* 获取逛首页分类内容列表
*
* @param string $gender "1,3"表示男, "2,3"表示女
* @param int channel APP客户端标识 1表示男,2:表示女,3:潮童,4:创意生活
* @param int type 分类ID 0:最新,1:话题,2:搭配,3:潮人,4:潮品,5:小贴士
* @param int $uid 用户ID
* @param string $udid 客户端唯一标识
* @param int $page 分页第几页, 默认第1页
* @return array
*/
public static function getArticle($gender, $type, $uid, $udid, $page = 1)
{
// 逛首页的分类名称列表
$category = ListData::category();
$article = array();
switch ($gender) {
case '1,3': // 男
$article = ListData::article('1,3', $type, $uid, $udid, $page);
break;
case '2,3': // 女
$article = ListData::article('2,3', $type, $uid, $udid, $page);
break;
default: // 其它所有
$article = ListData::article('1,2,3', $type, $uid, $udid, $page);
break;
}
$data = array();
$build = array();
// 模板中使用JS的标识
$data['guangHome'] = true;
// 顶部的分类列表
if (!empty($category['data'])) {
foreach ($category['data'] as $value) {
$build = array();
$build['typeId'] = $value['id'];
$build['type'] = $value['name'];
$build['focus'] = ($value['id'] == $type);
$data['navs'][] = $build;
$data['guang']['infos'][] = array(
'show' => $build['focus'],
'info' => array(),
);
}
}
// 广告列表
if (!empty($article['data']['list']['adlist'])) {
foreach ($article['data']['list']['adlist'] as $value) {
$build = array();
$build['url'] = Helpers::getFilterUrl($value['url']);
$build['img'] = Helpers::getImageUrl($value['src'], 830, 327);
$data['guang']['swiper'][] = $build;
}
}
// 内容列表
if (!empty($article['data']['list']['artlist'])) {
$type = intval($type);
foreach ($article['data']['list']['artList'] as $value) {
$data['guang']['infos'][$type]['info'] = Helpers::formatArticle($value, true, false, true);
}
}
$category = array();
$article = array();
return $data;
}
... ...
... ... @@ -175,7 +175,7 @@ class IndexController extends AbstractAction
/* 获取资讯文章列表 */
$uid = $this->getUid();
$udid = $this->getUdid();
$page = intval($page) + 1;
//$page = intval($page) + 1;
$article = ListData::article($gender, $sortId, $uid, $udid, $page, $tag, $authorId);
if (empty($article['data']['list']['artList'])) {
break;
... ...
... ... @@ -31,6 +31,11 @@ class InfoController extends AbstractAction
$this->error();
}
// WAP上设置头部导航
if (null === $this->get('openby:yohobuy', null)) {
$this->setNavHeader('逛', true, SITE_MAIN);
}
$data = array();
$data['guangDetail'] = true; // 模板中使用JS的标识
$data['guang']['id'] = $id;
... ...
... ... @@ -85,7 +85,7 @@ class IndexController extends AbstractAction
if (!isset($brandIds[0])) {
$this->error();
}
// 当前的登录用户UID
$uid = $this->getUid();
// 存标题信息
... ... @@ -107,6 +107,7 @@ class IndexController extends AbstractAction
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$condition['brand'] = $brandIds[0];
if (isset($condition['gender'])) {
$condition['gender'] = rawurldecode($condition['gender']);
}
... ... @@ -118,7 +119,7 @@ class IndexController extends AbstractAction
$data['goodList']['brandWay'] = false;
$data['goodList']['search']['default'] = $query;
$data['goodList']['search']['url'] = Helpers::url('', null, 'search');
}
}
// 品牌一览过来的展示品牌介绍和LOGO
else {
$data['brandHome'] = Product\ListModel::getBrandIntro($brandIds[0], $uid, $title);
... ...