...
|
...
|
@@ -24,7 +24,6 @@ var allRTs, |
|
|
assetsPrefix,
|
|
|
cursorPosition,
|
|
|
configDomains,
|
|
|
hasMore = true,
|
|
|
titleInterval,
|
|
|
$html = $('html'),
|
|
|
$window = $(window),
|
...
|
...
|
@@ -60,14 +59,6 @@ var processInfo = { |
|
|
savedEval: false // 是否保存过评论
|
|
|
};
|
|
|
|
|
|
var key,
|
|
|
urls = {
|
|
|
makeEval: '/evalute/saveEvalute',
|
|
|
leaveMsg: '/leavemessage/saveLeavemessage',
|
|
|
msgHistory: '/conversationMessage/pageList',
|
|
|
evalReason: '/evalute/queryReasonByConversationId'
|
|
|
};
|
|
|
|
|
|
require('bootstrap');
|
|
|
require('../common');
|
|
|
require('blueimp-file-upload/js/jquery.iframe-transport');
|
...
|
...
|
@@ -80,6 +71,7 @@ encryptedUid = $encryptedUid.val(); |
|
|
assetsPrefix = $assetsPrefix.val();
|
|
|
socketConfCM = socketConf.conversationMessage;
|
|
|
socketConfCM.encryptedUid = encryptedUid;
|
|
|
|
|
|
// 原始配置信息用于重新连线
|
|
|
originConf = JSON.parse(JSON.stringify(socketConf));
|
|
|
|
...
|
...
|
@@ -511,14 +503,12 @@ function pageInit() { |
|
|
$evalModal.find('.discontent').empty().append(dom);
|
|
|
}
|
|
|
|
|
|
// todo
|
|
|
// 拉取评价原因
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: urls.evalReason,
|
|
|
data: {
|
|
|
conversationId: socketConfCM.conversationId
|
|
|
},
|
|
|
success: function success(res) {
|
|
|
serviceApi.reason({
|
|
|
conversationId: socketConfCM.conversationId
|
|
|
})
|
|
|
.done(function(res) {
|
|
|
var data = res.data,
|
|
|
len = data.length;
|
|
|
|
...
|
...
|
@@ -527,8 +517,7 @@ function pageInit() { |
|
|
len && discontentHtml(len, data);
|
|
|
}
|
|
|
$evalModal.modal('show');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -782,15 +771,16 @@ function pageInit() { |
|
|
* 获取历史聊天记录
|
|
|
*/
|
|
|
function fetchHistoryMsg() {
|
|
|
if(processInfo.loadingHistory) {
|
|
|
return;
|
|
|
}
|
|
|
processInfo.loadingHistory = true;
|
|
|
var msgList = [];
|
|
|
var data = {
|
|
|
encryptedUid: encryptedUid
|
|
|
};
|
|
|
|
|
|
if (processInfo.loadingHistory) {
|
|
|
return;
|
|
|
}
|
|
|
processInfo.loadingHistory = true;
|
|
|
|
|
|
if (endTime) {
|
|
|
data.endTime = endTime;
|
|
|
}
|
...
|
...
|
@@ -863,23 +853,15 @@ function pageInit() { |
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: urls.leaveMsg,
|
|
|
data: {
|
|
|
content: val,
|
|
|
encryptedUid: encryptedUid,
|
|
|
conversationId: socketConfCM.newConversationId || socketConfCM.conversationId
|
|
|
},
|
|
|
success: function(res) {
|
|
|
if (res && res.code === 200) {
|
|
|
lMsg.modal('hide');
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
serviceApi.leaveMsg({
|
|
|
content: val,
|
|
|
encryptedUid: encryptedUid,
|
|
|
conversationId: socketConfCM.conversationId
|
|
|
})
|
|
|
.done(function() {})
|
|
|
.always(function() {
|
|
|
lMsg.modal('hide');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 提交评价
|
...
|
...
|
@@ -911,14 +893,9 @@ function pageInit() { |
|
|
data.reasonMsg = reason;
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: urls.makeEval,
|
|
|
data: data,
|
|
|
success: function(res) {
|
|
|
// 提交评价过后,不管是否成功都应该关闭弹框
|
|
|
serviceApi.evaluate(data)
|
|
|
.done(function(res) {
|
|
|
processInfo.promoter = 1;
|
|
|
mEval.modal('hide');
|
|
|
$btnEval.hide();
|
|
|
processInfo.savedEval = true;
|
|
|
|
...
|
...
|
@@ -933,11 +910,10 @@ function pageInit() { |
|
|
window.close();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
})
|
|
|
.always(function() {
|
|
|
mEval.modal('hide');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 根节点高度设置
|
...
|
...
|
@@ -1193,11 +1169,12 @@ function pageInit() { |
|
|
// 滚动加载更多
|
|
|
$panelMainBody.scroll(function() {
|
|
|
var isLoadingArea = $panelMainBody.scrollTop() < 100;
|
|
|
isLoadingArea
|
|
|
&& processInfo.scrollLoad
|
|
|
&& !processInfo.loadingHistory
|
|
|
&& processInfo.hasMore
|
|
|
&& fetchHistoryMsg();
|
|
|
|
|
|
isLoadingArea &&
|
|
|
processInfo.scrollLoad &&
|
|
|
!processInfo.loadingHistory &&
|
|
|
processInfo.hasMore &&
|
|
|
fetchHistoryMsg();
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1209,13 +1186,6 @@ function pageInit() { |
|
|
success: function(domains) {
|
|
|
configDomains = domains;
|
|
|
|
|
|
// url前缀添加
|
|
|
for (key in urls) {
|
|
|
if (urls.hasOwnProperty(key)) {
|
|
|
urls[key] = configDomains.imCs + urls[key];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 检查支持性
|
|
|
(function() {
|
|
|
if (!window.WebSocket) {
|
...
|
...
|
|