Authored by Rock Zhang

pull codes

@@ -36,21 +36,6 @@ class BrandData @@ -36,21 +36,6 @@ class BrandData
36 } 36 }
37 37
38 /** 38 /**
39 - * 获取品牌页顶部楼层数据  
40 - *  
41 - * @return array 品牌也顶部楼层数据  
42 - */  
43 - public static function getBrandTopData()  
44 - {  
45 - // 构建必传参数  
46 - $param = Yohobuy::param();  
47 - $param['content_code'] = 'ce6ac059493ec26241a8cbe0bfa1b17a';  
48 - $param['client_secret'] = Sign::getSign($param);  
49 -  
50 - return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/resource/get', $param);  
51 - }  
52 -  
53 - /**  
54 * 获取品牌介绍 39 * 获取品牌介绍
55 * 40 *
56 * @param integer $brandId 品牌ID 41 * @param integer $brandId 品牌ID
@@ -70,13 +55,15 @@ class BrandData @@ -70,13 +55,15 @@ class BrandData
70 /** 55 /**
71 * 获取品牌banner数据 56 * 获取品牌banner数据
72 * @param integer $brandId 品牌ID 57 * @param integer $brandId 品牌ID
  58 + * @param integer $uid 用户id
73 * @return array banner数据 59 * @return array banner数据
74 */ 60 */
75 - public static function getBrandBanner($brandId) 61 + public static function getBrandBanner($brandId, $uid)
76 { 62 {
77 // 构建必传参数 63 // 构建必传参数
78 $param = Yohobuy::param(); 64 $param = Yohobuy::param();
79 $param['brand_id'] = $brandId; 65 $param['brand_id'] = $brandId;
  66 + $param['uid'] = $uid;
80 $param['method'] = 'app.brand.banner'; 67 $param['method'] = 'app.brand.banner';
81 $param['client_secret'] = Sign::getSign($param); 68 $param['client_secret'] = Sign::getSign($param);
82 69
@@ -37,22 +37,33 @@ class SearchData @@ -37,22 +37,33 @@ class SearchData
37 /** 37 /**
38 * 根据跟定查询数据搜索数据列表 38 * 根据跟定查询数据搜索数据列表
39 * 39 *
40 - * @param string $query 查询条件  
41 - * @param string $order 排序方式,默认为按照时间倒序排列s_t_desc,  
42 - * s_t_asc表示按时间正序排列,s_p_asc表示按价格正序排列,  
43 - * s_t_desc表示按价格倒序排列, 40 + * @param string $query 查询条件, 默认为null
  41 + * @param string $brand 品牌,默认为null
  42 + * @param string $gender 性别,默认为null,"1,3"表示男, "2,3"表示女, "1,2,3"表示全部
  43 + * @param string $p_d 折扣,默认为null
  44 + * @param string $misort 商品分类,默认为null
  45 + * @param string $msort 商品分类,默认为null
  46 + * @param string $order 排序方式,默认为按照时间倒序排列s_t_desc,
  47 + * s_t_asc表示按时间正序排列,
  48 + * s_p_asc表示按价格正序排列,
  49 + * s_p_desc表示按价格倒序排列,
44 * p_d_asc表示按折扣正序排列, 50 * p_d_asc表示按折扣正序排列,
45 * p_d_desc表示按折扣倒序排列 51 * p_d_desc表示按折扣倒序排列
46 - * @param integer $page 指定查询是多少页,默认为第一页  
47 - * @param integer $limit 指定查询多少个,默认是60哥  
48 - * @return array 搜索到的数据 52 + * @param integer $page 指定查询是多少页,默认为第一页
  53 + * @param integer $limit 指定查询多少个,默认是60哥
  54 + * @return array 搜索到的数据
49 */ 55 */
50 - public static function searchLiDatas($query, $order = 's_t_desc', $page = 1, $limit = 60) 56 + public static function searchLiDatas($query = null, $brand = null, $gender = null, $p_d = null, $misort = null, $msort = null, $order = 's_t_desc', $page = 1, $limit = 60)
51 { 57 {
52 // 构建必传参数 58 // 构建必传参数
53 $param = Yohobuy::param(); 59 $param = Yohobuy::param();
54 60
55 - $param['query'] = $query; 61 + is_null($query) || $param['query'] = $query;
  62 + is_null($brand) || $param['brand'] = $brand;
  63 + is_null($gender) || $param['gender'] = $gender;
  64 + is_null($p_d) || $param['p_d'] = $p_d;
  65 + is_null($misort) || $param['misort'] = $misort;
  66 + is_null($msort) || $param['msort'] = $msort;
56 $param['method'] = 'app.search.li'; 67 $param['method'] = 'app.search.li';
57 $param['order'] = $order; 68 $param['order'] = $order;
58 $param['page'] = $page; 69 $param['page'] = $page;
@@ -22,6 +22,7 @@ class BoysController extends AbstractAction @@ -22,6 +22,7 @@ class BoysController extends AbstractAction
22 22
23 // 渲染模板并输出 23 // 渲染模板并输出
24 $this->_view->display('index', array( 24 $this->_view->display('index', array(
  25 + 'searchUrl' => '/search',
25 'boysHomePage' => true, 26 'boysHomePage' => true,
26 'maybeLike' => true, 27 'maybeLike' => true,
27 'content' => Index\HomeModel::getBoysFloor() 28 'content' => Index\HomeModel::getBoysFloor()
@@ -22,6 +22,7 @@ class GirlsController extends AbstractAction @@ -22,6 +22,7 @@ class GirlsController extends AbstractAction
22 22
23 // 渲染模板并输出 23 // 渲染模板并输出
24 $this->_view->display('index', array( 24 $this->_view->display('index', array(
  25 + 'searchUrl' => '/search',
25 'grilsHomePage' => true, 26 'grilsHomePage' => true,
26 'maybeLike' => true, 27 'maybeLike' => true,
27 'content' => Index\HomeModel::getGirlsFloor() 28 'content' => Index\HomeModel::getGirlsFloor()
@@ -22,6 +22,7 @@ class KidsController extends AbstractAction @@ -22,6 +22,7 @@ class KidsController extends AbstractAction
22 22
23 // 渲染模板并输出 23 // 渲染模板并输出
24 $this->_view->display('index', array( 24 $this->_view->display('index', array(
  25 + 'searchUrl' => '/search',
25 'kidsHomePage' => true, 26 'kidsHomePage' => true,
26 'maybeLike' => true, 27 'maybeLike' => true,
27 'content' => Index\HomeModel::getKidsFloor() 28 'content' => Index\HomeModel::getKidsFloor()
@@ -22,6 +22,7 @@ class LifestyleController extends AbstractAction @@ -22,6 +22,7 @@ class LifestyleController extends AbstractAction
22 22
23 // 渲染模板并输出 23 // 渲染模板并输出
24 $this->_view->display('index', array( 24 $this->_view->display('index', array(
  25 + 'searchUrl' => '/search',
25 'lifestyleHomePage' => true, 26 'lifestyleHomePage' => true,
26 'maybeLike' => true, 27 'maybeLike' => true,
27 'content' => Index\HomeModel::getLifestyleFloor() 28 'content' => Index\HomeModel::getLifestyleFloor()
@@ -57,7 +57,7 @@ class SearchController extends AbstractAction @@ -57,7 +57,7 @@ class SearchController extends AbstractAction
57 57
58 $result = SearchData::searchFuzzyDatas($keyword); 58 $result = SearchData::searchFuzzyDatas($keyword);
59 59
60 - $this->echoJson($result); 60 + $this->_view->display('list', array('searchPage' => true, 'pageFooter' => true));
61 } 61 }
62 } 62 }
63 63
@@ -68,9 +68,23 @@ class SearchController extends AbstractAction @@ -68,9 +68,23 @@ class SearchController extends AbstractAction
68 */ 68 */
69 public function listsearch() 69 public function listsearch()
70 { 70 {
  71 + $query = $this->get('query', '');
  72 +
  73 + $result = SearchData::searchLiDatas($query);
  74 +
  75 + $this->echoJson($result);
  76 + }
  77 +
  78 + /**
  79 + * 根据指定条件筛选查询到数据
  80 + *
  81 + * @return array 筛选之后的结果
  82 + */
  83 + public function sortsearch()
  84 + {
71 if($this->isAjax()) 85 if($this->isAjax())
72 { 86 {
73 - $query = $this->get('query', ''); 87 + $query = $this->post('query', '');
74 88
75 $result = SearchData::searchLiDatas($query); 89 $result = SearchData::searchLiDatas($query);
76 90
1 <?php 1 <?php
2 2
3 use Action\AbstractAction; 3 use Action\AbstractAction;
  4 +use LibModels\Wap\Product\SearchData;
  5 +use LibModels\Wap\Category\BrandData;
  6 +use Plugin\DataProcess\ListProcess;
4 7
5 /** 8 /**
6 * 商品列表页 9 * 商品列表页
7 */ 10 */
8 -  
9 class ListController extends AbstractAction 11 class ListController extends AbstractAction
10 { 12 {
11 public function indexAction() 13 public function indexAction()
@@ -13,97 +15,72 @@ class ListController extends AbstractAction @@ -13,97 +15,72 @@ class ListController extends AbstractAction
13 $data = array( 15 $data = array(
14 'goodListPage' => true, 16 'goodListPage' => true,
15 'goodList' => array( 17 'goodList' => array(
16 - 'search' => 'Aape',  
17 - 'brandWay' => array(  
18 - 'url' => 'http://aape.m.yohobuy.com/',  
19 - 'name' => 'Aape',  
20 - 'thumb' => 'http://img13.static.yhbimg.com/brandLogo/2015/08/26/15/02261f64c198cb4b181c5ef9e61f38f4b9.jpg?imageMogr2/thumbnail/150x70/extent/150x70/background/d2hpdGU=/position/center/quality/90'  
21 - ),  
22 - 'new' => array(  
23 - array(  
24 - 'id' => 1,  
25 - 'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/09/15/03/02e50b1037b45b90aa8f33ee328b18facf.jpg?imageMogr2/thumbnail/290x388/extent/290x388/background/d2hpdGU=/position/center/quality/90',  
26 - 'url' => '',  
27 - 'name' => 'Aape X YO’HOOD moon face YOH',  
28 - 'salePrice' => 599,  
29 - 'tags' => array(  
30 - 'is_new' => true,  
31 - 'is_discount' => true  
32 - ),  
33 - 'is_soon_sold_out' => true  
34 - ),  
35 - array(  
36 - 'id' => 2,  
37 - 'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/09/15/03/0101b0c3998752d02724a5512c6efcb241.jpg?imageMogr2/thumbnail/290x388/extent/290x388/background/d2hpdGU=/position/center/quality/90',  
38 - 'url' => '',  
39 - 'name' => 'Aape X YO’HOOD moon face YOH',  
40 - 'salePrice' => 99,  
41 - 'tags' => array(  
42 - 'is_yohoood' => true  
43 - ),  
44 - 'is_soon_sold_out' => true  
45 - )  
46 - ),  
47 - 'filter' => array(  
48 - array(  
49 - 'classify' => array(  
50 - array(  
51 - 'title' => '性别',  
52 - 'name' => '全部性别',  
53 - 'default' => true,  
54 - 'subs' => array(  
55 - array(  
56 - 'chosed' => true,  
57 - 'dataId' => 0,  
58 - 'name' => '全部性别'  
59 - ),  
60 - array(  
61 - 'dataId' => 1,  
62 - 'name' => '男'  
63 - ),  
64 - array(  
65 - 'dataId' => 3,  
66 - 'name' => '女'  
67 - )  
68 - )  
69 - ),  
70 - array(  
71 - 'title' => '尺寸',  
72 - 'name' => 'XL',  
73 - 'subs' => array(  
74 - array(  
75 - 'dataId' => 0,  
76 - 'name' => '全部尺寸'  
77 - ),  
78 - array(  
79 - 'dataId' => 1,  
80 - 'name' => 'S'  
81 - ),  
82 - array(  
83 - 'dataId' => 2,  
84 - 'name' => 'M'  
85 - ),  
86 - array(  
87 - 'dataId' => 3,  
88 - 'name' => 'L'  
89 - ),  
90 - array(  
91 - 'chosed' => true,  
92 - 'dataId' => 4,  
93 - 'name' => 'XL'  
94 - ),  
95 - array(  
96 - 'dataId' => 5,  
97 - 'name' => 'XXL'  
98 - )  
99 - )  
100 - )  
101 - )  
102 - ) 18 + )
  19 + );
  20 +
  21 + $brand = $this->get('brand', null);
  22 + $gender = $this->get('gender', null);
  23 + $p_d = $this->get('p_d', null);
  24 + $misort = $this->get('misort', null);
  25 + $msort = $this->get('msort', null);
  26 +
  27 + // 查询数据
  28 + $listData = SearchData::searchLiDatas(null, $brand, $gender, $p_d, $misort, $msort);
  29 + // 处理返回的数据
  30 + if (isset($listData['code']) && $listData['code'] == 200) {
  31 + $tmpData = $listData['data'];
  32 +
  33 + $data['goodList'] = ListProcess::getListData($tmpData);
  34 + }
  35 +
  36 + $this->_view->display('index', $data);
  37 + }
  38 +
  39 +
  40 + public function brandAction()
  41 + {
  42 + $brand = $this->get('brand', null);
  43 + $gender = $this->get('gender', null);
  44 + $sort = $this->get('sort', null);
  45 + $color = $this->get('color', null);
  46 + $size = $this->get('size', null);
  47 + $price = $this->get('price', null);
  48 + $p_d = $this->get('p_d', null);
  49 +
  50 + $data = array(
  51 + 'goodListPage' => true,
  52 + 'goodList' => array(
  53 + 'brand' => array(
  54 + 'id' => $brand
103 ) 55 )
104 ) 56 )
105 ); 57 );
106 58
  59 + // 获取品牌介绍信息
  60 + $introData = BrandData::getBrandIntro($brand);
  61 + if(isset($introData['code']) && $introData['code'] == 200)
  62 + {
  63 + $data['goodList']['intro'] = isset($introData['data']['brand_intro']) ? $introData['data']['brand_intro'] : '';
  64 + }
  65 +
  66 + // 获取品牌banner的数据
  67 + $bannerData = BrandData::getBrandBanner($brand, 0);
  68 + if(isset($bannerData['code']) && $bannerData['code'] == 200)
  69 + {
  70 + $data['goodList']['banner'] = isset($bannerData['data']['banner']) ? $bannerData['data']['banner'] : '';
  71 + }
  72 +
  73 + // 查询数据
  74 + $listData = BrandData::selectBrandDetail($gender, $brand, $sort, $color, $size, $price, $p_d);
  75 + // 处理返回的数据
  76 + if (isset($listData['code']) && $listData['code'] == 200) {
  77 + $tmpData = $listData['data'];
  78 +
  79 + $data['goodList'] = ListProcess::getListData($tmpData);
  80 + }
  81 +
107 $this->_view->display('index', $data); 82 $this->_view->display('index', $data);
108 } 83 }
109 -}  
  84 +
  85 +
  86 +}
@@ -16,8 +16,10 @@ class NewsaleController extends AbstractAction @@ -16,8 +16,10 @@ class NewsaleController extends AbstractAction
16 16
17 $data = array( 17 $data = array(
18 'newArrival' => true, 18 'newArrival' => true,
19 - 'header' => array(  
20 - 'title' => '新品到着' 19 + 'pageHeader' => array(
  20 + 'navBack' => true,
  21 + 'navTitle' => '新品到着',
  22 + 'navHome' => '/'
21 ) 23 )
22 ); 24 );
23 25
@@ -74,8 +76,10 @@ class NewsaleController extends AbstractAction @@ -74,8 +76,10 @@ class NewsaleController extends AbstractAction
74 76
75 $data = array( 77 $data = array(
76 'discount' => true, 78 'discount' => true,
77 - 'header' => array(  
78 - 'title' => 'SALE' 79 + 'pageHeader' => array(
  80 + 'navBack' => true,
  81 + 'navTitle' => 'SALE',
  82 + 'navHome' => '/'
79 ) 83 )
80 ); 84 );
81 85