Authored by Rock Zhang

修复品牌一览页面楼层数据处理错误的bug

@@ -9,25 +9,17 @@ @@ -9,25 +9,17 @@
9 </div> 9 </div>
10 </div> 10 </div>
11 11
12 - {{# bannerTop}}  
13 - {{> home/banner_top}}  
14 - {{/ bannerTop}} 12 + {{# topData}}
  13 + {{! 头部banner}}
  14 + {{# bannerTop}}
  15 + {{> home/banner_top}}
  16 + {{/ bannerTop}}
15 17
16 - {{# hotBrand}}  
17 - <div class="hot-brand">  
18 - <ul class="hot-brand-list clearfix">  
19 - {{# list}}  
20 - <li>  
21 - <a href="{{url}}">  
22 - <div class="img-box">  
23 - <img class="lazy" data-original="{{img}}" alt="">  
24 - </div>  
25 - </a>  
26 - </li>  
27 - {{/ list}}  
28 - </ul>  
29 - </div>  
30 - {{/ hotBrand}} 18 + {{! 热门品牌可滑动}}
  19 + {{# hotBrandsScroll}}
  20 + {{> home/hot_brands_swipe}}
  21 + {{/ hotBrandsScroll}}
  22 + {{/ topData}}
31 23
32 {{# brandList}} 24 {{# brandList}}
33 <div class="brand-list bar-{{@index}}"> 25 <div class="brand-list bar-{{@index}}">
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace Category; 3 namespace Category;
4 4
5 use LibModels\Wap\Category\BrandData; 5 use LibModels\Wap\Category\BrandData;
  6 +use Plugin\DataProcess\FloorProcess;
6 use Plugin\Helpers; 7 use Plugin\Helpers;
7 8
8 /** 9 /**
@@ -60,55 +61,8 @@ class BrandModel @@ -60,55 +61,8 @@ class BrandModel
60 // 搜索链接地址 61 // 搜索链接地址
61 $result['searchUrl'] = Helpers::url('/brands/search', null); 62 $result['searchUrl'] = Helpers::url('/brands/search', null);
62 63
63 - /* 顶部的轮翻广告或热门品牌列表(当没有轮翻广告的情况下会是这个样子的! 此处是根据接口改造成的逻辑) */  
64 - if (!empty($brand['brandTop'][0]['data']['list'])) {  
65 - $build = array();  
66 - foreach ($brand['brandTop'][0]['data']['list'] as $value) {  
67 - if (isset($value['url'])) {  
68 - $build['url'] = Helpers::getFilterUrl($value['url']);  
69 - }  
70 - $build['img'] = Helpers::getImageUrl($value['src'], 144, 144);  
71 - $build['name'] = $value['name'];  
72 - $result['hotBrand']['list'][] = $build;  
73 - }  
74 - }  
75 - // 顶部的轮翻广告列表  
76 - elseif (!empty($brand['brandTop'][0]['data'])) {  
77 - $build = array();  
78 - foreach ($brand['brandTop'][0]['data'] as $value) {  
79 - if (isset($value['url'])) {  
80 - $build['url'] = Helpers::getFilterUrl($value['url']);  
81 - }  
82 - $build['img'] = Helpers::getImageUrl($value['src'], 640, 310);  
83 - $build['title'] = $value['title'];  
84 - $result['bannerTop']['list'][] = $build;  
85 - }  
86 - }  
87 - // 顶部的轮翻广告列表  
88 - elseif (!empty($brand['brandTop']['list'][0]['data'])) {  
89 - $build = array();  
90 - foreach ($brand['brandTop']['list'][0]['data'] as $value) {  
91 - if (isset($value['url'])) {  
92 - $build['url'] = Helpers::getFilterUrl($value['url']);  
93 - }  
94 - $build['img'] = Helpers::getImageUrl($value['src'], 640, 310);  
95 - $build['title'] = $value['title'];  
96 - $result['bannerTop']['list'][] = $build;  
97 - }  
98 - }  
99 -  
100 - /* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */  
101 - if (!empty($brand['brandTop'][1]['data']['list'])) {  
102 - $build = array();  
103 - foreach ($brand['brandTop'][1]['data']['list'] as $value) {  
104 - if (isset($value['url'])) {  
105 - $build['url'] = Helpers::getFilterUrl($value['url']);  
106 - }  
107 - $build['img'] = Helpers::getImageUrl($value['src'], 144, 144);  
108 - $build['name'] = $value['name'];  
109 - $result['hotBrand']['list'][] = $build;  
110 - }  
111 - } 64 + // 资源位处理
  65 + $result['topData'] = FloorProcess::getContent($brand['brandTop'], $channel);
112 66
113 /* 按字母'A-Z'分组的品牌列表 */ 67 /* 按字母'A-Z'分组的品牌列表 */
114 if (!empty($brand['brandList']['brands'])) { 68 if (!empty($brand['brandList']['brands'])) {