Authored by OF1706

search api

... ... @@ -10,6 +10,7 @@ const api = global.yoho.API;
const helpers = global.yoho.helpers;
const searchApi = require('./search-api');
const headerModel = require('../../../doraemon/models/header');
// const searchHandler = require('./search-handler');
const _ = require('lodash');
const needParams = ['query', 'msort', 'misort'];
... ... @@ -136,4 +137,4 @@ const getSuggest = (params) => {
module.exports = {
handleSuggest,
getSuggest
}
\ No newline at end of file
};
... ...
... ... @@ -115,7 +115,7 @@ const serachFilterBrands = (req, res, next) => {
const suggestHistory = (req, res, next) => {
search.getSuggest(req.query).then(result => {
if(req.query.json === '1') {
if (req.query.json === '1') {
return res.send(result);
}
... ... @@ -141,7 +141,7 @@ const suggestHistory = (req, res, next) => {
const suggestRecommend = (req, res, next) => {
search.getSuggest(req.query).then(result => {
if(req.query.json === '1') {
if (req.query.json === '1') {
return res.send(result);
}
... ... @@ -164,4 +164,4 @@ module.exports = {
serachFilterBrands,
suggestHistory,
suggestRecommend
}
\ No newline at end of file
};
... ...
... ... @@ -27,9 +27,9 @@ module.exports = {
// service: 'http://service.yoho.cn/',
// gray
//singleApi: 'http://single.gray.yohops.com/',
//api: 'http://api.gray.yohops.com/',
//service: 'http://service.gray.yohops.com/',
// singleApi: 'http://single.gray.yohops.com/',
// api: 'http://api.gray.yohops.com/',
// service: 'http://service.gray.yohops.com/',
// dev
// api: 'http://dev-api.yohops.com:9999/',
... ...
... ... @@ -7,7 +7,7 @@ var $ = require('yoho-jquery'),
handlebars = require('yoho-handlebars');
var $head = $('.head-wrapper'),
$searchForm = $('#search-form'), //头部搜索栏
$searchForm = $('#search-form'), // 头部搜索栏
$searchKey = $searchForm.find('.search-key'),
$searchSug = $head.find('.search-suggest');
... ... @@ -99,4 +99,4 @@ $searchKey.keyup(function(e) {
setTimeout(function() {
$searchSug.hide();
}, 200);
});
\ No newline at end of file
});
... ...