Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Conflicts: library/Plugin/DataProcess/ListProcess.php
Showing
17 changed files
with
97 additions
and
73 deletions
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | }()); | 22 | }()); |
23 | })(document, window); | 23 | })(document, window); |
24 | </script> | 24 | </script> |
25 | -<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.css"> | 25 | +<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.css"> |
26 | </head> | 26 | </head> |
27 | <body class=passport-body> | 27 | <body class=passport-body> |
28 | <div class="back-email-page passport-page yoho-page"> | 28 | <div class="back-email-page passport-page yoho-page"> |
@@ -36,8 +36,8 @@ | @@ -36,8 +36,8 @@ | ||
36 | <span id="btn-sure" class="btn btn-sure disable row">确定</span> | 36 | <span id="btn-sure" class="btn btn-sure disable row">确定</span> |
37 | </div> | 37 | </div> |
38 | </div> | 38 | </div> |
39 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/lib.js"></script> | ||
40 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.js"></script> | 39 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/lib.js"></script> |
40 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.js"></script> | ||
41 | <script> | 41 | <script> |
42 | seajs.use('js/common'); | 42 | seajs.use('js/common'); |
43 | </script> | 43 | </script> |
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | }()); | 22 | }()); |
23 | })(document, window); | 23 | })(document, window); |
24 | </script> | 24 | </script> |
25 | -<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.css"> | 25 | +<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.css"> |
26 | </head> | 26 | </head> |
27 | <body class=passport-body> | 27 | <body class=passport-body> |
28 | <div class="login-international-page passport-page yoho-page"> | 28 | <div class="login-international-page passport-page yoho-page"> |
@@ -57,8 +57,8 @@ | @@ -57,8 +57,8 @@ | ||
57 | <span id="btn-login" class="btn btn-login disble row">登录</span> | 57 | <span id="btn-login" class="btn btn-login disble row">登录</span> |
58 | </div> | 58 | </div> |
59 | </div> | 59 | </div> |
60 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/lib.js"></script> | ||
61 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.js"></script> | 60 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/lib.js"></script> |
61 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.js"></script> | ||
62 | <script> | 62 | <script> |
63 | seajs.use('js/common'); | 63 | seajs.use('js/common'); |
64 | </script> | 64 | </script> |
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | }()); | 22 | }()); |
23 | })(document, window); | 23 | })(document, window); |
24 | </script> | 24 | </script> |
25 | -<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.css"> | 25 | +<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.css"> |
26 | </head> | 26 | </head> |
27 | <body class=passport-body> | 27 | <body class=passport-body> |
28 | <div class="back-mobile-page passport-page yoho-page"> | 28 | <div class="back-mobile-page passport-page yoho-page"> |
@@ -54,8 +54,8 @@ | @@ -54,8 +54,8 @@ | ||
54 | <span id="btn-next" class="btn btn-next disable row">下一步</span> | 54 | <span id="btn-next" class="btn btn-next disable row">下一步</span> |
55 | </div> | 55 | </div> |
56 | </div> | 56 | </div> |
57 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/lib.js"></script> | ||
58 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.js"></script> | 57 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/lib.js"></script> |
58 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.js"></script> | ||
59 | <script> | 59 | <script> |
60 | seajs.use('js/common'); | 60 | seajs.use('js/common'); |
61 | </script> | 61 | </script> |
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | }()); | 22 | }()); |
23 | })(document, window); | 23 | })(document, window); |
24 | </script> | 24 | </script> |
25 | -<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.css"> | 25 | +<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.css"> |
26 | </head> | 26 | </head> |
27 | <body class=passport-body> | 27 | <body class=passport-body> |
28 | <div class="reg-page passport-page yoho-page"> | 28 | <div class="reg-page passport-page yoho-page"> |
@@ -55,8 +55,8 @@ | @@ -55,8 +55,8 @@ | ||
55 | <p class="register-tip">YOHO!Family账号可登录YOHO!有货、YOHO!Boys、YOHO!Girls及SHOW</p> | 55 | <p class="register-tip">YOHO!Family账号可登录YOHO!有货、YOHO!Boys、YOHO!Girls及SHOW</p> |
56 | </div> | 56 | </div> |
57 | </div> | 57 | </div> |
58 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/lib.js"></script> | ||
59 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.js"></script> | 58 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/lib.js"></script> |
59 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.js"></script> | ||
60 | <script> | 60 | <script> |
61 | seajs.use('js/common'); | 61 | seajs.use('js/common'); |
62 | </script> | 62 | </script> |
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | }()); | 22 | }()); |
23 | })(document, window); | 23 | })(document, window); |
24 | </script> | 24 | </script> |
25 | -<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.css"> | 25 | +<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.css"> |
26 | </head> | 26 | </head> |
27 | <body class=passport-body> | 27 | <body class=passport-body> |
28 | <div class="login-page passport-page yoho-page"> | 28 | <div class="login-page passport-page yoho-page"> |
@@ -69,8 +69,8 @@ | @@ -69,8 +69,8 @@ | ||
69 | </ul> | 69 | </ul> |
70 | </div> | 70 | </div> |
71 | </div> | 71 | </div> |
72 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/lib.js"></script> | ||
73 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.js"></script> | 72 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/lib.js"></script> |
73 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.js"></script> | ||
74 | <script> | 74 | <script> |
75 | seajs.use('js/common'); | 75 | seajs.use('js/common'); |
76 | </script> | 76 | </script> |
@@ -112,7 +112,7 @@ class NewsaleData | @@ -112,7 +112,7 @@ class NewsaleData | ||
112 | 112 | ||
113 | $param['client_secret'] = Sign::getSign($param); | 113 | $param['client_secret'] = Sign::getSign($param); |
114 | 114 | ||
115 | - return Yohobuy::get(Yohobuy::API_URL, $param); | 115 | + return Yohobuy::get(Yohobuy::API_URL, $param, 600); // 缓存10分钟 |
116 | } | 116 | } |
117 | 117 | ||
118 | /** | 118 | /** |
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Plugin\DataProcess; | 3 | namespace Plugin\DataProcess; |
4 | + | ||
4 | use Plugin\Helpers; | 5 | use Plugin\Helpers; |
5 | 6 | ||
6 | /** | 7 | /** |
@@ -17,19 +18,16 @@ class ListProcess | @@ -17,19 +18,16 @@ class ListProcess | ||
17 | */ | 18 | */ |
18 | public static function getListData($data) | 19 | public static function getListData($data) |
19 | { | 20 | { |
20 | - $result = array('new'=>array(), 'filter'=>array()); | 21 | + $result = array('new' => array(), 'filter' => array()); |
21 | 22 | ||
22 | - if(isset($data['product_list'])) | ||
23 | - { | 23 | + if (isset($data['product_list'])) { |
24 | $result['new'] = self::getProductData($data['product_list']); | 24 | $result['new'] = self::getProductData($data['product_list']); |
25 | } | 25 | } |
26 | - if(isset($data['filter'])) | ||
27 | - { | 26 | + if (isset($data['filter'])) { |
28 | $result['filter'] = self::getFilterData($data['filter']); | 27 | $result['filter'] = self::getFilterData($data['filter']); |
29 | } | 28 | } |
30 | 29 | ||
31 | return $result; | 30 | return $result; |
32 | - | ||
33 | } | 31 | } |
34 | 32 | ||
35 | /** | 33 | /** |
@@ -43,13 +41,11 @@ class ListProcess | @@ -43,13 +41,11 @@ class ListProcess | ||
43 | // 处理商品 | 41 | // 处理商品 |
44 | $products = array(); | 42 | $products = array(); |
45 | 43 | ||
46 | - foreach ($data as $value) | ||
47 | - { | 44 | + foreach ($data as $value) { |
48 | $products[] = Helpers::formatProduct($value, true, true, true, true); | 45 | $products[] = Helpers::formatProduct($value, true, true, true, true); |
49 | } | 46 | } |
50 | 47 | ||
51 | return $products; | 48 | return $products; |
52 | - | ||
53 | } | 49 | } |
54 | 50 | ||
55 | /** | 51 | /** |
@@ -62,12 +58,12 @@ class ListProcess | @@ -62,12 +58,12 @@ class ListProcess | ||
62 | public static function getFilterData($data, $gender = 0) | 58 | public static function getFilterData($data, $gender = 0) |
63 | { | 59 | { |
64 | // 过滤条件数据 | 60 | // 过滤条件数据 |
65 | - $filters = array('classify'=>array()); | 61 | + $filters = array('classify' => array()); |
66 | 62 | ||
67 | $num = 1; | 63 | $num = 1; |
64 | + $build = array(); | ||
68 | foreach ($data as $key => $val) { | 65 | foreach ($data as $key => $val) { |
69 | - if(empty($val)) | ||
70 | - { | 66 | + if (empty($val)) { |
71 | continue; | 67 | continue; |
72 | } | 68 | } |
73 | if (!is_callable("self::$key")) { | 69 | if (!is_callable("self::$key")) { |
@@ -79,7 +75,7 @@ class ListProcess | @@ -79,7 +75,7 @@ class ListProcess | ||
79 | $build['active'] = true; | 75 | $build['active'] = true; |
80 | } | 76 | } |
81 | 77 | ||
82 | - $num++; | 78 | + $num ++; |
83 | $filters['classify'][] = $build; | 79 | $filters['classify'][] = $build; |
84 | } | 80 | } |
85 | 81 | ||
@@ -87,7 +83,6 @@ class ListProcess | @@ -87,7 +83,6 @@ class ListProcess | ||
87 | self::sortArrByField($filters['classify'], 'sort_col'); | 83 | self::sortArrByField($filters['classify'], 'sort_col'); |
88 | 84 | ||
89 | return $filters; | 85 | return $filters; |
90 | - | ||
91 | } | 86 | } |
92 | 87 | ||
93 | private static function brand($data) | 88 | private static function brand($data) |
@@ -166,7 +161,7 @@ class ListProcess | @@ -166,7 +161,7 @@ class ListProcess | ||
166 | foreach ($data as $key => $one) { | 161 | foreach ($data as $key => $one) { |
167 | $discount = array(); | 162 | $discount = array(); |
168 | $discount['dataId'] = $key; | 163 | $discount['dataId'] = $key; |
169 | - $discount['name'] = $one['name'] .'折商品'; | 164 | + $discount['name'] = $one['name'] . '折商品'; |
170 | 165 | ||
171 | $result['subs'][] = $discount; | 166 | $result['subs'][] = $discount; |
172 | } | 167 | } |
@@ -226,18 +221,18 @@ class ListProcess | @@ -226,18 +221,18 @@ class ListProcess | ||
226 | $category['dataId'] = isset($one['relation_parameter']) ? $one['relation_parameter']['sort'] : 0; | 221 | $category['dataId'] = isset($one['relation_parameter']) ? $one['relation_parameter']['sort'] : 0; |
227 | $category['name'] = $one['category_name']; | 222 | $category['name'] = $one['category_name']; |
228 | 223 | ||
229 | - /*// 子品类(目前h5不支持二级) | ||
230 | - if(isset($one['sub'])) | ||
231 | - { | ||
232 | - $category['subs'] = array(); | ||
233 | - foreach ($one['sub'] as $single) { | ||
234 | - $subitem = array(); | ||
235 | - $subitem['dataId'] = $single['category_id']; | ||
236 | - $subitem['name'] = $single['category_name']; | 224 | + /* // 子品类(目前h5不支持二级) |
225 | + if(isset($one['sub'])) | ||
226 | + { | ||
227 | + $category['subs'] = array(); | ||
228 | + foreach ($one['sub'] as $single) { | ||
229 | + $subitem = array(); | ||
230 | + $subitem['dataId'] = $single['category_id']; | ||
231 | + $subitem['name'] = $single['category_name']; | ||
237 | 232 | ||
238 | - $category['subs'][] = $subitem; | ||
239 | - } | ||
240 | - }*/ | 233 | + $category['subs'][] = $subitem; |
234 | + } | ||
235 | + } */ | ||
241 | 236 | ||
242 | $result['subs'][] = $category; | 237 | $result['subs'][] = $category; |
243 | } | 238 | } |
@@ -290,7 +285,7 @@ class ListProcess | @@ -290,7 +285,7 @@ class ListProcess | ||
290 | 285 | ||
291 | foreach ($data as $one) { | 286 | foreach ($data as $one) { |
292 | $size = array(); | 287 | $size = array(); |
293 | - $size['dataId'] = $one['size_id']; | 288 | + $size['dataId'] = $one['size_id']; |
294 | $size['name'] = $one['size_name']; | 289 | $size['name'] = $one['size_name']; |
295 | 290 | ||
296 | $result['subs'][] = $size; | 291 | $result['subs'][] = $size; |
@@ -306,7 +301,8 @@ class ListProcess | @@ -306,7 +301,8 @@ class ListProcess | ||
306 | * @param string $field 字段名称 | 301 | * @param string $field 字段名称 |
307 | * @param boolean $desc 时候降序排列,默认为false | 302 | * @param boolean $desc 时候降序排列,默认为false |
308 | */ | 303 | */ |
309 | - private static function sortArrByField(&$array, $field, $desc = false){ | 304 | + private static function sortArrByField(&$array, $field, $desc = false) |
305 | + { | ||
310 | $fieldArr = array(); | 306 | $fieldArr = array(); |
311 | foreach ($array as $k => $v) { | 307 | foreach ($array as $k => $v) { |
312 | $fieldArr[$k] = $v[$field]; | 308 | $fieldArr[$k] = $v[$field]; |
@@ -314,4 +310,5 @@ class ListProcess | @@ -314,4 +310,5 @@ class ListProcess | ||
314 | $sort = $desc == false ? SORT_ASC : SORT_DESC; | 310 | $sort = $desc == false ? SORT_ASC : SORT_DESC; |
315 | array_multisort($fieldArr, $sort, $array); | 311 | array_multisort($fieldArr, $sort, $array); |
316 | } | 312 | } |
313 | + | ||
317 | } | 314 | } |
@@ -43,8 +43,7 @@ class NewSaleProcess | @@ -43,8 +43,7 @@ class NewSaleProcess | ||
43 | // 处理商品 | 43 | // 处理商品 |
44 | if (isset($products['product_list'])) { | 44 | if (isset($products['product_list'])) { |
45 | foreach ($products['product_list'] as $single) { | 45 | foreach ($products['product_list'] as $single) { |
46 | - | ||
47 | - $result['goods'][] = Helpers::formatProduct($single, true, false, false); | 46 | + $result['goods'][] = Helpers::formatProduct($single, true, false, false, 290, 388); |
48 | } | 47 | } |
49 | } | 48 | } |
50 | 49 |
@@ -204,7 +204,7 @@ class Helpers | @@ -204,7 +204,7 @@ class Helpers | ||
204 | $result['price'] = $productData['market_price']; | 204 | $result['price'] = $productData['market_price']; |
205 | $result['salePrice'] = $productData['sales_price']; | 205 | $result['salePrice'] = $productData['sales_price']; |
206 | $result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y'); | 206 | $result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y'); |
207 | - $result['url'] = OLD_MAIN . '/product/pro_' . $productData['product_id'] . '_' | 207 | + $result['url'] = SITE_MAIN . '/product/pro_' . $productData['product_id'] . '_' |
208 | . $productData['goods_list'][0]['goods_id'] | 208 | . $productData['goods_list'][0]['goods_id'] |
209 | . '/' . $productData['cn_alphabet'] . '.html'; | 209 | . '/' . $productData['cn_alphabet'] . '.html'; |
210 | 210 |
@@ -201,6 +201,14 @@ server | @@ -201,6 +201,14 @@ server | ||
201 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 201 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
202 | proxy_set_header Accept-Encoding "gzip"; | 202 | proxy_set_header Accept-Encoding "gzip"; |
203 | } | 203 | } |
204 | + location ^~ /plustar { | ||
205 | + proxy_redirect off; | ||
206 | + proxy_pass http://yohobuy; | ||
207 | + proxy_set_header Host $host; | ||
208 | + proxy_set_header X-Real-IP $remote_addr; | ||
209 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
210 | + proxy_set_header Accept-Encoding "gzip"; | ||
211 | + } | ||
204 | 212 | ||
205 | # 搜索相关 | 213 | # 搜索相关 |
206 | location ^~ /search { | 214 | location ^~ /search { |
@@ -211,6 +219,14 @@ server | @@ -211,6 +219,14 @@ server | ||
211 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 219 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
212 | proxy_set_header Accept-Encoding "gzip"; | 220 | proxy_set_header Accept-Encoding "gzip"; |
213 | } | 221 | } |
222 | + location ^~ /index/search { | ||
223 | + proxy_redirect off; | ||
224 | + proxy_pass http://yohobuy; | ||
225 | + proxy_set_header Host $host; | ||
226 | + proxy_set_header X-Real-IP $remote_addr; | ||
227 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
228 | + proxy_set_header Accept-Encoding "gzip"; | ||
229 | + } | ||
214 | 230 | ||
215 | # 其它访问都跳到老版 | 231 | # 其它访问都跳到老版 |
216 | location / { | 232 | location / { |
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | <div class="trend-coll-tail"> | 10 | <div class="trend-coll-tail"> |
11 | <h3 class="recommend-title">推荐搭配</h3> | 11 | <h3 class="recommend-title">推荐搭配</h3> |
12 | <div class="recommend-swiper"> | 12 | <div class="recommend-swiper"> |
13 | - <ul class="recommend-list clearfix"> | 13 | + <ul class="recommend-list swiper-wrapper clearfix"> |
14 | {{# recommend_collocation}} | 14 | {{# recommend_collocation}} |
15 | <li class="recommend-item swiper-slide"><a href="{{url}}"><img class="img" 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}} |
@@ -149,6 +149,9 @@ class SearchController extends AbstractAction | @@ -149,6 +149,9 @@ class SearchController extends AbstractAction | ||
149 | $this->setTitle('搜索'); | 149 | $this->setTitle('搜索'); |
150 | $this->setNavHeader('搜索', true, SITE_MAIN); | 150 | $this->setNavHeader('搜索', true, SITE_MAIN); |
151 | } | 151 | } |
152 | + | ||
153 | + // 右下角的购物车链接 | ||
154 | + $data['goodList']['cartUrl'] = Helpers::url('/cart/index/index', null); | ||
152 | 155 | ||
153 | // // 查询数据 | 156 | // // 查询数据 |
154 | // if (!isset($condition['query'])) { | 157 | // if (!isset($condition['query'])) { |
@@ -46,7 +46,6 @@ class NewsaleModel | @@ -46,7 +46,6 @@ class NewsaleModel | ||
46 | switch (intval($channel)) { | 46 | switch (intval($channel)) { |
47 | case 1: // 男生 | 47 | case 1: // 男生 |
48 | $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_BOYS, self::CODE_TOP_NEW_BOYS); | 48 | $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_BOYS, self::CODE_TOP_NEW_BOYS); |
49 | - | ||
50 | break; | 49 | break; |
51 | case 2: // 女生 | 50 | case 2: // 女生 |
52 | $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_GIRLS, self::CODE_TOP_NEW_GIRLS); | 51 | $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_GIRLS, self::CODE_TOP_NEW_GIRLS); |
@@ -214,7 +213,7 @@ class NewsaleModel | @@ -214,7 +213,7 @@ class NewsaleModel | ||
214 | 213 | ||
215 | if (isset($data['code']) && $data['code'] === 200) { | 214 | if (isset($data['code']) && $data['code'] === 200) { |
216 | foreach ($data['data']['product_list'] as $val) { | 215 | foreach ($data['data']['product_list'] as $val) { |
217 | - $result['goods'][] = Helpers::formatProduct($val, true, false, false); | 216 | + $result['goods'][] = Helpers::formatProduct($val, true, false, false, 299,388); |
218 | } | 217 | } |
219 | } | 218 | } |
220 | 219 |
@@ -25,7 +25,7 @@ class ClassController extends AbstractAction | @@ -25,7 +25,7 @@ class ClassController extends AbstractAction | ||
25 | 'showDownloadApp' => true, | 25 | 'showDownloadApp' => true, |
26 | 'category' => array( | 26 | 'category' => array( |
27 | 'class' => $classes, | 27 | 'class' => $classes, |
28 | - 'searchUrl' => Helpers::url('/search.html', null, 'search'), | 28 | + 'searchUrl' => Helpers::url('/search', null, 'search'), |
29 | ) | 29 | ) |
30 | ); | 30 | ); |
31 | 31 |
@@ -51,6 +51,10 @@ class IndexController extends AbstractAction | @@ -51,6 +51,10 @@ class IndexController extends AbstractAction | ||
51 | $this->setTitle($name); | 51 | $this->setTitle($name); |
52 | $this->setNavHeader($name, true, SITE_MAIN); | 52 | $this->setNavHeader($name, true, SITE_MAIN); |
53 | 53 | ||
54 | + $goodList = array(); | ||
55 | + $goodList['cartUrl'] = Helpers::url('/cart/index/index', null); | ||
56 | + $goodList += $condition; | ||
57 | + | ||
54 | // $goodList = Product\ListModel::getClassData($condition); | 58 | // $goodList = Product\ListModel::getClassData($condition); |
55 | // if (!empty($condition) && !empty($goodList)) { | 59 | // if (!empty($condition) && !empty($goodList)) { |
56 | // $goodList = array_merge($goodList, $condition); | 60 | // $goodList = array_merge($goodList, $condition); |
@@ -58,8 +62,8 @@ class IndexController extends AbstractAction | @@ -58,8 +62,8 @@ class IndexController extends AbstractAction | ||
58 | $this->_view->display('index', array( | 62 | $this->_view->display('index', array( |
59 | 'goodListPage' => true, | 63 | 'goodListPage' => true, |
60 | 'showDownloadApp' => true, | 64 | 'showDownloadApp' => true, |
61 | - 'goodList' => $condition, | ||
62 | - 'pageFooter' => true, | 65 | + 'goodList' => $goodList, |
66 | + 'pageFooter' => true, | ||
63 | )); | 67 | )); |
64 | } | 68 | } |
65 | 69 | ||
@@ -84,8 +88,9 @@ class IndexController extends AbstractAction | @@ -84,8 +88,9 @@ class IndexController extends AbstractAction | ||
84 | /* 通过品牌域名找到对应的品牌ID */ | 88 | /* 通过品牌域名找到对应的品牌ID */ |
85 | $domainList = Product\ListModel::getAllBrandDomains(); | 89 | $domainList = Product\ListModel::getAllBrandDomains(); |
86 | $brandIds = array_keys($domainList, $domain); | 90 | $brandIds = array_keys($domainList, $domain); |
87 | - if (!isset($brandIds[0])) { | ||
88 | - $this->go(SITE_MAIN); | 91 | + $brandId = 0; |
92 | + if (isset($brandIds[0])) { | ||
93 | + $brandId = $brandIds[0]; | ||
89 | } | 94 | } |
90 | 95 | ||
91 | // 当前的登录用户UID | 96 | // 当前的登录用户UID |
@@ -108,8 +113,8 @@ class IndexController extends AbstractAction | @@ -108,8 +113,8 @@ class IndexController extends AbstractAction | ||
108 | 'discount' => FILTER_VALIDATE_INT, | 113 | 'discount' => FILTER_VALIDATE_INT, |
109 | 'gender' => FILTER_DEFAULT, | 114 | 'gender' => FILTER_DEFAULT, |
110 | 'p_d' => FILTER_DEFAULT,), false); | 115 | 'p_d' => FILTER_DEFAULT,), false); |
111 | - $condition['brand'] = $brandIds[0]; | ||
112 | - | 116 | + $condition['brand'] = $brandId; |
117 | + | ||
113 | if (isset($condition['gender'])) { | 118 | if (isset($condition['gender'])) { |
114 | $condition['gender'] = rawurldecode($condition['gender']); | 119 | $condition['gender'] = rawurldecode($condition['gender']); |
115 | } | 120 | } |
@@ -120,15 +125,18 @@ class IndexController extends AbstractAction | @@ -120,15 +125,18 @@ class IndexController extends AbstractAction | ||
120 | // 从搜索页过来的,显示搜索框, 和进入品牌引导信息 | 125 | // 从搜索页过来的,显示搜索框, 和进入品牌引导信息 |
121 | if ($from === 'search') { | 126 | if ($from === 'search') { |
122 | $data['goodList'] = array(); | 127 | $data['goodList'] = array(); |
123 | - $data['goodList']['brandWay'] = \Product\ListModel::getBrandLogoByIds($brandIds[0], $title); | 128 | + $data['goodList']['brandWay'] = \Product\ListModel::getBrandLogoByIds($brandId, $title); |
124 | $data['goodList']['search']['default'] = $query; | 129 | $data['goodList']['search']['default'] = $query; |
125 | $data['goodList']['search']['url'] = Helpers::url('', null, 'search'); | 130 | $data['goodList']['search']['url'] = Helpers::url('', null, 'search'); |
126 | } | 131 | } |
127 | // 品牌一览过来的展示品牌介绍和LOGO | 132 | // 品牌一览过来的展示品牌介绍和LOGO |
128 | else { | 133 | else { |
129 | - $data['brandHome'] = \Product\ListModel::getBrandIntro($brandIds[0], $uid, $title); | 134 | + $data['brandHome'] = \Product\ListModel::getBrandIntro($brandId, $uid, $title); |
130 | $data['goodList'] = array(); | 135 | $data['goodList'] = array(); |
131 | } | 136 | } |
137 | + | ||
138 | + // 右下角的购物车链接 | ||
139 | + $data['goodList']['cartUrl'] = Helpers::url('/cart/index/index', null); | ||
132 | $data['goodList'] += $condition; | 140 | $data['goodList'] += $condition; |
133 | $data['pageFooter'] = true; | 141 | $data['pageFooter'] = true; |
134 | 142 |
@@ -33,7 +33,8 @@ class NewsaleController extends AbstractAction | @@ -33,7 +33,8 @@ class NewsaleController extends AbstractAction | ||
33 | 'price' => '0', | 33 | 'price' => '0', |
34 | 'size' => '0', | 34 | 'size' => '0', |
35 | 'dayLimit' => 1, | 35 | 'dayLimit' => 1, |
36 | - 'discount' => '' | 36 | + 'discount' => '', |
37 | + 'goodList' => array('cartUrl' => Helpers::url('/cart/index/index', null)), | ||
37 | ); | 38 | ); |
38 | 39 | ||
39 | $this->_view->display('new', $data); | 40 | $this->_view->display('new', $data); |
@@ -61,7 +62,8 @@ class NewsaleController extends AbstractAction | @@ -61,7 +62,8 @@ class NewsaleController extends AbstractAction | ||
61 | 'gender' => Helpers::getGenderByCookie(), | 62 | 'gender' => Helpers::getGenderByCookie(), |
62 | 'price' => '0', | 63 | 'price' => '0', |
63 | 'size' => '0', | 64 | 'size' => '0', |
64 | - 'discount' => '0.1,0.9' | 65 | + 'discount' => '0.1,0.9', |
66 | + 'goodList' => array('cartUrl' => Helpers::url('/cart/index/index', null)), | ||
65 | ); | 67 | ); |
66 | 68 | ||
67 | $this->_view->display('sale', $data); | 69 | $this->_view->display('sale', $data); |
@@ -97,7 +99,7 @@ class NewsaleController extends AbstractAction | @@ -97,7 +99,7 @@ class NewsaleController extends AbstractAction | ||
97 | $channel = Helpers::getChannelByCookie(); | 99 | $channel = Helpers::getChannelByCookie(); |
98 | 100 | ||
99 | $data = NewsaleData::selectNewSaleProducts( | 101 | $data = NewsaleData::selectNewSaleProducts( |
100 | - $gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order | 102 | + $gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order |
101 | ); | 103 | ); |
102 | $result = \Product\NewsaleModel::selectData($data); | 104 | $result = \Product\NewsaleModel::selectData($data); |
103 | } | 105 | } |
@@ -63,17 +63,17 @@ routes.cate.route.action = Index | @@ -63,17 +63,17 @@ routes.cate.route.action = Index | ||
63 | 63 | ||
64 | ; 品牌一览 | 64 | ; 品牌一览 |
65 | routes.brands.type = "rewrite" | 65 | routes.brands.type = "rewrite" |
66 | -routes.brands.match = "/brands" | 66 | +routes.brands.match = "/brands$" |
67 | routes.brands.route.module = Category | 67 | routes.brands.route.module = Category |
68 | routes.brands.route.controller = Brand | 68 | routes.brands.route.controller = Brand |
69 | routes.brands.route.action = Index | 69 | routes.brands.route.action = Index |
70 | 70 | ||
71 | ; 品牌一览搜索页 | 71 | ; 品牌一览搜索页 |
72 | -routes.brands.type = "rewrite" | ||
73 | -routes.brands.match = "/brands/search" | ||
74 | -routes.brands.route.module = Category | ||
75 | -routes.brands.route.controller = Brand | ||
76 | -routes.brands.route.action = Search | 72 | +routes.brandsearch.type = "rewrite" |
73 | +routes.brandsearch.match = "/brands/search" | ||
74 | +routes.brandsearch.route.module = Category | ||
75 | +routes.brandsearch.route.controller = Brand | ||
76 | +routes.brandsearch.route.action = Search | ||
77 | 77 | ||
78 | ; 新品到着(NEW) | 78 | ; 新品到着(NEW) |
79 | routes.productnew.type = "rewrite" | 79 | routes.productnew.type = "rewrite" |
@@ -104,10 +104,10 @@ routes.goodsfilter.route.controller = Search | @@ -104,10 +104,10 @@ routes.goodsfilter.route.controller = Search | ||
104 | routes.goodsfilter.route.action = Filter | 104 | routes.goodsfilter.route.action = Filter |
105 | 105 | ||
106 | ; 品牌搜索 | 106 | ; 品牌搜索 |
107 | -routes.productnew.type = "rewrite" | ||
108 | -routes.productnew.match = "/brands/search$" | ||
109 | -routes.productnew.route.module = Category | ||
110 | -routes.productnew.route.controller = Brand | ||
111 | -routes.productnew.route.action = Search | 107 | +routes.brandsearch.type = "rewrite" |
108 | +routes.brandsearch.match = "/brands/search$" | ||
109 | +routes.brandsearch.route.module = Category | ||
110 | +routes.brandsearch.route.controller = Brand | ||
111 | +routes.brandsearch.route.action = Search | ||
112 | 112 | ||
113 | 113 |
-
Please register or login to post a comment