Commit 38b60c08 by 施宇

111

parent 3c2e6093
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<div class="search_div clr"> <div class="search_div clr">
<div class="input_div fl"> <div class="input_div fl">
<span class="icon iconfont iconjuxing"></span> <span class="icon iconfont iconjuxing"></span>
<input type="text" placeholder="请输入要搜索的内容"> <input type="text" placeholder="请输入要搜索的内容" class="search-input">
</div> </div>
<div class="btn fl btn_60 btn_fz_18 input_btn bold btn_blue"> <div class="btn fl btn_60 btn_fz_18 input_btn bold btn_blue">
搜索 搜索
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="search_div clr"> <div class="search_div clr">
<div class="input_div fl"> <div class="input_div fl">
<span class="icon iconfont iconjuxing"></span> <span class="icon iconfont iconjuxing"></span>
<input type="text" placeholder="请输入要搜索的内容"> <input type="text" placeholder="请输入要搜索的内容" class="input-search">
</div> </div>
<div class="input_btn fl btn_48 btn bold btn_blue"> <div class="input_btn fl btn_48 btn bold btn_blue">
搜索 搜索
...@@ -33,19 +33,19 @@ ...@@ -33,19 +33,19 @@
<div class="zz condition_content"> <div class="zz condition_content">
<span class="bold">时间:</span> <span class="bold">时间:</span>
<div class="condition_right_content clr"> <div class="condition_right_content clr">
<div class="fl active">今天</div> <div class="fl jt">今天</div>
<div class="fl">三天之内</div> <div class="fl st">三天之内</div>
<div class="fl">本周</div> <div class="fl qt">七天之内</div>
</div> </div>
</div> </div>
<div class="fz condition_content "> <!-- <div class="fz condition_content ">
<span class="bold">封装:</span> <span class="bold">封装:</span>
<div class="condition_right_content clr"> <div class="condition_right_content clr">
<div class="fl">贸易商</div> <div class="fl">贸易商</div>
<div class="fl">贸易商</div> <div class="fl">贸易商</div>
<div class="fl">贸易商</div> <div class="fl">贸易商</div>
</div> </div>
</div> </div> -->
</div> </div>
<div class="goods_data_list search_data_list"> <div class="goods_data_list search_data_list">
</div> </div>
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<div class="time fr ellipsis boxsiz">{{layui.util.toDateString(item.update_time * 1000)}}</div> <div class="time fr ellipsis boxsiz">{{layui.util.toDateString(item.update_time * 1000)}}</div>
</div> </div>
<a class="icon iconfont iconjuxing2 fr"></a> <a class="icon iconfont iconjuxing2 fr"></a>
{{# if(item['status/eq'] !== 1){ }} {{# if(item['status'] == 1){ }}
{{# if(item['audit_status'] == 1){ }} {{# if(item['audit_status'] == 1){ }}
<a class="xj xj_status fr">下架</a> <a class="xj xj_status fr">下架</a>
{{# } else { }} {{# } else { }}
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<include file="public/top" /> <include file="public/top" />
<div class="right_content release_inquiry_content"> <div class="right_content release_inquiry_content">
<div class="content"> <div class="content">
<div class="nav_title">商品管理 > 发布商品 > 上传商品</div> <div class="nav_title">询报价 > 发布询价</div>
<div class="inquiry_form"> <div class="inquiry_form">
<div class="top_title clr"> <div class="top_title clr">
<h3 class="bold fl">发布询价</h3> <h3 class="bold fl">发布询价</h3>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div class="search_div clr"> <div class="search_div clr">
<div class="input_div fl"> <div class="input_div fl">
<span class="icon iconfont iconjuxing"></span> <span class="icon iconfont iconjuxing"></span>
<input type="text" placeholder="请输入要搜索的内容"> <input type="text" placeholder="请输入要搜索的内容" class="input-search">
</div> </div>
<div class="input_btn fl btn_48 btn bold btn_blue"> <div class="input_btn fl btn_48 btn bold btn_blue">
搜索 搜索
...@@ -29,25 +29,25 @@ ...@@ -29,25 +29,25 @@
</div> </div>
<div class="search_condition"> <div class="search_condition">
<ul class="search_nav clr"> <ul class="search_nav clr">
<li class="search_sp fl active">商品</li> <li class="search_sp fl">商品</li>
<li class="search_xj fl">询价</li> <li class="search_xj fl">询价</li>
</ul> </ul>
<div class="zz condition_content"> <div class="zz condition_content">
<span class="bold">时间:</span> <span class="bold">时间:</span>
<div class="condition_right_content clr"> <div class="condition_right_content clr">
<div class="fl active">今天 </div> <div class="fl jt">今天 </div>
<div class="fl">三天之内</div> <div class="fl st">三天之内</div>
<div class="fl">本周</div> <div class="fl qt">七天之内</div>
</div> </div>
</div> </div>
<div class="fz condition_content "> <!-- <div class="fz condition_content ">
<span class="bold">封装:</span> <span class="bold">封装:</span>
<div class="condition_right_content clr"> <div class="condition_right_content clr">
<div class="fl">贸易商</div> <div class="fl">贸易商</div>
<div class="fl">贸易商</div> <div class="fl">贸易商</div>
<div class="fl">贸易商</div> <div class="fl">贸易商</div>
</div> </div>
</div> </div> -->
</div> </div>
<div class="goods_data_list"> <div class="goods_data_list">
</div> </div>
......
...@@ -550,6 +550,9 @@ body { ...@@ -550,6 +550,9 @@ body {
display: none; display: none;
} }
} }
.layui-icon {
display: none !important;
}
@font-face { @font-face {
font-family: "iconfont"; font-family: "iconfont";
src: url('../../fonts/iconfont.eot?t=1561691322757'); src: url('../../fonts/iconfont.eot?t=1561691322757');
...@@ -846,4 +849,3 @@ body { ...@@ -846,4 +849,3 @@ body {
color: #ADB6BF; color: #ADB6BF;
cursor: pointer; cursor: pointer;
} }
/*# sourceMappingURL=base.css.map */
\ No newline at end of file
...@@ -684,6 +684,9 @@ body { ...@@ -684,6 +684,9 @@ body {
display: none; display: none;
} }
} }
.layui-icon{
display: none !important;
}
// 字体样式 // 字体样式
@import "./fonts.less"; @import "./fonts.less";
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
/*** /***
* 询价上下架 * 询价上下架
*/ */
inquirysave: offer_url + "/inquiry/save", inquirstatusysave: offer_url + "/inquiry/status/save",
/*** /***
* 询价统计 * 询价统计
*/ */
......
!function () { ! function () {
window.IcController = { window.IcController = {
init: function () { init: function () {
this.created(this).mounted(this).handleBind(this); this.created(this).mounted(this).handleBind(this);
}, },
getData: function (url, type, param, callback, isload, isheader) { getData: function (url, type, param, callback, isload, isheader) {
//是否启动loadin效果 //是否启动loadin效果
if (isload == undefined) { if (isload == undefined) {
var index = layer.load(1, { var index = layer.load(1, {
offset: ['50%', "50%"], offset: ['50%', "50%"],
shade: false shade: false
}); });
} }
var platform = { var platform = {
source: 2 source: 2
}; };
var params = $.extend({}, platform, param); var params = $.extend({}, platform, param);
//跨域模式切换 兼容 //跨域模式切换 兼容
var dataTypeXpx = "json"; var dataTypeXpx = "json";
if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)) { if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)) {
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
}, },
}); });
} }
$.ajax({ $.ajax({
type: type, type: type,
url: url, url: url,
...@@ -43,136 +43,144 @@ ...@@ -43,136 +43,144 @@
withCredentials: true withCredentials: true
}, },
success: function (data) { success: function (data) {
//处理token失效的情况 //处理token失效的情况
if (data.errcode === 501 || data.err_code === 501) { if (data.errcode === 501 || data.err_code === 501) {
layer.msg('登录已失效,请重新登录', {time: 600}, function () { layer.msg('登录已失效,请重新登录', {
time: 600
}, function () {
window.location.href = passport_url + '/login'; window.location.href = passport_url + '/login';
}); });
} else { } else {
typeof callback == 'function' && callback(data); typeof callback == 'function' && callback(data);
layer.close(index); layer.close(index);
} }
return false; return false;
}, },
error: function () { error: function () {
layer.close(index); layer.close(index);
layer.msg('网络出现问题,请重试!'); layer.msg('网络出现问题,请重试!');
return false; return false;
} }
}); });
}, },
created: function (opt) { created: function (opt) {
if ($('#head_pic').length > 0) { if ($('#head_pic').length > 0) {
//获取用户信息 //获取用户信息
this.getData(apis.userInfo, 'GET', {token: Util.getCookie('token') || ''}, function (res) { this.getData(apis.userInfo, 'GET', {
token: Util.getCookie('token') || ''
}, function (res) {
if (res.errcode === 0) { if (res.errcode === 0) {
//消息数量 //消息数量
$("#count_num").empty().html(res.data['msg_notification']); $("#count_num").empty().html(res.data['msg_notification']);
//设置头像 //设置头像
if (res.data.avatar) { if (res.data.avatar) {
$("#head_pic").find('img').attr('src', res.data['avatar']); $("#head_pic").find('img').attr('src', res.data['avatar']);
} }
//首页 //首页
if ($(".user_home").length > 0) { if ($(".user_home").length > 0) {
$(".user_home").find(".company").empty().html(res.data['company_name']); $(".user_home").find(".company").empty().html(res.data['company_name']);
$(".user_home").find(".tel").empty().html(res.data['mobile']); $(".user_home").find(".tel").empty().html(res.data['mobile']);
$(".user_home").find(".last_login_time").empty().html(res.data['last_login_time']); $(".user_home").find(".last_login_time").empty().html(res.data['last_login_time']);
$(".user_home").find(".info_desc").children('p').empty().html('Hi,'+Util.getTimeState()); $(".user_home").find(".info_desc").children('p').empty().html('Hi,' + Util.getTimeState());
} }
} }
}); });
} }
return this; return this;
}, },
mounted: function (opt) { mounted: function (opt) {
//导航栏 //导航栏
var isShow = $('.xbj_li').find('dl').css('display'); var isShow = $('.xbj_li').find('dl').css('display');
if (isShow == 'none') { if (isShow == 'none') {
$('.xbj_li').find('.li_right').removeClass('iconjuxing15').addClass('iconjuxing12'); $('.xbj_li').find('.li_right').removeClass('iconjuxing15').addClass('iconjuxing12');
} else { } else {
$('.xbj_li').find('.li_right').removeClass('iconjuxing12').addClass('iconjuxing15'); $('.xbj_li').find('.li_right').removeClass('iconjuxing12').addClass('iconjuxing15');
} }
return this; return this;
}, },
handleBind: function (opt) { handleBind: function (opt) {
//导航栏 //导航栏
$('.xbj_li').on('click', function () { $('.xbj_li').on('click', function () {
var isShow = $(this).find('dl').css('display'); var isShow = $(this).find('dl').css('display');
if (isShow == 'none') { if (isShow == 'none') {
$(this).find('dl').slideDown(); $(this).find('dl').slideDown();
$('.xbj_li').find('.li_right').removeClass('iconjuxing12').addClass('iconjuxing15'); $('.xbj_li').find('.li_right').removeClass('iconjuxing12').addClass('iconjuxing15');
} else { } else {
$(this).find('dl').slideUp(); $(this).find('dl').slideUp();
$('.xbj_li').find('.li_right').removeClass('iconjuxing15').addClass('iconjuxing12'); $('.xbj_li').find('.li_right').removeClass('iconjuxing15').addClass('iconjuxing12');
} }
}); });
//退出 //退出
$(".nav_end").on('click', function () { $(".nav_end").on('click', function () {
layer.confirm('您确定退出系统嘛', {icon: 3, title: '提示', move: false}, function (index) { layer.confirm('您确定退出系统嘛', {
icon: 3,
title: '提示',
move: false
}, function (index) {
opt.getData(apis.authLogout, 'POST', null, function (res) { opt.getData(apis.authLogout, 'POST', null, function (res) {
if (res.err_code === 0) { if (res.err_code === 0) {
Util.delCookie('token', cookieHostname); Util.delCookie('token', cookieHostname);
window.location.href = index_url; window.location.href = index_url;
} else { } else {
layer.msg(res.err_msg); layer.msg(res.err_msg);
} }
}, undefined, true); }, undefined, true);
layer.close(index); layer.close(index);
}) })
}); });
return this; return this;
}, },
}, $(function () { }, $(function () {
...@@ -192,17 +200,17 @@ ...@@ -192,17 +200,17 @@
* @returns {boolean} * @returns {boolean}
*/ */
setCookie: function (name, value, time, domain) { setCookie: function (name, value, time, domain) {
domain = domain ? ";domain=" + domain : ""; domain = domain ? ";domain=" + domain : "";
var Days = time; var Days = time;
var exp = new Date(); var exp = new Date();
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000); exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
document.cookie = name + "=" + value + ";expires=" + exp.toGMTString() + ";path=/" + domain; document.cookie = name + "=" + value + ";expires=" + exp.toGMTString() + ";path=/" + domain;
return true; return true;
}, },
/** /**
...@@ -211,19 +219,19 @@ ...@@ -211,19 +219,19 @@
* @returns {*} * @returns {*}
*/ */
getCookie: function (name) { getCookie: function (name) {
var strCookie = document.cookie; var strCookie = document.cookie;
var arrCookie = strCookie.split("; "); var arrCookie = strCookie.split("; ");
for (var i = 0; i < arrCookie.length; i++) { for (var i = 0; i < arrCookie.length; i++) {
var arr = arrCookie[i].split("="); var arr = arrCookie[i].split("=");
if (name == arr[0]) { if (name == arr[0]) {
return arr[1]; return arr[1];
} }
} }
return ""; return "";
...@@ -233,17 +241,17 @@ ...@@ -233,17 +241,17 @@
* @param name * @param name
*/ */
delCookie: function (name, domain) { delCookie: function (name, domain) {
domain = domain ? ";domain=" + domain : ""; domain = domain ? ";domain=" + domain : "";
var exp = new Date(); var exp = new Date();
exp.setTime(exp.getTime() - 10000); exp.setTime(exp.getTime() - 10000);
document.cookie = name + "=" + '' + ";expires=" + exp.toGMTString() + ";path=/" + domain; document.cookie = name + "=" + '' + ";expires=" + exp.toGMTString() + ";path=/" + domain;
return true; return true;
}, },
/** /**
* 获取参数 * 获取参数
...@@ -251,28 +259,28 @@ ...@@ -251,28 +259,28 @@
* @returns {*} * @returns {*}
*/ */
getRequest: function (value) { getRequest: function (value) {
if (window.location.pathname == "/s/") { if (window.location.pathname == "/s/") {
var url = unescape(location.search); var url = unescape(location.search);
} else { } else {
var url = decodeURI(location.search); var url = decodeURI(location.search);
} }
var object = {}; var object = {};
if (url.indexOf("?") != -1) { if (url.indexOf("?") != -1) {
var str = url.substr(1); var str = url.substr(1);
var strs = str.split("&"); var strs = str.split("&");
for (var i = 0; i < strs.length; i++) { for (var i = 0; i < strs.length; i++) {
object[strs[i].split("=")[0]] = strs[i].split("=")[1]; object[strs[i].split("=")[0]] = strs[i].split("=")[1];
} }
} }
return object[value]; return object[value];
...@@ -283,91 +291,128 @@ ...@@ -283,91 +291,128 @@
* @returns {string} * @returns {string}
*/ */
getDateStr: function (val) { getDateStr: function (val) {
var dd = new Date(); var dd = new Date();
dd.setDate(dd.getDate() + val); dd.setDate(dd.getDate() + val);
var y = dd.getFullYear(); var y = dd.getFullYear();
var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1); var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1);
var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate(); var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();
return y + "-" + m + "-" + d; return y + "-" + m + "-" + d;
}, },
/** /**
* 时间问候语 * 时间问候语
*/ */
getTimeState: function () { getTimeState: function () {
var timeNow = new Date(); var timeNow = new Date();
// 获取当前小时 // 获取当前小时
var hours = timeNow.getHours(); var hours = timeNow.getHours();
// 设置默认文字 // 设置默认文字
var text = ''; var text = '';
// 判断当前时间段 // 判断当前时间段
if (hours >= 0 && hours <= 10) { if (hours >= 0 && hours <= 10) {
text = '早上好'; text = '早上好';
} else if (hours > 10 && hours <= 14) { } else if (hours > 10 && hours <= 14) {
text = '中午好'; text = '中午好';
} else if (hours > 14 && hours <= 18) { } else if (hours > 14 && hours <= 18) {
text = '下午好'; text = '下午好';
} else if (hours > 18 && hours <= 24) { } else if (hours > 18 && hours <= 24) {
text = '晚上好'; text = '晚上好';
} }
return text; return text;
},
/**获取前几天的日期 */
getDay: function (day) {
var today = new Date();
var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;
today.setTime(targetday_milliseconds); //注意,这行是关键代码
var tYear = today.getFullYear();
var tMonth = today.getMonth();
var tDate = today.getDate();
tMonth = this.doHandleMonth(tMonth + 1);
tDate = this.doHandleMonth(tDate);
return tYear + "-" + tMonth + "-" + tDate + ' 00:00:00';
},
/**对月份进行处理 */
doHandleMonth: function (month) {
var m = month;
if (month.toString().length == 1) {
m = "0" + month;
52
}
return m;
} }
}; };
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
return Util; return Util;
} else { } else {
window.Util = Util; window.Util = Util;
} }
})(window); })(window);
//form序列化json //form序列化json
$.fn.serializeJson = function () { $.fn.serializeJson = function () {
var serializeObj = {}; var serializeObj = {};
var array = this.serializeArray(); var array = this.serializeArray();
var str = this.serialize(); var str = this.serialize();
$(array).each(function () { $(array).each(function () {
if (serializeObj[this.name]) { if (serializeObj[this.name]) {
if ($.isArray(serializeObj[this.name])) { if ($.isArray(serializeObj[this.name])) {
serializeObj[this.name].push(this.value); serializeObj[this.name].push(this.value);
} else { } else {
serializeObj[this.name] = [serializeObj[this.name], this.value]; serializeObj[this.name] = [serializeObj[this.name], this.value];
} }
} else { } else {
serializeObj[this.name] = this.value; serializeObj[this.name] = this.value;
} }
}); });
return serializeObj; return serializeObj;
......
...@@ -72,7 +72,14 @@ $(function () { ...@@ -72,7 +72,14 @@ $(function () {
$(this).addClass('active').siblings().removeClass('active') $(this).addClass('active').siblings().removeClass('active')
}); });
$('.input_btn').click(function () { $('.input_btn').click(function () {
window.location.href = "/search" var key = $('.search-input').val();
if(key){
window.location.href = "/search?key="+key;
}else{
window.location.href = "/search"
}
}); });
$('.home_content').on('click', '.newXjIcon', function () { $('.home_content').on('click', '.newXjIcon', function () {
window.location.href = "/roborder" window.location.href = "/roborder"
......
// $(function () {
// var indexSearch = {
// init: function () {
// this.bindFun();
// $('.search_sp').click();
// },
// getData: function (type) {
// var url = type==1?apis.goodsSearch:apis.inquirySearch;
// IcController.getData(url, 'GET', {
// "offset": 8,
// "p": 1,
// }, function (res) {
// var getTpl = "";
// if(type == 1){
// getTpl = sphtml.innerHTML
// }else{
// getTpl = xjhtml.innerHTML
// }
// if (res.errcode == 0) {
// $('.nav_title').find('span').text(res.total);
// var list = [];
// if(type == 1){
// list = res.goods_list
// }else{
// list = res.inquiry_list
// }
// layui.laytpl(getTpl).render(list, function (html) {
// $(".search_data_list").html(html);
// });
// } else if (res.errcode == 105001) {
// $('.nav_title').find('span').text(0)
// layui.laytpl(getTpl).render([], function (html) {
// $(".search_data_list").html(html);
// });
// }
// })
// },
// bindFun:function(){
// var self = this;
// $('.search_nav li').on('click',function(){
// var index = $(this).index();
// $(this).addClass('active').siblings().removeClass('active');
// $(".search_data_list").empty();
// $('.nav_title').find('span').text(0)
// if(index == 0){//商品
// self.getData(1)
// }else{//询价
// self.getData(2)
// }
// })
// }
// };
// indexSearch.init();
// })
$(function () { $(function () {
var indexSearch = { var indexSearch = {
key: Util.getRequest('key') || "",
init: function () { init: function () {
$('.input-search').val(this.key);
this.bindFun(); this.bindFun();
$('.search_sp').click(); $('.input_btn').click();
}, },
getData: function (type) { getData: function (type, time) {
var url = type==1?apis.goodsSearch:apis.inquirySearch; var self = this;
var url = type == 1 ? apis.goodsSearch : apis.inquirySearch;
IcController.getData(url, 'GET', { IcController.getData(url, 'GET', {
"offset": 8, "offset": 8,
"p": 1, "p": 1,
"goods_name/like": self.key,
"start_time": time
}, function (res) { }, function (res) {
var getTpl = ""; var getTpl = "";
if(type == 1){ if (type == 1) {
getTpl = sphtml.innerHTML getTpl = sphtml.innerHTML
}else{ } else {
getTpl = xjhtml.innerHTML getTpl = xjhtml.innerHTML
} }
if (res.errcode == 0) { if (res.errcode == 0) {
$('.nav_title').find('span').text(res.total); $('.nav_title').find('span').text(res.total)
var list = []; var list = [];
if(type == 1){ if (type == 1) {
list = res.goods_list list = res.goods_list
}else{ } else {
list = res.inquiry_list list = res.inquiry_list
} }
layui.laytpl(getTpl).render(list, function (html) { layui.laytpl(getTpl).render(list, function (html) {
$(".search_data_list").html(html); $(".goods_data_list").html(html);
}); });
} else if (res.errcode == 105001) { } else if (res.errcode == type == 1 ? 105013 : 105001) {
$('.nav_title').find('span').text(0) $('.nav_title').find('span').text(0)
layui.laytpl(getTpl).render([], function (html) { layui.laytpl(getTpl).render([], function (html) {
$(".search_data_list").html(html); $(".goods_data_list").html(html);
}); });
} }
}) })
}, },
bindFun:function(){ bindFun: function () {
var self = this; var self = this;
$('.search_nav li').on('click',function(){ $('.search_nav li').on('click', function () {
var index = $(this).index();
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass('active').siblings().removeClass('active');
$(".search_data_list").empty(); $(".goods_data_list").empty();
$('.nav_title').find('span').text(0) $('.nav_title').find('span').text(0);
if(index == 0){//商品 $('.jt').click();
self.getData(1) });
}else{//询价 $('.input_btn').on('click', function () {
self.getData(2) self.key = $('.input-search').val();
$('.search_sp').click();
});
$('.zz').on('click', '.fl', function () {
var index = $(this).index();
var spOrXj = 1;
var time = new Date(Util.getDay(0));
$(this).addClass('active').siblings().removeClass('active');
if ($('.search_xj').hasClass('active')) {
spOrXj = 2
}
if (index == 0) {
self.getData(spOrXj, time.getTime() / 1000)
} else if (index == 1) {
time = new Date(Util.getDay(-3));
self.getData(spOrXj, time.getTime() / 1000)
} else {
time = new Date(Util.getDay(-7));
self.getData(spOrXj, time.getTime() / 1000)
} }
}) })
} }
......
...@@ -46,6 +46,7 @@ $(function () { ...@@ -46,6 +46,7 @@ $(function () {
count: res.total, count: res.total,
limit: 7, limit: 7,
curr: page, curr: page,
layout:['prev', 'page', 'next','refresh'],
jump: function (obj, first) { jump: function (obj, first) {
if (!first) { if (!first) {
//分页回调调用 //分页回调调用
...@@ -97,7 +98,8 @@ $(function () { ...@@ -97,7 +98,8 @@ $(function () {
}, },
sxj: function (id, type) { sxj: function (id, type) {
//上下架 1上架 2下架 //上下架 1上架 2下架
IcController.getData(apis.inquirysave, 'GET', { var self = this;
IcController.getData(apis.inquirstatusysave, 'GET', {
"token": Util.getCookie('token') || "", "token": Util.getCookie('token') || "",
"inquiry_items_id": id, "inquiry_items_id": id,
"status": type "status": type
...@@ -106,7 +108,8 @@ $(function () { ...@@ -106,7 +108,8 @@ $(function () {
layer.msg('操作成功', { layer.msg('操作成功', {
time: 600 time: 600
}, function () { }, function () {
console.log('操作成功') self.getCount();
$('.layui-icon-refresh').click();
}); });
} else { } else {
layer.msg('操作失败') layer.msg('操作失败')
...@@ -158,7 +161,7 @@ $(function () { ...@@ -158,7 +161,7 @@ $(function () {
inquiry.getData(inquiry.params, 1); inquiry.getData(inquiry.params, 1);
}); });
//上架 //上架
$('.inquiry_data').on('click', '.sj', function (e) { $('.inquiry_data').on('click', '.fb', function (e) {
e.stopPropagation(); e.stopPropagation();
var userId = $(this).parent('.data_item').attr('userid'); var userId = $(this).parent('.data_item').attr('userid');
if ($(this).hasClass('disabled')) { if ($(this).hasClass('disabled')) {
......
$(function () {
var roborderObj = {
init: function () {
this.getData(1, 1);
this.bindFun();
},
getData: function (type, p) {
var self = this;
var params = {
"offset": 10,
"p": p,
};
if (type == 1) { //最新询价
params["add_time/order"] = "desc";
} else if (type == 2) { //今日询价
params["today"] = "1";
} else { //0回复询价
params["offer_num/eq"] = 0;
}
IcController.getData(apis.inquirySearch, 'GET', params,
function (res) {
var getTpl = zqTpl.innerHTML;
if (res.errcode === 0) {
$('#pagination').show();
layui.laytpl(getTpl).render(res.inquiry_list, function (html) {
$(".goods_data_list").empty().html(html);
layui.laypage.render({
elem: 'pagination',
theme: '#1080d0',
count: res.total,
limit: 10,
curr: p,
jump: function (obj, first) {
if (!first) {
//分页回调调用
self.getData(type, obj.curr)
}
}
});
});
} else {
layui.laytpl(getTpl).render([], function (html) {
$(".goods_data_list").empty().html(html);
$('#pagination').hide();
});
}
})
},
bindFun:function(){
var self = this;
$('.condition_content').find('.filter_span').on('click',function(){
var index = $(this).index();
$(this).addClass('active').siblings().removeClass('active');
$(".goods_data_list").empty();
$('#pagination').hide();
self.getData(index,1)
});
$('.roborder_content').on('click','.my_xj_item',function(){
var userid = $(this).attr('userid');
window.location.href = "/quotedetail?id=" + userid
});
//编辑
$('.edit_div').click(function () {
window.location.href = "/releaseinquiry"
});
}
};
roborderObj.init();
})
\ No newline at end of file
$(function () { $(function () {
var search = { var search = {
key: Util.getRequest('key') || "",
init: function () { init: function () {
$('.input-search').val(this.key);
this.bindFun(); this.bindFun();
$('.search_sp').click(); $('.input_btn').click();
}, },
getData: function (type, p) { getData: function (type, p, time) {
var self = this; var self = this;
var url = type == 1 ? apis.goodsSearch : apis.inquirySearch; var url = type == 1 ? apis.goodsSearch : apis.inquirySearch;
IcController.getData(url, 'GET', { IcController.getData(url, 'GET', {
"offset": 10, "offset": 10,
"p": p, "p": p,
"goods_name/like": self.key,
"start_time": time
}, function (res) { }, function (res) {
var getTpl = ""; var getTpl = "";
if(type == 1){ if (type == 1) {
getTpl = sphtml.innerHTML getTpl = sphtml.innerHTML
}else{ } else {
getTpl = xjhtml.innerHTML getTpl = xjhtml.innerHTML
} }
if (res.errcode == 0) { if (res.errcode == 0) {
$('#pagination').show(); $('#pagination').show();
$('.nav_title').find('span').text(res.total) $('.nav_title').find('span').text(res.total)
var list = []; var list = [];
if(type == 1){ if (type == 1) {
list = res.goods_list list = res.goods_list
}else{ } else {
list = res.inquiry_list list = res.inquiry_list
} }
layui.laytpl(getTpl).render(list, function (html) { layui.laytpl(getTpl).render(list, function (html) {
...@@ -37,12 +41,12 @@ $(function () { ...@@ -37,12 +41,12 @@ $(function () {
jump: function (obj, first) { jump: function (obj, first) {
if (!first) { if (!first) {
//分页回调调用 //分页回调调用
self.getData(type, obj.curr) self.getData(type, obj.curr, self.key, time)
} }
} }
}); });
}); });
} else if (res.errcode == 105001) { } else if (res.errcode == type == 1 ? 105013 : 105001) {
$('.nav_title').find('span').text(0) $('.nav_title').find('span').text(0)
layui.laytpl(getTpl).render([], function (html) { layui.laytpl(getTpl).render([], function (html) {
$(".goods_data_list").html(html); $(".goods_data_list").html(html);
...@@ -55,15 +59,32 @@ $(function () { ...@@ -55,15 +59,32 @@ $(function () {
bindFun: function () { bindFun: function () {
var self = this; var self = this;
$('.search_nav li').on('click', function () { $('.search_nav li').on('click', function () {
var index = $(this).index();
$(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();
if (index == 0) { //商品 $('.jt').click();
self.getData(1, 1) });
} else { //询价 $('.input_btn').on('click', function () {
self.getData(2, 1) self.key = $('.input-search').val();
$('.search_sp').click();
});
$('.zz').on('click', '.fl', function () {
var index = $(this).index();
var spOrXj = 1;
var time = new Date(Util.getDay(0));
$(this).addClass('active').siblings().removeClass('active');
if ($('.search_xj').hasClass('active')) {
spOrXj = 2
}
if (index == 0) {
self.getData(spOrXj, 1,time.getTime() / 1000)
} else if (index == 1) {
time = new Date(Util.getDay(-3));
self.getData(spOrXj, 1,time.getTime() / 1000)
} else {
time = new Date(Util.getDay(-7));
self.getData(spOrXj, 1,time.getTime() / 1000)
} }
}) })
} }
......
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