Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Conflicts: library/LibModels/Wap/Category/BrandData.php yohobuy/m.yohobuy.com/application/modules/Product/controllers/List.php
Showing
38 changed files
with
856 additions
and
237 deletions
@@ -728,7 +728,9 @@ | @@ -728,7 +728,9 @@ | ||
728 | ## 商品列表页 | 728 | ## 商品列表页 |
729 | { | 729 | { |
730 | goodList: { | 730 | goodList: { |
731 | - search: '', //是否显示搜索栏并指定初始值 | 731 | + search: { |
732 | + default: '' | ||
733 | + }, //是否显示搜索栏并指定初始值 | ||
732 | brandWay: { //品牌入口 | 734 | brandWay: { //品牌入口 |
733 | url: '', | 735 | url: '', |
734 | thumb: '', | 736 | thumb: '', |
@@ -736,6 +738,7 @@ | @@ -736,6 +738,7 @@ | ||
736 | }, | 738 | }, |
737 | brand: { | 739 | brand: { |
738 | id: 0, | 740 | id: 0, |
741 | + banner: '' | ||
739 | intro: '...' | 742 | intro: '...' |
740 | }, | 743 | }, |
741 | new: [ | 744 | new: [ |
@@ -296,17 +296,17 @@ class AbstractAction extends Controller_Abstract | @@ -296,17 +296,17 @@ class AbstractAction extends Controller_Abstract | ||
296 | /** | 296 | /** |
297 | * 设置网站导航头部信息 | 297 | * 设置网站导航头部信息 |
298 | * | 298 | * |
299 | - * @param string $backUrl 返回的链接 | ||
300 | * @param string $title 头部标题 | 299 | * @param string $title 头部标题 |
300 | + * @param string $backUrl 返回的链接 | ||
301 | * @param string $homeUrl 返回首页的链接 | 301 | * @param string $homeUrl 返回首页的链接 |
302 | * @return void | 302 | * @return void |
303 | */ | 303 | */ |
304 | - protected function setNavHeader($backUrl, $title, $homeUrl) | 304 | + protected function setNavHeader($title = '', $backUrl = true, $homeUrl = '/') |
305 | { | 305 | { |
306 | $header = array(); | 306 | $header = array(); |
307 | 307 | ||
308 | - if (!empty($backUrl)) { | ||
309 | - $header['navBack'] = $backUrl; | 308 | + if ($backUrl) { |
309 | + $header['navBack'] = true; | ||
310 | } | 310 | } |
311 | if (!empty($title)) { | 311 | if (!empty($title)) { |
312 | $header['navTitle'] = $title; | 312 | $header['navTitle'] = $title; |
@@ -16,12 +16,43 @@ use Api\Sign; | @@ -16,12 +16,43 @@ use Api\Sign; | ||
16 | */ | 16 | */ |
17 | class BrandData | 17 | class BrandData |
18 | { | 18 | { |
19 | + const URI_BRAND_TOPPOS = 'operations/api/v5/resource/get'; | ||
19 | 20 | ||
20 | /** | 21 | /** |
22 | + * 封装获取品牌一览页面的数据 | ||
23 | + * | ||
24 | + * @param string $contentCode 获取广告资源需要的位置码 | ||
25 | + * @param int $channel 频道标识 1:男,2:女,3:潮童,4:创意生活 | ||
26 | + * @return array( | ||
27 | + * "brandTop": "顶部的轮翻广告及热门品牌数据", | ||
28 | + * "brandList": "按字母'A-Z'分组的品牌列表数据" | ||
29 | + * ) | ||
30 | + * @author fei.hong <fei.hong@yoho.cn> | ||
31 | + */ | ||
32 | + public static function package($contentCode, $channel) | ||
33 | + { | ||
34 | + $urlList = array(); | ||
35 | + | ||
36 | + /* 顶部的轮翻广告及热门品牌数据 */ | ||
37 | + $param = Yohobuy::param(); | ||
38 | + $param['content_code'] = $contentCode; | ||
39 | + $param['client_secret'] = Sign::getSign($param); | ||
40 | + $urlList['brandTop'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param); | ||
41 | + | ||
42 | + /* 按字母"A-Z"分组的品牌列表数据 */ | ||
43 | + $param = Yohobuy::param(); | ||
44 | + $param['method'] = 'app.brand.brandlist'; | ||
45 | + $param['yh_channel'] = $channel; | ||
46 | + $param['client_secret'] = Sign::getSign($param); | ||
47 | + $urlList['brandList'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param); | ||
48 | + | ||
49 | + return Yohobuy::getMulti($urlList); | ||
50 | + } | ||
51 | + | ||
52 | + /** | ||
21 | * 获取品牌数据 | 53 | * 获取品牌数据 |
22 | * | 54 | * |
23 | * @param integer $channel 是否,默认1表示是,传值为空是app中用于品牌搜索的数据 | 55 | * @param integer $channel 是否,默认1表示是,传值为空是app中用于品牌搜索的数据 |
24 | - * | ||
25 | * @return array 品牌数据 | 56 | * @return array 品牌数据 |
26 | */ | 57 | */ |
27 | public static function getBrandsData($channel = 1) | 58 | public static function getBrandsData($channel = 1) |
@@ -36,6 +67,22 @@ class BrandData | @@ -36,6 +67,22 @@ class BrandData | ||
36 | } | 67 | } |
37 | 68 | ||
38 | /** | 69 | /** |
70 | + * 获取品牌页顶部楼层数据 | ||
71 | + * | ||
72 | + * @param string $contentCode 位置码 | ||
73 | + * @return array 品牌也顶部楼层数据 | ||
74 | + */ | ||
75 | + public static function getBrandTopData($contentCode) | ||
76 | + { | ||
77 | + // 构建必传参数 | ||
78 | + $param = Yohobuy::param(); | ||
79 | + $param['content_code'] = $contentCode; | ||
80 | + $param['client_secret'] = Sign::getSign($param); | ||
81 | + | ||
82 | + return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param); | ||
83 | + } | ||
84 | + | ||
85 | + /** | ||
39 | * 获取品牌介绍 | 86 | * 获取品牌介绍 |
40 | * | 87 | * |
41 | * @param integer $brandId 品牌ID | 88 | * @param integer $brandId 品牌ID |
@@ -11,27 +11,42 @@ class FloorProcess | @@ -11,27 +11,42 @@ class FloorProcess | ||
11 | { | 11 | { |
12 | 12 | ||
13 | /** | 13 | /** |
14 | + * 频道参数 | ||
15 | + * | ||
16 | + * @var array | ||
17 | + */ | ||
18 | + private static $channel = array( | ||
19 | + '1' => '1,3', | ||
20 | + '2' => '2,3' | ||
21 | + ); | ||
22 | + | ||
23 | + /** | ||
14 | * 处理首页内容 | 24 | * 处理首页内容 |
15 | * @param $data | 25 | * @param $data |
16 | * @param $type 类型 默认1:男首页 2:女首页 3:kids 4:lifestyle | 26 | * @param $type 类型 默认1:男首页 2:女首页 3:kids 4:lifestyle |
17 | */ | 27 | */ |
18 | public static function getContent($data, $type = 1) | 28 | public static function getContent($data, $type = 1) |
19 | { | 29 | { |
30 | + if (empty($data['list'])) { | ||
31 | + return array(); | ||
32 | + } | ||
33 | + | ||
20 | $result = array(); | 34 | $result = array(); |
21 | - if (!empty($data['list'])) { | ||
22 | - $build = array(); | ||
23 | - foreach ($data['list'] as $v) { | ||
24 | - $fun = $v['template_name']; | ||
25 | - if (!is_callable("self::$fun")) { | ||
26 | - continue; | ||
27 | - } | ||
28 | - $build = self::$fun($v['data'], $type); | ||
29 | - if (empty($build)) { | ||
30 | - continue; | ||
31 | - } | ||
32 | - $result[] = $build; | 35 | + |
36 | + $build = array(); | ||
37 | + foreach ($data['list'] as $v) { | ||
38 | + $fun = $v['template_name']; | ||
39 | + if (empty($v['data']) || !is_callable("self::$fun")) { | ||
40 | + continue; | ||
41 | + } | ||
42 | + $build = self::$fun($v['data'], $type); | ||
43 | + if (empty($build)) { | ||
44 | + continue; | ||
33 | } | 45 | } |
46 | + $result[] = $build; | ||
34 | } | 47 | } |
48 | + $build = array(); | ||
49 | + | ||
35 | return $result; | 50 | return $result; |
36 | } | 51 | } |
37 | 52 | ||
@@ -46,16 +61,35 @@ class FloorProcess | @@ -46,16 +61,35 @@ class FloorProcess | ||
46 | $result = array(); | 61 | $result = array(); |
47 | 62 | ||
48 | foreach ($data as &$one) { | 63 | foreach ($data as &$one) { |
49 | - $one['img'] = Helpers::getImageUrl($one['src'], 750, 364, 1); | 64 | + $one['url'] = Helpers::getFilterUrl($one['url']); |
65 | + $one['img'] = Helpers::getImageUrl($one['src'], 640, 310); | ||
66 | + unset($one['src']); | ||
67 | + } | ||
68 | + $result['bannerTop']['list'] = $data; | ||
69 | + | ||
70 | + return $result; | ||
71 | + } | ||
72 | + | ||
73 | + /** | ||
74 | + * 图标 | ||
75 | + */ | ||
76 | + private static function floor($data) | ||
77 | + { | ||
78 | + $result = array(); | ||
79 | + | ||
80 | + foreach ($data as &$one) { | ||
81 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
82 | + $one['img'] = Helpers::getImageUrl($one['src'], 98, 98); | ||
50 | unset($one['src']); | 83 | unset($one['src']); |
51 | } | 84 | } |
52 | - $result['list'] = $data; | 85 | + $result['iconsEnter']['list'] = $data; |
53 | 86 | ||
54 | - return array('bannerTop' => $result); | 87 | + return $result; |
55 | } | 88 | } |
56 | 89 | ||
57 | /** | 90 | /** |
58 | * 图标列表数据处理方法 | 91 | * 图标列表数据处理方法 |
92 | + * | ||
59 | * @param array $data 图标列表数据 | 93 | * @param array $data 图标列表数据 |
60 | * @param $type 类型 默认1:男首页 2:女首页 3:kids 4:lifestyle | 94 | * @param $type 类型 默认1:男首页 2:女首页 3:kids 4:lifestyle |
61 | * @return array 处理之后的图标列表数据 | 95 | * @return array 处理之后的图标列表数据 |
@@ -65,36 +99,66 @@ class FloorProcess | @@ -65,36 +99,66 @@ class FloorProcess | ||
65 | $result = array(); | 99 | $result = array(); |
66 | 100 | ||
67 | foreach ($data as &$one) { | 101 | foreach ($data as &$one) { |
68 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 102 | + $one['url'] = Helpers::getFilterUrl($one['url']); |
103 | + $one['img'] = Helpers::getImageUrl($one['src'], 98, 98); | ||
69 | unset($one['src']); | 104 | unset($one['src']); |
70 | } | 105 | } |
71 | - $result['list'] = $data; | 106 | + $result['iconsEnter']['list'] = $data; |
72 | 107 | ||
73 | - return array('iconsEnter' => $result); | 108 | + return $result; |
74 | } | 109 | } |
75 | 110 | ||
76 | /** | 111 | /** |
77 | - * 单图片数据处理方法 | 112 | + * 单广告图片数据处理方法 |
113 | + * | ||
78 | * @param array $data 单图片数据 | 114 | * @param array $data 单图片数据 |
79 | * @param $type 类型 默认1:男首页 2:女首页 3:kids 4:lifestyle | 115 | * @param $type 类型 默认1:男首页 2:女首页 3:kids 4:lifestyle |
80 | * @return array 处理之后的单图片数据 | 116 | * @return array 处理之后的单图片数据 |
81 | */ | 117 | */ |
82 | private static function single_image($data, $type) | 118 | private static function single_image($data, $type) |
83 | { | 119 | { |
84 | - if (empty($data)) { | ||
85 | - return array(); | ||
86 | - } | ||
87 | - | 120 | + $result = array(); |
121 | + | ||
88 | foreach ($data as &$one) { | 122 | foreach ($data as &$one) { |
89 | - $one['img'] = Helpers::getImageUrl($one['src'], 750, 364, 1); | 123 | + $one['url'] = Helpers::getFilterUrl($one['url']); |
124 | + $one['img'] = Helpers::getImageUrl($one['src'], 640, 200); | ||
90 | unset($one['src']); | 125 | unset($one['src']); |
91 | } | 126 | } |
127 | + $result['banner'] = $data; | ||
128 | + | ||
129 | + return $result; | ||
130 | + } | ||
131 | + | ||
132 | + /** | ||
133 | + * 女生品类 | ||
134 | + */ | ||
135 | + private static function recommend_content_three($data, $type) | ||
136 | + { | ||
137 | + $result = array(); | ||
138 | + | ||
139 | + $build = array(); | ||
140 | + if (!empty($data['big_image'][0])) { | ||
141 | + $build['img'] = Helpers::getImageUrl($data['big_image'][0]['src'], 640, 198); | ||
142 | + $build['url'] = Helpers::getFilterUrl($data['big_image'][0]['url']); | ||
143 | + $result['hotCategory']['banner'] = $build; | ||
144 | + } | ||
145 | + | ||
146 | + $build = array(); | ||
147 | + foreach ($data['list'] as $one) { | ||
148 | + $build['url'] = Helpers::getFilterUrl($one['url']); | ||
149 | + $build['img'] = Helpers::getImageUrl($one['src'], 140, 140); | ||
150 | + $build['textCn'] = $one['title']; | ||
151 | + $result['hotCategory']['list'][] = $build; | ||
152 | + } | ||
153 | + | ||
154 | + | ||
92 | 155 | ||
93 | - return array('banner' => $data); | 156 | + return $result; |
94 | } | 157 | } |
95 | 158 | ||
96 | /** | 159 | /** |
97 | * 带标题的12个小图推荐数据处理方法 | 160 | * 带标题的12个小图推荐数据处理方法 |
161 | + * | ||
98 | * @param array $data 带标题的12个小图推荐数据 | 162 | * @param array $data 带标题的12个小图推荐数据 |
99 | * @param $type 类型 默认1:男首页 2:女首页 3:kids 4:lifestyle | 163 | * @param $type 类型 默认1:男首页 2:女首页 3:kids 4:lifestyle |
100 | * @return array 处理之后的带标题的12个小图推荐数据 | 164 | * @return array 处理之后的带标题的12个小图推荐数据 |
@@ -104,15 +168,20 @@ class FloorProcess | @@ -104,15 +168,20 @@ class FloorProcess | ||
104 | $result = array(); | 168 | $result = array(); |
105 | 169 | ||
106 | foreach ($data['list'] as &$one) { | 170 | foreach ($data['list'] as &$one) { |
107 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 171 | + if (isset($one['url'])) { |
172 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
173 | + } | ||
174 | + $one['img'] = Helpers::getImageUrl($one['src'], 140, 140); | ||
175 | + $one['textCn'] = $one['title']; | ||
108 | unset($one['src']); | 176 | unset($one['src']); |
109 | } | 177 | } |
110 | $data['is_show_name'] = $data['title']['is_show']; | 178 | $data['is_show_name'] = $data['title']['is_show']; |
111 | $data['name'] = $data['title']['title']; | 179 | $data['name'] = $data['title']['title']; |
112 | unset($data['title']); | 180 | unset($data['title']); |
113 | - $result = $data; | ||
114 | 181 | ||
115 | - return array('hotCategory' => $result); | 182 | + $result['hotCategory'] = $data; |
183 | + | ||
184 | + return $result; | ||
116 | } | 185 | } |
117 | 186 | ||
118 | /** | 187 | /** |
@@ -125,16 +194,20 @@ class FloorProcess | @@ -125,16 +194,20 @@ class FloorProcess | ||
125 | { | 194 | { |
126 | $result = array(); | 195 | $result = array(); |
127 | 196 | ||
128 | - $data['is_show_name'] = (isset($data['is_show_name']) && $data['is_show_name'] == 'Y') ? 1 : 0; | 197 | + $data['is_show_name'] = (isset($data['is_show_name']) && $data['is_show_name'] === 'Y') ? 1 : 0; |
129 | $data['name'] = $data['title']['title']; | 198 | $data['name'] = $data['title']['title']; |
130 | unset($data['title']); | 199 | unset($data['title']); |
131 | foreach ($data['list'] as &$one) { | 200 | foreach ($data['list'] as &$one) { |
132 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 201 | + if (isset($one['url'])) { |
202 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
203 | + } | ||
204 | + $one['img'] = Helpers::getImageUrl($one['src'], 158, 174); | ||
133 | unset($one['src']); | 205 | unset($one['src']); |
134 | } | 206 | } |
135 | - $result = $data; | 207 | + $data['more'] = '/category/brand/index?channel=' . $type; |
208 | + $result['hotBrands'] = $data; | ||
136 | 209 | ||
137 | - return array('hotBrands' => $result); | 210 | + return $result; |
138 | } | 211 | } |
139 | 212 | ||
140 | /** | 213 | /** |
@@ -148,16 +221,22 @@ class FloorProcess | @@ -148,16 +221,22 @@ class FloorProcess | ||
148 | $result = array(); | 221 | $result = array(); |
149 | 222 | ||
150 | foreach ($data['article'] as &$one) { | 223 | foreach ($data['article'] as &$one) { |
151 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 224 | + if (isset($one['url'])) { |
225 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
226 | + } | ||
227 | + $one['img'] = Helpers::getImageUrl($one['src'], 400, 400); | ||
152 | unset($one['src']); | 228 | unset($one['src']); |
153 | } | 229 | } |
154 | foreach ($data['recommend_collocation'] as &$one) { | 230 | foreach ($data['recommend_collocation'] as &$one) { |
155 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 231 | + if (isset($one['url'])) { |
232 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
233 | + } | ||
234 | + $one['img'] = Helpers::getImageUrl($one['src'], 140, 140); | ||
156 | unset($one['src']); | 235 | unset($one['src']); |
157 | } | 236 | } |
158 | - $result = $data; | 237 | + $result['trendColloaction'] = $data; |
159 | 238 | ||
160 | - return array('trendColloaction' => $result); | 239 | + return $result; |
161 | } | 240 | } |
162 | 241 | ||
163 | /** | 242 | /** |
@@ -171,12 +250,15 @@ class FloorProcess | @@ -171,12 +250,15 @@ class FloorProcess | ||
171 | $result = array(); | 250 | $result = array(); |
172 | 251 | ||
173 | foreach ($data['list'] as &$one) { | 252 | foreach ($data['list'] as &$one) { |
174 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 253 | + if (isset($one['url'])) { |
254 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
255 | + } | ||
256 | + $one['img'] = Helpers::getImageUrl($one['src'], 580, 360); | ||
175 | unset($one['src']); | 257 | unset($one['src']); |
176 | } | 258 | } |
177 | - $result = $data; | 259 | + $result['trendTopics'] = $data; |
178 | 260 | ||
179 | - return array('trendTopics' => $result); | 261 | + return $result; |
180 | } | 262 | } |
181 | 263 | ||
182 | /** | 264 | /** |
@@ -190,19 +272,33 @@ class FloorProcess | @@ -190,19 +272,33 @@ class FloorProcess | ||
190 | $result = array(); | 272 | $result = array(); |
191 | 273 | ||
192 | foreach ($data['big_image'] as &$one) { | 274 | foreach ($data['big_image'] as &$one) { |
193 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 275 | + if (isset($one['url'])) { |
276 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
277 | + } | ||
278 | + $one['img'] = Helpers::getImageUrl($one['src'], 640, 403); | ||
194 | unset($one['src']); | 279 | unset($one['src']); |
195 | } | 280 | } |
196 | $data['banner']['list'] = $data['big_image']; | 281 | $data['banner']['list'] = $data['big_image']; |
197 | - unset($data['big_image']); | ||
198 | 282 | ||
199 | - foreach ($data['list'] as &$one) { | ||
200 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 283 | + foreach ($data['list'] as $kk => &$one) { |
284 | + if ($kk == 0) { | ||
285 | + $one['img'] = Helpers::getImageUrl($one['src'], 253, 383); | ||
286 | + } else { | ||
287 | + $one['img'] = Helpers::getImageUrl($one['src'], 191, 191); | ||
288 | + } | ||
289 | + if (isset($one['url'])) { | ||
290 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
291 | + } | ||
292 | + $one['textCn'] = $one['title']; | ||
293 | + | ||
201 | unset($one['src']); | 294 | unset($one['src']); |
202 | } | 295 | } |
203 | - $result = $data; | ||
204 | 296 | ||
205 | - return array('goodsCategory' => $result); | 297 | + unset($data['big_image']); |
298 | + | ||
299 | + $result['goodsCategory'] = $data; | ||
300 | + | ||
301 | + return $result; | ||
206 | } | 302 | } |
207 | 303 | ||
208 | /** | 304 | /** |
@@ -217,19 +313,25 @@ class FloorProcess | @@ -217,19 +313,25 @@ class FloorProcess | ||
217 | 313 | ||
218 | $data['banner'] = array(); | 314 | $data['banner'] = array(); |
219 | foreach ($data['big_image'] as &$one) { | 315 | foreach ($data['big_image'] as &$one) { |
220 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 316 | + if (isset($one['url'])) { |
317 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
318 | + } | ||
319 | + $one['img'] = Helpers::getImageUrl($one['src'], 640, 400); | ||
221 | unset($one['src']); | 320 | unset($one['src']); |
222 | } | 321 | } |
223 | $data['banner'] = $data['big_image']; | 322 | $data['banner'] = $data['big_image']; |
224 | unset($data['big_image']); | 323 | unset($data['big_image']); |
225 | 324 | ||
226 | foreach ($data['list'] as &$one) { | 325 | foreach ($data['list'] as &$one) { |
227 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 326 | + if (isset($one['url'])) { |
327 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
328 | + } | ||
329 | + $one['img'] = Helpers::getImageUrl($one['src'], 212, 192); | ||
228 | unset($one['src']); | 330 | unset($one['src']); |
229 | } | 331 | } |
230 | - $result = $data; | 332 | + $result['creativeLife'] = $data; |
231 | 333 | ||
232 | - return array('creativeLife' => $result); | 334 | + return $result; |
233 | } | 335 | } |
234 | 336 | ||
235 | /** | 337 | /** |
@@ -240,15 +342,21 @@ class FloorProcess | @@ -240,15 +342,21 @@ class FloorProcess | ||
240 | */ | 342 | */ |
241 | private static function small_pic($data, $type) | 343 | private static function small_pic($data, $type) |
242 | { | 344 | { |
345 | + // 按照以前业务操作,不显示 | ||
346 | + return array(); | ||
347 | + | ||
243 | $result = array(); | 348 | $result = array(); |
244 | 349 | ||
245 | foreach ($data as &$one) { | 350 | foreach ($data as &$one) { |
246 | - $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1); | 351 | + if (isset($one['url'])) { |
352 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
353 | + } | ||
354 | + $one['img'] = Helpers::getImageUrl($one['src'], 98, 98); | ||
247 | unset($one['src']); | 355 | unset($one['src']); |
248 | } | 356 | } |
249 | - $result = $data; | 357 | + $result['small_pic'] = $data; |
250 | 358 | ||
251 | - return array('small_pic' => $result); | 359 | + return $result; |
252 | } | 360 | } |
253 | 361 | ||
254 | /** | 362 | /** |
@@ -264,9 +372,47 @@ class FloorProcess | @@ -264,9 +372,47 @@ class FloorProcess | ||
264 | } | 372 | } |
265 | 373 | ||
266 | $data['name'] = $data['title']; | 374 | $data['name'] = $data['title']; |
267 | - $data['img'] = Helpers::getImageUrl($data['src'], 640, 198, 2); | 375 | + $data['img'] = Helpers::getImageUrl($data['src'], 640, 198); |
376 | + if (isset($data['url'])) { | ||
377 | + $data['url'] = Helpers::getFilterUrl($data['url']); | ||
378 | + } | ||
268 | 379 | ||
269 | return array('plusStar' => $data); | 380 | return array('plusStar' => $data); |
270 | } | 381 | } |
271 | 382 | ||
383 | + /** | ||
384 | + * 自定义品牌 | ||
385 | + * | ||
386 | + * @param unknown $data | ||
387 | + * @param mixed $type | ||
388 | + * @return multitype: | ||
389 | + */ | ||
390 | + private static function custom_brands($data, $type) | ||
391 | + { | ||
392 | + // URL附加参数 | ||
393 | + $param = ''; | ||
394 | + if (isset(self::$channel[$type])) { | ||
395 | + $param = '/?gender=' . self::$channel[$type]; | ||
396 | + } | ||
397 | + | ||
398 | + $result = array(); | ||
399 | + $result['hotBrandsScroll']['name'] = $data['title']['title']; | ||
400 | + foreach ($data['list'] as &$one) { | ||
401 | + if (isset($one['url'])) { | ||
402 | + $one['url'] = Helpers::getFilterUrl($one['url']); | ||
403 | + } | ||
404 | + $one['img'] = Helpers::getImageUrl($one['src'], 140, 140); | ||
405 | + $one['textCn'] = $one['name']; | ||
406 | + if (isset($one['url'])) { | ||
407 | + $one['url'] .= $param; | ||
408 | + } | ||
409 | + } | ||
410 | + if (!empty($data['is_show_name']) && $data['is_show_name'] == 'Y') { | ||
411 | + $result['hotBrandsScroll']['is_show_name'] = true; | ||
412 | + } | ||
413 | + $result['hotBrandsScroll']['list'] = $data['list']; | ||
414 | + | ||
415 | + return $result; | ||
416 | + } | ||
417 | + | ||
272 | } | 418 | } |
@@ -10,15 +10,26 @@ class Helpers | @@ -10,15 +10,26 @@ class Helpers | ||
10 | 10 | ||
11 | /** | 11 | /** |
12 | * 根据尺寸获得图片url | 12 | * 根据尺寸获得图片url |
13 | - * @param string $fileName 文件名 | 13 | + * @param string $url 路径 |
14 | * @param integer $width 图片宽度 | 14 | * @param integer $width 图片宽度 |
15 | * @param integer $height 图片高度 | 15 | * @param integer $height 图片高度 |
16 | * @param integer $mode 模式 | 16 | * @param integer $mode 模式 |
17 | * @return string 图片地址 | 17 | * @return string 图片地址 |
18 | */ | 18 | */ |
19 | - public static function getImageUrl($fileName, $width, $height, $mode = 2) | 19 | + public static function getImageUrl($url, $width, $height, $mode = 2) |
20 | { | 20 | { |
21 | - return strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode)); | 21 | + return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode)); |
22 | + } | ||
23 | + | ||
24 | + /** | ||
25 | + * 获取过滤后的URL链接 | ||
26 | + * | ||
27 | + * @param string $url 路径 | ||
28 | + * @return string 去除掉如&openby:yohobuy={"action":"go.brand"}这样的APP附加参数 | ||
29 | + */ | ||
30 | + public static function getFilterUrl($url) | ||
31 | + { | ||
32 | + return strstr($url, '&openby:yohobuy=', true); | ||
22 | } | 33 | } |
23 | 34 | ||
24 | /** | 35 | /** |
This diff could not be displayed because it is too large.
No preview for this file type
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > | 2 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > |
3 | <svg xmlns="http://www.w3.org/2000/svg"> | 3 | <svg xmlns="http://www.w3.org/2000/svg"> |
4 | <metadata> | 4 | <metadata> |
5 | -Created by FontForge 20120731 at Wed Oct 21 13:32:56 2015 | 5 | +Created by FontForge 20120731 at Wed Oct 21 18:23:04 2015 |
6 | By Ads | 6 | By Ads |
7 | </metadata> | 7 | </metadata> |
8 | <defs> | 8 | <defs> |
@@ -19,7 +19,7 @@ Created by FontForge 20120731 at Wed Oct 21 13:32:56 2015 | @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Wed Oct 21 13:32:56 2015 | ||
19 | bbox="0 -224 3943 812.871" | 19 | bbox="0 -224 3943 812.871" |
20 | underline-thickness="50" | 20 | underline-thickness="50" |
21 | underline-position="-100" | 21 | underline-position="-100" |
22 | - unicode-range="U+0078-E622" | 22 | + unicode-range="U+0078-E623" |
23 | /> | 23 | /> |
24 | <missing-glyph horiz-adv-x="374" | 24 | <missing-glyph horiz-adv-x="374" |
25 | d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> | 25 | d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> |
@@ -140,5 +140,7 @@ t-2.5 -15v-80h-208q-20 0 -34 -14t-14 -34v-80h832v80q0 6 -1.5 11t-3.5 10t-5.5 9t- | @@ -140,5 +140,7 @@ t-2.5 -15v-80h-208q-20 0 -34 -14t-14 -34v-80h832v80q0 6 -1.5 11t-3.5 10t-5.5 9t- | ||
140 | <glyph glyph-name="uniE622" unicode="" horiz-adv-x="1173" | 140 | <glyph glyph-name="uniE622" unicode="" horiz-adv-x="1173" |
141 | d="M586 588q-64 150 -188 203q-114 47 -222 -7q-112 -56 -155 -192q-20 -67 -21 -144q0 -41 9 -78.5t24 -66.5t39 -57.5t47 -48.5t55.5 -43t56.5 -38t58.5 -35.5t53.5 -33.5q63 -42 118 -94.5t86.5 -95t39.5 -69.5q4 19 25.5 50t53.5 66t75 74t88 71q21 15 53.5 35.5t58 36 | 141 | d="M586 588q-64 150 -188 203q-114 47 -222 -7q-112 -56 -155 -192q-20 -67 -21 -144q0 -41 9 -78.5t24 -66.5t39 -57.5t47 -48.5t55.5 -43t56.5 -38t58.5 -35.5t53.5 -33.5q63 -42 118 -94.5t86.5 -95t39.5 -69.5q4 19 25.5 50t53.5 66t75 74t88 71q21 15 53.5 35.5t58 36 |
142 | t57 38t55 43t47 48t39 56.5t25 66.5t8.5 78.5q0 75 -19.5 138t-52.5 105.5t-76.5 70.5t-91 37.5t-98 1t-96 -34.5t-85.5 -72.5t-67 -108.5z" /> | 142 | t57 38t55 43t47 48t39 56.5t25 66.5t8.5 78.5q0 75 -19.5 138t-52.5 105.5t-76.5 70.5t-91 37.5t-98 1t-96 -34.5t-85.5 -72.5t-67 -108.5z" /> |
143 | + <glyph glyph-name="uniE623" unicode="" | ||
144 | +d="M835 576l-60 63l-263 -275v0l-263 275l-60 -63l262 -276l-262 -276l60 -63l263 275v0l263 -275l60 63l-262 276z" /> | ||
143 | </font> | 145 | </font> |
144 | </defs></svg> | 146 | </defs></svg> |
No preview for this file type
No preview for this file type
@@ -7,6 +7,10 @@ | @@ -7,6 +7,10 @@ | ||
7 | var $ = require('yoho.zepto'), | 7 | var $ = require('yoho.zepto'), |
8 | lazyLoad = require('yoho.zeptolazyload'); | 8 | lazyLoad = require('yoho.zeptolazyload'); |
9 | 9 | ||
10 | +//品牌页参数 | ||
11 | +var $brandHeader = $('#brand-header'), | ||
12 | + $introBox = $('#intro-box'); | ||
13 | + | ||
10 | var filter = require('../plugin/filter'); | 14 | var filter = require('../plugin/filter'); |
11 | 15 | ||
12 | var $goodsContainer = $('#goods-container'), | 16 | var $goodsContainer = $('#goods-container'), |
@@ -276,4 +280,22 @@ $(window).scroll(function() { | @@ -276,4 +280,22 @@ $(window).scroll(function() { | ||
276 | $(document).height() - 0.25 * $goodsContainer.height()) { | 280 | $(document).height() - 0.25 * $goodsContainer.height()) { |
277 | search(); | 281 | search(); |
278 | } | 282 | } |
283 | +}); | ||
284 | + | ||
285 | +//品牌介绍 | ||
286 | +$brandHeader.children('.btn-intro').bind('touchstart', function() { | ||
287 | + $introBox.removeClass('hide'); | ||
288 | +}); | ||
289 | + | ||
290 | +$('.close-intro, .brand-intro-box').click(function() { | ||
291 | + $introBox.addClass('hide'); | ||
292 | +}); | ||
293 | + | ||
294 | +$('#brand-intro').click(function(e) { | ||
295 | + e.stopPropagation(); | ||
296 | +}); | ||
297 | + | ||
298 | +//品牌收藏 | ||
299 | +$brandHeader.children('.btn-col').bind('touchstart', function() { | ||
300 | + $(this).toggleClass('coled'); | ||
279 | }); | 301 | }); |
1 | .brand-page { | 1 | .brand-page { |
2 | + | ||
3 | + | ||
4 | + .newbrand-search { | ||
5 | + width: 93.75%; | ||
6 | + height: 30px; | ||
7 | + padding: 7px 3.125%; | ||
8 | + background-color: #f8f8f8; | ||
9 | + left: 0; | ||
10 | + z-index: 10; | ||
11 | + .search-box { | ||
12 | + position: relative; | ||
13 | + height: 30px; | ||
14 | + background-color: #FFF; | ||
15 | + border-radius: 15px; | ||
16 | + padding: 0 16px 0 26px; | ||
17 | + | ||
18 | + .search-input { | ||
19 | + width: 100%; | ||
20 | + height: 30px; | ||
21 | + border: 0; | ||
22 | + } | ||
23 | + | ||
24 | + .search-icon { | ||
25 | + position: absolute; | ||
26 | + font-size: 12px; | ||
27 | + top: 16px; | ||
28 | + left: 24px; | ||
29 | + } | ||
2 | 30 | ||
31 | + } | ||
32 | + | ||
33 | + } | ||
34 | + | ||
3 | .hot-brand { | 35 | .hot-brand { |
4 | margin: (30rem / $pxConvertRem) 0 0; | 36 | margin: (30rem / $pxConvertRem) 0 0; |
5 | 37 |
@@ -43,11 +43,7 @@ | @@ -43,11 +43,7 @@ | ||
43 | white-space: nowrap; | 43 | white-space: nowrap; |
44 | } | 44 | } |
45 | } | 45 | } |
46 | - | ||
47 | - .brand:nth-child(4n) { | ||
48 | - border-right: none; | ||
49 | - } | ||
50 | - | 46 | + |
51 | .more { | 47 | .more { |
52 | float: left; | 48 | float: left; |
53 | width: 317rem / $pxConvertRem; | 49 | width: 317rem / $pxConvertRem; |
@@ -17,9 +17,6 @@ | @@ -17,9 +17,6 @@ | ||
17 | display: -webkit-flex; | 17 | display: -webkit-flex; |
18 | width: 98rem / $pxConvertRem; | 18 | width: 98rem / $pxConvertRem; |
19 | height: 98rem / $pxConvertRem; | 19 | height: 98rem / $pxConvertRem; |
20 | - border-radius: 50%; | ||
21 | - border: 2rem / $pxConvertRem solid #e0e0e0; | ||
22 | - box-sizing: border-box; | ||
23 | overflow: hidden; | 20 | overflow: hidden; |
24 | align-items:center; | 21 | align-items:center; |
25 | justify-content: center; | 22 | justify-content: center; |
@@ -39,4 +39,18 @@ | @@ -39,4 +39,18 @@ | ||
39 | color: #000; | 39 | color: #000; |
40 | } | 40 | } |
41 | } | 41 | } |
42 | + .load-more-info { | ||
43 | + width: 100%; | ||
44 | + height: 570rem / $pxConvertRem; | ||
45 | + line-height: 70rem / $pxConvertRem; | ||
46 | + text-align: center; | ||
47 | + font-size: 14px; | ||
48 | + overflow: hidden; | ||
49 | + | ||
50 | + .status { | ||
51 | + &.hide { | ||
52 | + display: none; | ||
53 | + } | ||
54 | + } | ||
55 | + } | ||
42 | } | 56 | } |
@@ -96,10 +96,59 @@ | @@ -96,10 +96,59 @@ | ||
96 | 96 | ||
97 | .btn-col { | 97 | .btn-col { |
98 | right: 15px; | 98 | right: 15px; |
99 | + | ||
100 | + .iconfont { | ||
101 | + font-size: 12px; | ||
102 | + } | ||
99 | } | 103 | } |
100 | 104 | ||
101 | .brand-intro-box { | 105 | .brand-intro-box { |
102 | - display: none; | 106 | + position: absolute; |
107 | + top: 0; | ||
108 | + left: 0; | ||
109 | + right: 0; | ||
110 | + bottom: 0; | ||
111 | + background: rgba(0,0,0,.3); | ||
112 | + padding: 44px 0; | ||
113 | + z-index: 1; | ||
114 | + overflow: auto; | ||
115 | + | ||
116 | + .brand-intro { | ||
117 | + position: relative; | ||
118 | + box-sizing: border-box; | ||
119 | + width: 85%; | ||
120 | + margin: 0 7.5%; | ||
121 | + background: #fff; | ||
122 | + padding: 10px 8%; | ||
123 | + } | ||
124 | + | ||
125 | + h2 { | ||
126 | + text-align: center; | ||
127 | + font-size: 17px; | ||
128 | + line-height: 40px; | ||
129 | + } | ||
130 | + | ||
131 | + .con { | ||
132 | + font-size: 12px; | ||
133 | + line-height: 16px; | ||
134 | + padding: 20px 0; | ||
135 | + border-top: 1px solid #e6e6e6; | ||
136 | + border-bottom: 1px solid #e6e6e6; | ||
137 | + overflow-x: hidden; | ||
138 | + } | ||
139 | + | ||
140 | + .fo { | ||
141 | + font-size: 18px; | ||
142 | + height: 40px; | ||
143 | + line-height: 40px; | ||
144 | + text-align: center; | ||
145 | + } | ||
146 | + | ||
147 | + .close-intro { | ||
148 | + position: absolute; | ||
149 | + top: 6px; | ||
150 | + right: 6px; | ||
151 | + } | ||
103 | } | 152 | } |
104 | 153 | ||
105 | .list-nav { | 154 | .list-nav { |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="brand-page yoho-page"> | 2 | <div class="brand-page yoho-page"> |
3 | + | ||
4 | + <div class="newbrand-search" style="position: fixed; top: 44px;"> | ||
5 | + <div class="search-box clearfix"> | ||
6 | + <a href="/index/search/index" > | ||
7 | + <input type="text" class="search-input" placeholder="查找品牌" name="query" id="query" value="" disabled=""> | ||
8 | + <i class="search-icon iconfont clearfix"></i> | ||
9 | + </a> | ||
10 | + </div> | ||
11 | + </div> | ||
12 | + | ||
13 | + | ||
3 | {{# bannerTop}} | 14 | {{# bannerTop}} |
4 | {{> home/banner_top}} | 15 | {{> home/banner_top}} |
5 | {{/ bannerTop}} | 16 | {{/ bannerTop}} |
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | {{/ brandWay}} | 24 | {{/ brandWay}} |
25 | 25 | ||
26 | {{# brand}} | 26 | {{# brand}} |
27 | - <div class="brand-header" data-id={{id}}> | 27 | + <div id="brand-header" class="brand-header" data-id={{id}}> |
28 | <img class="lazy" data-original={{banner}}> | 28 | <img class="lazy" data-original={{banner}}> |
29 | <a class="btn-intro" href="javascript:void(0);"> | 29 | <a class="btn-intro" href="javascript:void(0);"> |
30 | 品牌介绍 | 30 | 品牌介绍 |
@@ -34,8 +34,18 @@ | @@ -34,8 +34,18 @@ | ||
34 | 收藏 | 34 | 收藏 |
35 | </a> | 35 | </a> |
36 | </div> | 36 | </div> |
37 | - <div class="brand-intro-box"> | ||
38 | - <div id="brand-intro" class="brand-intro">{{intro}}</div> | 37 | + <div id="intro-box" class="brand-intro-box hide"> |
38 | + <div id="brand-intro" class="brand-intro"> | ||
39 | + <h2>品牌介绍</h2> | ||
40 | + <div class="con"> | ||
41 | + {{{intro}}} | ||
42 | + </div> | ||
43 | + <p class="fo"> | ||
44 | + <span></span> | ||
45 | + 100%品牌授权正品 | ||
46 | + </p> | ||
47 | + <span class="iconfont close-intro"></span> | ||
48 | + </div> | ||
39 | </div> | 49 | </div> |
40 | {{/ brand}} | 50 | {{/ brand}} |
41 | 51 |
1 | <div class="hot-category"> | 1 | <div class="hot-category"> |
2 | - | ||
3 | {{> home/floor_header}} | 2 | {{> home/floor_header}} |
4 | - | 3 | + |
4 | + {{# banner}} | ||
5 | + <a class="banner" href="{{url}}"> | ||
6 | + <img class="lazy" data-original="{{img}}"> | ||
7 | + </a> | ||
8 | + {{/ banner}} | ||
5 | <ul class="category-list clearfix"> | 9 | <ul class="category-list clearfix"> |
6 | {{# list}} | 10 | {{# list}} |
7 | <li> | 11 | <li> |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <div id="goods-list" class="goods-list clearfix"></div> | 7 | <div id="goods-list" class="goods-list clearfix"></div> |
8 | 8 | ||
9 | <div id="load-more-info" class="load-more-info"> | 9 | <div id="load-more-info" class="load-more-info"> |
10 | - <div class="loading status"> | 10 | + <div class="loading status hide"> |
11 | 正在加载... | 11 | 正在加载... |
12 | </div> | 12 | </div> |
13 | <span class="no-more status hide">没有更多啦</span> | 13 | <span class="no-more status hide">没有更多啦</span> |
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <div class="recommend-swiper"> | 12 | <div class="recommend-swiper"> |
13 | <ul class="recommend-list clearfix"> | 13 | <ul class="recommend-list clearfix"> |
14 | {{# recommend_collocation}} | 14 | {{# recommend_collocation}} |
15 | - <li class="recommend-item swiper-slide"><a href="{{url}}"><img class="lazy" src="{{img}}" alt="" /></a></li> | 15 | + <li class="recommend-item swiper-slide"><a href="{{url}}"><img class="img" src="{{img}}" alt="" /></a></li> |
16 | {{/ recommend_collocation}} | 16 | {{/ recommend_collocation}} |
17 | </ul> | 17 | </ul> |
18 | </div> | 18 | </div> |
1 | {{> layout/page_footer}} | 1 | {{> layout/page_footer}} |
2 | {{#if rlsEnv}} | 2 | {{#if rlsEnv}} |
3 | - <script src="http://static.wap.yohobuy.com/js/sea.js"></script> | ||
4 | - <script>seajs.config({base:'http://static.wap.yohobuy.com/'});</script> | 3 | +<script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script> |
4 | +<script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script> | ||
5 | {{/if}} | 5 | {{/if}} |
6 | {{#if testEnv}} | 6 | {{#if testEnv}} |
7 | - <script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script> | ||
8 | - <script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script> | 7 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/lib.js"></script> |
8 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/index.js"></script> | ||
9 | {{/if}} | 9 | {{/if}} |
10 | {{#if devEnv}} | 10 | {{#if devEnv}} |
11 | - <script src="http://localhost:8000/static/js/sea.js?nowrap"></script> | ||
12 | - <script> | ||
13 | - seajs.config({ | ||
14 | - base: 'http://localhost:8000/' | ||
15 | - }); | ||
16 | - </script> | 11 | +<script src="http://localhost:8000/static/js/sea.js?nowrap"></script> |
12 | +<script>seajs.config({base: 'http://localhost:8000/'});</script> | ||
17 | {{/if}} | 13 | {{/if}} |
18 | {{> layout/use}} | 14 | {{> layout/use}} |
19 | </body> | 15 | </body> |
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html> | 2 | <html> |
3 | <head> | 3 | <head> |
4 | - <meta charset="utf-8"> | ||
5 | - <title>{{title}}YOHO!有货</title> | ||
6 | - <meta name="keywords" content="{{keywords}}Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"> | ||
7 | - <meta name="description" content="{{description}}YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"> | ||
8 | - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
9 | - <meta http-equiv="cleartype" content="on"> | ||
10 | - <meta name="apple-mobile-web-app-status-bar-style" content="black" /> | ||
11 | - <meta content="telephone=no" name="format-detection" /> | ||
12 | - <meta content="email=no" name="format-detection" /> | ||
13 | - <script type="text/javascript"> | ||
14 | - (function (doc, win) { | ||
15 | - var docEl = doc.documentElement; | ||
16 | - (function () { | ||
17 | - var clientWidth = docEl.clientWidth; | ||
18 | - if (!clientWidth) { | ||
19 | - return; | ||
20 | - } | ||
21 | - docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; | ||
22 | - }()); | ||
23 | - })(document, window); | ||
24 | - </script> | ||
25 | - {{#if rlsEnv}} | ||
26 | - <link rel="stylesheet" href="http://static.wap.yohobuy.com/css/index.css"> | ||
27 | - {{/if}} | ||
28 | - {{#if testEnv}} | ||
29 | - <link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css"> | ||
30 | - {{/if}} | ||
31 | - {{#if devEnv}} | ||
32 | - <link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css"> | ||
33 | - {{/if}} | 4 | +<meta charset="utf-8"> |
5 | +<title>{{title}}YOHO!有货</title> | ||
6 | +<meta name="keywords" content="{{keywords}}Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"> | ||
7 | +<meta name="description" content="{{description}}YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"> | ||
8 | +<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
9 | +<meta http-equiv="cleartype" content="on"> | ||
10 | +<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | ||
11 | +<meta content="telephone=no" name="format-detection" /> | ||
12 | +<meta content="email=no" name="format-detection" /> | ||
13 | +<script type="text/javascript"> | ||
14 | + (function(doc, win) { | ||
15 | + var docEl = doc.documentElement; | ||
16 | + (function() { | ||
17 | + var clientWidth = docEl.clientWidth; | ||
18 | + if (!clientWidth) { | ||
19 | + return; | ||
20 | + } | ||
21 | + docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; | ||
22 | + }()); | ||
23 | + })(document, window); | ||
24 | +</script> | ||
25 | +{{#if rlsEnv}} | ||
26 | +<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css"> | ||
27 | +{{/if}} | ||
28 | +{{#if testEnv}} | ||
29 | +<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/index.css"> | ||
30 | +{{/if}} | ||
31 | +{{#if devEnv}} | ||
32 | +<link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css"> | ||
33 | +{{/if}} | ||
34 | </head> | 34 | </head> |
35 | <body {{#if isPassportPage}}class=passport-body{{/if}}> | 35 | <body {{#if isPassportPage}}class=passport-body{{/if}}> |
36 | -{{> layout/page_header}} | ||
36 | + {{> layout/page_header}} |
1 | -{{#pageHeader}} | ||
2 | - <header class="yoho-header"> | ||
3 | - {{#navBack}} | ||
4 | - <a href={{.}} class="nav-back"></a> | ||
5 | - {{/navBack}} | ||
6 | - {{#navHome}} | ||
7 | - <a href={{.}} class="nav-home"></a> | ||
8 | - {{/navHome}} | ||
9 | - {{#navTitle}} | ||
10 | - <p class="nav-title">{{.}}</p> | ||
11 | - {{/navTitle}} | ||
12 | - </header> | 1 | +{{#pageHeader}} |
2 | +<header class="yoho-header"> | ||
3 | + {{#if navBack}} | ||
4 | + <a href="javascript:history.go(-1);" class="nav-back"></a> | ||
5 | + {{/if}} | ||
6 | + {{#navHome}} | ||
7 | + <a href="{{.}}" class="nav-home"></a> | ||
8 | + {{/navHome}} | ||
9 | + {{#navTitle}} | ||
10 | + <p class="nav-title">{{.}}</p> | ||
11 | + {{/navTitle}} | ||
12 | +</header> | ||
13 | {{/pageHeader}} | 13 | {{/pageHeader}} |
1 | <script> | 1 | <script> |
2 | seajs.use('js/common'); | 2 | seajs.use('js/common'); |
3 | </script> | 3 | </script> |
4 | - | ||
5 | {{!-- 逛(PLUS+STAR) --}} | 4 | {{!-- 逛(PLUS+STAR) --}} |
6 | {{#if psList}} | 5 | {{#if psList}} |
7 | - <script> | ||
8 | - seajs.use('js/guang/plus-star/list'); | ||
9 | - </script> | 6 | +<script> |
7 | + seajs.use('js/guang/plus-star/list'); | ||
8 | +</script> | ||
10 | {{/if}} | 9 | {{/if}} |
11 | {{#if psDetail}} | 10 | {{#if psDetail}} |
12 | - <script> | ||
13 | - seajs.use('js/guang/plus-star/detail'); | ||
14 | - </script> | 11 | +<script> |
12 | + seajs.use('js/guang/plus-star/detail'); | ||
13 | +</script> | ||
15 | {{/if}} | 14 | {{/if}} |
16 | {{#if guangHome}} | 15 | {{#if guangHome}} |
17 | - <script> | ||
18 | - seajs.use('js/guang/home'); | ||
19 | - </script> | 16 | +<script> |
17 | + seajs.use('js/guang/home'); | ||
18 | +</script> | ||
20 | {{/if}} | 19 | {{/if}} |
21 | {{#if guangList}} | 20 | {{#if guangList}} |
22 | - <script> | ||
23 | - seajs.use('js/guang/list'); | ||
24 | - </script> | 21 | +<script> |
22 | + seajs.use('js/guang/list'); | ||
23 | +</script> | ||
25 | {{/if}} | 24 | {{/if}} |
26 | {{#if guangDetail}} | 25 | {{#if guangDetail}} |
27 | - <script> | ||
28 | - seajs.use('js/guang/detail'); | ||
29 | - </script> | 26 | +<script> |
27 | + seajs.use('js/guang/detail'); | ||
28 | +</script> | ||
30 | {{/if}} | 29 | {{/if}} |
31 | - | ||
32 | {{!-- 注册 --}} | 30 | {{!-- 注册 --}} |
33 | {{#if regIndex}} | 31 | {{#if regIndex}} |
34 | - <script> | ||
35 | - seajs.use('js/passport/register/register'); | ||
36 | - </script> | 32 | +<script> |
33 | + seajs.use('js/passport/register/register'); | ||
34 | +</script> | ||
37 | {{/if}} | 35 | {{/if}} |
38 | {{#if regCode}} | 36 | {{#if regCode}} |
39 | - <script> | ||
40 | - seajs.use('js/passport/register/code'); | ||
41 | - </script> | 37 | +<script> |
38 | + seajs.use('js/passport/register/code'); | ||
39 | +</script> | ||
42 | {{/if}} | 40 | {{/if}} |
43 | {{#if regPwd}} | 41 | {{#if regPwd}} |
44 | - <script> | ||
45 | - seajs.use('js/passport/register/password'); | ||
46 | - </script> | 42 | +<script> |
43 | + seajs.use('js/passport/register/password'); | ||
44 | +</script> | ||
47 | {{/if}} | 45 | {{/if}} |
48 | - | ||
49 | {{!-- 登陆 --}} | 46 | {{!-- 登陆 --}} |
50 | {{#if loginIndex}} | 47 | {{#if loginIndex}} |
51 | - <script> | ||
52 | - seajs.use('js/passport/login/login'); | ||
53 | - </script> | 48 | +<script> |
49 | + seajs.use('js/passport/login/login'); | ||
50 | +</script> | ||
54 | {{/if}} | 51 | {{/if}} |
55 | {{#if loginInterational}} | 52 | {{#if loginInterational}} |
56 | - <script> | ||
57 | - seajs.use('js/passport/login/interational'); | ||
58 | - </script> | 53 | +<script> |
54 | + seajs.use('js/passport/login/interational'); | ||
55 | +</script> | ||
59 | {{/if}} | 56 | {{/if}} |
60 | - | ||
61 | {{!-- 密码找回 --}} | 57 | {{!-- 密码找回 --}} |
62 | {{#if backEmail}} | 58 | {{#if backEmail}} |
63 | - <script> | ||
64 | - seajs.use('js/passport/back/email'); | ||
65 | - </script> | 59 | +<script> |
60 | + seajs.use('js/passport/back/email'); | ||
61 | +</script> | ||
66 | {{/if}} | 62 | {{/if}} |
67 | {{#if backEmailSuccess}} | 63 | {{#if backEmailSuccess}} |
68 | - <script> | ||
69 | - seajs.use('js/passport/back/email-success'); | ||
70 | - </script> | 64 | +<script> |
65 | + seajs.use('js/passport/back/email-success'); | ||
66 | +</script> | ||
71 | {{/if}} | 67 | {{/if}} |
72 | {{#if backMobile}} | 68 | {{#if backMobile}} |
73 | - <script> | ||
74 | - seajs.use('js/passport/back/mobile'); | ||
75 | - </script> | 69 | +<script> |
70 | + seajs.use('js/passport/back/mobile'); | ||
71 | +</script> | ||
76 | {{/if}} | 72 | {{/if}} |
77 | {{#if backCode}} | 73 | {{#if backCode}} |
78 | - <script> | ||
79 | - seajs.use('js/passport/back/code'); | ||
80 | - </script> | 74 | +<script> |
75 | + seajs.use('js/passport/back/code'); | ||
76 | +</script> | ||
81 | {{/if}} | 77 | {{/if}} |
82 | {{#if backNewPwd}} | 78 | {{#if backNewPwd}} |
83 | - <script> | ||
84 | - seajs.use('js/passport/back/new-password'); | ||
85 | - </script> | 79 | +<script> |
80 | + seajs.use('js/passport/back/new-password'); | ||
81 | +</script> | ||
86 | {{/if}} | 82 | {{/if}} |
87 | - | ||
88 | {{!-- 首页 --}} | 83 | {{!-- 首页 --}} |
89 | {{#if grilsHomePage}} | 84 | {{#if grilsHomePage}} |
90 | - <script> | ||
91 | - seajs.use('js/home/home'); | ||
92 | - </script> | 85 | +<script> |
86 | + seajs.use('js/home/home'); | ||
87 | +</script> | ||
93 | {{/if}} | 88 | {{/if}} |
94 | {{#if boysHomePage}} | 89 | {{#if boysHomePage}} |
95 | - <script> | ||
96 | - seajs.use('js/home/home'); | ||
97 | - </script> | 90 | +<script> |
91 | + seajs.use('js/home/home'); | ||
92 | +</script> | ||
98 | {{/if}} | 93 | {{/if}} |
99 | {{#if kidsHomePage}} | 94 | {{#if kidsHomePage}} |
100 | - <script> | ||
101 | - seajs.use('js/home/home'); | ||
102 | - </script> | 95 | +<script> |
96 | + seajs.use('js/home/home'); | ||
97 | +</script> | ||
103 | {{/if}} | 98 | {{/if}} |
104 | {{#if lifestyleHomePage}} | 99 | {{#if lifestyleHomePage}} |
105 | - <script> | ||
106 | - seajs.use('js/home/home'); | ||
107 | - </script> | 100 | +<script> |
101 | + seajs.use('js/home/home'); | ||
102 | +</script> | ||
108 | {{/if}} | 103 | {{/if}} |
109 | - | ||
110 | {{!-- 新品到着 --}} | 104 | {{!-- 新品到着 --}} |
111 | {{#if newArrival}} | 105 | {{#if newArrival}} |
112 | - <script> | ||
113 | - seajs.use('js/product/newsale/newarrival'); | ||
114 | - </script> | 106 | +<script> |
107 | + seajs.use('js/product/newsale/newarrival'); | ||
108 | +</script> | ||
115 | {{/if}} | 109 | {{/if}} |
116 | {{!-- 折扣专区 --}} | 110 | {{!-- 折扣专区 --}} |
117 | {{#if discount}} | 111 | {{#if discount}} |
118 | - <script> | ||
119 | - seajs.use('js/product/newsale/discount'); | ||
120 | - </script> | 112 | +<script> |
113 | + seajs.use('js/product/newsale/discount'); | ||
114 | +</script> | ||
121 | {{/if}} | 115 | {{/if}} |
122 | - | ||
123 | {{!-- 商品列表 --}} | 116 | {{!-- 商品列表 --}} |
124 | {{#if goodListPage}} | 117 | {{#if goodListPage}} |
125 | - <script> | ||
126 | - seajs.use('js/product/list'); | ||
127 | - </script> | 118 | +<script> |
119 | + seajs.use('js/product/list'); | ||
120 | +</script> | ||
128 | {{/if}} | 121 | {{/if}} |
129 | - | ||
130 | {{!-- 品类 --}} | 122 | {{!-- 品类 --}} |
131 | {{#if categoryPage}} | 123 | {{#if categoryPage}} |
132 | - <script> | ||
133 | - seajs.use('js/category/index'); | ||
134 | - </script> | 124 | +<script> |
125 | + seajs.use('js/category/index'); | ||
126 | +</script> | ||
135 | {{/if}} | 127 | {{/if}} |
136 | {{!-- 品牌 --}} | 128 | {{!-- 品牌 --}} |
137 | {{#if brandPage}} | 129 | {{#if brandPage}} |
138 | - <script> | ||
139 | - seajs.use('js/category/brand'); | ||
140 | - </script> | 130 | +<script> |
131 | + seajs.use('js/category/brand'); | ||
132 | +</script> | ||
141 | {{/if}} | 133 | {{/if}} |
142 | - | ||
143 | {{!-- 搜索 --}} | 134 | {{!-- 搜索 --}} |
144 | {{#if searchPage}} | 135 | {{#if searchPage}} |
145 | - <script> | ||
146 | - seajs.use('js/index/search'); | ||
147 | - </script> | 136 | +<script> |
137 | + seajs.use('js/index/search'); | ||
138 | +</script> | ||
148 | {{/if}} | 139 | {{/if}} |
149 | - | ||
150 | {{!-- 购物车 --}} | 140 | {{!-- 购物车 --}} |
151 | {{#if shoppingCartPage}} | 141 | {{#if shoppingCartPage}} |
152 | - <script> | ||
153 | - seajs.use('js/shopping-cart/index'); | ||
154 | - </script> | 142 | +<script> |
143 | + seajs.use('js/shopping-cart/index'); | ||
144 | +</script> | ||
155 | {{/if}} | 145 | {{/if}} |
@@ -13,6 +13,9 @@ class BoysController extends AbstractAction | @@ -13,6 +13,9 @@ class BoysController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_BOYS); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('男生首页'); | 20 | $this->setTitle('男生首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -13,6 +13,9 @@ class GirlsController extends AbstractAction | @@ -13,6 +13,9 @@ class GirlsController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_GIRLS); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('女生首页'); | 20 | $this->setTitle('女生首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -27,7 +30,6 @@ class GirlsController extends AbstractAction | @@ -27,7 +30,6 @@ class GirlsController extends AbstractAction | ||
27 | 'maybeLike' => true, | 30 | 'maybeLike' => true, |
28 | 'content' => Index\HomeModel::getGirlsFloor() | 31 | 'content' => Index\HomeModel::getGirlsFloor() |
29 | )); | 32 | )); |
30 | - | ||
31 | } | 33 | } |
32 | 34 | ||
33 | } | 35 | } |
@@ -13,6 +13,10 @@ class IndexController extends AbstractAction | @@ -13,6 +13,10 @@ class IndexController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 先检查COOKIE是否有访问过, 有则跳转到相应的频道页 | ||
17 | + Index\HomeModel::goSwitchChannel(); | ||
18 | + | ||
19 | + // 渲染模板 | ||
16 | $this->_view->display('index', array( | 20 | $this->_view->display('index', array( |
17 | 'background' => Index\HomeModel::getBgImage() | 21 | 'background' => Index\HomeModel::getBgImage() |
18 | )); | 22 | )); |
@@ -13,6 +13,9 @@ class KidsController extends AbstractAction | @@ -13,6 +13,9 @@ class KidsController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_KIDS); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('潮童首页'); | 20 | $this->setTitle('潮童首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -27,7 +30,6 @@ class KidsController extends AbstractAction | @@ -27,7 +30,6 @@ class KidsController extends AbstractAction | ||
27 | 'maybeLike' => true, | 30 | 'maybeLike' => true, |
28 | 'content' => Index\HomeModel::getKidsFloor() | 31 | 'content' => Index\HomeModel::getKidsFloor() |
29 | )); | 32 | )); |
30 | - | ||
31 | } | 33 | } |
32 | 34 | ||
33 | } | 35 | } |
@@ -13,6 +13,9 @@ class LifestyleController extends AbstractAction | @@ -13,6 +13,9 @@ class LifestyleController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_LIFESTYLE); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('创意生活首页'); | 20 | $this->setTitle('创意生活首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -27,7 +30,6 @@ class LifestyleController extends AbstractAction | @@ -27,7 +30,6 @@ class LifestyleController extends AbstractAction | ||
27 | 'maybeLike' => true, | 30 | 'maybeLike' => true, |
28 | 'content' => Index\HomeModel::getLifestyleFloor() | 31 | 'content' => Index\HomeModel::getLifestyleFloor() |
29 | )); | 32 | )); |
30 | - | ||
31 | } | 33 | } |
32 | 34 | ||
33 | } | 35 | } |
1 | +<?php | ||
2 | + | ||
3 | +namespace Category; | ||
4 | + | ||
5 | +use LibModels\Wap\Category\BrandData; | ||
6 | +use Configs\CacheConfig; | ||
7 | +use Plugin\Helpers; | ||
8 | + | ||
9 | +/** | ||
10 | + * 品牌相关的模板数据模型 | ||
11 | + * | ||
12 | + * @name BrandModel | ||
13 | + * @package Models/Category | ||
14 | + * @copyright yoho.inc | ||
15 | + * @version 1.0 (2015-10-21 13:52:44) | ||
16 | + * @author fei.hong <fei.hong@yoho.cn> | ||
17 | + */ | ||
18 | +class BrandModel | ||
19 | +{ | ||
20 | + /* 男生频道取品牌广告及热门品牌数据的位置码 */ | ||
21 | + const CODE_TOPPOS_BOYS = 'ce6ac059493ec26241a8cbe0bfa1b17a'; | ||
22 | + /* 女生频道取品牌广告及热门品牌数据的位置码 */ | ||
23 | + const CODE_TOPPOS_GIRLS = 'dac99cdedc1f948e84c145aca561f7d2'; | ||
24 | + /* 潮童频道取品牌广告及热门品牌数据的位置码 */ | ||
25 | + const CODE_TOPPOS_KIDS = '713784f93f52bb1a7b93916b2bb15510'; | ||
26 | + /* 创意生活频道取品牌广告及热门品牌数据的位置码 */ | ||
27 | + const CODE_TOPPOS_LIFESTYLE = 'f1aa914fd23cbcda71a87de6f5416c75'; | ||
28 | + | ||
29 | + /** | ||
30 | + * 根据频道获取品牌一览数据 | ||
31 | + * | ||
32 | + * @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 | ||
33 | + * @return array | ||
34 | + */ | ||
35 | + public static function getBrandByChannel($channel) | ||
36 | + { | ||
37 | + $result = array(); | ||
38 | + $brand = array(); | ||
39 | + | ||
40 | + /* 根据频道调用接口 */ | ||
41 | + switch (intval($channel)) { | ||
42 | + case 1: // 男生 | ||
43 | + $brand = BrandData::package(self::CODE_TOPPOS_BOYS, 1); | ||
44 | + break; | ||
45 | + case 2: // 女生 | ||
46 | + $brand = BrandData::package(self::CODE_TOPPOS_GIRLS, 2); | ||
47 | + break; | ||
48 | + case 3: // 潮童 | ||
49 | + $brand = BrandData::package(self::CODE_TOPPOS_KIDS, 3); | ||
50 | + break; | ||
51 | + case 4: // 创意生活 | ||
52 | + $brand = BrandData::package(self::CODE_TOPPOS_LIFESTYLE, 4); | ||
53 | + break; | ||
54 | + } | ||
55 | + | ||
56 | + /* 顶部的轮翻广告列表 */ | ||
57 | + if (!empty($brand['brandTop'][0]['data'])) { | ||
58 | + $build = array(); | ||
59 | + foreach ($brand['brandTop'][0]['data'] as $value) { | ||
60 | + $build['url'] = Helpers::getFilterUrl($value['url']); | ||
61 | + $build['img'] = Helpers::getImageUrl($value['src'], 640, 300); | ||
62 | + $build['title'] = $value['title']; | ||
63 | + $result['bannerTop']['list'][] = $build; | ||
64 | + } | ||
65 | + } | ||
66 | + | ||
67 | + /* 顶部的热门品牌列表 */ | ||
68 | + if (!empty($brand['brandTop'][1]['data']['list'])) { | ||
69 | + $build = array(); | ||
70 | + foreach ($brand['brandTop'][1]['data']['list'] as $value) { | ||
71 | + $build['url'] = Helpers::getFilterUrl($value['url']); | ||
72 | + $build['img'] = Helpers::getImageUrl($value['src'], 144, 144); | ||
73 | + $build['name'] = $value['name']; | ||
74 | + $result['hotBrand']['list'][] = $build; | ||
75 | + } | ||
76 | + } | ||
77 | + | ||
78 | + /* 按字母'A-Z'分组的品牌列表 */ | ||
79 | + if (!empty($brand['brandList']['brands'])) { | ||
80 | + $list = array(); | ||
81 | + $build = array(); | ||
82 | + foreach ($brand['brandList']['brands'] as $char => $value) { | ||
83 | + $build['title'] = $char; | ||
84 | + $build['list'] = array(); | ||
85 | + foreach ($value as $row) { | ||
86 | + $list['name'] = $row['brand_name']; | ||
87 | + $list['isHot'] = ($row['is_hot'] === 'Y') ? true : false; | ||
88 | + $list['isNew'] = ($row['is_show_new'] === 'Y') ? true : false; | ||
89 | + $list['url'] = 'http://' . $row['brand_domain'] . '.' . OLD_DOMAIN; | ||
90 | + $build['list'][] = $list; | ||
91 | + } | ||
92 | + $result['brandList'][] = $build; | ||
93 | + } | ||
94 | + } | ||
95 | + | ||
96 | + $brand = array(); | ||
97 | + | ||
98 | + return $result; | ||
99 | + } | ||
100 | + | ||
101 | +} |
@@ -19,8 +19,8 @@ use Configs\CacheConfig; | @@ -19,8 +19,8 @@ use Configs\CacheConfig; | ||
19 | */ | 19 | */ |
20 | class HomeModel | 20 | class HomeModel |
21 | { | 21 | { |
22 | - | ||
23 | /* 频道选择页取背景图片的位置码 */ | 22 | /* 频道选择页取背景图片的位置码 */ |
23 | + | ||
24 | const CODE_BG = '7ba9118028f9b22090b57341487567eb'; | 24 | const CODE_BG = '7ba9118028f9b22090b57341487567eb'; |
25 | 25 | ||
26 | /* 男生楼层资源的位置码 */ | 26 | /* 男生楼层资源的位置码 */ |
@@ -37,6 +37,44 @@ class HomeModel | @@ -37,6 +37,44 @@ class HomeModel | ||
37 | /* 女生底部广告的位置码 */ | 37 | /* 女生底部广告的位置码 */ |
38 | const CODE_BANNER_BOTTOM_GIRLS = '8c8bd1b89a22e5895f05882e0825b493'; | 38 | const CODE_BANNER_BOTTOM_GIRLS = '8c8bd1b89a22e5895f05882e0825b493'; |
39 | 39 | ||
40 | + /* COOKIE标识访问的是男生频道 */ | ||
41 | + const COOKIE_NAME_BOYS = 'boys'; | ||
42 | + /* COOKIE标识访问的是女生频道 */ | ||
43 | + const COOKIE_NAME_GIRLS = 'girls'; | ||
44 | + /* COOKIE标识访问的是潮童频道 */ | ||
45 | + const COOKIE_NAME_KIDS = 'kids'; | ||
46 | + /* COOKIE标识访问的是创意生活频道 */ | ||
47 | + const COOKIE_NAME_LIFESTYLE = 'lifestyle'; | ||
48 | + | ||
49 | + /** | ||
50 | + * 选择频道 | ||
51 | + * | ||
52 | + * @return void | ||
53 | + */ | ||
54 | + public static function goSwitchChannel() | ||
55 | + { | ||
56 | + // 通过COOKIE检查是否已设置过首页频道时,跳转到对应的频道页 | ||
57 | + if (!empty($_COOKIE['_Channel'])) { | ||
58 | + headers_sent() || header('Location: /' . $_COOKIE['_Channel']); | ||
59 | + exit(); | ||
60 | + } | ||
61 | + // 没有Cookie时, 设置默认访问的频道 | ||
62 | + else { | ||
63 | + self::setSwitchToCookie(self::COOKIE_NAME_BOYS); | ||
64 | + } | ||
65 | + } | ||
66 | + | ||
67 | + /** | ||
68 | + * 设置选择的频道保存到浏览器COOKIE | ||
69 | + * | ||
70 | + * @param string $cookie | ||
71 | + * @return void | ||
72 | + */ | ||
73 | + public static function setSwitchToCookie($cookie) | ||
74 | + { | ||
75 | + setcookie('_Channel', $cookie, time() + 86400 * 300, '/', '.' . SITE_DOMAIN); | ||
76 | + } | ||
77 | + | ||
40 | /** | 78 | /** |
41 | * 获取频道选择页的背景图片 | 79 | * 获取频道选择页的背景图片 |
42 | * | 80 | * |
@@ -44,6 +82,8 @@ class HomeModel | @@ -44,6 +82,8 @@ class HomeModel | ||
44 | */ | 82 | */ |
45 | public static function getBgImage() | 83 | public static function getBgImage() |
46 | { | 84 | { |
85 | + $result = false; | ||
86 | + | ||
47 | if (USE_CACHE) { | 87 | if (USE_CACHE) { |
48 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 88 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
49 | $result = Cache::get(CacheConfig::KEY_ACTION_INDEX_INDEX, 'master'); | 89 | $result = Cache::get(CacheConfig::KEY_ACTION_INDEX_INDEX, 'master'); |
@@ -56,8 +96,6 @@ class HomeModel | @@ -56,8 +96,6 @@ class HomeModel | ||
56 | $banner = IndexData::getBannerStart(self::CODE_BG); | 96 | $banner = IndexData::getBannerStart(self::CODE_BG); |
57 | if (isset($banner['data'][0]['data']['list'][0]['src'])) { | 97 | if (isset($banner['data'][0]['data']['list'][0]['src'])) { |
58 | $result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 1); | 98 | $result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 1); |
59 | - } else { | ||
60 | - $result = false; | ||
61 | } | 99 | } |
62 | 100 | ||
63 | if (USE_CACHE) { | 101 | if (USE_CACHE) { |
@@ -76,9 +114,13 @@ class HomeModel | @@ -76,9 +114,13 @@ class HomeModel | ||
76 | 114 | ||
77 | /** | 115 | /** |
78 | * 获取男生首页的楼层数据 | 116 | * 获取男生首页的楼层数据 |
117 | + * | ||
118 | + * @return array | false | ||
79 | */ | 119 | */ |
80 | public static function getBoysFloor() | 120 | public static function getBoysFloor() |
81 | { | 121 | { |
122 | + $result = array(); | ||
123 | + | ||
82 | if (USE_CACHE) { | 124 | if (USE_CACHE) { |
83 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 125 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
84 | $result = Cache::get(CacheConfig::KEY_ACTION_BOYS_INDEX, 'master'); | 126 | $result = Cache::get(CacheConfig::KEY_ACTION_BOYS_INDEX, 'master'); |
@@ -103,15 +145,19 @@ class HomeModel | @@ -103,15 +145,19 @@ class HomeModel | ||
103 | Cache::set(CacheConfig::KEY_ACTION_BOYS_INDEX, $result); | 145 | Cache::set(CacheConfig::KEY_ACTION_BOYS_INDEX, $result); |
104 | } | 146 | } |
105 | } | 147 | } |
106 | - | 148 | + |
107 | return $result; | 149 | return $result; |
108 | } | 150 | } |
109 | 151 | ||
110 | /** | 152 | /** |
111 | * 获取女生首页的楼层数据 | 153 | * 获取女生首页的楼层数据 |
154 | + * | ||
155 | + * @return array | false | ||
112 | */ | 156 | */ |
113 | public static function getGirlsFloor() | 157 | public static function getGirlsFloor() |
114 | { | 158 | { |
159 | + $result = array(); | ||
160 | + | ||
115 | if (USE_CACHE) { | 161 | if (USE_CACHE) { |
116 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 162 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
117 | $result = Cache::get(CacheConfig::KEY_ACTION_GIRLS_INDEX, 'master'); | 163 | $result = Cache::get(CacheConfig::KEY_ACTION_GIRLS_INDEX, 'master'); |
@@ -136,15 +182,19 @@ class HomeModel | @@ -136,15 +182,19 @@ class HomeModel | ||
136 | Cache::set(CacheConfig::KEY_ACTION_GIRLS_INDEX, $result); | 182 | Cache::set(CacheConfig::KEY_ACTION_GIRLS_INDEX, $result); |
137 | } | 183 | } |
138 | } | 184 | } |
139 | - | 185 | + |
140 | return $result; | 186 | return $result; |
141 | } | 187 | } |
142 | 188 | ||
143 | /** | 189 | /** |
144 | * 获取潮童首页的楼层数据 | 190 | * 获取潮童首页的楼层数据 |
191 | + * | ||
192 | + * @return array | false | ||
145 | */ | 193 | */ |
146 | public static function getKidsFloor() | 194 | public static function getKidsFloor() |
147 | { | 195 | { |
196 | + $result = false; | ||
197 | + | ||
148 | if (USE_CACHE) { | 198 | if (USE_CACHE) { |
149 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 199 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
150 | $result = Cache::get(CacheConfig::KEY_ACTION_KIDS_INDEX, 'master'); | 200 | $result = Cache::get(CacheConfig::KEY_ACTION_KIDS_INDEX, 'master'); |
@@ -169,15 +219,19 @@ class HomeModel | @@ -169,15 +219,19 @@ class HomeModel | ||
169 | Cache::set(CacheConfig::KEY_ACTION_KIDS_INDEX, $result); | 219 | Cache::set(CacheConfig::KEY_ACTION_KIDS_INDEX, $result); |
170 | } | 220 | } |
171 | } | 221 | } |
172 | - | 222 | + |
173 | return $result; | 223 | return $result; |
174 | } | 224 | } |
175 | 225 | ||
176 | /** | 226 | /** |
177 | * 获取创意生活首页的楼层数据 | 227 | * 获取创意生活首页的楼层数据 |
228 | + * | ||
229 | + * @return array | false | ||
178 | */ | 230 | */ |
179 | public static function getLifestyleFloor() | 231 | public static function getLifestyleFloor() |
180 | { | 232 | { |
233 | + $result = false; | ||
234 | + | ||
181 | if (USE_CACHE) { | 235 | if (USE_CACHE) { |
182 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 236 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
183 | $result = Cache::get(CacheConfig::KEY_ACTION_LIFESTYLE_INDEX, 'master'); | 237 | $result = Cache::get(CacheConfig::KEY_ACTION_LIFESTYLE_INDEX, 'master'); |
@@ -202,7 +256,7 @@ class HomeModel | @@ -202,7 +256,7 @@ class HomeModel | ||
202 | Cache::set(CacheConfig::KEY_ACTION_LIFESTYLE_INDEX, $result); | 256 | Cache::set(CacheConfig::KEY_ACTION_LIFESTYLE_INDEX, $result); |
203 | } | 257 | } |
204 | } | 258 | } |
205 | - | 259 | + |
206 | return $result; | 260 | return $result; |
207 | } | 261 | } |
208 | 262 |
1 | <?php | 1 | <?php |
2 | use Action\AbstractAction; | 2 | use Action\AbstractAction; |
3 | -use LibModels\Wap\Category\BrandData; | ||
4 | 3 | ||
5 | /** | 4 | /** |
6 | - * 品牌 | 5 | + * 品牌相关的控制器 |
7 | */ | 6 | */ |
8 | class BrandController extends AbstractAction | 7 | class BrandController extends AbstractAction |
9 | { | 8 | { |
9 | + /** | ||
10 | + * 品牌一览 | ||
11 | + * | ||
12 | + * @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 | ||
13 | + */ | ||
10 | public function indexAction() | 14 | public function indexAction() |
11 | { | 15 | { |
12 | - // 获取品牌数据 | ||
13 | - /*$brandTopData = BrandData::getBrandTopData(); | ||
14 | - $brandsData = BrandData::getBrandsData(); | ||
15 | - | 16 | + $this->setTitle('品牌一览'); |
17 | + $this->setNavHeader('品牌一览'); | ||
18 | + | ||
19 | + /* 判断参数是否有效 */ | ||
20 | + $channel = $this->get('channel', 1); | ||
21 | + if (!is_numeric($channel) || intval($channel) > 4) { | ||
22 | + $channel = 1; | ||
23 | + } | ||
24 | + | ||
25 | + /* 获取渲染模板需要的数据 */ | ||
26 | + /*$data = Category\BrandModel::getBrandByChannel($channel); | ||
27 | + if (!is_array($data)) { | ||
28 | + $data = array(); | ||
29 | + } | ||
30 | + $data['brandPage'] = true; | ||
31 | + | ||
16 | $brandTop = array(); | 32 | $brandTop = array(); |
17 | if($brandTopData['code'] == 200) | 33 | if($brandTopData['code'] == 200) |
18 | { | 34 | { |
@@ -29,6 +45,11 @@ class BrandController extends AbstractAction | @@ -29,6 +45,11 @@ class BrandController extends AbstractAction | ||
29 | 45 | ||
30 | $data = array ( | 46 | $data = array ( |
31 | 'brandPage' => true, | 47 | 'brandPage' => true, |
48 | + 'pageHeader' => array ( | ||
49 | + 'navBack' => 'sss ', | ||
50 | + 'navHome' => 'sss ', | ||
51 | + 'navTitle' => 'sss ' | ||
52 | + ), | ||
32 | 'bannerTop' => array ( | 53 | 'bannerTop' => array ( |
33 | 'list' => array ( | 54 | 'list' => array ( |
34 | array ( | 55 | array ( |
@@ -234,6 +255,8 @@ class BrandController extends AbstractAction | @@ -234,6 +255,8 @@ class BrandController extends AbstractAction | ||
234 | 255 | ||
235 | $this->_view->assign('title', 'YOHO!有货'); | 256 | $this->_view->assign('title', 'YOHO!有货'); |
236 | //$this->_view->display('brand', compact('brands')); | 257 | //$this->_view->display('brand', compact('brands')); |
258 | + | ||
259 | + // 渲染模板 | ||
237 | $this->_view->display('index', $data); | 260 | $this->_view->display('index', $data); |
238 | } | 261 | } |
239 | } | 262 | } |
@@ -15,6 +15,7 @@ class ListController extends AbstractAction | @@ -15,6 +15,7 @@ class ListController extends AbstractAction | ||
15 | $data = array( | 15 | $data = array( |
16 | 'goodListPage' => true, | 16 | 'goodListPage' => true, |
17 | 'goodList' => array( | 17 | 'goodList' => array( |
18 | +<<<<<<< HEAD | ||
18 | ) | 19 | ) |
19 | ); | 20 | ); |
20 | 21 | ||
@@ -52,6 +53,99 @@ class ListController extends AbstractAction | @@ -52,6 +53,99 @@ class ListController extends AbstractAction | ||
52 | 'goodList' => array( | 53 | 'goodList' => array( |
53 | 'brand' => array( | 54 | 'brand' => array( |
54 | 'id' => $brand | 55 | 'id' => $brand |
56 | +======= | ||
57 | + 'search' => 'Aape', | ||
58 | + 'brandWay' => array( | ||
59 | + 'url' => 'http://aape.m.yohobuy.com/', | ||
60 | + 'name' => 'Aape', | ||
61 | + 'thumb' => 'http://img13.static.yhbimg.com/brandLogo/2015/08/26/15/02261f64c198cb4b181c5ef9e61f38f4b9.jpg?imageMogr2/thumbnail/150x70/extent/150x70/background/d2hpdGU=/position/center/quality/90' | ||
62 | + ), | ||
63 | + 'brand' => array( | ||
64 | + 'id' => 1, | ||
65 | + 'banner' => 'http://img10.static.yhbimg.com/brandBanner/2015/08/26/07/015af5d6ee626cb132cd9c436e896fae26.jpg?imageMogr2/crop/640x' | ||
66 | + ), | ||
67 | + 'new' => array( | ||
68 | + array( | ||
69 | + 'id' => 1, | ||
70 | + 'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/09/15/03/02e50b1037b45b90aa8f33ee328b18facf.jpg?imageMogr2/thumbnail/290x388/extent/290x388/background/d2hpdGU=/position/center/quality/90', | ||
71 | + 'url' => '', | ||
72 | + 'name' => 'Aape X YO’HOOD moon face YOH', | ||
73 | + 'salePrice' => 599, | ||
74 | + 'tags' => array( | ||
75 | + 'is_new' => true, | ||
76 | + 'is_discount' => true | ||
77 | + ), | ||
78 | + 'is_soon_sold_out' => true | ||
79 | + ), | ||
80 | + array( | ||
81 | + 'id' => 2, | ||
82 | + 'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/09/15/03/0101b0c3998752d02724a5512c6efcb241.jpg?imageMogr2/thumbnail/290x388/extent/290x388/background/d2hpdGU=/position/center/quality/90', | ||
83 | + 'url' => '', | ||
84 | + 'name' => 'Aape X YO’HOOD moon face YOH', | ||
85 | + 'salePrice' => 99, | ||
86 | + 'tags' => array( | ||
87 | + 'is_yohoood' => true | ||
88 | + ), | ||
89 | + 'is_soon_sold_out' => true | ||
90 | + ) | ||
91 | + ), | ||
92 | + 'filter' => array( | ||
93 | + array( | ||
94 | + 'classify' => array( | ||
95 | + array( | ||
96 | + 'title' => '性别', | ||
97 | + 'name' => '全部性别', | ||
98 | + 'default' => true, | ||
99 | + 'subs' => array( | ||
100 | + array( | ||
101 | + 'chosed' => true, | ||
102 | + 'dataId' => 0, | ||
103 | + 'name' => '全部性别' | ||
104 | + ), | ||
105 | + array( | ||
106 | + 'dataId' => 1, | ||
107 | + 'name' => '男' | ||
108 | + ), | ||
109 | + array( | ||
110 | + 'dataId' => 3, | ||
111 | + 'name' => '女' | ||
112 | + ) | ||
113 | + ) | ||
114 | + ), | ||
115 | + array( | ||
116 | + 'title' => '尺寸', | ||
117 | + 'name' => 'XL', | ||
118 | + 'subs' => array( | ||
119 | + array( | ||
120 | + 'dataId' => 0, | ||
121 | + 'name' => '全部尺寸' | ||
122 | + ), | ||
123 | + array( | ||
124 | + 'dataId' => 1, | ||
125 | + 'name' => 'S' | ||
126 | + ), | ||
127 | + array( | ||
128 | + 'dataId' => 2, | ||
129 | + 'name' => 'M' | ||
130 | + ), | ||
131 | + array( | ||
132 | + 'dataId' => 3, | ||
133 | + 'name' => 'L' | ||
134 | + ), | ||
135 | + array( | ||
136 | + 'chosed' => true, | ||
137 | + 'dataId' => 4, | ||
138 | + 'name' => 'XL' | ||
139 | + ), | ||
140 | + array( | ||
141 | + 'dataId' => 5, | ||
142 | + 'name' => 'XXL' | ||
143 | + ) | ||
144 | + ) | ||
145 | + ) | ||
146 | + ) | ||
147 | + ) | ||
148 | +>>>>>>> 4b0a4270663f76e6b242af42f29607e22ffa75e7 | ||
55 | ) | 149 | ) |
56 | ) | 150 | ) |
57 | ); | 151 | ); |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | use Yaf\Application; | 2 | use Yaf\Application; |
3 | 3 | ||
4 | define('SITE_DOMAIN', 'm.dev.yohobuy.com'); // 网站主域名 | 4 | define('SITE_DOMAIN', 'm.dev.yohobuy.com'); // 网站主域名 |
5 | +define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名 | ||
5 | define('USE_CACHE', false); // 缓存的开关 | 6 | define('USE_CACHE', false); // 缓存的开关 |
6 | define('APPLICATION_PATH', dirname(__DIR__)); | 7 | define('APPLICATION_PATH', dirname(__DIR__)); |
7 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); | 8 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | use Yaf\Application; | 2 | use Yaf\Application; |
3 | 3 | ||
4 | define('SITE_DOMAIN', 'buy.test.yoho.cn'); // 网站主域名 | 4 | define('SITE_DOMAIN', 'buy.test.yoho.cn'); // 网站主域名 |
5 | +define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名 | ||
5 | define('USE_CACHE', true); // 缓存的开关 | 6 | define('USE_CACHE', true); // 缓存的开关 |
6 | define('APPLICATION_PATH', dirname(__DIR__)); | 7 | define('APPLICATION_PATH', dirname(__DIR__)); |
7 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); | 8 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | use Yaf\Application; | 2 | use Yaf\Application; |
3 | 3 | ||
4 | define('SITE_DOMAIN', 'wap.yohobuy.com'); // 网站主域名 | 4 | define('SITE_DOMAIN', 'wap.yohobuy.com'); // 网站主域名 |
5 | +define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名 | ||
5 | define('USE_CACHE', true); // 缓存的开关 | 6 | define('USE_CACHE', true); // 缓存的开关 |
6 | define('APPLICATION_PATH', dirname(__DIR__)); | 7 | define('APPLICATION_PATH', dirname(__DIR__)); |
7 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); | 8 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); |
-
Please register or login to post a comment