Authored by zhangxiaoru

首页

@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 * Time: 15:55 7 * Time: 15:55
8 */ 8 */
9 9
10 -namespace LibModels\Wap\Shop; 10 +namespace LibModels\Wap\Product;
11 11
12 use Api\Yohobuy; 12 use Api\Yohobuy;
13 use Api\Sign; 13 use Api\Sign;
  1 +{{> layout/header}}
  2 +
  3 +<div class="product-category yoho-page">
  4 +
  5 + <div id="allproduct" class="allproduct">
  6 + <a href={{allproduct}}>
  7 + <p class="allproductParagaraph">全部商品</p>
  8 + <i class="arrow-icon iconfont">&#xe614;</i>
  9 + </a>
  10 + </div>
  11 + <div class="margin-under-allproduct">
  12 + </div>
  13 + <div class="category-container clearfix">
  14 + <div class="content">
  15 + {{# content}}
  16 + <ul class="primary-level">
  17 + {{# class}}
  18 + <li class="p-level-item">{{name}}
  19 + <div class="primary-level-trilangle trilanglefont hide">&#xe64a;</div>
  20 + </li>{{/ class}}
  21 + </ul>
  22 + <div class="sub-level-container hide">
  23 + {{# category}}
  24 + <ul class="sub-level">
  25 + {{# subcategory}}
  26 + <li>
  27 + <a href={{url}}>
  28 + {{category_name}}
  29 + </a>
  30 + </li>
  31 + {{/ subcategory}}
  32 + </ul>
  33 + {{/ category}}
  34 + </div>
  35 + {{/ content}}
  36 + </div>
  37 +</div>
  38 +
  39 +</div>
  40 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div>
  3 + <a class="banner">
  4 + <img src="{{content.shop_logo}}">
  5 + </a>
  6 +
  7 + <div class="descripition">
  8 + {{content.shop_intro}}
  9 + </div>
  10 +
  11 + <p class="fo">
  12 + <span class="iconfont">&#xe649;</span>
  13 + 100%品牌授权正品
  14 + </p>
  15 +</div>
  16 +{{> layout/footer}}
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 use Action\AbstractAction; 3 use Action\AbstractAction;
4 use Plugin\Helpers; 4 use Plugin\Helpers;
  5 +use LibModels\Wap\Product\ShopData;
5 6
6 /** 7 /**
7 * 商品列表相关的控制器 8 * 商品列表相关的控制器
@@ -228,4 +229,179 @@ class IndexController extends AbstractAction @@ -228,4 +229,179 @@ class IndexController extends AbstractAction
228 229
229 $this->_view->display('index', $data); 230 $this->_view->display('index', $data);
230 } 231 }
  232 +
  233 + /**
  234 + * 店铺品牌品类页,需要判断单品店还是多品店
  235 + *
  236 + * @return mixed
  237 + */
  238 + public function categoryAction()
  239 + {
  240 + $requestData = filter_input_array(INPUT_GET, array(
  241 + 'shop_id' => FILTER_DEFAULT,
  242 + ));
  243 + if (empty($requestData['shop_id'])) {
  244 + $this->go(SITE_MAIN);
  245 + }
  246 + $result = array();
  247 + $resource = array();
  248 + $resource['category'] = ShopData::getShopCategory($requestData['shop_id'], Helpers::getChannelByCookie(), Helpers::getGenderByCookie());
  249 + $resource['brands'] = ShopData::getShopBrands($requestData['shop_id']);
  250 + if ($resource['category']['code'] === 200) {
  251 + $class = array();
  252 + $category = array();
  253 + foreach ($resource['category']['data'] as &$item) {
  254 + array_push($class, array('name' => $item['category_name']));
  255 + foreach ($item['sub'] as &$item2) {
  256 + $item2['url'] = Helpers::url(''); // tar mark 还不知道链接是啥样的
  257 + }
  258 + array_push($category, array('subcategory' => $item['sub']));
  259 + }
  260 + $result['class'] = $class;
  261 + $result['category'] = $category;
  262 + }
  263 +
  264 + if ($resource['brands']['code'] === 200) {
  265 + $result['brands'] = $resource['brands']['data'];
  266 + }
  267 + // 处理图片链接
  268 + foreach ($result['brands'] as &$item) {
  269 + $item['brand_ico'] = \Plugin\Images::getImageUrl($item['brand_ico'], 0, 0);
  270 + }
  271 +// $result = $this->getCategoryContent();
  272 + ShopData::debugOut($result,false);
  273 + return $this->_view->display('category', array(
  274 + 'productCategoryPage' => true,
  275 + 'content' => $result,
  276 + ));
  277 + }
  278 +
  279 + /**
  280 + * 店铺简介页面
  281 + *
  282 + * @return mixed
  283 + */
  284 + public function introAction()
  285 + {
  286 + $requestData = filter_input_array(INPUT_GET, array(
  287 + 'shop_id' => FILTER_DEFAULT,
  288 + ));
  289 + if (empty($requestData['shop_id'])) {
  290 + $this->go(SITE_MAIN);
  291 + }
  292 + $result = array();
  293 + $resource = ShopData::getShopIntro($requestData['shop_id']);
  294 + if ($resource['code'] === 200) {
  295 + $result = $resource['data'];
  296 + }
  297 + return $this->_view->display('intro', array(
  298 + 'content' => $result,
  299 + ));
  300 +
  301 + }
  302 +
  303 +
  304 + /**
  305 + * 店铺分类品类页数据模拟
  306 + *
  307 + * @return array
  308 + */
  309 + public function getCategoryContent()
  310 + {
  311 + return array(// 数据模拟
  312 + 'class' => array(
  313 + array(
  314 + 'name' => '上衣',
  315 + ),
  316 + array(
  317 + 'name' => '裤装',
  318 + ),
  319 + array(
  320 + 'name' => '鞋靴',
  321 + ),
  322 + array(
  323 + 'name' => '包类',
  324 + )
  325 + ),
  326 + 'category' => array(
  327 + array(
  328 + 'subcategory' => array(
  329 + array(
  330 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  331 + 'name' => '上衣衣1'
  332 + ),
  333 + array(
  334 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  335 + 'name' => '上衣衣2'
  336 + ),
  337 + array(
  338 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  339 + 'name' => '上衣衣3'
  340 + ),
  341 +
  342 + )
  343 + ),
  344 + array(
  345 + 'subcategory' => array(
  346 + array(
  347 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  348 + 'name' => '裤装1'
  349 + ),
  350 + array(
  351 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  352 + 'name' => '裤装2'
  353 + ),
  354 + array(
  355 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  356 + 'name' => '裤装3'
  357 + ),
  358 + )
  359 + ),
  360 + array(
  361 + 'subcategory' => array(
  362 + array(
  363 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  364 + 'name' => '鞋靴1'
  365 + ),
  366 + array(
  367 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  368 + 'name' => '鞋靴2'
  369 + ),
  370 + array(
  371 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  372 + 'name' => '鞋靴3'
  373 + )
  374 + )
  375 + ),
  376 + array(
  377 + 'subcategory' => array(
  378 + array(
  379 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  380 + 'name' => '包类1'
  381 + ),
  382 + array(
  383 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  384 + 'name' => '包类2'
  385 + ),
  386 + array(
  387 + 'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
  388 + 'name' => '包类3'
  389 + )
  390 + )
  391 + )
  392 +
  393 + )
  394 + );
  395 + }
  396 +
  397 + /**
  398 + * 店铺简介数据模拟
  399 + *
  400 + * @return array
  401 + */
  402 + public function getIntroContent()
  403 + {
  404 + return array(// 数据模拟
  405 + );
  406 + }
231 } 407 }