Authored by Rock Zhang

修改频道页侧边栏数据获取接口地址以及返回的数据格式

Code Review By Rock Zhang
@@ -18,7 +18,7 @@ class SideData @@ -18,7 +18,7 @@ class SideData
18 { 18 {
19 19
20 const URI_LEFTNAV_ENTRANCE = 'operations/api/v5/entrance/getEntrance'; 20 const URI_LEFTNAV_ENTRANCE = 'operations/api/v5/entrance/getEntrance';
21 - const URI_LEFTNAV_CATEGORY = 'operations/api/v5/category/getCategory'; 21 + const URI_LEFTNAV_CATEGORY = 'operations/api/v6/category/getCategory';
22 22
23 /** 23 /**
24 * 左侧边栏的分类和图标数据 24 * 左侧边栏的分类和图标数据
@@ -40,6 +40,7 @@ class SideData @@ -40,6 +40,7 @@ class SideData
40 40
41 $param = Yohobuy::param(); 41 $param = Yohobuy::param();
42 $param['client_type'] = 'h5'; // 调用H5手机网站的 42 $param['client_type'] = 'h5'; // 调用H5手机网站的
  43 + $param['private_key'] = 'fd4ad5fcfa0de589ef238c0e7331b585'; // 调用Android的private_key不然会有参数验证错误的bug
43 $param['client_secret'] = Sign::getSign($param); 44 $param['client_secret'] = Sign::getSign($param);
44 45
45 return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_LEFTNAV_CATEGORY, $param); 46 return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_LEFTNAV_CATEGORY, $param);
@@ -64,7 +64,8 @@ class SideModel @@ -64,7 +64,8 @@ class SideModel
64 $subs[] = self::formatSideItem($oneSub); 64 $subs[] = self::formatSideItem($oneSub);
65 } 65 }
66 66
67 - $group[$groupKey]['subNav'] = $subs; 67 + $group[$groupKey]['styleClass'] = 'guang';
  68 + $group[$groupKey]['subNav']['list'] = $subs;
68 } 69 }
69 $groupKey++; 70 $groupKey++;
70 71
@@ -87,6 +88,7 @@ class SideModel @@ -87,6 +88,7 @@ class SideModel
87 88
88 // 追加逛的子分类数据 89 // 追加逛的子分类数据
89 $result[] = self::genLeftNavGuang($guangChoosed); 90 $result[] = self::genLeftNavGuang($guangChoosed);
  91 + print_r($result);
90 92
91 return $result; 93 return $result;
92 } 94 }
@@ -109,40 +111,43 @@ class SideModel @@ -109,40 +111,43 @@ class SideModel
109 $color = '#4f4138'; 111 $color = '#4f4138';
110 } 112 }
111 113
112 - return array(  
113 - 'textCn' => '逛',  
114 - 'textEn' => 'TRENDFINDER',  
115 - 'styleClass' => 'guang',  
116 - 'subNav' => array(  
117 - 'list' => array(  
118 - 0 => array(  
119 - 'textCn' => '逛',  
120 - 'textEn' => 'TrendFinder',  
121 - 'back' => true,  
122 - 'isSelect' => false,  
123 - 'bgColor' => $color,  
124 - ),  
125 - 1 => array(  
126 - 'textCn' => '查看全部',  
127 - 'textEn' => '',  
128 - 'back' => false,  
129 - 'isSelect' => ($guangChoosed === 'lifestyle' || $guangChoosed === 'kids') ? true : false,  
130 - 'url' => Helpers::url('', array('gender' => '1,2,3'), 'guang')  
131 - ),  
132 - 2 => array(  
133 - 'textCn' => '只看男生',  
134 - 'textEn' => 'Boys',  
135 - 'back' => false,  
136 - 'isSelect' => ($guangChoosed === 'boys') ? true : false,  
137 - 'url' => Helpers::url('', array('gender' => '1,3'), 'guang')  
138 - ),  
139 - 3 => array(  
140 - 'textCn' => '只看女生',  
141 - 'textEn' => 'Girls',  
142 - 'back' => false,  
143 - 'isSelect' => ($guangChoosed === 'girls') ? true : false,  
144 - 'url' => Helpers::url('', array('gender' => '2,3'), 'guang')  
145 - ), 114 + return
  115 + array(
  116 + array(
  117 + 'textCn' => '逛',
  118 + 'textEn' => 'TRENDFINDER',
  119 + 'styleClass' => 'guang',
  120 + 'subNav' => array(
  121 + 'list' => array(
  122 + 0 => array(
  123 + 'textCn' => '逛',
  124 + 'textEn' => 'TrendFinder',
  125 + 'back' => true,
  126 + 'isSelect' => false,
  127 + 'bgColor' => $color,
  128 + ),
  129 + 1 => array(
  130 + 'textCn' => '查看全部',
  131 + 'textEn' => '',
  132 + 'back' => false,
  133 + 'isSelect' => ($guangChoosed === 'lifestyle' || $guangChoosed === 'kids') ? true : false,
  134 + 'url' => Helpers::url('', array('gender' => '1,2,3'), 'guang')
  135 + ),
  136 + 2 => array(
  137 + 'textCn' => '只看男生',
  138 + 'textEn' => 'Boys',
  139 + 'back' => false,
  140 + 'isSelect' => ($guangChoosed === 'boys') ? true : false,
  141 + 'url' => Helpers::url('', array('gender' => '1,3'), 'guang')
  142 + ),
  143 + 3 => array(
  144 + 'textCn' => '只看女生',
  145 + 'textEn' => 'Girls',
  146 + 'back' => false,
  147 + 'isSelect' => ($guangChoosed === 'girls') ? true : false,
  148 + 'url' => Helpers::url('', array('gender' => '2,3'), 'guang')
  149 + ),
  150 + )
146 ) 151 )
147 ) 152 )
148 ); 153 );