Commit 38b60c08 by 施宇

111

parent 3c2e6093
......@@ -48,7 +48,7 @@
<div class="search_div clr">
<div class="input_div fl">
<span class="icon iconfont iconjuxing"></span>
<input type="text" placeholder="请输入要搜索的内容">
<input type="text" placeholder="请输入要搜索的内容" class="search-input">
</div>
<div class="btn fl btn_60 btn_fz_18 input_btn bold btn_blue">
搜索
......
......@@ -27,7 +27,7 @@
<div class="search_div clr">
<div class="input_div fl">
<span class="icon iconfont iconjuxing"></span>
<input type="text" placeholder="请输入要搜索的型号">
<input type="text" placeholder="请输入要搜索的型号" class="search-input">
</div>
<div class="input_btn fl btn_48 btn bold btn_blue">
搜索
......@@ -263,11 +263,18 @@
});
$('.input_btn').click(function () {
var key = $('.search-input').val();
if (key) {
window.location.href = search_url+'/indexsearch?key='+key;
} else {
window.location.href = search_url+'/indexsearch'
})
}
});
$('.mobile_wrapper .lb_nav span').click(function () {
var index = $(this).index();
$('.mobile_wrapper .lb_div_content').css('left', -(index * 700/7) + 'vw');
$('.mobile_wrapper .lb_div_content').css('left', -(index * 700 / 7) + 'vw');
$(this).addClass('active').siblings().removeClass('active')
});
......
......@@ -15,7 +15,7 @@
<div class="search_div clr">
<div class="input_div fl">
<span class="icon iconfont iconjuxing"></span>
<input type="text" placeholder="请输入要搜索的内容">
<input type="text" placeholder="请输入要搜索的内容" class="input-search">
</div>
<div class="input_btn fl btn_48 btn bold btn_blue">
搜索
......@@ -33,19 +33,19 @@
<div class="zz condition_content">
<span class="bold">时间:</span>
<div class="condition_right_content clr">
<div class="fl active">今天</div>
<div class="fl">三天之内</div>
<div class="fl">本周</div>
<div class="fl jt">今天</div>
<div class="fl st">三天之内</div>
<div class="fl qt">七天之内</div>
</div>
</div>
<div class="fz condition_content ">
<!-- <div class="fz condition_content ">
<span class="bold">封装:</span>
<div class="condition_right_content clr">
<div class="fl">贸易商</div>
<div class="fl">贸易商</div>
<div class="fl">贸易商</div>
</div>
</div>
</div> -->
</div>
<div class="goods_data_list search_data_list">
</div>
......
......@@ -101,7 +101,7 @@
<div class="time fr ellipsis boxsiz">{{layui.util.toDateString(item.update_time * 1000)}}</div>
</div>
<a class="icon iconfont iconjuxing2 fr"></a>
{{# if(item['status/eq'] !== 1){ }}
{{# if(item['status'] == 1){ }}
{{# if(item['audit_status'] == 1){ }}
<a class="xj xj_status fr">下架</a>
{{# } else { }}
......
......@@ -13,7 +13,7 @@
<include file="public/top" />
<div class="right_content release_inquiry_content">
<div class="content">
<div class="nav_title">商品管理 > 发布商品 > 上传商品</div>
<div class="nav_title">询报价 > 发布询价</div>
<div class="inquiry_form">
<div class="top_title clr">
<h3 class="bold fl">发布询价</h3>
......
......@@ -17,7 +17,7 @@
<div class="search_div clr">
<div class="input_div fl">
<span class="icon iconfont iconjuxing"></span>
<input type="text" placeholder="请输入要搜索的内容">
<input type="text" placeholder="请输入要搜索的内容" class="input-search">
</div>
<div class="input_btn fl btn_48 btn bold btn_blue">
搜索
......@@ -29,25 +29,25 @@
</div>
<div class="search_condition">
<ul class="search_nav clr">
<li class="search_sp fl active">商品</li>
<li class="search_sp fl">商品</li>
<li class="search_xj fl">询价</li>
</ul>
<div class="zz condition_content">
<span class="bold">时间:</span>
<div class="condition_right_content clr">
<div class="fl active">今天 </div>
<div class="fl">三天之内</div>
<div class="fl">本周</div>
<div class="fl jt">今天 </div>
<div class="fl st">三天之内</div>
<div class="fl qt">七天之内</div>
</div>
</div>
<div class="fz condition_content ">
<!-- <div class="fz condition_content ">
<span class="bold">封装:</span>
<div class="condition_right_content clr">
<div class="fl">贸易商</div>
<div class="fl">贸易商</div>
<div class="fl">贸易商</div>
</div>
</div>
</div> -->
</div>
<div class="goods_data_list">
</div>
......
......@@ -550,6 +550,9 @@ body {
display: none;
}
}
.layui-icon {
display: none !important;
}
@font-face {
font-family: "iconfont";
src: url('../../fonts/iconfont.eot?t=1561691322757');
......@@ -846,4 +849,3 @@ body {
color: #ADB6BF;
cursor: pointer;
}
/*# sourceMappingURL=base.css.map */
\ No newline at end of file
......@@ -684,6 +684,9 @@ body {
display: none;
}
}
.layui-icon{
display: none !important;
}
// 字体样式
@import "./fonts.less";
......
......@@ -108,7 +108,7 @@
/***
* 询价上下架
*/
inquirysave: offer_url + "/inquiry/save",
inquirstatusysave: offer_url + "/inquiry/status/save",
/***
* 询价统计
*/
......
!function () {
! function () {
window.IcController = {
init: function () {
this.created(this).mounted(this).handleBind(this);
......@@ -47,7 +47,9 @@
//处理token失效的情况
if (data.errcode === 501 || data.err_code === 501) {
layer.msg('登录已失效,请重新登录', {time: 600}, function () {
layer.msg('登录已失效,请重新登录', {
time: 600
}, function () {
window.location.href = passport_url + '/login';
......@@ -77,7 +79,9 @@
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) {
......@@ -100,7 +104,7 @@
$(".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());
}
......@@ -151,7 +155,11 @@
//退出
$(".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) {
......@@ -328,6 +336,43 @@
}
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) {
......
......@@ -72,7 +72,14 @@ $(function () {
$(this).addClass('active').siblings().removeClass('active')
});
$('.input_btn').click(function () {
var key = $('.search-input').val();
if(key){
window.location.href = "/search?key="+key;
}else{
window.location.href = "/search"
}
});
$('.home_content').on('click', '.newXjIcon', function () {
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 () {
var indexSearch = {
key: Util.getRequest('key') || "",
init: function () {
$('.input-search').val(this.key);
this.bindFun();
$('.search_sp').click();
$('.input_btn').click();
},
getData: function (type) {
var url = type==1?apis.goodsSearch:apis.inquirySearch;
getData: function (type, time) {
var self = this;
var url = type == 1 ? apis.goodsSearch : apis.inquirySearch;
IcController.getData(url, 'GET', {
"offset": 8,
"p": 1,
"goods_name/like": self.key,
"start_time": time
}, function (res) {
var getTpl = "";
if(type == 1){
if (type == 1) {
getTpl = sphtml.innerHTML
}else{
} else {
getTpl = xjhtml.innerHTML
}
if (res.errcode == 0) {
$('.nav_title').find('span').text(res.total);
$('.nav_title').find('span').text(res.total)
var list = [];
if(type == 1){
if (type == 1) {
list = res.goods_list
}else{
} else {
list = res.inquiry_list
}
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)
layui.laytpl(getTpl).render([], function (html) {
$(".search_data_list").html(html);
$(".goods_data_list").html(html);
});
}
})
},
bindFun:function(){
bindFun: function () {
var self = this;
$('.search_nav li').on('click',function(){
$('.search_nav li').on('click', function () {
$(this).addClass('active').siblings().removeClass('active');
$(".goods_data_list").empty();
$('.nav_title').find('span').text(0);
$('.jt').click();
});
$('.input_btn').on('click', function () {
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');
$(".search_data_list").empty();
$('.nav_title').find('span').text(0)
if(index == 0){//商品
self.getData(1)
}else{//询价
self.getData(2)
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 () {
count: res.total,
limit: 7,
curr: page,
layout:['prev', 'page', 'next','refresh'],
jump: function (obj, first) {
if (!first) {
//分页回调调用
......@@ -97,7 +98,8 @@ $(function () {
},
sxj: function (id, type) {
//上下架 1上架 2下架
IcController.getData(apis.inquirysave, 'GET', {
var self = this;
IcController.getData(apis.inquirstatusysave, 'GET', {
"token": Util.getCookie('token') || "",
"inquiry_items_id": id,
"status": type
......@@ -106,7 +108,8 @@ $(function () {
layer.msg('操作成功', {
time: 600
}, function () {
console.log('操作成功')
self.getCount();
$('.layui-icon-refresh').click();
});
} else {
layer.msg('操作失败')
......@@ -158,7 +161,7 @@ $(function () {
inquiry.getData(inquiry.params, 1);
});
//上架
$('.inquiry_data').on('click', '.sj', function (e) {
$('.inquiry_data').on('click', '.fb', function (e) {
e.stopPropagation();
var userId = $(this).parent('.data_item').attr('userid');
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 () {
var search = {
key: Util.getRequest('key') || "",
init: function () {
$('.input-search').val(this.key);
this.bindFun();
$('.search_sp').click();
$('.input_btn').click();
},
getData: function (type, p) {
getData: function (type, p, time) {
var self = this;
var url = type == 1 ? apis.goodsSearch : apis.inquirySearch;
IcController.getData(url, 'GET', {
"offset": 10,
"p": p,
"goods_name/like": self.key,
"start_time": time
}, function (res) {
var getTpl = "";
if(type == 1){
if (type == 1) {
getTpl = sphtml.innerHTML
}else{
} else {
getTpl = xjhtml.innerHTML
}
if (res.errcode == 0) {
$('#pagination').show();
$('.nav_title').find('span').text(res.total)
var list = [];
if(type == 1){
if (type == 1) {
list = res.goods_list
}else{
} else {
list = res.inquiry_list
}
layui.laytpl(getTpl).render(list, function (html) {
......@@ -37,12 +41,12 @@ $(function () {
jump: function (obj, 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)
layui.laytpl(getTpl).render([], function (html) {
$(".goods_data_list").html(html);
......@@ -55,15 +59,32 @@ $(function () {
bindFun: function () {
var self = this;
$('.search_nav li').on('click', function () {
var index = $(this).index();
$(this).addClass('active').siblings().removeClass('active');
$(".goods_data_list").empty();
$('.nav_title').find('span').text(0);
$('#pagination').hide();
if (index == 0) { //商品
self.getData(1, 1)
} else { //询价
self.getData(2, 1)
$('.jt').click();
});
$('.input_btn').on('click', function () {
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