Authored by zhangxiaoru

index

... ... @@ -128,6 +128,8 @@ const index = (req, res, next) => {
}),
pageFooter: true,
search: {
defaultTerms: result[0].content || '',
url: helpers.urlFormat('', null, 'search'),
hotTerms: result
}
... ...
... ... @@ -170,6 +170,9 @@ const getAllBrandNames = () => {
});
};
/**
* 获取热门搜索
**/
const getSearchIndex = () => {
return api.get('', {
method: 'app.search.getTerms'
... ...
... ... @@ -2,7 +2,7 @@
{{# search}}
<input type="hidden" value="{{defaultTerms}}" id="default-terms">
<div id="search-input" class="search-input">
<form id="search-form" action={{url}} method="get">
<form id="search-form" action="{{url}}" method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" placeholder="{{#if defaultTerms}}{{defaultTerms}}{{else}}搜索商品、品牌{{/if}}" name="query" data-bp-id="search_page_input_1" class="buriedpoint" autocomplete="off">
<input type="hidden" name="from" value="search">
... ...
... ... @@ -64,6 +64,7 @@ chHammer.on('tap', function() {
function GoSearch(query) {
// 保存搜索的内容
writeSearch.setHistoryValFun(query);
console.log(searchUrl)
document.location.href = searchUrl + '?query=' + query;
}
... ...