Commit cb5bded1 by 施宇

111

parent 1131a069
......@@ -3,9 +3,7 @@ $(function () {
key: Util.getRequest('key') || "",
type: Util.getRequest('type') || "",
time: Util.getRequest('time') || "",
initKey: Util.getRequest('key') || "",
init: function () {
$('.input-search').val(this.key);
this.bindFun();
this.renderPage()
},
......@@ -30,7 +28,7 @@ $(function () {
IcController.getData(url, 'GET', {
"offset": 8,
"p": 1,
"goods_name/like": self.initKey,
"goods_name/like": self.key,
"start_time": time
}, function (res) {
var getTpl = "";
......@@ -69,8 +67,6 @@ $(function () {
$(this).addClass('active').siblings().removeClass('active');
$(".goods_data_list").empty();
$('.nav_title').find('span').text(0);
$('.input-search').val('');
self.initKey = "";
if(index == 0){
self.type = 1
}else{
......@@ -83,8 +79,8 @@ $(function () {
if (len < 3) {
layer.msg('搜索内容太短')
} else {
self.initKey = $('.input-search').val();
window.location.replace("/indexsearch?key=" + self.initKey+'&type='+self.type+'&time='+self.time);
var val = $('.input-search').val();
window.location.replace("/indexsearch?key=" +val+'&type='+self.type+'&time='+self.time);
}
});
$('.zz').on('click', '.fl', function () {
......
$(function () {
var inquiry = {
params: {
"offset": 7,
"offset": 10,
"p": 1,
"token": Util.getCookie('token') || ""
},
......@@ -44,7 +44,7 @@ $(function () {
elem: 'pagination',
theme: '#1080d0',
count: res.total,
limit: 7,
limit: 10,
curr: page,
layout: ['prev', 'page', 'next', 'refresh'],
jump: function (obj, first) {
......@@ -84,6 +84,7 @@ $(function () {
} else {
layui.laytpl(getTpl).render(res.data, function (html) {
$(ele).siblings('.show_more').empty().html(html).slideDown();
$(ele).parents('.data_item').siblings('.data_item').find('.show_more').hide()
});
}
......
......@@ -86,6 +86,7 @@ $(function () {
} else {
layui.laytpl(getTpl).render(arr, function (html) {
$(ele).siblings('.show_more').empty().html(html).slideDown();
$(ele).parents('.data_item').siblings('.data_item').find('.show_more').hide()
});
}
......
......@@ -3,9 +3,7 @@ $(function () {
key: Util.getRequest('key') || "",
type: Util.getRequest('type') || "",
time: Util.getRequest('time') || "",
initKey: Util.getRequest('key') || "",
init: function () {
$('.input-search').val(this.key);
this.bindFun();
this.renderPage()
},
......@@ -31,7 +29,7 @@ $(function () {
IcController.getData(url, 'GET', {
"offset": 10,
"p": p,
"goods_name/like": self.initKey,
"goods_name/like": self.key,
"start_time": time,
"token": Util.getCookie('token') || ""
}, function (res) {
......@@ -80,18 +78,16 @@ $(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);
$('#pagination').hide();
$('.input-search').val('');
self.initKey = "";
if(index == 0){
if (index == 0) {
self.type = 1
}else{
} else {
self.type = 2
}
$('.jt').click();
......@@ -101,8 +97,8 @@ $(function () {
if (len < 3) {
layer.msg('搜索内容太短')
} else {
self.initKey = $('.input-search').val();
window.location.replace("/search?key=" + self.initKey+'&type='+self.type+'&time='+self.time);
var val = $('.input-search').val();
window.location.replace("/search?key=" + val + '&type=' + self.type + '&time=' + self.time);
}
});
$('.zz').on('click', '.fl', function () {
......@@ -112,7 +108,7 @@ $(function () {
$(this).addClass('active').siblings().removeClass('active');
if (self.type == 2) {
spOrXj = 2
}else{
} else {
spOrXj = 1
}
if (index == 0) {
......
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