...
|
...
|
@@ -11,6 +11,7 @@ var $ = require('yoho-jquery'), |
|
|
uuid = require('uuid'),
|
|
|
emojiMap = require('./emoji-map'),
|
|
|
editArea = require('./edit-area'),
|
|
|
serviceApi = require('./service-api'),
|
|
|
broswer = require('./broswer'),
|
|
|
socketChat = require('./socket-chat'),
|
|
|
socketConf = require('./socket-config');
|
...
|
...
|
@@ -781,6 +782,9 @@ function pageInit() { |
|
|
* 获取历史聊天记录
|
|
|
*/
|
|
|
function fetchHistoryMsg() {
|
|
|
if(processInfo.loadingHistory) {
|
|
|
return;
|
|
|
}
|
|
|
processInfo.loadingHistory = true;
|
|
|
var msgList = [];
|
|
|
var data = {
|
...
|
...
|
@@ -790,11 +794,9 @@ function pageInit() { |
|
|
if (endTime) {
|
|
|
data.endTime = endTime;
|
|
|
}
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/service/history',
|
|
|
data: data,
|
|
|
success: function(res) {
|
|
|
|
|
|
serviceApi.history(data)
|
|
|
.done(function(res) {
|
|
|
if (res && res.code === 200) {
|
|
|
if (processInfo.hasMore) {
|
|
|
msgList = res.data.records || [];
|
...
|
...
|
@@ -802,8 +804,12 @@ function pageInit() { |
|
|
}
|
|
|
$history.hide();
|
|
|
processInfo.scrollLoad = true;
|
|
|
} else {
|
|
|
processInfo.loadingHistory = false;
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
.fail(function() {
|
|
|
processInfo.loadingHistory = false;
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
|