Commit 674156f9 by 施宇

1111

parent bfe2b744
......@@ -71,14 +71,15 @@ $(function () {
$(this).addClass('active').siblings().removeClass('active')
});
$('.input_btn').click(function () {
var key = $.trim($('.search-input').val());
if (key.length<3) {
var val = $.trim($('.search-input').val());
if (!val.length) {
layer.msg('搜索内容不能为空')
} else if (val.length < 3) {
layer.msg('搜索内容太短')
} 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 () {
window.location.href = "/roborder"
......
......@@ -61,26 +61,27 @@ $(function () {
var self = this;
$('.search_nav li').on('click', function () {
var index = $(this).index();
if($(this).hasClass('active')){
if ($(this).hasClass('active')) {
return
}
$(this).addClass('active').siblings().removeClass('active');
$(".goods_data_list").empty();
$('.nav_title').find('span').text(0);
if(index == 0){
if (index == 0) {
self.type = 1
}else{
} else {
self.type = 2
}
$('.jt').click();
});
$('.input_btn').on('click', function () {
var len = $.trim($('.input-search').val());
if (len < 3) {
var val = $.trim($('.input-search').val());
if (!val.length) {
layer.msg('搜索内容不能为空')
} else if (val.length < 3) {
layer.msg('搜索内容太短')
} 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 () {
......@@ -90,7 +91,7 @@ $(function () {
$(this).addClass('active').siblings().removeClass('active');
if (self.type == 2) {
spOrXj = 2
}else{
} else {
spOrXj = 1
}
if (index == 0) {
......
......@@ -93,11 +93,12 @@ $(function () {
$('.jt').click();
});
$('.input_btn').on('click', function () {
var len = $.trim($('.input-search').val());
if (len < 3) {
layer.msg('搜索内容太短')
var val = $.trim($('.input-search').val());
if (!val.length) {
layer.msg('搜索内容不能为空')
} else if (val.length < 3) {
layer.msg('搜索内容太短');
} else {
var val = $('.input-search').val();
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