Merge branch 'release/5.3.1' into 'gray'
search UI See merge request !82
Showing
6 changed files
with
48 additions
and
37 deletions
@@ -152,6 +152,7 @@ const index = (req, res, next) => { | @@ -152,6 +152,7 @@ const index = (req, res, next) => { | ||
152 | navTitle: title | 152 | navTitle: title |
153 | }), | 153 | }), |
154 | pageFooter: true, | 154 | pageFooter: true, |
155 | + width750: true, | ||
155 | search: { | 156 | search: { |
156 | defaultTerms: (result && result.hotTerms && result.hotTerms.defaultTerms && result.hotTerms.defaultTerms.length !== 0) ? result.hotTerms.defaultTerms[0].content : '', | 157 | defaultTerms: (result && result.hotTerms && result.hotTerms.defaultTerms && result.hotTerms.defaultTerms.length !== 0) ? result.hotTerms.defaultTerms[0].content : '', |
157 | url: helpers.urlFormat('', null, 'search'), | 158 | url: helpers.urlFormat('', null, 'search'), |
@@ -272,6 +272,11 @@ const getSearchIndex = (uid) => { | @@ -272,6 +272,11 @@ const getSearchIndex = (uid) => { | ||
272 | if (result.data.hotTerms && result.data.hotTerms.length > 10) { | 272 | if (result.data.hotTerms && result.data.hotTerms.length > 10) { |
273 | result.data.hotTerms = result.data.hotTerms.slice(0, 10); | 273 | result.data.hotTerms = result.data.hotTerms.slice(0, 10); |
274 | } | 274 | } |
275 | + | ||
276 | + if (result.data.guessTerms && result.data.guessTerms.length > 10) { | ||
277 | + result.data.guessTerms = result.data.guessTerms.slice(0, 10); | ||
278 | + } | ||
279 | + | ||
275 | return result.data; | 280 | return result.data; |
276 | } else { | 281 | } else { |
277 | logger.error('Hot Search return code is not 200'); | 282 | logger.error('Hot Search return code is not 200'); |
@@ -16,10 +16,10 @@ | @@ -16,10 +16,10 @@ | ||
16 | <div class="hot-search-new search-group clearfix"> | 16 | <div class="hot-search-new search-group clearfix"> |
17 | 17 | ||
18 | <div class="search-content new-hot"> | 18 | <div class="search-content new-hot"> |
19 | - <ul class="clearfix swiper-wrapper"> | ||
20 | - <li class="swiper-slide hot-title">热搜</li> | 19 | + <ul class="hot-content"> |
20 | + <li class="hot-title">热搜</li> | ||
21 | {{# hotTerms}} | 21 | {{# hotTerms}} |
22 | - <li class="swiper-slide hot-term"> | 22 | + <li class="hot-term"> |
23 | <a href='javascript:void(0);'>{{content}}</a> | 23 | <a href='javascript:void(0);'>{{content}}</a> |
24 | </li> | 24 | </li> |
25 | {{/ hotTerms}} | 25 | {{/ hotTerms}} |
@@ -17,21 +17,21 @@ module.exports = { | @@ -17,21 +17,21 @@ module.exports = { | ||
17 | assetUrl: '//127.0.0.1:5001', | 17 | assetUrl: '//127.0.0.1:5001', |
18 | testCode: 'yoho4946abcdef#$%&!@', | 18 | testCode: 'yoho4946abcdef#$%&!@', |
19 | domains: { | 19 | domains: { |
20 | - // api: 'http://api-test3.yohops.com:9999/', | ||
21 | - // service: 'http://service-test3.yohops.com:9999/', | ||
22 | - // liveApi: 'http://testapi.live.yohops.com:9999/', | ||
23 | - // singleApi: 'http://api-test3.yohops.com:9999/', | ||
24 | - // imSocket: 'ws://im.yohobuy.com:10240', | ||
25 | - // imCs: 'http://im.yohobuy.com/api', | ||
26 | - // imServer: 'http://im.yohobuy.com/server' | 20 | + api: 'http://api-test3.yohops.com:9999/', |
21 | + service: 'http://service-test3.yohops.com:9999/', | ||
22 | + liveApi: 'http://testapi.live.yohops.com:9999/', | ||
23 | + singleApi: 'http://api-test3.yohops.com:9999/', | ||
24 | + imSocket: 'ws://im.yohobuy.com:10240', | ||
25 | + imCs: 'http://im.yohobuy.com/api', | ||
26 | + imServer: 'http://im.yohobuy.com/server' | ||
27 | 27 | ||
28 | - api: 'http://api.yoho.cn/', | ||
29 | - service: 'http://service.yoho.cn/', | ||
30 | - liveApi: 'http://api.live.yoho.cn/', | ||
31 | - singleApi: 'http://single.yoho.cn/', | ||
32 | - imSocket: 'wss://imsocket.yohobuy.com:443', | ||
33 | - imCs: 'https://imhttp.yohobuy.com/api', | ||
34 | - imServer: 'https://imhttp.yohobuy.com/server' | 28 | + // api: 'http://api.yoho.cn/', |
29 | + // service: 'http://service.yoho.cn/', | ||
30 | + // liveApi: 'http://api.live.yoho.cn/', | ||
31 | + // singleApi: 'http://single.yoho.cn/', | ||
32 | + // imSocket: 'wss://imsocket.yohobuy.com:443', | ||
33 | + // imCs: 'https://imhttp.yohobuy.com/api', | ||
34 | + // imServer: 'https://imhttp.yohobuy.com/server' | ||
35 | }, | 35 | }, |
36 | subDomains: { | 36 | subDomains: { |
37 | host: '.m.yohobuy.com', | 37 | host: '.m.yohobuy.com', |
@@ -246,12 +246,6 @@ $search.on('touchend', function() { | @@ -246,12 +246,6 @@ $search.on('touchend', function() { | ||
246 | return false; | 246 | return false; |
247 | }); | 247 | }); |
248 | 248 | ||
249 | -navSwiper = new Swiper('.new-hot', { | ||
250 | - grabCursor: true, | ||
251 | - slidesPerView: 'auto', | ||
252 | - slideElement: 'li' | ||
253 | -}); | ||
254 | - | ||
255 | // 初始化历史搜索的内容 | 249 | // 初始化历史搜索的内容 |
256 | (function() { | 250 | (function() { |
257 | var html = '', | 251 | var html = '', |
@@ -296,4 +290,5 @@ navSwiper = new Swiper('.new-hot', { | @@ -296,4 +290,5 @@ navSwiper = new Swiper('.new-hot', { | ||
296 | } | 290 | } |
297 | 291 | ||
298 | window.rePosFooter(); | 292 | window.rePosFooter(); |
293 | + | ||
299 | }()); | 294 | }()); |
@@ -53,17 +53,17 @@ | @@ -53,17 +53,17 @@ | ||
53 | } | 53 | } |
54 | 54 | ||
55 | li { | 55 | li { |
56 | - float: left; | ||
57 | margin-right: 20px; | 56 | margin-right: 20px; |
58 | margin-bottom: 20px; | 57 | margin-bottom: 20px; |
59 | max-width: 100%; | 58 | max-width: 100%; |
60 | overflow: hidden; | 59 | overflow: hidden; |
60 | + display: inline-block; | ||
61 | } | 61 | } |
62 | 62 | ||
63 | a { | 63 | a { |
64 | display: inline-block; | 64 | display: inline-block; |
65 | height: 68px; | 65 | height: 68px; |
66 | - line-height: 68px; | 66 | + line-height: 70px; |
67 | padding: 0 20px; | 67 | padding: 0 20px; |
68 | font-size: 28px; | 68 | font-size: 28px; |
69 | background: #f8f8f8; | 69 | background: #f8f8f8; |
@@ -76,6 +76,7 @@ | @@ -76,6 +76,7 @@ | ||
76 | .search-index { | 76 | .search-index { |
77 | border-top: 1px solid #e0e0e0; | 77 | border-top: 1px solid #e0e0e0; |
78 | background: #fff; | 78 | background: #fff; |
79 | + padding: 30px; | ||
79 | } | 80 | } |
80 | 81 | ||
81 | .clear-icon { | 82 | .clear-icon { |
@@ -111,10 +112,8 @@ | @@ -111,10 +112,8 @@ | ||
111 | padding-bottom: 30px; | 112 | padding-bottom: 30px; |
112 | 113 | ||
113 | .new-hot { | 114 | .new-hot { |
114 | - overflow: hidden; | ||
115 | background: #fff; | 115 | background: #fff; |
116 | padding-bottom: 30px; | 116 | padding-bottom: 30px; |
117 | - height: 130px; | ||
118 | border-bottom: 1px solid #e0e0e0; | 117 | border-bottom: 1px solid #e0e0e0; |
119 | } | 118 | } |
120 | 119 | ||
@@ -123,16 +122,26 @@ | @@ -123,16 +122,26 @@ | ||
123 | } | 122 | } |
124 | 123 | ||
125 | .hot-title { | 124 | .hot-title { |
126 | - font-size: 32px; | 125 | + font-size: 34px; |
127 | color: #000; | 126 | color: #000; |
128 | - line-height: 130px; | ||
129 | - height: 120px; | 127 | + line-height: 76px; |
128 | + height: 80px; | ||
130 | padding-left: 30px; | 129 | padding-left: 30px; |
130 | + text-align: center; | ||
131 | + display: inline-block; | ||
131 | } | 132 | } |
132 | 133 | ||
133 | .hot-term { | 134 | .hot-term { |
134 | padding-top: 30px; | 135 | padding-top: 30px; |
135 | } | 136 | } |
137 | + | ||
138 | + .hot-content { | ||
139 | + width: 100%; | ||
140 | + overflow-x: auto; | ||
141 | + overflow-y: hidden; | ||
142 | + white-space: nowrap; | ||
143 | + height: 130px; | ||
144 | + } | ||
136 | } | 145 | } |
137 | 146 | ||
138 | .search-content-title { | 147 | .search-content-title { |
@@ -171,23 +180,24 @@ | @@ -171,23 +180,24 @@ | ||
171 | 180 | ||
172 | a { | 181 | a { |
173 | border-radius: 8px; | 182 | border-radius: 8px; |
174 | - border: 2px solid #e0e0e0; | 183 | + border: 1PX solid #e0e0e0; |
175 | background: #fff; | 184 | background: #fff; |
176 | font-size: 28px; | 185 | font-size: 28px; |
177 | width: auto; | 186 | width: auto; |
178 | } | 187 | } |
179 | } | 188 | } |
180 | 189 | ||
181 | - .history-search { | ||
182 | - padding: 30px; | 190 | + .history { |
191 | + max-height: 300px; | ||
192 | + overflow: hidden; | ||
183 | } | 193 | } |
184 | 194 | ||
185 | .want-search { | 195 | .want-search { |
186 | - padding: 30px; | 196 | + padding-top: 20px; |
187 | } | 197 | } |
188 | 198 | ||
189 | .want { | 199 | .want { |
190 | - max-height: 264px; | 200 | + max-height: 300px; |
191 | overflow: hidden; | 201 | overflow: hidden; |
192 | } | 202 | } |
193 | } | 203 | } |
@@ -302,7 +312,7 @@ | @@ -302,7 +312,7 @@ | ||
302 | a { | 312 | a { |
303 | display: block; | 313 | display: block; |
304 | height: 68px; | 314 | height: 68px; |
305 | - line-height: 68px; | 315 | + line-height: 71px; |
306 | padding: 0 20px; | 316 | padding: 0 20px; |
307 | font-size: 28px; | 317 | font-size: 28px; |
308 | background: white; | 318 | background: white; |
@@ -310,7 +320,7 @@ | @@ -310,7 +320,7 @@ | ||
310 | overflow: hidden; | 320 | overflow: hidden; |
311 | text-overflow: ellipsis; | 321 | text-overflow: ellipsis; |
312 | white-space: nowrap; | 322 | white-space: nowrap; |
313 | - border: 1px solid #b8b8b8; | 323 | + border: 1PX solid #b8b8b8; |
314 | border-radius: 0.2rem; | 324 | border-radius: 0.2rem; |
315 | } | 325 | } |
316 | 326 |
-
Please register or login to post a comment