...
|
...
|
@@ -2,6 +2,7 @@ |
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use Plugin\Helpers;
|
|
|
use LibModels\Wap\Product\ShopData;
|
|
|
|
|
|
/**
|
|
|
* 商品列表相关的控制器
|
...
|
...
|
@@ -228,4 +229,179 @@ class IndexController extends AbstractAction |
|
|
|
|
|
$this->_view->display('index', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 店铺品牌品类页,需要判断单品店还是多品店
|
|
|
*
|
|
|
* @return mixed
|
|
|
*/
|
|
|
public function categoryAction()
|
|
|
{
|
|
|
$requestData = filter_input_array(INPUT_GET, array(
|
|
|
'shop_id' => FILTER_DEFAULT,
|
|
|
));
|
|
|
if (empty($requestData['shop_id'])) {
|
|
|
$this->go(SITE_MAIN);
|
|
|
}
|
|
|
$result = array();
|
|
|
$resource = array();
|
|
|
$resource['category'] = ShopData::getShopCategory($requestData['shop_id'], Helpers::getChannelByCookie(), Helpers::getGenderByCookie());
|
|
|
$resource['brands'] = ShopData::getShopBrands($requestData['shop_id']);
|
|
|
if ($resource['category']['code'] === 200) {
|
|
|
$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);
|
|
|
}
|
|
|
// $result = $this->getCategoryContent();
|
|
|
ShopData::debugOut($result,false);
|
|
|
return $this->_view->display('category', array(
|
|
|
'productCategoryPage' => true,
|
|
|
'content' => $result,
|
|
|
));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 店铺简介页面
|
|
|
*
|
|
|
* @return mixed
|
|
|
*/
|
|
|
public function introAction()
|
|
|
{
|
|
|
$requestData = filter_input_array(INPUT_GET, array(
|
|
|
'shop_id' => FILTER_DEFAULT,
|
|
|
));
|
|
|
if (empty($requestData['shop_id'])) {
|
|
|
$this->go(SITE_MAIN);
|
|
|
}
|
|
|
$result = array();
|
|
|
$resource = ShopData::getShopIntro($requestData['shop_id']);
|
|
|
if ($resource['code'] === 200) {
|
|
|
$result = $resource['data'];
|
|
|
}
|
|
|
return $this->_view->display('intro', array(
|
|
|
'content' => $result,
|
|
|
));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 店铺分类品类页数据模拟
|
|
|
*
|
|
|
* @return array
|
|
|
*/
|
|
|
public function getCategoryContent()
|
|
|
{
|
|
|
return array(// 数据模拟
|
|
|
'class' => array(
|
|
|
array(
|
|
|
'name' => '上衣',
|
|
|
),
|
|
|
array(
|
|
|
'name' => '裤装',
|
|
|
),
|
|
|
array(
|
|
|
'name' => '鞋靴',
|
|
|
),
|
|
|
array(
|
|
|
'name' => '包类',
|
|
|
)
|
|
|
),
|
|
|
'category' => array(
|
|
|
array(
|
|
|
'subcategory' => array(
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '上衣衣1'
|
|
|
),
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '上衣衣2'
|
|
|
),
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '上衣衣3'
|
|
|
),
|
|
|
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'subcategory' => array(
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '裤装1'
|
|
|
),
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '裤装2'
|
|
|
),
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '裤装3'
|
|
|
),
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'subcategory' => array(
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '鞋靴1'
|
|
|
),
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '鞋靴2'
|
|
|
),
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '鞋靴3'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'subcategory' => array(
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '包类1'
|
|
|
),
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '包类2'
|
|
|
),
|
|
|
array(
|
|
|
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
|
|
|
'name' => '包类3'
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
|
|
|
)
|
|
|
);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 店铺简介数据模拟
|
|
|
*
|
|
|
* @return array
|
|
|
*/
|
|
|
public function getIntroContent()
|
|
|
{
|
|
|
return array(// 数据模拟
|
|
|
);
|
|
|
}
|
|
|
} |
...
|
...
|
|