Showing
4 changed files
with
11 additions
and
22 deletions
@@ -24,23 +24,6 @@ $('#clear-history').bind('touchstart', function() { | @@ -24,23 +24,6 @@ $('#clear-history').bind('touchstart', function() { | ||
24 | }); | 24 | }); |
25 | }); | 25 | }); |
26 | 26 | ||
27 | -$('#search').bind('touchstart', function() { | ||
28 | - var val = $input.val(); | ||
29 | - | ||
30 | - $.ajax({ | ||
31 | - type: 'POST', | ||
32 | - url: '/search', | ||
33 | - data: { | ||
34 | - val: val | ||
35 | - }, | ||
36 | - success: function(data) { | ||
37 | - if (data.code === 200) { | ||
38 | - location.href = data.data; | ||
39 | - } | ||
40 | - } | ||
41 | - }); | ||
42 | -}); | ||
43 | - | ||
44 | $input.bind('input', function() { | 27 | $input.bind('input', function() { |
45 | if ($input.val() === '') { | 28 | if ($input.val() === '') { |
46 | $clear.addClass('hide'); | 29 | $clear.addClass('hide'); |
@@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
9 | font-size: 12px; | 9 | font-size: 12px; |
10 | top: 16px; | 10 | top: 16px; |
11 | left: 24px; | 11 | left: 24px; |
12 | + color: #b2b2b2; | ||
12 | } | 13 | } |
13 | 14 | ||
14 | input { | 15 | input { |
@@ -24,6 +25,7 @@ | @@ -24,6 +25,7 @@ | ||
24 | position: absolute; | 25 | position: absolute; |
25 | top: 12px; | 26 | top: 12px; |
26 | right: 50px; | 27 | right: 50px; |
28 | + color: #b2b2b2; | ||
27 | } | 29 | } |
28 | 30 | ||
29 | .search { | 31 | .search { |
@@ -2,10 +2,12 @@ | @@ -2,10 +2,12 @@ | ||
2 | <div class="search-page yoho-page"> | 2 | <div class="search-page yoho-page"> |
3 | {{# search}} | 3 | {{# search}} |
4 | <div id="search-input" class="search-input"> | 4 | <div id="search-input" class="search-input"> |
5 | + <form action="/product/list/index" method="get"> | ||
5 | <i class="search-icon iconfont"></i> | 6 | <i class="search-icon iconfont"></i> |
6 | - <input type="text" placeholder="搜索商品"> | ||
7 | - <i class="clear-input iconfont hide"></i> | ||
8 | - <button id="search" class="search">搜索</button> | 7 | + <input type="text" placeholder="搜索商品" name="query"> |
8 | + <i class="clear-input iconfont hide"></i> | ||
9 | + <button id="search" class="search" type="submit">搜索</button> | ||
10 | + </form> | ||
9 | </div> | 11 | </div> |
10 | <div class="search-items"> | 12 | <div class="search-items"> |
11 | <div class="hot-search"> | 13 | <div class="hot-search"> |
@@ -3,10 +3,12 @@ | @@ -3,10 +3,12 @@ | ||
3 | {{# goodList}} | 3 | {{# goodList}} |
4 | {{# search}} | 4 | {{# search}} |
5 | <div id="search-input" class="search-input"> | 5 | <div id="search-input" class="search-input"> |
6 | + <form action="/product/list/index" method="get"> | ||
6 | <i class="search-icon iconfont"></i> | 7 | <i class="search-icon iconfont"></i> |
7 | - <input type="text" value={{default}}> | 8 | + <input type="text" value={{default}} name="query"> |
8 | <i class="clear-input iconfont hide"></i> | 9 | <i class="clear-input iconfont hide"></i> |
9 | - <button id="search" class="search">搜索</button> | 10 | + <button id="search" class="search" type="submit">搜索</button> |
11 | + </form> | ||
10 | </div> | 12 | </div> |
11 | {{/ search}} | 13 | {{/ search}} |
12 | 14 |
-
Please register or login to post a comment