Commit cb5bded1 by 施宇

111

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