Commit 3ec8a6e3 by 施宇

bug修复

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