Authored by xiaowei

PC重构登录-跳转问题修复

... ... @@ -46,7 +46,7 @@ class LoginData extends \LibModels\Wap\Passport\LoginData
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL2, $param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -38,20 +38,14 @@ class BrandsController extends WebAction
*/
public function brandinfoAction()
{
$result = array();
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
$brandId = $this->get('brandId',0);
$uid=$this->getUid(false);
$brandId=144;
BrandsModel::getBrandInfo($brandId, $uid);
$brandId = $this->get('brandId', 0);
$uid = $this->getUid(false);
$data = BrandsModel::getBrandInfo($brandId, $uid);
$result = array(
'code' => 200,
'brand' => $data
... ... @@ -62,9 +56,10 @@ class BrandsController extends WebAction
$this->echoJson($result);
}
/**
* 品牌一览
/*
* 品牌list
*/
public function indexAction()
{
$headerdata = array(
... ...
... ... @@ -7,6 +7,7 @@ use Plugin\HelperSearch;
use LibModels\Web\Product\BrandData;
use Index\HomeModel;
use Product\SearchModel;
use Plugin\Helpers;
/**
* 品牌首页模板数据模型
... ... @@ -108,32 +109,41 @@ class BrandsModel
{
$switchParams = self::switchBrandParams($channel);
$brandTop = array();
/*
* $item1 = array(
'name' => '所有品牌',
'src' => $imgsrc,
'url' => ''
);
*/
$brandAds = array();
$brandList = array();
$res = BrandData::getTopBanner($switchParams['brandCode'], $switchParams['channelType']);
//头部10个品牌图块
if (isset($res['brandTop'][1]['data']['list']) && $res['brandTop'][1]['data']['list']) {
foreach ($res['brandTop'][1]['data']['list'] as $tbk => $tbv) {
$imgUrlTmp = explode("?", $tbv['src']);
$urlTmp = explode("?", $tbv['url']);
$topBrandTmp = array(
'name' => $tbv['name'],
'src' => Helpers::getImageUrl($imgUrlTmp[0], 80, 50, 3),
'url' => str_replace('m.', '', $urlTmp[0]),
);
$brandAds[$tbk] = $topBrandTmp;
}
}
//头部品牌图块
if (isset($res['brandTop'][0]['data']) && $res['brandTop'][0]['data']) {
foreach ($res['brandTop'][0]['data'] as $tk => $tv) {
$imgUrl = explode("?", $tv['src']);
$imgUrlTmp = explode("?", $tv['src']);
$urlTmp = explode("?", $tv['url']);
$topTmp = array(
'name' => $tv['title'],
'src' => $imgUrl[0],
'url' => $tv['url'],
'items' => array()
'src' => $imgUrlTmp[0],
'url' => $urlTmp[0],
'items' => $brandAds
);
$brandTop[$tk] = $topTmp;
}
}
//品牌list
if (isset($res['brandList']['brands']) && $res['brandList']['brands']) {
foreach ($res['brandList']['brands'] as $lk => $lv) {
$listTmp = array();
if (isset($lv) && $lv) {
$listTmp = array();
foreach ($lv as $ltk => $ltv) {
$listTmp[$ltk] = array(
'name' => $ltv['brand_name'],
... ... @@ -158,33 +168,20 @@ class BrandsModel
*/
public static function getBrandInfo($brandId, $uid)
{
$imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';
$data = array(
'key' => '1000011',
'icon' => $imgsrc,
'title' => '优显led触控台灯',
'content' => '优显led触控台灯优显led触控台灯优显led触控台灯优显led触控台灯',
'subtitle' => 'AAAAAA',
'imgs' => array(
array(
'src' => $imgsrc
),
array(
'src' => $imgsrc
),
array(
'src' => $imgsrc
)
)
);
$data = array();
$res = BrandData::getBrandIntro($brandId, $uid);
//if(isset($res['data']) && $res['data']){
// $data['key']=$brandId;
// $data['icon']=
//}
var_dump($res);
die();
if (isset($res['data']) && $res['data']) {
$icoUrlTmp = explode("?", $res['data']['brand_ico']) ;
$data = array(
'key' => $res['data']['brand_id'],
'icon' => $icoUrlTmp[0],
'title' => $res['data']['brand_name'],
'content' =>$res['data']['brand_intro'],
'subtitle' => 'FEATURED ITEMS',
'imgs' => array(),
);
}
return $data;
}
/*
... ...
... ... @@ -112,6 +112,7 @@ class LoginController extends WebAction
/* 设置登录有效时间30分钟, 防机器刷 */
$expire = $this->getSession('_LOGIN_EXPIRE');
if (empty($expire) || $expire < time()) {
$data = array('code' => 400, 'message' => '页面停留时间过长,请刷新页面', 'data' => '');
break;
}
... ... @@ -135,13 +136,13 @@ class LoginController extends WebAction
}
$refer = $this->getCookie('refer');
if (empty($refer)) {
$refer = SITE_MAIN . '/?go=1';
if (empty($refer) || strstr($refer, 'signin.html') || strstr($refer, 'passport/login/index')) {
$refer = SITE_MAIN;
}
else {
$refer = rawurldecode($refer);
}
$data['data']['session'] = Helpers::syncUserSession($data['data']['uid']);
$data['data']['session'] = Helpers::syncUserSession($data['data']['uid'],$refer);
$data['data']['href'] = $refer;
$token = Helpers::makeToken($data['data']['uid']);
... ...