Commit 3ec8a6e3 by 施宇

bug修复

Signed-off-by: shiyu <847476962@qq.com>
parent 5c55a957
...@@ -263,14 +263,19 @@ ...@@ -263,14 +263,19 @@
}); });
$('.input_btn').click(function () { $('.input_btn').click(function () {
var key = $('.search-input').val(); var key = $.trim($('.search-input').val());
if (key) { if (key.length < 3) {
window.location.href = search_url+'/indexsearch?key='+key; layer.msg('搜索内容太短')
} else {
var token = Util.getCookie('token') || "";
if (token) {
window.location.href = home_url + '/search?key=' + key + '&type=1&time=1';
} else { } else {
window.location.href = search_url+'/indexsearch'
}
window.location.href = search_url + '/indexsearch?key=' + key + '&type=1&time=1';
}
}
}); });
$('.mobile_wrapper .lb_nav span').click(function () { $('.mobile_wrapper .lb_nav span').click(function () {
var index = $(this).index(); var index = $(this).index();
......
...@@ -175,12 +175,16 @@ ...@@ -175,12 +175,16 @@
<div class="item_left_top quote_item_left_top"> <div class="item_left_top quote_item_left_top">
<h3 class="bold fl ellipsis boxsiz">{{item.goods_name}}</h3> <h3 class="bold fl ellipsis boxsiz">{{item.goods_name}}</h3>
<div class="price fl bold ellipsis boxsiz"> <div class="price fl bold ellipsis boxsiz">
{{# if(!item.price||item.price=='0.00'||item.price=='0'){ }}
未回复
{{# } else { }}
{{# if(item.currency == 1){ }} {{# if(item.currency == 1){ }}
{{# } else { }} {{# } else { }}
$ $
{{# } }} {{# } }}
{{item.price}} {{item.price}}
{{# } }}
</div> </div>
<div class="fr time">报价时间:<span>{{layui.util.toDateString(d.add_time * 1000)}}</span></div> <div class="fr time">报价时间:<span>{{layui.util.toDateString(d.add_time * 1000)}}</span></div>
</div> </div>
......
<div class="nav_left"> <div class="nav_left">
<div class="nav_content boxsiz"> <div class="nav_content boxsiz">
<div class="nav_left_header"> <div class="nav_left_header" id="nav_logo" style="cursor:pointer">
<div class="nav_logo"> <div class="nav_logo">
<a href="/"> <a>
<img src="__PUBLIC__/images/navlogo.png" alt="IClogo"> <img src="__PUBLIC__/images/navlogo.png" alt="IClogo">
</a> </a>
</div> </div>
......
...@@ -23,7 +23,7 @@ $(function () { ...@@ -23,7 +23,7 @@ $(function () {
}, function (res) { }, function (res) {
if (res.err_code == 0) { if (res.err_code == 0) {
self.img = res.data.avatar; self.img = res.data.avatar;
self.name = res.data.company_name; self.name = res.data.company_name||'--';
self.id = res.data.user_id + ''; self.id = res.data.user_id + '';
self.getHistoryUsers(res.data.im_username, res.data.im_password); self.getHistoryUsers(res.data.im_username, res.data.im_password);
...@@ -95,7 +95,7 @@ $(function () { ...@@ -95,7 +95,7 @@ $(function () {
img = this.templateObj.userImg || (dist + "/images/default.jpg") img = this.templateObj.userImg || (dist + "/images/default.jpg")
} else { } else {
id = obj.im_username; id = obj.im_username;
name = obj.company_name; name = obj.company_name || '--';
img = obj.avatar || (dist + "/images/default.jpg") img = obj.avatar || (dist + "/images/default.jpg")
} }
...@@ -443,6 +443,7 @@ $(function () { ...@@ -443,6 +443,7 @@ $(function () {
}, //收到表情消息; }, //收到表情消息;
onCmdMessage: function (message) { onCmdMessage: function (message) {
console.log(message)
self.receiveData(1, { self.receiveData(1, {
name: message.ext.name||'--', name: message.ext.name||'--',
id: message.ext.id, id: message.ext.id,
......
...@@ -170,6 +170,14 @@ ...@@ -170,6 +170,14 @@
$('.xbj_li').find('.li_right').removeClass('iconjuxing15').addClass('iconjuxing12'); $('.xbj_li').find('.li_right').removeClass('iconjuxing15').addClass('iconjuxing12');
} }
}); });
$('#nav_logo').on('click',function(){
var token = Util.getCookie('token') || "";
if(token){
window.location.href = index_url;
}else{
window.location.href = index_url;
}
})
//退出 //退出
$(".nav_end").on('click', function () { $(".nav_end").on('click', function () {
......
...@@ -71,11 +71,11 @@ $(function () { ...@@ -71,11 +71,11 @@ $(function () {
$(this).addClass('active').siblings().removeClass('active') $(this).addClass('active').siblings().removeClass('active')
}); });
$('.input_btn').click(function () { $('.input_btn').click(function () {
var key = $('.search-input').val(); var key = $.trim($('.search-input').val());
if (key) { if (key.length<3) {
window.location.href = "/search?key=" + key; layer.msg('搜索内容太短')
} else { } else {
window.location.href = "/search" window.location.href = "/search?key=" + key+'&type=1&time=1';
} }
......
$(function () { $(function () {
var indexSearch = { var indexSearch = {
key: Util.getRequest('key') || "", key: Util.getRequest('key') || "",
type: Util.getRequest('type') || "",
time: Util.getRequest('time') || "",
initKey: Util.getRequest('key') || "",
init: function () { init: function () {
$('.input-search').val(this.key); $('.input-search').val(this.key);
this.bindFun(); this.bindFun();
$('.input_btn').click(); this.renderPage()
},
renderPage: function () {
if (this.type == 2) {
$('.search_nav ').find('.search_xj').addClass('active').siblings().removeClass('active');
} else {
$('.search_nav ').find('.search_sp').addClass('active').siblings().removeClass('active');
}
if (this.time == 2) {
$('.condition_right_content').find('.st').click()
} else if (this.time == 3) {
$('.condition_right_content').find('.qt').click()
} else {
$('.condition_right_content').find('.jt').click()
};
$('.input-search').val(this.key);
}, },
getData: function (type, time) { getData: function (type, time) {
var self = this; var self = this;
...@@ -13,7 +30,7 @@ $(function () { ...@@ -13,7 +30,7 @@ $(function () {
IcController.getData(url, 'GET', { IcController.getData(url, 'GET', {
"offset": 8, "offset": 8,
"p": 1, "p": 1,
"goods_name/like": self.key, "goods_name/like": self.initKey,
"start_time": time "start_time": time
}, function (res) { }, function (res) {
var getTpl = ""; var getTpl = "";
...@@ -45,29 +62,50 @@ $(function () { ...@@ -45,29 +62,50 @@ $(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();
if($(this).hasClass('active')){
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);
$('.input-search').val('');
self.initKey = "";
if(index == 0){
self.type = 1
}else{
self.type = 2
}
$('.jt').click(); $('.jt').click();
}); });
$('.input_btn').on('click', function () { $('.input_btn').on('click', function () {
self.key = $('.input-search').val(); var len = $.trim($('.input-search').val());
$('.search_sp').click(); if (len < 3) {
layer.msg('搜索内容太短')
} else {
self.initKey = $('.input-search').val();
window.location.replace("/indexsearch?key=" + self.initKey+'&type='+self.type+'&time='+self.time);
}
}); });
$('.zz').on('click', '.fl', function () { $('.zz').on('click', '.fl', function () {
var index = $(this).index(); var index = $(this).index();
var spOrXj = 1; var spOrXj;
var time = Util.getDay(0); var time = Util.getDay(0);
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass('active').siblings().removeClass('active');
if ($('.search_xj').hasClass('active')) { if (self.type == 2) {
spOrXj = 2 spOrXj = 2
}else{
spOrXj = 1
} }
if (index == 0) { if (index == 0) {
self.time = 1;
self.getData(spOrXj, time) self.getData(spOrXj, time)
} else if (index == 1) { } else if (index == 1) {
self.time = 2;
time = Util.getDay(-3); time = Util.getDay(-3);
self.getData(spOrXj, time) self.getData(spOrXj, time)
} else { } else {
self.time = 3;
time = Util.getDay(-7); time = Util.getDay(-7);
self.getData(spOrXj, time) self.getData(spOrXj, time)
} }
......
$(function () { $(function () {
var quote = { var quote = {
params: { params: {
"offset": 7, "offset": 10,
"p": 1, "p": 1,
"token": Util.getCookie('token') || "" "token": Util.getCookie('token') || ""
}, },
...@@ -45,7 +45,7 @@ $(function () { ...@@ -45,7 +45,7 @@ $(function () {
elem: 'pagination', elem: 'pagination',
theme: '#1080d0', theme: '#1080d0',
count: res.total, count: res.total,
limit: 7, limit: 10,
curr: page, curr: page,
jump: function (obj, first) { jump: function (obj, first) {
if (!first) { if (!first) {
......
$(function () { $(function () {
var quotedetail = { var quotedetail = {
list: [],
init: function () { init: function () {
this.getUserData(); this.getUserData();
this.getMybjData(); this.getMybjData();
...@@ -36,13 +37,14 @@ $(function () { ...@@ -36,13 +37,14 @@ $(function () {
var params = { var params = {
"token": Util.getCookie('token') || "" "token": Util.getCookie('token') || ""
}; };
if(Util.getRequest('offerid')){ var self = this;
if (Util.getRequest('offerid')) {
params["offer_id/eq"] = Util.getRequest('offerid') params["offer_id/eq"] = Util.getRequest('offerid')
}else{ } else {
params["inquiry_items_id/eq"] = Util.getRequest('id') || "" params["inquiry_items_id/eq"] = Util.getRequest('id') || ""
} }
IcController.getData(apis.offerinfo, 'GET',params, function (res) { IcController.getData(apis.offerinfo, 'GET', params, function (res) {
var getXj = xjTpl.innerHTML; var getXj = xjTpl.innerHTML;
if (res.errcode == 0) { if (res.errcode == 0) {
if (res.total == 0) { if (res.total == 0) {
...@@ -53,6 +55,7 @@ $(function () { ...@@ -53,6 +55,7 @@ $(function () {
layui.laytpl(getXj).render(res.data[0].items, function (html) { layui.laytpl(getXj).render(res.data[0].items, function (html) {
$(".quote_detail_content .bj_detail").empty().html(html); $(".quote_detail_content .bj_detail").empty().html(html);
}); });
self.list = res.data[0].items
} }
} else { } else {
...@@ -85,6 +88,7 @@ $(function () { ...@@ -85,6 +88,7 @@ $(function () {
}, },
bindFun: function () { bindFun: function () {
var self = this;
$('.cz_mask').on('click', function () { $('.cz_mask').on('click', function () {
$('.from_mask').fadeOut() $('.from_mask').fadeOut()
}); });
...@@ -92,7 +96,47 @@ $(function () { ...@@ -92,7 +96,47 @@ $(function () {
if ($(this).hasClass('disabled')) { if ($(this).hasClass('disabled')) {
return return
} else { } else {
$('.from_mask').fadeIn() var len = self.list.length;
var parent = $('.from_mask');
if (len) {
var targetItem = self.list[len - 1];
console.log(targetItem)
if (targetItem.goods_name) {
parent.find('[name="goods_name"]').val(targetItem.goods_name)
}
if (targetItem.brand_name) {
parent.find('[name="brand_name"]').val(targetItem.brand_name)
}
if (targetItem.encap) {
parent.find('[name="encap"]').val(targetItem.encap)
}
if (targetItem.number) {
parent.find('[name="number"]').val(targetItem.number)
}
if (!targetItem.price || targetItem.price == '0.00' || targetItem.price == '0') {
parent.find('[name="price"]').val()
parent.find('[name="currency"]').val('1');
layui.form.render('select');
} else {
parent.find('[name="price"]').val(targetItem.price)
if (targetItem.currency == 1) {
parent.find('[name="currency"]').val('1')
} else {
parent.find('[name="currency"]').val('2')
}
layui.form.render('select');
}
if (targetItem.delivery_time === '现货') {
parent.find('.layui-form-radio').eq(0).trigger('click');
} else {
parent.find('.layui-form-radio').eq(1).trigger('click');
parent.find('[name="day"]').val(targetItem.delivery_time.slice(0, -1))
}
if (targetItem.remark) {
parent.find('[name="remark"]').val(targetItem.remark)
}
}
parent.fadeIn()
} }
}); });
...@@ -141,7 +185,7 @@ $(function () { ...@@ -141,7 +185,7 @@ $(function () {
url = apis.offercontinue; url = apis.offercontinue;
params = $.extend({}, data.field, { params = $.extend({}, data.field, {
token: Util.getCookie('token') || "", token: Util.getCookie('token') || "",
offer_id:$('.bj_item')[0].getAttribute('offerid') offer_id: $('.bj_item')[0].getAttribute('offerid')
}) })
} }
......
...@@ -9,6 +9,7 @@ $(function () { ...@@ -9,6 +9,7 @@ $(function () {
var params = { var params = {
"offset": 10, "offset": 10,
"p": p, "p": p,
"token": Util.getCookie('token') || ""
}; };
if (type == 1) { //最新询价 if (type == 1) { //最新询价
params["add_time/order"] = "desc"; params["add_time/order"] = "desc";
......
$(function () { $(function () {
var search = { var search = {
key: Util.getRequest('key') || "", key: Util.getRequest('key') || "",
type: Util.getRequest('type') || "",
time: Util.getRequest('time') || "",
initKey: Util.getRequest('key') || "",
init: function () { init: function () {
$('.input-search').val(this.key); $('.input-search').val(this.key);
this.bindFun(); this.bindFun();
$('.input_btn').click(); this.renderPage()
}, },
renderPage: function () {
if (this.type == 2) {
$('.search_nav ').find('.search_xj').addClass('active').siblings().removeClass('active');
} else {
$('.search_nav ').find('.search_sp').addClass('active').siblings().removeClass('active');
}
if (this.time == 2) {
$('.condition_right_content').find('.st').click()
} else if (this.time == 3) {
$('.condition_right_content').find('.qt').click()
} else {
$('.condition_right_content').find('.jt').click()
};
$('.input-search').val(this.key);
},
getData: function (type, p, time) { 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, "goods_name/like": self.initKey,
"start_time": time "start_time": time,
"token": Util.getCookie('token') || ""
}, function (res) { }, function (res) {
var getTpl = ""; var getTpl = "";
if (type == 1) { if (type == 1) {
...@@ -59,39 +79,60 @@ $(function () { ...@@ -59,39 +79,60 @@ $(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();
if($(this).hasClass('active')){
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('');
self.initKey = "";
if(index == 0){
self.type = 1
}else{
self.type = 2
}
$('.jt').click(); $('.jt').click();
}); });
$('.input_btn').on('click', function () { $('.input_btn').on('click', function () {
self.key = $('.input-search').val(); var len = $.trim($('.input-search').val());
$('.search_sp').click(); if (len < 3) {
layer.msg('搜索内容太短')
} else {
self.initKey = $('.input-search').val();
window.location.replace("/search?key=" + self.initKey+'&type='+self.type+'&time='+self.time);
}
}); });
$('.zz').on('click', '.fl', function () { $('.zz').on('click', '.fl', function () {
var index = $(this).index(); var index = $(this).index();
var spOrXj = 1; var spOrXj;
var time = Util.getDay(0); var time = Util.getDay(0);
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass('active').siblings().removeClass('active');
if ($('.search_xj').hasClass('active')) { if (self.type == 2) {
spOrXj = 2 spOrXj = 2
}else{
spOrXj = 1
} }
if (index == 0) { if (index == 0) {
self.getData(spOrXj, 1,time) self.time = 1;
self.getData(spOrXj, 1, time)
} else if (index == 1) { } else if (index == 1) {
self.time = 2;
time = Util.getDay(-3); time = Util.getDay(-3);
self.getData(spOrXj, 1,time) self.getData(spOrXj, 1, time)
} else { } else {
self.time = 3;
time = Util.getDay(-7); time = Util.getDay(-7);
self.getData(spOrXj, 1,time) self.getData(spOrXj, 1, time)
} }
}); });
$('.goods_data_list').on('click','.xj_item',function(){ $('.goods_data_list').on('click', '.xj_item', function () {
var userid = $(this).attr('userid'); var userid = $(this).attr('userid');
window.location.href = "/quotedetail?id=" + userid window.location.href = "/quotedetail?id=" + userid
}); });
$('.goods_data_list').on('click','.sp_item',function(){ $('.goods_data_list').on('click', '.sp_item', function () {
var goodid = $(this).attr('goodid'); var goodid = $(this).attr('goodid');
window.location.href = "/gooddetail?type=2&id=" + goodid window.location.href = "/gooddetail?type=2&id=" + goodid
}); });
......
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