Authored by 郭成尧

Merge branch 'release/4.5' of git.yoho.cn:fe/YOHOBUYWAP into release/4.5

... ... @@ -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
... ...
... ... @@ -72,7 +72,7 @@
{{/ brandList}}
{{# newBrandWall}}
<div class="new-brand-wall branding-wall">
<div class="new-brand-wall branding-wall hide">
{{# list}}
<div class="brand-wall-box">
<a href="{{url}}">
... ... @@ -85,7 +85,7 @@
{{/ newBrandWall}}
{{# recommandBrandWall}}
<div class="recommand-brand-wall branding-wall">
<div class="recommand-brand-wall branding-wall hide">
{{# list}}
<div class="brand-wall-box">
<a href="{{url}}">
... ...
... ... @@ -24,6 +24,12 @@
</div>
{{/ brandWay}}
{{# shopBanner}}
<div id="brand-header" class="brand-header" data-id={{id}}>
<img class="lazy" data-original={{banner}}>
</div>
{{/ shopBanner}}
{{# brandHome}}
<div id="brand-header" class="brand-header" data-id={{id}}>
<img class="lazy" data-original={{banner}}>
... ...
... ... @@ -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' => $data['shopInfo']['data']);
}
//店铺分类
$channel = Helpers::getChannelByCookie();
$data['shopCategory'] = ListData::getShopCategory($shopId, $channel);
... ...
... ... @@ -142,9 +142,6 @@ class IndexController extends AbstractAction
$title = '';
$brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
//如果店铺使用基础模板TODO
$baseBanner = ListModel::getShopBaseBanner($brandLogo['shopId']);
//无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
if ($brandLogo['type'] == 2 && !empty($brandLogo['shopId'])) {
$this->shop($brandLogo['shopId'], $uid);
... ... @@ -249,10 +246,7 @@ class IndexController extends AbstractAction
}
$this->setTitle($title);
$this->setNavHeader($title, true, SITE_MAIN);
//店铺页banner
if ($baseBanner) {
$data['brandHome']['banner'] = $data['brandHome'];
}
$this->_view->display('index', $data);
}
... ... @@ -461,9 +455,10 @@ class IndexController extends AbstractAction
}
/**
* 店铺首页
* 店铺首页 || 若店铺使用基础模板跳转品牌页
* @param int $shopId
* @author sefon 2016-4-26 20:50:58
* @return int
*/
private function shop($shopId)
{
... ... @@ -479,6 +474,11 @@ class IndexController extends AbstractAction
$this->setCookie('appUid', $uid);
}
$data = ListModel::shopData($shopId, $uid, $appVersion);
if (isset($data['goBrand'])) {
//跳转基础模板
self::baseShop($data['goBrand']);
exit;
}
$this->_view->display('shop', array(
'shopIndex' => $data,
'shopPage' => array(
... ... @@ -490,6 +490,97 @@ class IndexController extends AbstractAction
}
/**
* 店铺基础模板
* @param int $shop
* @author sefon 2016-4-26 20:50:58
* @return int
*/
private function baseShop($shop)
{
/* 过滤请求参数 */
$condition = filter_input_array(INPUT_GET, array(
'sort' => FILTER_DEFAULT,
'brand' => FILTER_DEFAULT,
'msort' => FILTER_DEFAULT,
'misort' => FILTER_DEFAULT,
'color' => FILTER_DEFAULT,
'size' => FILTER_DEFAULT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'discount' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
if ($shop['mult_brand_shop_type'] == 2) {
// 转义店铺
$condition['shop_id'] = $shop['shops_id'];
} else {
$brands = ShopData::getShopBrands($shop['shops_id']);
if (isset($brands['code']) && $brands['code'] == 200 && isset($brands['data']) && !empty($brands['data']))
$condition['brand'] = $brands['data'][0]['brand_id'];
}
// 转义分类
if (isset($condition['sort'])) {
$condition['sort'] = rawurldecode($condition['sort']);
}
// 转义一级分类
if (isset($condition['msort'])) {
$condition['msort'] = rawurldecode($condition['msort']);
}
// 转义二级分类
if (isset($condition['misort'])) {
$condition['misort'] = rawurldecode($condition['misort']);
}
// 转义颜色
if (isset($condition['color'])) {
$condition['color'] = rawurldecode($condition['color']);
}
// 转义尺码
if (isset($condition['size'])) {
$condition['size'] = rawurldecode($condition['size']);
}
// 转义风格
if (isset($condition['style'])) {
$condition['style'] = rawurldecode($condition['style']);
}
// 转义价格
if (isset($condition['price'])) {
$condition['price'] = rawurldecode($condition['price']);
}
// 转换折扣
if (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
}
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['discount'] = rawurldecode($condition['p_d']);
}
if (isset($condition['gender'])) {
$condition['gender'] = rawurldecode($condition['gender']);
}/* else {
$condition['gender'] = Helpers::getGenderByCookie();
}*/
$data = array();
$data['goodListPage'] = true;
$data['showDownloadApp'] = true;
$title = $shop['shop_name'];
// 右下角的购物车链接
$data['goodList']['cartUrl'] = Helpers::url('/cart/index/index', null);
$data['goodList'] += $condition;
$data['pageFooter'] = true;
$this->setTitle($title);
$this->setNavHeader($title, true, SITE_MAIN);
//店铺页banner
$data['shopBanner']['banner'] = ListModel::getShopBaseBanner($shop['shops_id']);
$this->_view->display('index', $data);
}
/**
* 店铺收藏
* @author sefon 2016-4-28 23:00:11
*/
... ... @@ -516,7 +607,6 @@ class IndexController extends AbstractAction
$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)) {
... ...