|
@@ -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
|
} |