Showing
4 changed files
with
68 additions
and
3 deletions
@@ -114,3 +114,17 @@ | @@ -114,3 +114,17 @@ | ||
114 | {{#if node}} | 114 | {{#if node}} |
115 | <div id="brand-card" class="brand-card" data-node="{{node}}"></div> | 115 | <div id="brand-card" class="brand-card" data-node="{{node}}"></div> |
116 | {{/if}} | 116 | {{/if}} |
117 | + | ||
118 | +{{!-- 水牌广告-基础模板 --}} | ||
119 | +{{#signboard}} | ||
120 | + <div class="sell-signboard left-modular"> | ||
121 | + <h2 class="title">{{title}}</h2> | ||
122 | + <ul class="left-list"> | ||
123 | + {{#each list}} | ||
124 | + <li> | ||
125 | + <a target="_blank" href="{{url}}"><img src="{{img}}" alt="{{title}}" /></a> | ||
126 | + </li> | ||
127 | + {{/each}} | ||
128 | + </ul> | ||
129 | + </div> | ||
130 | +{{/signboard}} |
@@ -108,6 +108,19 @@ | @@ -108,6 +108,19 @@ | ||
108 | } | 108 | } |
109 | } | 109 | } |
110 | } | 110 | } |
111 | + | ||
112 | + .sell-signboard { | ||
113 | + .left-list li { | ||
114 | + padding-left: 0; | ||
115 | + height: auto; | ||
116 | + margin-bottom: 10px; | ||
117 | + line-height: inherit; | ||
118 | + | ||
119 | + img { | ||
120 | + width: 100%; | ||
121 | + } | ||
122 | + } | ||
123 | + } | ||
111 | } | 124 | } |
112 | 125 | ||
113 | .min-screen .product-list-page .sort-intro { | 126 | .min-screen .product-list-page .sort-intro { |
@@ -562,10 +562,36 @@ class ShopModel | @@ -562,10 +562,36 @@ class ShopModel | ||
562 | return $result; | 562 | return $result; |
563 | } | 563 | } |
564 | 564 | ||
565 | + /** | ||
566 | + * 基础模板 | ||
567 | + * @param type int $shopId 店铺id | ||
568 | + * @return type [] | ||
569 | + */ | ||
565 | public static function basisTemplate($shopId) | 570 | public static function basisTemplate($shopId) |
566 | { | 571 | { |
567 | - $result = array(); | ||
568 | - $shopData = ShopData::shopsDecoratorList($shopId); | 572 | + $data = array('signboard' => array()); |
573 | + $parameters['shopId'] = $shopId; | ||
574 | + $shopList = ShopData::shopsDecoratorList($shopId); | ||
575 | + if (isset($shopList['data']['list']) && $shopList['code'] === 200) { | ||
576 | + foreach ($shopList['data']['list'] as $list) { | ||
577 | + $fun = $list['resource_name']; | ||
578 | + if (is_callable("self::$fun")) { | ||
579 | + $list = self::$fun(self::getResourceData($list), $parameters); | ||
580 | + switch ($fun) { | ||
581 | + case 'shopTopBanner': | ||
582 | + $data[$fun] = $list; | ||
583 | + break; | ||
584 | + case 'signboard': | ||
585 | + $data[$fun] = array( | ||
586 | + 'title' => isset($list[0]['title']) ? $list[0]['title'] : '', | ||
587 | + 'list'=> $list | ||
588 | + ); | ||
589 | + break; | ||
590 | + } | ||
591 | + } | ||
592 | + } | ||
593 | + } | ||
594 | + return $data; | ||
569 | } | 595 | } |
570 | 596 | ||
571 | /** | 597 | /** |
@@ -27,7 +27,7 @@ class IndexController extends WebAction | @@ -27,7 +27,7 @@ class IndexController extends WebAction | ||
27 | if (!$result) { | 27 | if (!$result) { |
28 | $this->go(SITE_MAIN); | 28 | $this->go(SITE_MAIN); |
29 | } | 29 | } |
30 | - | 30 | + |
31 | $type = intval(isset($result['type']) ? $result['type'] : ''); | 31 | $type = intval(isset($result['type']) ? $result['type'] : ''); |
32 | switch ($type) { | 32 | switch ($type) { |
33 | case 1: | 33 | case 1: |
@@ -47,6 +47,16 @@ class IndexController extends WebAction | @@ -47,6 +47,16 @@ class IndexController extends WebAction | ||
47 | $this->shopHome($result['shopId']); | 47 | $this->shopHome($result['shopId']); |
48 | exit(0); | 48 | exit(0); |
49 | } | 49 | } |
50 | + //基础模板 | ||
51 | + if ($result['shopTemplateType'] === 1 && !empty($result['shopId'])) { | ||
52 | + $basisData = ShopModel::basisTemplate($result['shopId']); | ||
53 | + $result['brandBanner'] = empty($basisData['shopTopBanner']['banner']) ? | ||
54 | + $result['brandBanner'] : $basisData['shopTopBanner']['banner']; | ||
55 | + $result['signboard'] = $basisData['signboard']; | ||
56 | + if (isset($result['node'])) { | ||
57 | + unset($result['node']); | ||
58 | + } | ||
59 | + } | ||
50 | break; | 60 | break; |
51 | } | 61 | } |
52 | 62 | ||
@@ -81,6 +91,8 @@ class IndexController extends WebAction | @@ -81,6 +91,8 @@ class IndexController extends WebAction | ||
81 | 91 | ||
82 | //调用模型获得品牌页数据 | 92 | //调用模型获得品牌页数据 |
83 | $data = BrandsModel::getBrandSearchData($condition, $options); | 93 | $data = BrandsModel::getBrandSearchData($condition, $options); |
94 | + //水牌位 | ||
95 | + $data['signboard'] = isset($result['signboard']) ? $result['signboard'] : ''; | ||
84 | $seo = $data['seo']; | 96 | $seo = $data['seo']; |
85 | $data = array( | 97 | $data = array( |
86 | //初始化js | 98 | //初始化js |
-
Please register or login to post a comment