Authored by xiaowei

H5修复分类不显示的bug

... ... @@ -19,7 +19,13 @@
<div class="content {{#unless focus}}hide{{/if}}">
<ul class="primary-level">
{{# ca}}
<li class="p-level-item{{#if @first}} focus{{/if}}">{{name}}</li>
<li class="p-level-item{{#if @first}} focus{{/if}}">
{{#if url}}
<a href={{url}}> {{name}}</a>
{{^}}
{{name}}
{{/if}}
</li>
{{/ ca}}
</ul>
<div class="sub-level-container">
... ...
... ... @@ -54,7 +54,17 @@ class ClassModel
$item['name'] = $val['category_name'];
$item['id'] = $val['relation_parameter']['sort'];
// 首先添加一级分类
if (!isset($val['sub'])) {
//ficx-bug根节点没有子分类,直接跳转相应品类页面
$item['url'] = Helpers::url('/', array(
'sort' => $item['id'],
'sort_name' => $item['name'],
'gender' => $genderArr[$k]), 'list');
$oneClass['ca'][] = $item;
continue;
}
//有子分类的,首先添加一级分类
$item['sub'][] = array(
'name' => '全部' . $item['name'],
'id' => $item['id'],
... ... @@ -64,10 +74,6 @@ class ClassModel
'gender' => $genderArr[$k]), 'list')
);
if(!isset($val['sub'])) {
continue;
}
$subitem = array();
foreach ($val['sub'] as $value) {
$subitem = array();
... ... @@ -86,7 +92,8 @@ class ClassModel
$result[] = $oneClass;
}
} while (false);
}
while (false);
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
... ...