Commit c82f6320 by 施宇

11

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