Authored by 郝肖肖

基础模板 水牌位

... ... @@ -114,3 +114,17 @@
{{#if node}}
<div id="brand-card" class="brand-card" data-node="{{node}}"></div>
{{/if}}
{{!-- 水牌广告-基础模板 --}}
{{#signboard}}
<div class="sell-signboard left-modular">
<h2 class="title">{{title}}</h2>
<ul class="left-list">
{{#each list}}
<li>
<a target="_blank" href="{{url}}"><img src="{{img}}" alt="{{title}}" /></a>
</li>
{{/each}}
</ul>
</div>
{{/signboard}}
... ...
... ... @@ -108,6 +108,19 @@
}
}
}
.sell-signboard {
.left-list li {
padding-left: 0;
height: auto;
margin-bottom: 10px;
line-height: inherit;
img {
width: 100%;
}
}
}
}
.min-screen .product-list-page .sort-intro {
... ...
... ... @@ -562,10 +562,36 @@ class ShopModel
return $result;
}
/**
* 基础模板
* @param type int $shopId 店铺id
* @return type []
*/
public static function basisTemplate($shopId)
{
$result = array();
$shopData = ShopData::shopsDecoratorList($shopId);
$data = array('signboard' => array());
$parameters['shopId'] = $shopId;
$shopList = ShopData::shopsDecoratorList($shopId);
if (isset($shopList['data']['list']) && $shopList['code'] === 200) {
foreach ($shopList['data']['list'] as $list) {
$fun = $list['resource_name'];
if (is_callable("self::$fun")) {
$list = self::$fun(self::getResourceData($list), $parameters);
switch ($fun) {
case 'shopTopBanner':
$data[$fun] = $list;
break;
case 'signboard':
$data[$fun] = array(
'title' => isset($list[0]['title']) ? $list[0]['title'] : '',
'list'=> $list
);
break;
}
}
}
}
return $data;
}
/**
... ...
... ... @@ -27,7 +27,7 @@ class IndexController extends WebAction
if (!$result) {
$this->go(SITE_MAIN);
}
$type = intval(isset($result['type']) ? $result['type'] : '');
switch ($type) {
case 1:
... ... @@ -47,6 +47,16 @@ class IndexController extends WebAction
$this->shopHome($result['shopId']);
exit(0);
}
//基础模板
if ($result['shopTemplateType'] === 1 && !empty($result['shopId'])) {
$basisData = ShopModel::basisTemplate($result['shopId']);
$result['brandBanner'] = empty($basisData['shopTopBanner']['banner']) ?
$result['brandBanner'] : $basisData['shopTopBanner']['banner'];
$result['signboard'] = $basisData['signboard'];
if (isset($result['node'])) {
unset($result['node']);
}
}
break;
}
... ... @@ -81,6 +91,8 @@ class IndexController extends WebAction
//调用模型获得品牌页数据
$data = BrandsModel::getBrandSearchData($condition, $options);
//水牌位
$data['signboard'] = isset($result['signboard']) ? $result['signboard'] : '';
$seo = $data['seo'];
$data = array(
//初始化js
... ...