Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Showing
21 changed files
with
138 additions
and
149 deletions
framework @ 75bbc3b0
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 | /** |
@@ -19,8 +20,7 @@ class ListProcess | @@ -19,8 +20,7 @@ class ListProcess | ||
19 | { | 20 | { |
20 | $result = array(); | 21 | $result = 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 ($returnFilter && isset($data['filter'])) { | 26 | if ($returnFilter && isset($data['filter'])) { |
@@ -28,7 +28,6 @@ class ListProcess | @@ -28,7 +28,6 @@ class ListProcess | ||
28 | } | 28 | } |
29 | 29 | ||
30 | return $result; | 30 | return $result; |
31 | - | ||
32 | } | 31 | } |
33 | 32 | ||
34 | /** | 33 | /** |
@@ -47,7 +46,6 @@ class ListProcess | @@ -47,7 +46,6 @@ class ListProcess | ||
47 | } | 46 | } |
48 | 47 | ||
49 | return $products; | 48 | return $products; |
50 | - | ||
51 | } | 49 | } |
52 | 50 | ||
53 | /** | 51 | /** |
@@ -60,23 +58,21 @@ class ListProcess | @@ -60,23 +58,21 @@ class ListProcess | ||
60 | public static function getFilterData($data, $gender = '1,2,3') | 58 | public static function getFilterData($data, $gender = '1,2,3') |
61 | { | 59 | { |
62 | // 过滤条件数据 | 60 | // 过滤条件数据 |
63 | - $filters = array('classify'=>array()); | 61 | + $filters = array('classify' => array()); |
64 | 62 | ||
65 | // 返回数据中有没有gender时要添加gender | 63 | // 返回数据中有没有gender时要添加gender |
66 | // $data['gender'] = array('2,3'=>'GIRLS','1,3'=>'BOYS'); | 64 | // $data['gender'] = array('2,3'=>'GIRLS','1,3'=>'BOYS'); |
67 | 65 | ||
68 | $num = 1; | 66 | $num = 1; |
69 | foreach ($data as $key => $val) { | 67 | foreach ($data as $key => $val) { |
70 | - if(empty($val)) | ||
71 | - { | 68 | + if (empty($val)) { |
72 | continue; | 69 | continue; |
73 | } | 70 | } |
74 | if (!is_callable("self::$key")) { | 71 | if (!is_callable("self::$key")) { |
75 | continue; | 72 | continue; |
76 | } | 73 | } |
77 | $build = self::$key($val, $gender); | 74 | $build = self::$key($val, $gender); |
78 | - if($num === 1) | ||
79 | - { | 75 | + if ($num === 1) { |
80 | $build['active'] = true; | 76 | $build['active'] = true; |
81 | } | 77 | } |
82 | 78 | ||
@@ -88,7 +84,6 @@ class ListProcess | @@ -88,7 +84,6 @@ class ListProcess | ||
88 | self::sortArrByField($filters['classify'], 'sort_col'); | 84 | self::sortArrByField($filters['classify'], 'sort_col'); |
89 | 85 | ||
90 | return $filters; | 86 | return $filters; |
91 | - | ||
92 | } | 87 | } |
93 | 88 | ||
94 | private static function brand($data) | 89 | private static function brand($data) |
@@ -167,7 +162,7 @@ class ListProcess | @@ -167,7 +162,7 @@ class ListProcess | ||
167 | foreach ($data as $key => $one) { | 162 | foreach ($data as $key => $one) { |
168 | $discount = array(); | 163 | $discount = array(); |
169 | $discount['dataId'] = $key; | 164 | $discount['dataId'] = $key; |
170 | - $discount['name'] = $one['name'] .'折商品'; | 165 | + $discount['name'] = $one['name'] . '折商品'; |
171 | 166 | ||
172 | $result['subs'][] = $discount; | 167 | $result['subs'][] = $discount; |
173 | } | 168 | } |
@@ -200,7 +195,9 @@ class ListProcess | @@ -200,7 +195,9 @@ class ListProcess | ||
200 | 195 | ||
201 | // 处理选中状态 | 196 | // 处理选中状态 |
202 | foreach ($result['subs'] as &$val) { | 197 | foreach ($result['subs'] as &$val) { |
203 | - $val['dataId'] === $gender && $val['chosed'] = true; | 198 | + if ($val['dataId'] === $gender) { |
199 | + $val['chosed'] = true; | ||
200 | + } | ||
204 | } | 201 | } |
205 | 202 | ||
206 | return $result; | 203 | return $result; |
@@ -222,23 +219,24 @@ class ListProcess | @@ -222,23 +219,24 @@ class ListProcess | ||
222 | ) | 219 | ) |
223 | ); | 220 | ); |
224 | 221 | ||
222 | + $category = array(); | ||
225 | foreach ($data as $one) { | 223 | foreach ($data as $one) { |
226 | - $category = array(); | 224 | + |
227 | $category['dataId'] = isset($one['relation_parameter']) ? $one['relation_parameter']['sort'] : 0; | 225 | $category['dataId'] = isset($one['relation_parameter']) ? $one['relation_parameter']['sort'] : 0; |
228 | $category['name'] = $one['category_name']; | 226 | $category['name'] = $one['category_name']; |
229 | 227 | ||
230 | - /*// 子品类(目前h5不支持二级) | ||
231 | - if(isset($one['sub'])) | ||
232 | - { | ||
233 | - $category['subs'] = array(); | ||
234 | - foreach ($one['sub'] as $single) { | ||
235 | - $subitem = array(); | ||
236 | - $subitem['dataId'] = $single['category_id']; | ||
237 | - $subitem['name'] = $single['category_name']; | 228 | + /* // 子品类(目前h5不支持二级) |
229 | + if(isset($one['sub'])) | ||
230 | + { | ||
231 | + $category['subs'] = array(); | ||
232 | + foreach ($one['sub'] as $single) { | ||
233 | + $subitem = array(); | ||
234 | + $subitem['dataId'] = $single['category_id']; | ||
235 | + $subitem['name'] = $single['category_name']; | ||
238 | 236 | ||
239 | - $category['subs'][] = $subitem; | ||
240 | - } | ||
241 | - }*/ | 237 | + $category['subs'][] = $subitem; |
238 | + } | ||
239 | + } */ | ||
242 | 240 | ||
243 | $result['subs'][] = $category; | 241 | $result['subs'][] = $category; |
244 | } | 242 | } |
@@ -262,8 +260,9 @@ class ListProcess | @@ -262,8 +260,9 @@ class ListProcess | ||
262 | ) | 260 | ) |
263 | ); | 261 | ); |
264 | 262 | ||
263 | + $price = array(); | ||
265 | foreach ($data as $key => $one) { | 264 | foreach ($data as $key => $one) { |
266 | - $price = array(); | 265 | + |
267 | $price['dataId'] = $key; | 266 | $price['dataId'] = $key; |
268 | $price['name'] = $one; | 267 | $price['name'] = $one; |
269 | 268 | ||
@@ -289,9 +288,10 @@ class ListProcess | @@ -289,9 +288,10 @@ class ListProcess | ||
289 | ) | 288 | ) |
290 | ); | 289 | ); |
291 | 290 | ||
291 | + $size = array(); | ||
292 | foreach ($data as $one) { | 292 | foreach ($data as $one) { |
293 | - $size = array(); | ||
294 | - $size['dataId'] = $one['size_id']; | 293 | + |
294 | + $size['dataId'] = $one['size_id']; | ||
295 | $size['name'] = $one['size_name']; | 295 | $size['name'] = $one['size_name']; |
296 | 296 | ||
297 | $result['subs'][] = $size; | 297 | $result['subs'][] = $size; |
@@ -307,7 +307,8 @@ class ListProcess | @@ -307,7 +307,8 @@ class ListProcess | ||
307 | * @param string $field 字段名称 | 307 | * @param string $field 字段名称 |
308 | * @param boolean $desc 时候降序排列,默认为false | 308 | * @param boolean $desc 时候降序排列,默认为false |
309 | */ | 309 | */ |
310 | - private static function sortArrByField(&$array, $field, $desc = false){ | 310 | + private static function sortArrByField(&$array, $field, $desc = false) |
311 | + { | ||
311 | $fieldArr = array(); | 312 | $fieldArr = array(); |
312 | foreach ($array as $k => $v) { | 313 | foreach ($array as $k => $v) { |
313 | $fieldArr[$k] = $v[$field]; | 314 | $fieldArr[$k] = $v[$field]; |
@@ -315,4 +316,5 @@ class ListProcess | @@ -315,4 +316,5 @@ class ListProcess | ||
315 | $sort = $desc == false ? SORT_ASC : SORT_DESC; | 316 | $sort = $desc == false ? SORT_ASC : SORT_DESC; |
316 | array_multisort($fieldArr, $sort, $array); | 317 | array_multisort($fieldArr, $sort, $array); |
317 | } | 318 | } |
319 | + | ||
318 | } | 320 | } |
@@ -201,7 +201,7 @@ class Helpers | @@ -201,7 +201,7 @@ class Helpers | ||
201 | $result['product_id'] = $productData['product_id']; | 201 | $result['product_id'] = $productData['product_id']; |
202 | $result['thumb'] = Images::getImageUrl($productData['default_images'], $width, $height); | 202 | $result['thumb'] = Images::getImageUrl($productData['default_images'], $width, $height); |
203 | $result['name'] = $productData['product_name']; | 203 | $result['name'] = $productData['product_name']; |
204 | - $result['price'] = $productData['market_price'] . '.00'; | 204 | + $result['price'] = empty($productData['market_price']) ? false : $productData['market_price'] . '.00'; |
205 | $result['salePrice'] = $productData['sales_price'] . '.00'; | 205 | $result['salePrice'] = $productData['sales_price'] . '.00'; |
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'] = SITE_MAIN . '/product/pro_' . $productData['product_id'] . '_' | 207 | $result['url'] = SITE_MAIN . '/product/pro_' . $productData['product_id'] . '_' |
@@ -7,8 +7,6 @@ var $ = require('jquery'); | @@ -7,8 +7,6 @@ var $ = require('jquery'); | ||
7 | 7 | ||
8 | var $footer = $('#yoho-footer'); | 8 | var $footer = $('#yoho-footer'); |
9 | 9 | ||
10 | -var FOOTERHEIGHT = 120; //footer height | ||
11 | - | ||
12 | function cookie(name) { | 10 | function cookie(name) { |
13 | var cookies = document.cookie, | 11 | var cookies = document.cookie, |
14 | cookieVal, | 12 | cookieVal, |
@@ -100,7 +98,7 @@ function rePosFooter() { | @@ -100,7 +98,7 @@ function rePosFooter() { | ||
100 | return; | 98 | return; |
101 | } | 99 | } |
102 | 100 | ||
103 | - if ($('body').height() < $(window).height() - FOOTERHEIGHT) { | 101 | + if ($('body').height() <= $(window).height()) { |
104 | $footer.addClass('bottom'); | 102 | $footer.addClass('bottom'); |
105 | } else { | 103 | } else { |
106 | $footer.removeClass('bottom'); | 104 | $footer.removeClass('bottom'); |
@@ -113,7 +111,7 @@ function rePosFooter() { | @@ -113,7 +111,7 @@ function rePosFooter() { | ||
113 | 111 | ||
114 | var user = getUser(); | 112 | var user = getUser(); |
115 | 113 | ||
116 | - if ($('body').height() < $(window).height() - FOOTERHEIGHT) { | 114 | + if ($('body').height() <= $(window).height()) { |
117 | $footer.addClass('bottom'); | 115 | $footer.addClass('bottom'); |
118 | } | 116 | } |
119 | 117 | ||
@@ -146,7 +144,10 @@ function rePosFooter() { | @@ -146,7 +144,10 @@ function rePosFooter() { | ||
146 | var uid = getUid(); | 144 | var uid = getUid(); |
147 | 145 | ||
148 | uid = uid === 0 ? '' : uid; | 146 | uid = uid === 0 ? '' : uid; |
149 | - window._yas(1 * new Date(), '1.0.8', 'yohobuy_m', uid, ''); | 147 | + |
148 | + if (window._yas) { | ||
149 | + window._yas(1 * new Date(), '1.0.8', 'yohobuy_m', uid, ''); | ||
150 | + } | ||
150 | }()); | 151 | }()); |
151 | 152 | ||
152 | 153 |
@@ -86,9 +86,7 @@ likeHammer.on('tap', function(e) { | @@ -86,9 +86,7 @@ likeHammer.on('tap', function(e) { | ||
86 | if (data.code === 200) { | 86 | if (data.code === 200) { |
87 | $this.toggleClass('like'); | 87 | $this.toggleClass('like'); |
88 | } else if (data.code === 400 || data.code === 412) { | 88 | } else if (data.code === 400 || data.code === 412) { |
89 | - | ||
90 | - //code:412 用户ID不正确,即未登录 | ||
91 | - tip.show('未登录'); | 89 | + location.href = data.data; //未登录跳转登录页面 |
92 | } else { | 90 | } else { |
93 | tip.show(data.message); | 91 | tip.show(data.message); |
94 | } | 92 | } |
@@ -10,6 +10,7 @@ var $ = require('jquery'), | @@ -10,6 +10,7 @@ var $ = require('jquery'), | ||
10 | $mobileWrap = $('.mobile-wrap'), | 10 | $mobileWrap = $('.mobile-wrap'), |
11 | $overlay = $('.overlay'), | 11 | $overlay = $('.overlay'), |
12 | $sideNav = $('.side-nav'), | 12 | $sideNav = $('.side-nav'), |
13 | + $subNav = $('.sub-nav'), | ||
13 | bannerSwiper, | 14 | bannerSwiper, |
14 | recommendSwiper, | 15 | recommendSwiper, |
15 | hotBrandsSwiper, | 16 | hotBrandsSwiper, |
@@ -40,7 +41,7 @@ navHammer.on('tap', function(event) { | @@ -40,7 +41,7 @@ navHammer.on('tap', function(event) { | ||
40 | //设置boy高宽,页面不能上下滑动 | 41 | //设置boy高宽,页面不能上下滑动 |
41 | $('body').css({ | 42 | $('body').css({ |
42 | height: $(window).height(), | 43 | height: $(window).height(), |
43 | - width: '100%', | 44 | + width: $(window).width(), |
44 | overflow: 'hidden' | 45 | overflow: 'hidden' |
45 | }); | 46 | }); |
46 | 47 | ||
@@ -48,8 +49,7 @@ navHammer.on('tap', function(event) { | @@ -48,8 +49,7 @@ navHammer.on('tap', function(event) { | ||
48 | return false; | 49 | return false; |
49 | }); | 50 | }); |
50 | 51 | ||
51 | -mobileWrapHammer = new Hammer($('.mobile-wrap')[0]); | ||
52 | -mobileWrapHammer.on('tap', function(e) { | 52 | +function hideSideBar() { |
53 | if ($mobileWrap.hasClass('menu-open')) { | 53 | if ($mobileWrap.hasClass('menu-open')) { |
54 | $mobileWrap.removeClass('menu-open'); | 54 | $mobileWrap.removeClass('menu-open'); |
55 | $overlay.css('opacity', 0); | 55 | $overlay.css('opacity', 0); |
@@ -62,28 +62,40 @@ mobileWrapHammer.on('tap', function(e) { | @@ -62,28 +62,40 @@ mobileWrapHammer.on('tap', function(e) { | ||
62 | setTimeout(function() { | 62 | setTimeout(function() { |
63 | $('.overlay').hide(); | 63 | $('.overlay').hide(); |
64 | }, 300); | 64 | }, 300); |
65 | - e.srcEvent.stopPropagation(); | ||
66 | - return false; | ||
67 | } | 65 | } |
66 | +} | ||
67 | + | ||
68 | +mobileWrapHammer = new Hammer($('.mobile-wrap')[0]); | ||
69 | +mobileWrapHammer.on('tap', function(e) { | ||
70 | + hideSideBar(); | ||
71 | + e.srcEvent.stopPropagation(); | ||
72 | + return false; | ||
68 | }); | 73 | }); |
69 | 74 | ||
70 | //点击一级导航,弹出二级导航 | 75 | //点击一级导航,弹出二级导航 |
71 | -$sideNav.on('touchend', 'li', function () { | 76 | +$sideNav.on('touchend', 'li', function (e) { |
72 | if ($(this).find('.sub-nav').size() > 0) { | 77 | if ($(this).find('.sub-nav').size() > 0) { |
73 | $('.sub-nav').removeClass('show'); | 78 | $('.sub-nav').removeClass('show'); |
74 | $(this).find('.sub-nav').addClass('show'); | 79 | $(this).find('.sub-nav').addClass('show'); |
75 | } | 80 | } |
76 | - return false; | 81 | + e.stopPropagation(); |
82 | + if (e.target.pathname === location.pathname) { | ||
83 | + hideSideBar(); | ||
84 | + return false; | ||
85 | + } | ||
77 | }); | 86 | }); |
78 | 87 | ||
79 | //返回一级导航,收起二级导航 | 88 | //返回一级导航,收起二级导航 |
80 | -$('.sub-nav').each(function () { | 89 | +$subNav.each(function () { |
81 | $(this).find('li').eq(0).on('touchend', function (e) { | 90 | $(this).find('li').eq(0).on('touchend', function (e) { |
82 | $('.sub-nav').removeClass('show'); | 91 | $('.sub-nav').removeClass('show'); |
92 | + e.stopPropagation(); | ||
83 | return false; | 93 | return false; |
84 | }); | 94 | }); |
85 | -}).on('touchend', function() { | ||
86 | - $('.sub-nav').find('li').removeClass('current'); | 95 | +}).on('touchend', function(e) { |
96 | + if (e.currentTarget !== e.target) { | ||
97 | + $subNav.find('li').removeClass('current'); | ||
98 | + } | ||
87 | }); | 99 | }); |
88 | 100 | ||
89 | //头部banner轮播 | 101 | //头部banner轮播 |
@@ -104,6 +104,8 @@ function initFilter(opt) { | @@ -104,6 +104,8 @@ function initFilter(opt) { | ||
104 | var $this = $(e.target), | 104 | var $this = $(e.target), |
105 | $cur; | 105 | $cur; |
106 | 106 | ||
107 | + e.preventDefault();//防止透点 | ||
108 | + | ||
107 | if ($this.closest('.filter-body').length > 0) { | 109 | if ($this.closest('.filter-body').length > 0) { |
108 | $cur = $this.closest('.sub-item'); | 110 | $cur = $this.closest('.sub-item'); |
109 | if ($cur.length > 0) { | 111 | if ($cur.length > 0) { |
@@ -401,7 +401,7 @@ if ($brandHeader.length > 0) { | @@ -401,7 +401,7 @@ if ($brandHeader.length > 0) { | ||
401 | if (data.code === 200) { | 401 | if (data.code === 200) { |
402 | $this.toggleClass('coled'); | 402 | $this.toggleClass('coled'); |
403 | } else if (data.code === 400 || data.code === 412) { | 403 | } else if (data.code === 400 || data.code === 412) { |
404 | - tip.show('未登录'); | 404 | + location.href = data.data;//未登录跳转登录页 |
405 | } else { | 405 | } else { |
406 | tip.show(data.message); | 406 | tip.show(data.message); |
407 | } | 407 | } |
@@ -72,9 +72,10 @@ | @@ -72,9 +72,10 @@ | ||
72 | height: 158rem / $pxConvertRem; | 72 | height: 158rem / $pxConvertRem; |
73 | 73 | ||
74 | .img-box { | 74 | .img-box { |
75 | + display: table-cell; | ||
76 | + vertical-align: middle; | ||
75 | width: 100%; | 77 | width: 100%; |
76 | - height: 100%; | ||
77 | - | 78 | + height: 158rem / $pxConvertRem; |
78 | } | 79 | } |
79 | } | 80 | } |
80 | } | 81 | } |
1 | .side-nav { | 1 | .side-nav { |
2 | - // display: none; | 2 | + display: block; |
3 | background: #fff; | 3 | background: #fff; |
4 | position: fixed; | 4 | position: fixed; |
5 | top: 0; | 5 | top: 0; |
6 | - right: 100rem / $pxConvertRem; | ||
7 | bottom: 0; | 6 | bottom: 0; |
8 | - left: 0; | ||
9 | - z-index: 1; | 7 | + // left: 0; |
8 | + right: 640rem / $pxConvertRem; | ||
9 | + width: 540rem / $pxConvertRem; | ||
10 | + z-index: -1; | ||
10 | overflow: hidden; | 11 | overflow: hidden; |
11 | - @include transform(translateX(-540rem / $pxConvertRem)); | ||
12 | - @include transition(all .3s ease-out); | 12 | + @include transition(right .3s); |
13 | 13 | ||
14 | ul { | 14 | ul { |
15 | background: #f0f0f0; | 15 | background: #f0f0f0; |
@@ -107,8 +107,8 @@ | @@ -107,8 +107,8 @@ | ||
107 | } | 107 | } |
108 | 108 | ||
109 | .side-nav.on { | 109 | .side-nav.on { |
110 | - // display: block; | ||
111 | - @include transform(translateX(0rem / $pxConvertRem)); | 110 | + right: 100rem / $pxConvertRem; |
111 | + z-index: 3; | ||
112 | } | 112 | } |
113 | 113 | ||
114 | .sub-nav { | 114 | .sub-nav { |
@@ -117,10 +117,9 @@ | @@ -117,10 +117,9 @@ | ||
117 | bottom: 0; | 117 | bottom: 0; |
118 | top: 0; | 118 | top: 0; |
119 | left: 0; | 119 | left: 0; |
120 | - // right: 100rem / $pxConvertRem; | ||
121 | - width: 100%; | 120 | + width: 540rem / $pxConvertRem; |
122 | background: #fff !important; | 121 | background: #fff !important; |
123 | - // z-index: 2; | 122 | + overflow: hidden; |
124 | 123 | ||
125 | @include transform(translateX(540rem / $pxConvertRem)); | 124 | @include transform(translateX(540rem / $pxConvertRem)); |
126 | @include transition(transform 0.3s); | 125 | @include transition(transform 0.3s); |
1 | .search-page { | 1 | .search-page { |
2 | .search-input { | 2 | .search-input { |
3 | position: relative; | 3 | position: relative; |
4 | - padding: 7px 46px 7px 15px; | 4 | + padding: 7px 98px 7px 15px; |
5 | background: #f8f8f8; | 5 | background: #f8f8f8; |
6 | 6 | ||
7 | .search-icon { | 7 | .search-icon { |
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | height: 30px; | 16 | height: 30px; |
17 | width: 100%; | 17 | width: 100%; |
18 | border-radius: 15px; | 18 | border-radius: 15px; |
19 | - text-indent: 26px; | 19 | + padding: 0 26px; |
20 | background: #fff; | 20 | background: #fff; |
21 | border: none; | 21 | border: none; |
22 | } | 22 | } |
@@ -41,6 +41,10 @@ | @@ -41,6 +41,10 @@ | ||
41 | .search-items { | 41 | .search-items { |
42 | padding: 20px 10px; | 42 | padding: 20px 10px; |
43 | 43 | ||
44 | + a { | ||
45 | + color: #000; | ||
46 | + } | ||
47 | + | ||
44 | h3 { | 48 | h3 { |
45 | font-size: 12px; | 49 | font-size: 12px; |
46 | margin-bottom: 10px; | 50 | margin-bottom: 10px; |
@@ -184,10 +184,19 @@ | @@ -184,10 +184,19 @@ | ||
184 | color: #999; | 184 | color: #999; |
185 | } | 185 | } |
186 | 186 | ||
187 | + .nav-txt { | ||
188 | + display: inline-block; | ||
189 | + height: 100%; | ||
190 | + box-sizing: border-box; | ||
191 | + } | ||
192 | + | ||
187 | .active > a { | 193 | .active > a { |
188 | - border-bottom: 2px solid #000; | ||
189 | color: #000; | 194 | color: #000; |
190 | 195 | ||
196 | + .nav-txt { | ||
197 | + border-bottom: 2px solid #000; | ||
198 | + } | ||
199 | + | ||
191 | .iconfont { | 200 | .iconfont { |
192 | color: #999; | 201 | color: #999; |
193 | 202 |
@@ -15,18 +15,6 @@ | @@ -15,18 +15,6 @@ | ||
15 | <div class="swiper-pagination"></div> | 15 | <div class="swiper-pagination"></div> |
16 | </div> | 16 | </div> |
17 | 17 | ||
18 | - {{# authorInfo}} | ||
19 | - <div id="author-infos" class="editor-header clearfix" data-id={{id}}> | ||
20 | - <div class="avatar"> | ||
21 | - <img src="{{avatar}}"> | ||
22 | - </div> | ||
23 | - <div class="text"> | ||
24 | - <p class="name">{{name}}</p> | ||
25 | - <p class="info">{{info}}</p> | ||
26 | - </div> | ||
27 | - </div> | ||
28 | - {{/ authorInfo}} | ||
29 | - | ||
30 | <ul id="guang-nav" class="guang-nav clearfix"> | 18 | <ul id="guang-nav" class="guang-nav clearfix"> |
31 | {{# navs}} | 19 | {{# navs}} |
32 | <li class="guang-nav-item {{#focus}}focus{{/focus}}" data-type={{typeId}}> | 20 | <li class="guang-nav-item {{#focus}}focus{{/focus}}" data-type={{typeId}}> |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="guang-list-page guang-page yoho-page"> | 2 | <div class="guang-list-page guang-page yoho-page"> |
3 | {{# guang}} | 3 | {{# guang}} |
4 | - {{# author}} | 4 | + {{# authorInfo}} |
5 | <div id="author-infos" class="editor-header clearfix" data-id={{id}}> | 5 | <div id="author-infos" class="editor-header clearfix" data-id={{id}}> |
6 | <div class="avatar"> | 6 | <div class="avatar"> |
7 | <img src="{{avatar}}"> | 7 | <img src="{{avatar}}"> |
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | <p class="info">{{info}}</p> | 11 | <p class="info">{{info}}</p> |
12 | </div> | 12 | </div> |
13 | </div> | 13 | </div> |
14 | - {{/ author}} | 14 | + {{/ authorInfo}} |
15 | 15 | ||
16 | <div id="info-list" class="info-list"> | 16 | <div id="info-list" class="info-list"> |
17 | {{# infos}} | 17 | {{# infos}} |
@@ -27,16 +27,4 @@ | @@ -27,16 +27,4 @@ | ||
27 | var s = document.getElementsByTagName("script")[0]; | 27 | var s = document.getElementsByTagName("script")[0]; |
28 | s.parentNode.insertBefore(hm, s); | 28 | s.parentNode.insertBefore(hm, s); |
29 | })(); | 29 | })(); |
30 | -</script> | ||
31 | - | ||
32 | -<script type="text/javascript"> | ||
33 | - (function(w,d,s,j,f){ | ||
34 | - w['YohoAcquisitionObject']=f; | ||
35 | - w[f]=function(){w[f].p=arguments;}; | ||
36 | - var a=d.createElement(s); | ||
37 | - var m=d.getElementsByTagName(s)[0]; | ||
38 | - a.async=1; | ||
39 | - a.src=j; | ||
40 | - m.parentNode.insertBefore(a,m); | ||
41 | - })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.8/yas.js','_yas'); | ||
42 | </script> | 30 | </script> |
@@ -20,7 +20,20 @@ | @@ -20,7 +20,20 @@ | ||
20 | <script>seajs.config({base: 'http://localhost:8000/'});</script> | 20 | <script>seajs.config({base: 'http://localhost:8000/'});</script> |
21 | {{/if}} | 21 | {{/if}} |
22 | 22 | ||
23 | -{{> layout/analysis}} | 23 | +<script type="text/javascript"> |
24 | + (function(w,d,s,j,f){ | ||
25 | + w['YohoAcquisitionObject']=f; | ||
26 | + w[f]=function(){w[f].p=arguments;}; | ||
27 | + var a=d.createElement(s); | ||
28 | + var m=d.getElementsByTagName(s)[0]; | ||
29 | + a.async=1; | ||
30 | + a.src=j; | ||
31 | + m.parentNode.insertBefore(a,m); | ||
32 | + })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.8/yas.js','_yas'); | ||
33 | +</script> | ||
34 | + | ||
24 | {{> layout/use}} | 35 | {{> layout/use}} |
36 | + | ||
37 | +{{> layout/analysis}} | ||
25 | </body> | 38 | </body> |
26 | </html> | 39 | </html> |
@@ -52,13 +52,13 @@ | @@ -52,13 +52,13 @@ | ||
52 | <ul id="list-nav" class="list-nav clearfix"> | 52 | <ul id="list-nav" class="list-nav clearfix"> |
53 | <li class="new active"> | 53 | <li class="new active"> |
54 | <a href="javascript:void(0);"> | 54 | <a href="javascript:void(0);"> |
55 | - 最新 | 55 | + <span class="nav-txt">最新</span> |
56 | <span class="iconfont cur"></span> | 56 | <span class="iconfont cur"></span> |
57 | </a> | 57 | </a> |
58 | </li> | 58 | </li> |
59 | <li class="price"> | 59 | <li class="price"> |
60 | <a href="javascript:void(0);"> | 60 | <a href="javascript:void(0);"> |
61 | - 价格 | 61 | + <span class="nav-txt">价格</span> |
62 | <span class="icon"> | 62 | <span class="icon"> |
63 | <i class="iconfont up"></i> | 63 | <i class="iconfont up"></i> |
64 | <i class="iconfont down cur"></i> | 64 | <i class="iconfont down cur"></i> |
@@ -67,7 +67,7 @@ | @@ -67,7 +67,7 @@ | ||
67 | </li> | 67 | </li> |
68 | <li class="discount"> | 68 | <li class="discount"> |
69 | <a href="javascript:void(0);"> | 69 | <a href="javascript:void(0);"> |
70 | - 折扣 | 70 | + <span class="nav-txt">折扣</span> |
71 | <span class="icon"> | 71 | <span class="icon"> |
72 | <i class="iconfont up"></i> | 72 | <i class="iconfont up"></i> |
73 | <i class="iconfont down cur"></i> | 73 | <i class="iconfont down cur"></i> |
@@ -76,7 +76,7 @@ | @@ -76,7 +76,7 @@ | ||
76 | </li> | 76 | </li> |
77 | <li class="filter"> | 77 | <li class="filter"> |
78 | <a href="javascript:void(0);"> | 78 | <a href="javascript:void(0);"> |
79 | - 筛选 | 79 | + <span class="nav-txt">筛选</span> |
80 | <span class="iconfont"></span> | 80 | <span class="iconfont"></span> |
81 | </a> | 81 | </a> |
82 | </li> | 82 | </li> |
@@ -19,7 +19,7 @@ class HomeController extends AbstractAction | @@ -19,7 +19,7 @@ class HomeController extends AbstractAction | ||
19 | public function indexAction() | 19 | public function indexAction() |
20 | { | 20 | { |
21 | // 目前跳到老站 | 21 | // 目前跳到老站 |
22 | - $this->go(OLD_MAIN . '/home'); | 22 | + // $this->go(OLD_MAIN . '/home'); |
23 | } | 23 | } |
24 | 24 | ||
25 | } | 25 | } |
@@ -123,7 +123,9 @@ class BrandModel | @@ -123,7 +123,9 @@ class BrandModel | ||
123 | $list = array(); | 123 | $list = array(); |
124 | $build = array(); | 124 | $build = array(); |
125 | foreach ($brand['data']['brands'] as $char => $value) { | 125 | foreach ($brand['data']['brands'] as $char => $value) { |
126 | + $build = array(); | ||
126 | foreach ($value as $row) { | 127 | foreach ($value as $row) { |
128 | + $list = array(); | ||
127 | $list['name'] = $row['brand_name']; | 129 | $list['name'] = $row['brand_name']; |
128 | $list['isHot'] = ($row['is_hot'] === 'Y') ? true : false; | 130 | $list['isHot'] = ($row['is_hot'] === 'Y') ? true : false; |
129 | $list['isNew'] = ($row['is_show_new'] === 'Y') ? true : false; | 131 | $list['isNew'] = ($row['is_show_new'] === 'Y') ? true : false; |
@@ -16,6 +16,6 @@ class IndexController extends AbstractAction | @@ -16,6 +16,6 @@ class IndexController extends AbstractAction | ||
16 | public function indexAction() | 16 | public function indexAction() |
17 | { | 17 | { |
18 | // 跳转到老版 | 18 | // 跳转到老版 |
19 | - $this->go(OLD_MAIN . '/cart/index/index'); | 19 | + // $this->go(OLD_MAIN . '/cart/index/index'); |
20 | } | 20 | } |
21 | } | 21 | } |
@@ -36,11 +36,11 @@ class RecomController extends AbstractAction | @@ -36,11 +36,11 @@ class RecomController extends AbstractAction | ||
36 | $gender = $this->get('gender', '1,3'); | 36 | $gender = $this->get('gender', '1,3'); |
37 | // 女 | 37 | // 女 |
38 | if ($gender === '2,3') { | 38 | if ($gender === '2,3') { |
39 | - $recom = RecomData::mayLike('2,3', 2); | 39 | + $recom = RecomData::mayLike('2,3', 2, $page); |
40 | } | 40 | } |
41 | // 男 | 41 | // 男 |
42 | else { | 42 | else { |
43 | - $recom = RecomData::mayLike('1,3', 1); | 43 | + $recom = RecomData::mayLike('1,3', 1, $page); |
44 | } | 44 | } |
45 | 45 | ||
46 | /* 判断是否有内容返回 */ | 46 | /* 判断是否有内容返回 */ |
@@ -58,10 +58,13 @@ class RecomController extends AbstractAction | @@ -58,10 +58,13 @@ class RecomController extends AbstractAction | ||
58 | foreach ($recom['data']['product_list'] as $value) { | 58 | foreach ($recom['data']['product_list'] as $value) { |
59 | $data['goods'][] = Helpers::formatProduct($value, true, true, true, 276, 366); | 59 | $data['goods'][] = Helpers::formatProduct($value, true, true, true, 276, 366); |
60 | } | 60 | } |
61 | - $this->_view->display('maylike', $data); | ||
62 | } while (false); | 61 | } while (false); |
63 | 62 | ||
64 | - echo ' '; | 63 | + if (isset($data)) { |
64 | + $this->_view->display('maylike', $data); | ||
65 | + } else { | ||
66 | + echo ' '; | ||
67 | + } | ||
65 | } | 68 | } |
66 | 69 | ||
67 | /** | 70 | /** |
@@ -100,11 +103,13 @@ class RecomController extends AbstractAction | @@ -100,11 +103,13 @@ class RecomController extends AbstractAction | ||
100 | foreach ($recom['data']['product_list'] as $value) { | 103 | foreach ($recom['data']['product_list'] as $value) { |
101 | $data['goods'][] = Helpers::formatProduct($value, true); | 104 | $data['goods'][] = Helpers::formatProduct($value, true); |
102 | } | 105 | } |
103 | - $this->_view->display('maylike', $data); | ||
104 | - | ||
105 | } while (false); | 106 | } while (false); |
106 | 107 | ||
107 | - echo ' '; | 108 | + if (isset($data)) { |
109 | + $this->_view->display('maylike', $data); | ||
110 | + } else { | ||
111 | + echo ' '; | ||
112 | + } | ||
108 | } | 113 | } |
109 | 114 | ||
110 | /** | 115 | /** |
@@ -119,23 +124,22 @@ class RecomController extends AbstractAction | @@ -119,23 +124,22 @@ class RecomController extends AbstractAction | ||
119 | if (!$this->isAjax()) { | 124 | if (!$this->isAjax()) { |
120 | break; | 125 | break; |
121 | } | 126 | } |
122 | - | 127 | + |
123 | /* 创意生活只有一页数据 */ | 128 | /* 创意生活只有一页数据 */ |
124 | $page = $this->get('page', 1); | 129 | $page = $this->get('page', 1); |
125 | if (intval($page) > 1) { | 130 | if (intval($page) > 1) { |
126 | break; | 131 | break; |
127 | - } | 132 | + } |
128 | 133 | ||
129 | /* 取可能喜欢的数据 */ | 134 | /* 取可能喜欢的数据 */ |
130 | $recom = RecomData::mayLikeLifestyle(); | 135 | $recom = RecomData::mayLikeLifestyle(); |
131 | - | 136 | + |
132 | /* 构建人气单品数据 */ | 137 | /* 构建人气单品数据 */ |
133 | if (empty($recom['top']['data']['product_list'])) { | 138 | if (empty($recom['top']['data']['product_list'])) { |
134 | break; | 139 | break; |
135 | } | 140 | } |
136 | - | 141 | + |
137 | $data = array(); | 142 | $data = array(); |
138 | - | ||
139 | $build = array(); | 143 | $build = array(); |
140 | $build['show'] = true; | 144 | $build['show'] = true; |
141 | foreach ($recom['top']['data']['product_list'] as $value) { | 145 | foreach ($recom['top']['data']['product_list'] as $value) { |
@@ -177,47 +181,13 @@ class RecomController extends AbstractAction | @@ -177,47 +181,13 @@ class RecomController extends AbstractAction | ||
177 | // } | 181 | // } |
178 | // $data['goodsContainer'][] = $build; | 182 | // $data['goodsContainer'][] = $build; |
179 | // } | 183 | // } |
180 | - | ||
181 | - $this->_view->display('maylikelife', $data); | ||
182 | - | ||
183 | } while (false); | 184 | } while (false); |
184 | 185 | ||
185 | - echo ' '; | 186 | + if (isset($data)) { |
187 | + $this->_view->display('maylikelife', $data); | ||
188 | + } else { | ||
189 | + echo ' '; | ||
190 | + } | ||
186 | } | 191 | } |
187 | 192 | ||
188 | -// /** | ||
189 | -// * 你可能喜欢的 | ||
190 | -// * | ||
191 | -// * 备注: | ||
192 | -// * 调用位于男生(BOYS),女生(GIRLS),潮童(KIDS),创意生活(LifeStyle)页面的底部. | ||
193 | -// * 调用方式为AJAX,需要用JS遍历该数据集,替换图片URL地址中的{width},{height},{mode}. | ||
194 | -// * JS替换示例: str.replace("{width}", 300).replace("{height}", 300).replace("{mode}", 2); | ||
195 | -// * | ||
196 | -// * @param string gender "1,3"表示男, "2,3"表示女, 当channel为3时该参数可不传 | ||
197 | -// * @param string channel 1表示男, 2表示女, 3表示潮童 | ||
198 | -// * @return json | ||
199 | -// */ | ||
200 | -// public function maylikeAction() | ||
201 | -// { | ||
202 | -// if ($this->isAjax()) { | ||
203 | -// $data = ''; | ||
204 | -// $gender = $this->get('gender', '1,3'); | ||
205 | -// $channel = $this->get('channel', '1'); | ||
206 | -// | ||
207 | -// switch (strval($channel)) { | ||
208 | -// case '1': // 男(Boys) | ||
209 | -// case '2': // 女(Girls) | ||
210 | -// $data = RecomData::mayLike($gender, $channel); | ||
211 | -// break; | ||
212 | -// case '3': // 潮童(Kids) | ||
213 | -// $data = RecomData::mayLikeKids(); | ||
214 | -// break; | ||
215 | -// case '4': // 创意生活(LifeStyle) | ||
216 | -// $data = RecomData::mayLikeLifestyle(); | ||
217 | -// break; | ||
218 | -// } | ||
219 | -// | ||
220 | -// $this->echoJson($data); | ||
221 | -// } | ||
222 | -// } | ||
223 | } | 193 | } |
-
Please register or login to post a comment