Commit 674156f9 by 施宇

1111

parent bfe2b744
...@@ -71,14 +71,15 @@ $(function () { ...@@ -71,14 +71,15 @@ $(function () {
$(this).addClass('active').siblings().removeClass('active') $(this).addClass('active').siblings().removeClass('active')
}); });
$('.input_btn').click(function () { $('.input_btn').click(function () {
var key = $.trim($('.search-input').val()); var val = $.trim($('.search-input').val());
if (key.length<3) { if (!val.length) {
layer.msg('搜索内容不能为空')
} else if (val.length < 3) {
layer.msg('搜索内容太短') layer.msg('搜索内容太短')
} else { } else {
window.location.href = "/search?key=" + key+'&type=1&time=1'; window.location.href = "/search?key=" + val+'&type=1&time=1';
} }
}); });
$('.home_content').on('click', '.newXjIcon', function () { $('.home_content').on('click', '.newXjIcon', function () {
window.location.href = "/roborder" window.location.href = "/roborder"
......
...@@ -61,26 +61,27 @@ $(function () { ...@@ -61,26 +61,27 @@ $(function () {
var self = this; var self = this;
$('.search_nav li').on('click', function () { $('.search_nav li').on('click', function () {
var index = $(this).index(); var index = $(this).index();
if($(this).hasClass('active')){ if ($(this).hasClass('active')) {
return return
} }
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass('active').siblings().removeClass('active');
$(".goods_data_list").empty(); $(".goods_data_list").empty();
$('.nav_title').find('span').text(0); $('.nav_title').find('span').text(0);
if(index == 0){ if (index == 0) {
self.type = 1 self.type = 1
}else{ } else {
self.type = 2 self.type = 2
} }
$('.jt').click(); $('.jt').click();
}); });
$('.input_btn').on('click', function () { $('.input_btn').on('click', function () {
var len = $.trim($('.input-search').val()); var val = $.trim($('.input-search').val());
if (len < 3) { if (!val.length) {
layer.msg('搜索内容不能为空')
} else if (val.length < 3) {
layer.msg('搜索内容太短') layer.msg('搜索内容太短')
} else { } else {
var val = $('.input-search').val(); window.location.replace("/indexsearch?key=" + val + '&type=' + self.type + '&time=' + self.time);
window.location.replace("/indexsearch?key=" +val+'&type='+self.type+'&time='+self.time);
} }
}); });
$('.zz').on('click', '.fl', function () { $('.zz').on('click', '.fl', function () {
...@@ -90,7 +91,7 @@ $(function () { ...@@ -90,7 +91,7 @@ $(function () {
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass('active').siblings().removeClass('active');
if (self.type == 2) { if (self.type == 2) {
spOrXj = 2 spOrXj = 2
}else{ } else {
spOrXj = 1 spOrXj = 1
} }
if (index == 0) { if (index == 0) {
......
...@@ -93,11 +93,12 @@ $(function () { ...@@ -93,11 +93,12 @@ $(function () {
$('.jt').click(); $('.jt').click();
}); });
$('.input_btn').on('click', function () { $('.input_btn').on('click', function () {
var len = $.trim($('.input-search').val()); var val = $.trim($('.input-search').val());
if (len < 3) { if (!val.length) {
layer.msg('搜索内容太短') layer.msg('搜索内容不能为空')
} else if (val.length < 3) {
layer.msg('搜索内容太短');
} else { } else {
var val = $('.input-search').val();
window.location.replace("/search?key=" + val + '&type=' + self.type + '&time=' + self.time); window.location.replace("/search?key=" + val + '&type=' + self.type + '&time=' + self.time);
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment