Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhangxiaoru
8 years ago
Commit
4c3728538d4ef4a571a3667367ffefddc832df39
1 parent
0d1573ca
search 调整
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
35 deletions
apps/product/controllers/search.js
apps/product/models/search.js
apps/product/views/action/search/index.hbs
config/common.js
public/js/product/search/index.js
public/scss/product/search/_search.css
apps/product/controllers/search.js
View file @
4c37285
...
...
@@ -152,6 +152,7 @@ const index = (req, res, next) => {
navTitle
:
title
}),
pageFooter
:
true
,
width750
:
true
,
search
:
{
defaultTerms
:
(
result
&&
result
.
hotTerms
&&
result
.
hotTerms
.
defaultTerms
&&
result
.
hotTerms
.
defaultTerms
.
length
!==
0
)
?
result
.
hotTerms
.
defaultTerms
[
0
].
content
:
''
,
url
:
helpers
.
urlFormat
(
''
,
null
,
'search'
),
...
...
apps/product/models/search.js
View file @
4c37285
...
...
@@ -272,6 +272,11 @@ const getSearchIndex = (uid) => {
if
(
result
.
data
.
hotTerms
&&
result
.
data
.
hotTerms
.
length
>
10
)
{
result
.
data
.
hotTerms
=
result
.
data
.
hotTerms
.
slice
(
0
,
10
);
}
if
(
result
.
data
.
guessTerms
&&
result
.
data
.
guessTerms
.
length
>
10
)
{
result
.
data
.
guessTerms
=
result
.
data
.
guessTerms
.
slice
(
0
,
10
);
}
return
result
.
data
;
}
else
{
logger
.
error
(
'Hot Search return code is not 200'
);
...
...
apps/product/views/action/search/index.hbs
View file @
4c37285
...
...
@@ -16,10 +16,10 @@
<div
class=
"hot-search-new search-group clearfix"
>
<div
class=
"search-content new-hot"
>
<ul
class=
"clearfix swiper-wrapper"
>
<li
class=
"swiper-slide hot-title"
>
热搜
</li>
<ul
class=
"hot-content"
>
<li
class=
"hot-title"
>
热搜
</li>
{{#
hotTerms
}}
<li
class=
"
swiper-slide
hot-term"
>
<li
class=
"hot-term"
>
<a
href=
'javascript:void(0);'
>
{{
content
}}
</a>
</li>
{{/
hotTerms
}}
...
...
config/common.js
View file @
4c37285
...
...
@@ -17,21 +17,21 @@ module.exports = {
assetUrl
:
'//127.0.0.1:5001'
,
testCode
:
'yoho4946abcdef#$%&!@'
,
domains
:
{
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/',
// imSocket: 'ws://im.yohobuy.com:10240',
// imCs: 'http://im.yohobuy.com/api',
// imServer: 'http://im.yohobuy.com/server'
api
:
'http://api-test3.yohops.com:9999/'
,
service
:
'http://service-test3.yohops.com:9999/'
,
liveApi
:
'http://testapi.live.yohops.com:9999/'
,
singleApi
:
'http://api-test3.yohops.com:9999/'
,
imSocket
:
'ws://im.yohobuy.com:10240'
,
imCs
:
'http://im.yohobuy.com/api'
,
imServer
:
'http://im.yohobuy.com/server'
api
:
'http://api.yoho.cn/'
,
service
:
'http://service.yoho.cn/'
,
liveApi
:
'http://api.live.yoho.cn/'
,
singleApi
:
'http://single.yoho.cn/'
,
imSocket
:
'wss://imsocket.yohobuy.com:443'
,
imCs
:
'https://imhttp.yohobuy.com/api'
,
imServer
:
'https://imhttp.yohobuy.com/server'
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/',
// imSocket: 'wss://imsocket.yohobuy.com:443',
// imCs: 'https://imhttp.yohobuy.com/api',
// imServer: 'https://imhttp.yohobuy.com/server'
},
subDomains
:
{
host
:
'.m.yohobuy.com'
,
...
...
public/js/product/search/index.js
View file @
4c37285
...
...
@@ -246,12 +246,6 @@ $search.on('touchend', function() {
return
false
;
});
navSwiper
=
new
Swiper
(
'.new-hot'
,
{
grabCursor
:
true
,
slidesPerView
:
'auto'
,
slideElement
:
'li'
});
// 初始化历史搜索的内容
(
function
()
{
var
html
=
''
,
...
...
@@ -296,4 +290,5 @@ navSwiper = new Swiper('.new-hot', {
}
window
.
rePosFooter
();
}());
...
...
public/scss/product/search/_search.css
View file @
4c37285
...
...
@@ -53,11 +53,11 @@
}
li
{
float
:
left
;
margin-right
:
20px
;
margin-bottom
:
20px
;
max-width
:
100%
;
overflow
:
hidden
;
display
:
inline-block
;
}
a
{
...
...
@@ -76,6 +76,7 @@
.search-index
{
border-top
:
1px
solid
#e0e0e0
;
background
:
#fff
;
padding
:
30px
;
}
.clear-icon
{
...
...
@@ -111,10 +112,8 @@
padding-bottom
:
30px
;
.new-hot
{
overflow
:
hidden
;
background
:
#fff
;
padding-bottom
:
30px
;
height
:
130px
;
border-bottom
:
1px
solid
#e0e0e0
;
}
...
...
@@ -125,14 +124,24 @@
.hot-title
{
font-size
:
32px
;
color
:
#000
;
line-height
:
130px
;
height
:
120px
;
line-height
:
80px
;
height
:
80px
;
padding-left
:
30px
;
text-align
:
center
;
display
:
inline-block
;
}
.hot-term
{
padding-top
:
30px
;
}
.hot-content
{
width
:
100%
;
overflow-x
:
auto
;
overflow-y
:
hidden
;
white-space
:
nowrap
;
height
:
130px
;
}
}
.search-content-title
{
...
...
@@ -178,16 +187,12 @@
}
}
.history-search
{
padding
:
30px
;
}
.want-search
{
padding
:
30px
;
.history
{
max-height
:
300px
;
}
.want
{
max-height
:
264
px
;
max-height
:
300
px
;
overflow
:
hidden
;
}
}
...
...
Please
register
or
login
to post a comment