Authored by 周少峰

shop base template ,add getResizeImgurl

... ... @@ -107,7 +107,7 @@ class ShopProcess
*/
private static function shopTopBanner_APP($data)
{
self::$shopData['branerImg'] = Images::getImageUrl($data[0]['shopSrc'], 640, 200);
self::$shopData['branerImg'] = Images::getResizeImagesUrl($data[0]['shopSrc'], 640, 200, 1);
}
/**
... ...
... ... @@ -75,6 +75,19 @@ class Images
}
/**
* 获取图片地址
* @param $fileName http://img13.static.yhbimg.com/yhb-img02/2016/06/01/19/02878f3a909f5c468a1445210b38a9512f.jpg
* @param $width
* @param $height
* @param int $mode
* @return mixed
*/
public static function getResizeImagesUrl($fileName, $width, $height, $mode = 2)
{
$fileName = self::MakeTemplateRequest($fileName);
return self::getImageUrl($fileName, $width, $height, $mode = 2);
}
/**
* 获取图片URL模板
* @param $fileName
* @param int $mode
... ...
... ... @@ -419,6 +419,10 @@ class ListModel
$data['decorator'] = ListData::getShopDecorator($shopId);
//店铺信息
$data['shopInfo'] = ListData::getShopInfo($shopId, $uid);
//店铺使用基础模板,返回品牌页面
if (isset($data['shopInfo']['data']['shop_template_type']) && $data['shopInfo']['data']['shop_template_type'] === 1) {
return array('goBrand' => true);
}
//店铺分类
$channel = Helpers::getChannelByCookie();
$data['shopCategory'] = ListData::getShopCategory($shopId, $channel);
... ...
... ... @@ -128,21 +128,25 @@ class IndexController extends AbstractAction
//如果是app 或者多品店,可直接获取shopId
$appShopId = $this->get('shop_id');
if (!empty($appShopId)) {
$this->shop($appShopId);
exit;
}
/* 品牌域名参数 @see Bootstrap.php */
$domain = $this->param('named');
if (empty($domain)) {
$this->go(SITE_MAIN);
// 如果店铺使用基础模板返回 true
if (!$this->shop($appShopId)){
exit;
}
} else {
/* 品牌域名参数 @see Bootstrap.php */
$domain = $this->param('named');
if (empty($domain)) {
$this->go(SITE_MAIN);
}
$brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
}
// 当前的登录用户UID
$uid = $this->getUid();
// 存标题信息
$title = '';
$brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
//如果店铺使用基础模板TODO
//如果店铺使用基础模板 TODO
$baseBanner = ListModel::getShopBaseBanner($brandLogo['shopId']);
//无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
... ... @@ -461,9 +465,10 @@ class IndexController extends AbstractAction
}
/**
* 店铺首页
* 店铺首页 || 若店铺使用基础模板跳转品牌页
* @param int $shopId
* @author sefon 2016-4-26 20:50:58
* @return int
*/
private function shop($shopId)
{
... ... @@ -479,6 +484,9 @@ class IndexController extends AbstractAction
$this->setCookie('appUid', $uid);
}
$data = ListModel::shopData($shopId, $uid, $appVersion);
if ($data['goBrand']) {
return true;
}
$this->_view->display('shop', array(
'shopIndex' => $data,
'shopPage' => array(
... ...