Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
14 changed files
with
92 additions
and
72 deletions
framework @ 75bbc3b0
@@ -56,10 +56,12 @@ var $listNav = $('#list-nav'), | @@ -56,10 +56,12 @@ var $listNav = $('#list-nav'), | ||
56 | $pre, //纪录进入筛选前的active项 | 56 | $pre, //纪录进入筛选前的active项 |
57 | searching; | 57 | searching; |
58 | 58 | ||
59 | -swiper = new Swiper('.swiper-container', { | ||
60 | - lazyLoading: true, | ||
61 | - pagination: '.swiper-pagination' | ||
62 | -}); | 59 | +if ($('.swiper-container .swiper-slide').length > 1) { |
60 | + swiper = new Swiper('.swiper-container', { | ||
61 | + lazyLoading: true, | ||
62 | + pagination: '.swiper-pagination' | ||
63 | + }); | ||
64 | +} | ||
63 | 65 | ||
64 | /** | 66 | /** |
65 | * 筛选注册的回调,筛选子项点击后逻辑 | 67 | * 筛选注册的回调,筛选子项点击后逻辑 |
@@ -132,7 +134,7 @@ function search(opt) { | @@ -132,7 +134,7 @@ function search(opt) { | ||
132 | } | 134 | } |
133 | 135 | ||
134 | //导航类别 | 136 | //导航类别 |
135 | - if ($pre === undefined || $pre.hasClass('new')) { | 137 | + if ($pre.hasClass('new')) { |
136 | navType = 'newest'; | 138 | navType = 'newest'; |
137 | } else if ($pre.hasClass('price')) { | 139 | } else if ($pre.hasClass('price')) { |
138 | navType = 'price'; | 140 | navType = 'price'; |
@@ -308,6 +310,8 @@ $(window).scroll(function() { | @@ -308,6 +310,8 @@ $(window).scroll(function() { | ||
308 | //当scroll到1/4$goodsContainer高度后继续请求下一页数据 | 310 | //当scroll到1/4$goodsContainer高度后继续请求下一页数据 |
309 | if ($(window).scrollTop() + winH > | 311 | if ($(window).scrollTop() + winH > |
310 | $(document).height() - 0.25 * $goodsContainer.height()) { | 312 | $(document).height() - 0.25 * $goodsContainer.height()) { |
311 | - search(); | 313 | + if ($pre !== undefined) { |
314 | + search(); | ||
315 | + } | ||
312 | } | 316 | } |
313 | -}); | 317 | +}); |
@@ -59,10 +59,12 @@ var $listNav = $('#list-nav'), | @@ -59,10 +59,12 @@ var $listNav = $('#list-nav'), | ||
59 | $pgc.addClass('hide'); | 59 | $pgc.addClass('hide'); |
60 | $dgc.addClass('hide'); | 60 | $dgc.addClass('hide'); |
61 | 61 | ||
62 | -swiper = new Swiper('.swiper-container', { | ||
63 | - lazyLoading: true, | ||
64 | - pagination: '.swiper-pagination' | ||
65 | -}); | 62 | +if ($('.swiper-container .swiper-slide').length > 1) { |
63 | + swiper = new Swiper('.swiper-container', { | ||
64 | + lazyLoading: true, | ||
65 | + pagination: '.swiper-pagination' | ||
66 | + }); | ||
67 | +} | ||
66 | 68 | ||
67 | /** | 69 | /** |
68 | * 筛选注册的回调,筛选子项点击后逻辑 | 70 | * 筛选注册的回调,筛选子项点击后逻辑 |
@@ -151,7 +153,7 @@ function search(opt) { | @@ -151,7 +153,7 @@ function search(opt) { | ||
151 | } | 153 | } |
152 | 154 | ||
153 | //导航类别 | 155 | //导航类别 |
154 | - if ($pre === undefined || $pre.hasClass('today')) { | 156 | + if ($pre.hasClass('today')) { |
155 | navType = 'today'; | 157 | navType = 'today'; |
156 | dayLimit = 1; | 158 | dayLimit = 1; |
157 | } else if ($pre.hasClass('week')) { | 159 | } else if ($pre.hasClass('week')) { |
@@ -270,7 +272,8 @@ $listNav.delegate('li', 'touchstart', function() { | @@ -270,7 +272,8 @@ $listNav.delegate('li', 'touchstart', function() { | ||
270 | 272 | ||
271 | nav = navInfo[navType]; | 273 | nav = navInfo[navType]; |
272 | 274 | ||
273 | - if ($this.hasClass('hide')) { | 275 | + if (!($this.hasClass('active'))) { |
276 | + | ||
274 | $active = $this.siblings('.active'); | 277 | $active = $this.siblings('.active'); |
275 | 278 | ||
276 | $pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项 | 279 | $pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项 |
@@ -314,6 +317,8 @@ $(window).scroll(function() { | @@ -314,6 +317,8 @@ $(window).scroll(function() { | ||
314 | //当scroll到1/4$goodsContainer高度后继续请求下一页数据 | 317 | //当scroll到1/4$goodsContainer高度后继续请求下一页数据 |
315 | if ($(window).scrollTop() + winH > | 318 | if ($(window).scrollTop() + winH > |
316 | $(document).height() - 0.25 * $goodsContainer.height()) { | 319 | $(document).height() - 0.25 * $goodsContainer.height()) { |
317 | - search(); | 320 | + if ($pre !== undefined) { |
321 | + search(); | ||
322 | + } | ||
318 | } | 323 | } |
319 | }); | 324 | }); |
@@ -2,31 +2,32 @@ | @@ -2,31 +2,32 @@ | ||
2 | 2 | ||
3 | .newbrand-search { | 3 | .newbrand-search { |
4 | width: 93.75%; | 4 | width: 93.75%; |
5 | - height: 30px; | ||
6 | - padding: 7px 3.125%; | 5 | + height: 60rem / $pxConvertRem; |
6 | + padding: 14rem / $pxConvertRem 3.125%; | ||
7 | background-color: #f8f8f8; | 7 | background-color: #f8f8f8; |
8 | left: 0; | 8 | left: 0; |
9 | - top: 44px; | 9 | + top: 88rem / $pxConvertRem; |
10 | position: fixed; | 10 | position: fixed; |
11 | z-index: 2; | 11 | z-index: 2; |
12 | .search-box { | 12 | .search-box { |
13 | position: relative; | 13 | position: relative; |
14 | - height: 30px; | 14 | + height: 60rem / $pxConvertRem; |
15 | background-color: #FFF; | 15 | background-color: #FFF; |
16 | - border-radius: 15px; | ||
17 | - padding: 0 16px 0 26px; | 16 | + border-radius: 30rem / $pxConvertRem; |
17 | + padding: 0 32rem / $pxConvertRem 0 52rem / $pxConvertRem; | ||
18 | 18 | ||
19 | .search-input { | 19 | .search-input { |
20 | width: 100%; | 20 | width: 100%; |
21 | - height: 30px; | 21 | + height: 60rem / $pxConvertRem; |
22 | border: 0; | 22 | border: 0; |
23 | } | 23 | } |
24 | 24 | ||
25 | .search-icon { | 25 | .search-icon { |
26 | position: absolute; | 26 | position: absolute; |
27 | - font-size: 12px; | ||
28 | - top: 16px; | ||
29 | - left: 24px; | 27 | + font-size: 24rem / $pxConvertRem; |
28 | + top: 20rem / $pxConvertRem; | ||
29 | + left: 24rem / $pxConvertRem; | ||
30 | + color: #bdbdbd; | ||
30 | } | 31 | } |
31 | 32 | ||
32 | } | 33 | } |
@@ -62,50 +63,53 @@ | @@ -62,50 +63,53 @@ | ||
62 | color: #999999; | 63 | color: #999999; |
63 | font-weight: bold; | 64 | font-weight: bold; |
64 | position: relative; | 65 | position: relative; |
65 | - | ||
66 | h2 { | 66 | h2 { |
67 | - width: 100%; | ||
68 | - height: 25px; | ||
69 | - line-height: 25px; | ||
70 | - font-size: 17px; | 67 | + // width: 100%; |
68 | + padding: 0 20rem / $pxConvertRem; | ||
69 | + height: 50rem / $pxConvertRem; | ||
70 | + line-height: 50rem / $pxConvertRem; | ||
71 | + font-size: 34rem / $pxConvertRem; | ||
71 | border-top: 1px solid #e6e6e6; | 72 | border-top: 1px solid #e6e6e6; |
72 | background-color: #f4f4f4; | 73 | background-color: #f4f4f4; |
73 | } | 74 | } |
74 | } | 75 | } |
75 | 76 | ||
76 | - p { | ||
77 | - cursor: pointer; | ||
78 | - height: 25px; | ||
79 | - padding-right: 10px; | ||
80 | - a { | ||
81 | - display: block; | ||
82 | - font-size: 17px; | ||
83 | - border-bottom: 1px solid #f3f3f3; | ||
84 | - border-top: 1px solid #f9f9f9; | ||
85 | - i { | ||
86 | - position: relative; | ||
87 | - top: 1px; | ||
88 | - color: #ff0000; | ||
89 | - padding-left: 16px; | ||
90 | - } | 77 | + p { |
78 | + cursor: pointer; | ||
79 | + // height: 50rem / $pxConvertRem; | ||
80 | + padding: 0 20rem / $pxConvertRem; | ||
81 | + a { | ||
82 | + display: block; | ||
83 | + padding-top: 10rem / $pxConvertRem; | ||
84 | + height: 76rem / $pxConvertRem; | ||
85 | + line-height: 76rem / $pxConvertRem; | ||
86 | + font-size: 34rem / $pxConvertRem; | ||
87 | + border-bottom: 1px solid #f3f3f3; | ||
88 | + border-top: 1px solid #f9f9f9; | ||
89 | + i { | ||
90 | + position: relative; | ||
91 | + top: 1px; | ||
92 | + color: #ff0000; | ||
93 | + padding-left: 32rem / $pxConvertRem; | ||
91 | } | 94 | } |
92 | } | 95 | } |
96 | + } | ||
93 | } | 97 | } |
94 | 98 | ||
95 | .right-bar { | 99 | .right-bar { |
96 | 100 | ||
97 | - width: 30px; | ||
98 | - top: 120px !important; | 101 | + width: 60rem / $pxConvertRem; |
102 | + top: 240rem / $pxConvertRem !important; | ||
99 | overflow: hidden; | 103 | overflow: hidden; |
100 | position: fixed; | 104 | position: fixed; |
101 | - right: 1px; | ||
102 | - border-radius: 6px; | 105 | + right: 2rem / $pxConvertRem; |
106 | + border-radius: 12rem / $pxConvertRem; | ||
103 | background: rgba(0,0,0,.8); | 107 | background: rgba(0,0,0,.8); |
104 | z-index: 2; | 108 | z-index: 2; |
105 | b { | 109 | b { |
106 | - height: 16px; | 110 | + height: 32rem / $pxConvertRem; |
107 | 111 | ||
108 | - line-height: 14px; | 112 | + line-height: 28rem / $pxConvertRem; |
109 | text-align: center; | 113 | text-align: center; |
110 | display: block; | 114 | display: block; |
111 | color: #999999; | 115 | color: #999999; |
@@ -114,6 +118,6 @@ | @@ -114,6 +118,6 @@ | ||
114 | } | 118 | } |
115 | 119 | ||
116 | .con { | 120 | .con { |
117 | - padding-top: 5px; | 121 | + padding-top: 10rem / $pxConvertRem; |
118 | } | 122 | } |
119 | } | 123 | } |
@@ -16,9 +16,10 @@ | @@ -16,9 +16,10 @@ | ||
16 | opacity: 0.5; | 16 | opacity: 0.5; |
17 | margin: 0 (9rem / $pxConvertRem); | 17 | margin: 0 (9rem / $pxConvertRem); |
18 | border-radius: 50%; | 18 | border-radius: 50%; |
19 | - } | ||
20 | - span.swiper-active-switch { | ||
21 | - opacity: 1; | 19 | + &.swiper-pagination-bullet-active { |
20 | + background: #fff; | ||
21 | + opacity: 1; | ||
22 | + } | ||
22 | } | 23 | } |
23 | } | 24 | } |
24 | } | 25 | } |
@@ -17,14 +17,15 @@ | @@ -17,14 +17,15 @@ | ||
17 | overflow: hidden; | 17 | overflow: hidden; |
18 | 18 | ||
19 | .brand-logo { | 19 | .brand-logo { |
20 | - width: 100%; | 20 | + display: table-cell; |
21 | + width: 3.95rem; | ||
21 | height: 128rem / $pxConvertRem; | 22 | height: 128rem / $pxConvertRem; |
22 | line-height: 128rem / $pxConvertRem; | 23 | line-height: 128rem / $pxConvertRem; |
23 | text-align: center; | 24 | text-align: center; |
24 | font-size: 0; | 25 | font-size: 0; |
26 | + vertical-align: middle; | ||
25 | 27 | ||
26 | img { | 28 | img { |
27 | - vertical-align: middle; | ||
28 | max-width: 100%; | 29 | max-width: 100%; |
29 | max-height: 100%; | 30 | max-height: 100%; |
30 | } | 31 | } |
@@ -68,13 +69,13 @@ | @@ -68,13 +69,13 @@ | ||
68 | .brands-swiper { | 69 | .brands-swiper { |
69 | background: #fff; | 70 | background: #fff; |
70 | width: 100%; | 71 | width: 100%; |
71 | - height: 140rem / $pxConvertRem; | 72 | + height: 180rem / $pxConvertRem; |
72 | margin-bottom: 28rem / $pxConvertRem; | 73 | margin-bottom: 28rem / $pxConvertRem; |
73 | overflow: hidden; | 74 | overflow: hidden; |
74 | 75 | ||
75 | .brands-list { | 76 | .brands-list { |
76 | position: relative; | 77 | position: relative; |
77 | - height: 140rem / $pxConvertRem; | 78 | + height: 180rem / $pxConvertRem; |
78 | 79 | ||
79 | li { | 80 | li { |
80 | float: left; | 81 | float: left; |
@@ -85,11 +86,12 @@ | @@ -85,11 +86,12 @@ | ||
85 | 86 | ||
86 | a { | 87 | a { |
87 | position: relative; | 88 | position: relative; |
88 | - display: block; | 89 | + display: table-cell; |
89 | width: 100%; | 90 | width: 100%; |
90 | - height: 100%; | 91 | + height: 140rem / $pxConvertRem; |
91 | line-height: 140rem / $pxConvertRem; | 92 | line-height: 140rem / $pxConvertRem; |
92 | font-size: 0; | 93 | font-size: 0; |
94 | + vertical-align: middle; | ||
93 | } | 95 | } |
94 | 96 | ||
95 | img { | 97 | img { |
@@ -102,7 +104,8 @@ | @@ -102,7 +104,8 @@ | ||
102 | position: absolute; | 104 | position: absolute; |
103 | left: 8rem / $pxConvertRem; | 105 | left: 8rem / $pxConvertRem; |
104 | right: 8rem / $pxConvertRem; | 106 | right: 8rem / $pxConvertRem; |
105 | - bottom: 8rem / $pxConvertRem; | 107 | + bottom: -32rem / $pxConvertRem; |
108 | + width: 100%; | ||
106 | height: 28rem / $pxConvertRem; | 109 | height: 28rem / $pxConvertRem; |
107 | line-height: 28rem / $pxConvertRem; | 110 | line-height: 28rem / $pxConvertRem; |
108 | text-align: center; | 111 | text-align: center; |
@@ -108,14 +108,14 @@ | @@ -108,14 +108,14 @@ | ||
108 | {{/if}} | 108 | {{/if}} |
109 | 109 | ||
110 | {{!-- 新品到着 --}} | 110 | {{!-- 新品到着 --}} |
111 | -{{#if newArrival}} | 111 | +{{#if newArrivalPage}} |
112 | <script> | 112 | <script> |
113 | seajs.use('js/product/newsale/newarrival'); | 113 | seajs.use('js/product/newsale/newarrival'); |
114 | </script> | 114 | </script> |
115 | {{/if}} | 115 | {{/if}} |
116 | 116 | ||
117 | {{!-- 折扣专区 --}} | 117 | {{!-- 折扣专区 --}} |
118 | -{{#if discount}} | 118 | +{{#if discountPage}} |
119 | <script> | 119 | <script> |
120 | seajs.use('js/product/newsale/discount'); | 120 | seajs.use('js/product/newsale/discount'); |
121 | </script> | 121 | </script> |
@@ -140,10 +140,11 @@ class DetailController extends AbstractAction | @@ -140,10 +140,11 @@ class DetailController extends AbstractAction | ||
140 | if (!empty($detail['getOtherArticle'])) { | 140 | if (!empty($detail['getOtherArticle'])) { |
141 | foreach ($detail['getOtherArticle'] as $value) { | 141 | foreach ($detail['getOtherArticle'] as $value) { |
142 | $value['url'] = '/guang/detail/index?id=' . $value['id']; | 142 | $value['url'] = '/guang/detail/index?id=' . $value['id']; |
143 | + $value['thumb'] = Helpers::getImageUrl($value['thumb'], 279, 175); | ||
143 | $data['relatedInfo'][] = $value; | 144 | $data['relatedInfo'][] = $value; |
144 | } | 145 | } |
145 | } | 146 | } |
146 | - | 147 | + |
147 | $this->_view->display('index', $data); | 148 | $this->_view->display('index', $data); |
148 | 149 | ||
149 | $detail = array(); | 150 | $detail = array(); |
@@ -79,7 +79,7 @@ class PlusstarController extends AbstractAction | @@ -79,7 +79,7 @@ class PlusstarController extends AbstractAction | ||
79 | $data['ps']['likeUrl'] = false; //"http://guang.m.yohobuy.com/plustar/brandinfo?id=285&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":285}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"701"}},"priority":"Y"}}"; | 79 | $data['ps']['likeUrl'] = false; //"http://guang.m.yohobuy.com/plustar/brandinfo?id=285&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":285}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"701"}},"priority":"Y"}}"; |
80 | $data['ps']['intro'] = empty($brandInfo['getBrandInfo']['data']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['data']['brand_intro']), array(' ' => ' ')); | 80 | $data['ps']['intro'] = empty($brandInfo['getBrandInfo']['data']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['data']['brand_intro']), array(' ' => ' ')); |
81 | $data['ps']['newArrival'] = array(); | 81 | $data['ps']['newArrival'] = array(); |
82 | - $data['ps']['newArrival']['moreUrl'] = ''; // @todo 品牌列表页面 | 82 | + $data['ps']['newArrival']['moreUrl'] = '/product/list/brand?brand='.$id; // @todo 品牌列表页面 |
83 | $data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct']; | 83 | $data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct']; |
84 | $data['ps']['infos'] = array(); | 84 | $data['ps']['infos'] = array(); |
85 | 85 |
@@ -24,7 +24,7 @@ class NewsaleController extends AbstractAction | @@ -24,7 +24,7 @@ class NewsaleController extends AbstractAction | ||
24 | $this->channelTrans($channel); | 24 | $this->channelTrans($channel); |
25 | 25 | ||
26 | $data = array(); | 26 | $data = array(); |
27 | - $data['newArrival'] = true; | 27 | + $data['newArrivalPage'] = true; |
28 | $data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel); | 28 | $data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel); |
29 | $goodsList = \Product\NewsaleModel::getNewProducts($channel, 60); | 29 | $goodsList = \Product\NewsaleModel::getNewProducts($channel, 60); |
30 | if (!empty($goodsList)) { | 30 | if (!empty($goodsList)) { |
@@ -58,7 +58,7 @@ class NewsaleController extends AbstractAction | @@ -58,7 +58,7 @@ class NewsaleController extends AbstractAction | ||
58 | $this->channelTrans($channel); | 58 | $this->channelTrans($channel); |
59 | 59 | ||
60 | $data = array(); | 60 | $data = array(); |
61 | - $data['discount'] = true; | 61 | + $data['discountPage'] = true; |
62 | $data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel); | 62 | $data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel); |
63 | $goodsList = \Product\NewsaleModel::getSaleProducts($channel, 60); | 63 | $goodsList = \Product\NewsaleModel::getSaleProducts($channel, 60); |
64 | if (!empty($goodsList)) { | 64 | if (!empty($goodsList)) { |
@@ -132,7 +132,7 @@ class NewsaleController extends AbstractAction | @@ -132,7 +132,7 @@ class NewsaleController extends AbstractAction | ||
132 | 132 | ||
133 | $data = NewsaleData::selectNewSaleProducts( | 133 | $data = NewsaleData::selectNewSaleProducts( |
134 | $gender, $brand, $sort, $color, | 134 | $gender, $brand, $sort, $color, |
135 | - $size, $price, $p_d, $channel, $dayLimit, $limit, $page | 135 | + $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order |
136 | ); | 136 | ); |
137 | $result = \Product\NewsaleModel::selectData($data); | 137 | $result = \Product\NewsaleModel::selectData($data); |
138 | 138 |
-
Please register or login to post a comment