Authored by xuqi

search

... ... @@ -24,23 +24,6 @@ $('#clear-history').bind('touchstart', function() {
});
});
$('#search').bind('touchstart', function() {
var val = $input.val();
$.ajax({
type: 'POST',
url: '/search',
data: {
val: val
},
success: function(data) {
if (data.code === 200) {
location.href = data.data;
}
}
});
});
$input.bind('input', function() {
if ($input.val() === '') {
$clear.addClass('hide');
... ...
... ... @@ -9,6 +9,7 @@
font-size: 12px;
top: 16px;
left: 24px;
color: #b2b2b2;
}
input {
... ... @@ -24,6 +25,7 @@
position: absolute;
top: 12px;
right: 50px;
color: #b2b2b2;
}
.search {
... ...
... ... @@ -2,10 +2,12 @@
<div class="search-page yoho-page">
{{# search}}
<div id="search-input" class="search-input">
<form action="/product/list/index" method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" placeholder="搜索商品">
<i class="clear-input iconfont hide">&#xe61a;</i>
<button id="search" class="search">搜索</button>
<input type="text" placeholder="搜索商品" name="query">
<i class="clear-input iconfont hide">&#xe626;</i>
<button id="search" class="search" type="submit">搜索</button>
</form>
</div>
<div class="search-items">
<div class="hot-search">
... ...
... ... @@ -3,10 +3,12 @@
{{# goodList}}
{{# search}}
<div id="search-input" class="search-input">
<form action="/product/list/index" method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" value={{default}}>
<input type="text" value={{default}} name="query">
<i class="clear-input iconfont hide">&#xe61a;</i>
<button id="search" class="search">搜索</button>
<button id="search" class="search" type="submit">搜索</button>
</form>
</div>
{{/ search}}
... ...