Authored by zhangxiaoru

店铺首页

... ... @@ -23,7 +23,7 @@
{{# subcategory}}
<li>
<a href={{url}}>
{{name}}
{{category_name}}
</a>
</li>
{{/ subcategory}}
... ...
... ... @@ -48,16 +48,28 @@ class IndexController extends AbstractAction
$resource['category'] = ShopData::getShopCategory($requestData['shop_id'], Helpers::getChannelByCookie(), Helpers::getGenderByCookie());
$resource['brands'] = ShopData::getShopBrands($requestData['shop_id']);
if ($resource['category']['code'] === 200) {
$result['category'] = $resource['category']['data'];
$class = array();
$category = array();
foreach ($resource['category']['data'] as &$item) {
array_push($class, array('name' => $item['category_name']));
foreach ($item['sub'] as &$item2) {
$item2['url'] = Helpers::url(''); // tar mark 还不知道链接是啥样的
}
array_push($category, array('subcategory' => $item['sub']));
}
$result['class'] = $class;
$result['category'] = $category;
}
if ($resource['brands']['code'] === 200) {
$result['brands'] = $resource['brands']['data'];
}
// 处理图片链接
foreach ($result['brands'] as &$item) {
$item['brand_ico'] = \Plugin\Images::getImageUrl($item['brand_ico'],0,0);
$item['brand_ico'] = \Plugin\Images::getImageUrl($item['brand_ico'], 0, 0);
}
// ShopData::debugOut($result);
// $result = $this->getCategoryContent();
ShopData::debugOut($result,false);
return $this->_view->display('category', array(
'productCategoryPage' => true,
'content' => $result,
... ...