Authored by 李奇

断链倒计时修改

... ... @@ -40,7 +40,7 @@ var key,
urls = {
makeEval: '/evalute/saveEvalute',
leaveMsg: '/leavemessage/saveLeavemessage',
evalReason: '/evalute/queryEvaluteReason',
evalReason: '/evalute/queryReasonByConversationId',
msgHistory: '/conversationMessage/pageList'
};
... ... @@ -55,7 +55,7 @@ encryptedUid = $encryptedUid.val();
socketConf.conversationMessage.encryptedUid = encryptedUid;
cmEntity = socketConf.conversationMessage;
// // 原始配置信息用于重新连线
// 原始配置信息用于重新连线
originConf = JSON.parse(JSON.stringify(socketConf));
// url前缀添加
... ... @@ -269,7 +269,6 @@ function enterSuccess(message) {
<p class="push-tip">
<span class="tip">
${message.content}
<span class="countdown"></span>
</span>
</p>
</div>`;
... ... @@ -277,9 +276,6 @@ function enterSuccess(message) {
// 添加消息
$msgList.append(liHtml);
$panelMainBody.scrollTop($panelMainBody[0].scrollHeight);
// 倒计时信息
countdown(message.newContent, $('.tip .countdown'));
}
/**
... ... @@ -382,6 +378,31 @@ function _handleCusMsg(rec, msgType, message) {
}
/**
* 链接终端倒计时
* @private
*/
function _breakCountdown(message) {
var liHtml;
liHtml =
`<div class="list-item">
<p class="push-tip">
<span class="tip">
${message.content}
<span class="countdown"></span>
</span>
</p>
</div>`;
$msgList.append(liHtml);
$panelMainBody.scrollTop($panelMainBody[0].scrollHeight);
// 倒计时信息
countdown(message.newContent, $('.tip .countdown'));
}
/**
* 处理客服消息
* @private
*/
... ... @@ -473,7 +494,7 @@ function showEvalModal() {
type: 'GET',
url: urls.evalReason,
data: {
customerSettingId: 0 // TODO
conversationId: socketConf.conversationMessage.conversationId
},
success: function(res) {
var data = res.data,
... ... @@ -515,6 +536,10 @@ function getMessage(rec) {
_handleCusMsg(rec, msgType, message);
break;
case allTypes.BREAK_TIME:
_breakCountdown(message);
break;
case allTypes.ROBOT_SEND:
rec.csName = rec.csName || '客服机器人';
message.newContent = message.newContent || '机器人暂时无法提供服务';
... ...
... ... @@ -12,8 +12,8 @@
* @returns {string}
*/
function _secsFormat(total, el) {
var mins = Math.floor(+total / 60);
var secs = +total - mins * 60;
var mins = Math.floor(total / 60);
var secs = total - mins * 60;
mins < 10 && (mins = '0' + mins);
secs < 10 && (secs = '0' + secs);
... ...
... ... @@ -11,6 +11,7 @@ var config = {
ENTER: 1, // 用户进入
LINK_SUCCESS: 2, // 连线客服成功
CU_SEND: 3, // 用户发消息
BREAK_TIME: 5, // 断链倒计时
ROBOT_SEND: 103, // 机器人消息
TRANSFER: 1006, // 会话转移
CS_ENTER: 10001, // 客服进入
... ... @@ -37,7 +38,7 @@ var config = {
sessionId: '',
encryptedUid: 0,
userHead: '//img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif', // 用户头像
userName: '18551982891', // 用户昵称
userName: '18551982891', // 用户账号
csId: 0,
type: 1,
serviceSortId: 0,
... ...