Commit c82f6320 by 施宇

11

parent d5b2a85c
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<!-- 询价模板 --> <!-- 询价模板 -->
<div class="my_xj_list clr"> <div class="my_xj_list clr">
{{# layui.each(d, function(index, item){ }} {{# layui.each(d, function(index, item){ }}
<div class="my_xj_item fl boxsiz"> <div class="my_xj_item fl boxsiz xj_item" style="cursor:pointer" userid="{{item.inquiry_items_id}}">
<div class="item_top clr"> <div class="item_top clr">
<span class="fl type xtype lineBlock"></span> <span class="fl type xtype lineBlock"></span>
<div class="fl num ellipsis">{{item.goods_name}}</div> <div class="fl num ellipsis">{{item.goods_name}}</div>
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<!-- 报价模板 --> <!-- 报价模板 -->
<div class="my_xj_list clr"> <div class="my_xj_list clr">
{{# layui.each(d, function(index, item){ }} {{# layui.each(d, function(index, item){ }}
<div class="my_xj_item fl boxsiz"> <div class="my_xj_item fl boxsiz bj_item" style="cursor:pointer" userid="{{item.inquiry_items_id}}" offerid="{{item.offer_id}}">
<div class="item_top clr"> <div class="item_top clr">
<span class="fl type btype lineBlock"></span> <span class="fl type btype lineBlock"></span>
<div class="fl num ellipsis">{{item.goods_name}}</div> <div class="fl num ellipsis">{{item.goods_name}}</div>
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
</div> </div>
<div class="new_xj_list"> <div class="new_xj_list">
{{# layui.each(d, function(index, item){ }} {{# layui.each(d, function(index, item){ }}
<div class="new_xj_item clr" userid="{{item.inquiry_items_id}}" offerid="{{item.offer_id}}"> <div class="new_xj_item clr" userid="{{item.inquiry_items_id}}" offerid="{{item.offer_id}}" style="cursor:pointer">
<div class="type fl bold ellipsis boxsiz">{{item.goods_name}}</div> <div class="type fl bold ellipsis boxsiz">{{item.goods_name}}</div>
<div class="brand fl ellipsis boxsiz">品牌:<span>{{item.brand_name}}</span></div> <div class="brand fl ellipsis boxsiz">品牌:<span>{{item.brand_name}}</span></div>
<div class="num fl ellipsis boxsiz">数量:<span>PCS{{item.number}}</span></div> <div class="num fl ellipsis boxsiz">数量:<span>PCS{{item.number}}</span></div>
......
...@@ -5,6 +5,7 @@ $(function () { ...@@ -5,6 +5,7 @@ $(function () {
appName: "icsales", appName: "icsales",
// defaultName:"18664936975", // defaultName:"18664936975",
defaultName: "18589050841", defaultName: "18589050841",
eleTarget: "18589050841",
init: function () { init: function () {
this.ieFun() this.ieFun()
this.connection(); this.connection();
...@@ -23,12 +24,13 @@ $(function () { ...@@ -23,12 +24,13 @@ $(function () {
} }
}, undefined, true) }, undefined, true)
}, },
getHistoryData: function (id) { getHistoryData: function (id, isCustomer) {
var self = this;
this.conn.fetchHistoryMessages({ this.conn.fetchHistoryMessages({
queue: id, queue: id,
count: "1000", count: "10",
success: function (data) { success: function (data) {
console.log(data) self.renderHistory(isCustomer, data, id)
}, },
fail: function (e) { fail: function (e) {
console.log(e) console.log(e)
...@@ -36,19 +38,51 @@ $(function () { ...@@ -36,19 +38,51 @@ $(function () {
} }
}) })
}, },
renderHistory: function (isCustomer, data) { renderHistory: function (isCustomer, data, id) {
var len = data.length; var len = data.length;
var arr = [];
for (var i = 0; i < len; i++) { for (var i = 0; i < len; i++) {
var fromId = data[i].from,//发送者的id var fromId = data[i].from, //发送者的id
toId = data[i].to;//接收者的id toId = data[i].to; //接收者的id
if (data[i].from == '18271408717') {//自己发送的 if (fromId == '18271408717') { //自己发送的
this.historyHtml(1) this.historyHtml(1, data[i])
} else {//自己接收的 } else { //自己接收的
this.historyHtml(2 ) this.historyHtml(2, data[i]);
if (data.action == 'action') {
arr.push({
type: 1,
data: {
ext: data.ext
}
})
} else {
if (typeof (data.data) == 'string') {
arr.push({
type: 3,
data: {
ext: data.ext
}
})
} else {
arr.push({
type: 3,
data: {
ext: data.ext
}
})
}
}
} }
} }
}, },
historyHtml:function(leftOrRight,data){//1右边 2左边 historyHtml: function (leftOrRight, data) { //1右边 2左边
if (leftOrRight == 1) {
} else {
}
}, },
defaultUser: function () { defaultUser: function () {
...@@ -364,7 +398,7 @@ $(function () { ...@@ -364,7 +398,7 @@ $(function () {
console.log('登入成功') console.log('登入成功')
self.defaultUser(); self.defaultUser();
self.singleChat(); self.singleChat();
self.getHistoryData(self.defaultName); self.getHistoryData(self.defaultName, true);
}, },
onTextMessage: function (message) { onTextMessage: function (message) {
......
...@@ -73,12 +73,12 @@ $(function () { ...@@ -73,12 +73,12 @@ $(function () {
}); });
$('.input_btn').click(function () { $('.input_btn').click(function () {
var key = $('.search-input').val(); var key = $('.search-input').val();
if(key){ if (key) {
window.location.href = "/search?key="+key; window.location.href = "/search?key=" + key;
}else{ } else {
window.location.href = "/search" window.location.href = "/search"
} }
}); });
$('.home_content').on('click', '.newXjIcon', function () { $('.home_content').on('click', '.newXjIcon', function () {
...@@ -88,6 +88,15 @@ $(function () { ...@@ -88,6 +88,15 @@ $(function () {
var userid = $(this).parent('.new_xj_item').attr('userid'); var userid = $(this).parent('.new_xj_item').attr('userid');
window.location.href = "/quotedetail?id=" + userid window.location.href = "/quotedetail?id=" + userid
}); });
$('.goods_data_list').on('click', '.xj_item', function () {
var userid = $(this).attr('userid');
window.location.href = "/inquirydetail?id=" + userid
});
$('.goods_data_list').on('click', '.bj_item', function () {
var userid = $(this).attr('userid'),
offerid = $(this).attr('offerid')
window.location.href = "/quotedetail?id=" + userid + '&offerid=' + offerid
})
} }
}; };
homeObj.init() homeObj.init()
......
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