Authored by zhangxiaoru

search 调整

... ... @@ -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'),
... ...
... ... @@ -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');
... ...
... ... @@ -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}}
... ...
... ... @@ -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',
... ...
... ... @@ -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();
}());
... ...
... ... @@ -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: 264px;
max-height: 300px;
overflow: hidden;
}
}
... ...