|
|
@ -88,6 +88,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<script type="text/javascript"> |
|
|
<script type="text/javascript"> |
|
|
|
|
|
var aa ="${ctx}" |
|
|
if (typeof console == "undefined") { |
|
|
if (typeof console == "undefined") { |
|
|
this.console = { |
|
|
this.console = { |
|
|
log: function (msg) { |
|
|
log: function (msg) { |
|
|
@ -98,17 +99,10 @@ |
|
|
var ws; |
|
|
var ws; |
|
|
|
|
|
|
|
|
function connect() { |
|
|
function connect() { |
|
|
//ws = new WebSocket("ws://{$sysconfig['gateway']}"); |
|
|
ws = new WebSocket("ws://127.0.0.1:8090/jchat"); |
|
|
ws = new WebSocket("wss://cs.btcaholic.com/ct"); |
|
|
//ws = new WebSocket("wss://cs.btcaholic.com/ct"); |
|
|
ws.onmessage = onmessage; |
|
|
ws.onmessage = onmessage; |
|
|
|
|
|
|
|
|
// ws.onopen = function(){ |
|
|
|
|
|
// if (ws.readyState===1) { |
|
|
|
|
|
// ws.send(); |
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
ws.onclose = function () { |
|
|
ws.onclose = function () { |
|
|
console.log("reconnct timer."); |
|
|
console.log("reconnct timer."); |
|
|
// setTimeout(function(){ |
|
|
// setTimeout(function(){ |
|
|
@ -218,15 +212,15 @@ |
|
|
|
|
|
|
|
|
// |
|
|
// |
|
|
function save_message(data) { |
|
|
function save_message(data) { |
|
|
$.post("{:url('Index/save_message')}", data, function (data) { |
|
|
$.post("v2/save_message", data, function (data) { |
|
|
//do nothing |
|
|
//do nothing |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$(function () { |
|
|
$(function () { |
|
|
$.post("{:url('Index/chat_record')}", "foid={$chat_user}&room_id={$room_id}", function (data) { |
|
|
$.post("chat_record", "foid=${toid}&room_id=${room_id}", function (data) { |
|
|
for (var i = 0; i < data.length; i++) { |
|
|
for (var i = 0; i < data.length; i++) { |
|
|
if (data[i].fid !== '{$room_id}') { |
|
|
if (data[i].fid !== '${room_id}') { |
|
|
$(".chat-content").append('<div class="heisay"><img class="portrait" src="/static/css/chat/img/0.jpg"><div class="say_content"><p>Customer Service' + data[i].time.substr(10, 9) + '</p><span>' + data[i].content + '</span></div></div>').parseEmotion(); |
|
|
$(".chat-content").append('<div class="heisay"><img class="portrait" src="/static/css/chat/img/0.jpg"><div class="say_content"><p>Customer Service' + data[i].time.substr(10, 9) + '</p><span>' + data[i].content + '</span></div></div>').parseEmotion(); |
|
|
} else { |
|
|
} else { |
|
|
$(".chat-content").append('<div class="mysay"><p>Me ' + data[i].time.substr(10, 9) + '</p><span>' + data[i].content + '</span></div>').parseEmotion(); |
|
|
$(".chat-content").append('<div class="mysay"><p>Me ' + data[i].time.substr(10, 9) + '</p><span>' + data[i].content + '</span></div>').parseEmotion(); |
|
|
@ -237,12 +231,3 @@ |
|
|
}); |
|
|
}); |
|
|
}) |
|
|
}) |
|
|
</script> |
|
|
</script> |
|
|
<script type="text/javascript"> |
|
|
|
|
|
|
|
|
|
|
|
// document.addEventListener('dblclick', function(e) { |
|
|
|
|
|
// e.preventDefault(); |
|
|
|
|
|
|
|
|
|
|
|
// }, { passive: false }); |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
</script> |
|
|
|