Authored by 周少峰

Merge branch 'feature/mBrandShop' into release/4.4

... ... @@ -90,8 +90,7 @@ class ListData
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
//TODO
// return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, $cache);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
... ... @@ -108,8 +107,8 @@ class ListData
$param['shop_id'] = $shopId;
$param['client_secret'] = Sign::getSign($param);
//TODO
// return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get('http://devapi.yoho.cn:58078/', $param, $cache);
return Yohobuy::get(Yohobuy::API_URL, $param);
// return Yohobuy::get('http://devapi.yoho.cn:58078/', $param, $cache);
}
/**
... ... @@ -126,8 +125,8 @@ class ListData
$param['shop_id'] = $shopId;
$param['client_secret'] = Sign::getSign($param);
//TODO
// return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, $cache);
return Yohobuy::get(Yohobuy::API_URL, $param);
// return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, $cache);
}
/**
... ... @@ -143,8 +142,8 @@ class ListData
$param['brand_id'] = $brandId;
$param['client_secret'] = Sign::getSign($param);
//TODO
// return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, $cache);
return Yohobuy::get(Yohobuy::API_URL, $param);
// return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, $cache);
}
}
... ...
... ... @@ -36,13 +36,13 @@ class ListProcess
* @param $data
* @return array 处理之后的商品数据
*/
public static function getProductData($data)
public static function getProductData($data, $isApp = false)
{
// 处理商品
$products = array();
foreach ($data as $value) {
$products[] = Helpers::formatProduct($value, true, true, true, 235, 314);
$products[] = Helpers::formatProduct($value, true, true, true, 235, 314, true);
}
return $products;
... ...
... ... @@ -25,7 +25,7 @@ class ShopProcess
public static function formShopData($data, $shopId, $appVersion)
{
self::$shopId = $shopId;
self::$appVersion = $appVersion;
self::$shopData['appVersion'] = self::$appVersion = $appVersion;
foreach ($data as $key => $val) {
if (empty($val) || !is_callable("self::$key")) {
continue;
... ... @@ -52,7 +52,7 @@ class ShopProcess
self::$shopData['shopIntroHref'] = Helpers::url('/product/index/intro', array('shop_id' => self::$shopId));
//全部商品链接
$appSuffix = '{"action":"go.list","params":{"title":"全部商品", "shop_id":"'.self::$shopId.'","page":"1"}}';
self::$shopData['allGoods'] = Helpers::url('', array('shop_id' => self::$shopId, 'title' => '全部商品', 'yohobuy' => $appSuffix), 'search');
self::$shopData['allGoods'] = Helpers::url('', array('shop_id' => self::$shopId, 'title' => '全部商品', 'openby:yohobuy' => $appSuffix), 'search');
//搜索链接
self::$shopData['url'] = Helpers::url('', array('shop_id' => self::$shopId), 'search');
//人气单品的链接
... ... @@ -119,11 +119,14 @@ class ShopProcess
return;
}
foreach ($data as $val) {
self::$shopData['brandList']['list'][] = array(
'url' => Helpers::url('', '', $val['brandDomain']),
'img' => Images::getImageUrl($val['brandIco'], 640, 400),
'brandName' => $val['brandName']
);
$appSuffix = 'openby:yohobuy={"action":"go.brand","params":{"shop_id":"'.self::$shopId.'","brand_id":"'.$val['id'].'"}}';
$brand['url'] = Helpers::url('', '', $val['brandDomain']);
if (!empty(self::$appVersion)) {
$brand['url'] .= '?'.$appSuffix;
}
$brand['img'] = Images::getImageUrl($val['brandIco'], 640, 400);
$brand['brandName'] = $val['brandName'];
self::$shopData['brandList']['list'][] = $brand;
}
//大于5个返回更多品牌链接
if ($brandNumber > 5) {
... ...
... ... @@ -38,9 +38,9 @@
<li tab="new-arrival">上新</li>
<li tab="popularity">人气</li>
<li>
<a href="{{allGoods}}" target="_blank">全部商品</a>
<a href="{{allGoods}}">全部商品</a>
</li>
</ul>
</ul>
<div id="home-page" class="main">
<div id="nav-main" >
... ...
... ... @@ -469,13 +469,10 @@ class IndexController extends AbstractAction
}
//app环境
else {
$data['appVersion'] = $appVersion;
$uid = $this->get('uid');
$this->setSession('appUid', $uid);
}
$data = ListModel::shopData($shopId, $uid, $appVersion);
$this->_view->display('shop', array(
'shopIndex' => $data,
'shopPage' => true
... ... @@ -504,12 +501,13 @@ class IndexController extends AbstractAction
if (empty($uid)) {
$data['code'] = 401;
//TODO app登陆地址
$refer = urlencode($_SERVER['HTTP_REFERER']);
$refer = $_SERVER['HTTP_REFERER'];
$toUrl = Helpers::url('/signin.html')."?refer=".$refer;
if (!empty($appVersion)){
$toUrl .= '&yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"'.$refer.'","param":{}},"requesturl":{"param":{},"url":""},"priority":"Y"}}';
$toUrl .= '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"'.$refer.'","param":{}},"requesturl":{"param":{},"url":""},"priority":"Y"}}';
}
$data['url'] = $toUrl;
// print_r($data); exit;
break;
}
if (!empty($shopId) && !empty($uid)) {
... ...