Showing
4 changed files
with
30 additions
and
32 deletions
@@ -77,29 +77,8 @@ let search = (req, res, next) => { | @@ -77,29 +77,8 @@ let search = (req, res, next) => { | ||
77 | 77 | ||
78 | }; | 78 | }; |
79 | 79 | ||
80 | - | ||
81 | -/** | ||
82 | - * 添加品牌搜索记录 | ||
83 | - * @author sefon 2016-5-13 14:21:53 | ||
84 | - */ | ||
85 | -let addBrandSearch = (req, res, next) => { | ||
86 | - | ||
87 | - let param = { | ||
88 | - | ||
89 | - uid: req.user.uid || 6228593, // TODO | ||
90 | - | ||
91 | - brandName: req.query.brandName || '1' | ||
92 | - | ||
93 | - }; | ||
94 | - | ||
95 | - indexModel.branchSearch(param).then(result => { | ||
96 | - res.render('brand/search', result); | ||
97 | - }).catch(next); | ||
98 | - | ||
99 | -}; | ||
100 | - | ||
101 | module.exports = { | 80 | module.exports = { |
102 | index, | 81 | index, |
103 | search, | 82 | search, |
104 | - addBrandSearch | 83 | + delBrandHistory |
105 | }; | 84 | }; |
@@ -291,7 +291,23 @@ const branchSearchHistory = (params) => { | @@ -291,7 +291,23 @@ const branchSearchHistory = (params) => { | ||
291 | 291 | ||
292 | }, { code: 200 }).then(result => { | 292 | }, { code: 200 }).then(result => { |
293 | 293 | ||
294 | - return result; | 294 | + let resu = { |
295 | + data: { | ||
296 | + list: [ | ||
297 | + { | ||
298 | + name: '111', | ||
299 | + searchTime: '111' | ||
300 | + }, | ||
301 | + { | ||
302 | + name: '22', | ||
303 | + searchTime: '22' | ||
304 | + } | ||
305 | + ] | ||
306 | + } | ||
307 | + }; | ||
308 | + | ||
309 | + // console.log(resu); | ||
310 | + return resu; | ||
295 | 311 | ||
296 | }); | 312 | }); |
297 | }; | 313 | }; |
@@ -332,9 +348,8 @@ const branchSearch = (params) => { | @@ -332,9 +348,8 @@ const branchSearch = (params) => { | ||
332 | showDownloadApp: true, | 348 | showDownloadApp: true, |
333 | pageFooter: true, | 349 | pageFooter: true, |
334 | hot: [], | 350 | hot: [], |
335 | - brandList: [ | ||
336 | - | ||
337 | - ] | 351 | + history: [], |
352 | + brandList: [] | ||
338 | }; | 353 | }; |
339 | 354 | ||
340 | if (result && result[0] && result[0].data) { | 355 | if (result && result[0] && result[0].data) { |
@@ -347,8 +362,6 @@ const branchSearch = (params) => { | @@ -347,8 +362,6 @@ const branchSearch = (params) => { | ||
347 | 362 | ||
348 | let build = []; | 363 | let build = []; |
349 | 364 | ||
350 | - if (key != '') { | ||
351 | - | ||
352 | brandList[key].forEach(row => { | 365 | brandList[key].forEach(row => { |
353 | 366 | ||
354 | build.push({ | 367 | build.push({ |
@@ -367,8 +380,6 @@ const branchSearch = (params) => { | @@ -367,8 +380,6 @@ const branchSearch = (params) => { | ||
367 | 380 | ||
368 | } | 381 | } |
369 | 382 | ||
370 | - } | ||
371 | - | ||
372 | resu.brandList = JSON.stringify(obj); | 383 | resu.brandList = JSON.stringify(obj); |
373 | } | 384 | } |
374 | 385 | ||
@@ -389,6 +400,14 @@ const branchSearch = (params) => { | @@ -389,6 +400,14 @@ const branchSearch = (params) => { | ||
389 | 400 | ||
390 | } | 401 | } |
391 | 402 | ||
403 | + if (result && result[1] && result[1].data) { | ||
404 | + | ||
405 | + let hisList = result[1].data; | ||
406 | + | ||
407 | + resu.history.push(hisList); | ||
408 | + | ||
409 | + } | ||
410 | + | ||
392 | return resu; | 411 | return resu; |
393 | 412 | ||
394 | }); | 413 | }); |
@@ -23,6 +23,6 @@ router.get('/channel/bottomBanner', channel.bottomBanner); | @@ -23,6 +23,6 @@ router.get('/channel/bottomBanner', channel.bottomBanner); | ||
23 | 23 | ||
24 | router.get('/brands', brandController.index); // 品牌首页 | 24 | router.get('/brands', brandController.index); // 品牌首页 |
25 | router.get('/brands/search', brandController.search); // 品牌搜索页 | 25 | router.get('/brands/search', brandController.search); // 品牌搜索页 |
26 | -router.post('/brands/search', brandController.addBrandSearch); // 添加品牌搜索记录 | 26 | +router.get('/delBrandHistory', brandController.delBrandHistory); // 删除品牌搜索记录 |
27 | 27 | ||
28 | module.exports = router; | 28 | module.exports = router; |
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | </div> | 14 | </div> |
15 | 15 | ||
16 | <div class="search-brand-page"> | 16 | <div class="search-brand-page"> |
17 | - <div class="search-items"> | 17 | + <div class="search-items">{{log history}} |
18 | {{#if history}} | 18 | {{#if history}} |
19 | <div class="net-history hide"> | 19 | <div class="net-history hide"> |
20 | <div class="history-search net-search hide"> | 20 | <div class="history-search net-search hide"> |
-
Please register or login to post a comment