Authored by 李奇

修改

... ... @@ -35,9 +35,65 @@ const index = (req, res) => {
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
},
{
isCs: true,
content: 123
}
]
}); //todo
}); // todo
};
... ...
... ... @@ -22,7 +22,9 @@
<p class="order-amount">订单金额:¥{{lastOrderAmount}}</p>
<div class="order-other">
<span class="state">订单状态:{{orderStatusDesc}}</span>
<span class="btn send-order">发送订单</span>
<span class="btn send-order data-no="{{orderCode}}"
data-nm="{{buyNumber}}" data-time="{{createTime}}"
data-status="{{orderStatusDesc}}">发送订单</span>
</div>
</div>
</div>
... ...
... ... @@ -33,6 +33,120 @@
<span class="about-hist no-his">近一周没有历史消息</span>
</div>
{{/if}}
<div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div>
<div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div>
<div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div>
<div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div> <div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div>
<div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div>
<div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div> <div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div>
<div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div>
<div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div> <div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div>
<div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div>
<div class="list-item host">
<img src="/img/service/agent-avatar.png" class="avatar">
<div class="item-detail">
<span class="time">客服助手 {{sendTimeShort}}</span>
<div class="msg-bubble">
<span>{{content}}</span>
</div>
</div>
</div>
</div>
</div>
<div class="main-footer">
... ...
... ... @@ -8,8 +8,8 @@
<div class="cus-body">
<div class="stars">
<span class="star positive"></span>
<span class="star"></span>
<span class="star"></span>
<span class="star positive"></span>
<span class="star positive"></span>
<span class="star"></span>
<span class="star"></span>
<p class="star-text">一般</p>
... ... @@ -22,11 +22,10 @@
</div>
<div class="dis-row">
<span class="type">客服对业务不熟悉</span>
<span class="type chosen">话语不明确</span>
<span class="type">话语不明确</span>
</div>
</div>
<textarea maxlength="50" placeholder="请您输入不满意的其他原因" spellcheck="false"></textarea>
<textarea class="other-reason" maxlength="50" placeholder="请您输入不满意的其他原因" spellcheck="false"></textarea>
</div>
<div class="cus-footer">
<button class="btn dark submit">提交</button>
... ...
... ... @@ -159,115 +159,115 @@ function setEmoji(e) {
comp = $('.emoji-component');
var emojiMap = [
{file: "100", text: "/微笑", code: "/::)"},
{file: "101", text: "/撇嘴", code: "/::~"},
{file: "102", text: "/色", code: "/::B"},
{file: "103", text: "/发呆", code: "/::|"},
{file: "104", text: "/得意", code: "/:8-)"},
{file: "105", text: "/流泪", code: "/::<"},
{file: "106", text: "/害羞", code: "/::$"},
{file: "107", text: "/闭嘴", code: "/::X"},
{file: "108", text: "/睡", code: "/::Z"},
{file: "109", text: "/大哭", code: "/::'("},
{file: "110", text: "/尴尬", code: "/::-|"},
{file: "111", text: "/发怒", code: "/::@"},
{file: "112", text: "/调皮", code: "/::P"},
{file: "113", text: "/呲牙", code: "/::D"},
{file: "114", text: "/惊讶", code: "/::O"},
{file: "115", text: "/难过", code: "/::("},
{file: "116", text: "/酷", code: "/::+"},
{file: "117", text: "/冷汗", code: "/:--b"},
{file: "118", text: "/抓狂", code: "/::Q"},
{file: "119", text: "/吐", code: "/::T"},
{file: "120", text: "/偷笑", code: "/:,@P"},
{file: "121", text: "/愉快", code: "/:,@-D"},
{file: "122", text: "/白眼", code: "/::d"},
{file: "123", text: "/傲慢", code: "/:,@o"},
{file: "124", text: "/饥饿", code: "/::g"},
{file: "125", text: "/困", code: "/:|-)"},
{file: "126", text: "/惊恐", code: "/::!"},
{file: "127", text: "/流汗", code: "/::L"},
{file: "128", text: "/憨笑", code: "/::>"},
{file: "129", text: "/悠闲", code: "/::,@"},
{file: "130", text: "/奋斗", code: "/:,@f"},
{file: "131", text: "/咒骂", code: "/::-S"},
{file: "132", text: "/疑问", code: "/:?"},
{file: "133", text: "/嘘", code: "/:,@x"},
{file: "134", text: "/晕", code: "/:,@@"},
{file: "135", text: "/疯了", code: "/::8"},
{file: "136", text: "/衰", code: "/:,@!"},
{file: "137", text: "/骷髅", code: "/:!!!"},
{file: "138", text: "/敲打", code: "/:xx"},
{file: "139", text: "/再见", code: "/:bye"},
{file: "140", text: "/擦汗", code: "/:wipe"},
{file: "141", text: "/抠鼻", code: "/:dig"},
{file: "142", text: "/鼓掌", code: "/:handclap"},
{file: "143", text: "/糗大了", code: "/:&-("},
{file: "144", text: "/坏笑", code: "/:B-)"},
{file: "145", text: "/左哼哼", code: "/:<@"},
{file: "146", text: "/右哼哼", code: "/:@>"},
{file: "147", text: "/哈欠", code: "/::-O"},
{file: "148", text: "/鄙视", code: "/:>-|"},
{file: "149", text: "/委屈", code: "/:P-("},
{file: "150", text: "/快哭了", code: "/::'|"},
{file: "151", text: "/阴险", code: "/:X-)"},
{file: "152", text: "/亲亲", code: "/::*"},
{file: "153", text: "/吓", code: "/:@x"},
{file: "154", text: "/可怜", code: "/:8*"},
{file: "155", text: "/菜刀", code: "/:pd"},
{file: "156", text: "/西瓜", code: "/:<W>"},
{file: "157", text: "/啤酒", code: "/:beer"},
{file: "158", text: "/篮球", code: "/:basketb"},
{file: "159", text: "/乒乓", code: "/:oo"},
{file: "160", text: "/咖啡", code: "/:coffee"},
{file: "161", text: "/饭", code: "/:eat"},
{file: "162", text: "/猪头", code: "/:pig"},
{file: "163", text: "/玫瑰", code: "/:rose"},
{file: "164", text: "/凋谢", code: "/:fade"},
{file: "165", text: "/嘴唇", code: "/:showlove"},
{file: "166", text: "/爱心", code: "/:heart"},
{file: "167", text: "/心碎", code: "/:break"},
{file: "168", text: "/蛋糕", code: "/:cake"},
{file: "169", text: "/闪电", code: "/:li"},
{file: "170", text: "/炸弹", code: "/:bome"},
{file: "171", text: "/刀", code: "/:kn"},
{file: "172", text: "/足球", code: "/:footb"},
{file: "173", text: "/瓢虫", code: "/:ladybug"},
{file: "174", text: "/便便", code: "/:shit"},
{file: "175", text: "/月亮", code: "/:moon"},
{file: "176", text: "/太阳", code: "/:sun"},
{file: "177", text: "/礼物", code: "/:gift"},
{file: "178", text: "/拥抱", code: "/:hug"},
{file: "179", text: "/强", code: "/:strong"},
{file: "180", text: "/弱", code: "/:weak"},
{file: "181", text: "/握手", code: "/:share"},
{file: "182", text: "/胜利", code: "/:v"},
{file: "183", text: "/抱拳", code: "/:@)"},
{file: "184", text: "/勾引", code: "/:jj"},
{file: "185", text: "/拳头", code: "/:@@"},
{file: "186", text: "/差劲", code: "/:bad"},
{file: "187", text: "/爱你", code: "/:lvu"},
{file: "188", text: "/NO", code: "/:no"},
{file: "189", text: "/OK", code: "/:ok"},
{file: "190", text: "/爱情", code: "/:love"},
{file: "191", text: "/飞吻", code: "/:<L>"},
{file: "192", text: "/跳跳", code: "/:jump"},
{file: "193", text: "/发抖", code: "/:shake"},
{file: "194", text: "/怄火", code: "/:<O>"},
{file: "195", text: "/转圈", code: "/:circle"},
{file: "196", text: "/磕头", code: "/:kotow"},
{file: "197", text: "/回头", code: "/:turn"},
{file: "198", text: "/跳绳", code: "/:skip"},
{file: "199", text: "/投降", code: "/:oY"},
{file: "200", text: "/激动", code: "/:#-O"},
{file: "201", text: "/乱舞", code: "/:hiphot"},
{file: "202", text: "/献吻", code: "/:kiss"},
{file: "203", text: "/左太极", code: "/:<&"},
{file: "204", text: "/右太极", code: "/:&>"}
{file: '100', text: '/微笑', code: '/::)'},
{file: '101', text: '/撇嘴', code: '/::~'},
{file: '102', text: '/色', code: '/::B'},
{file: '103', text: '/发呆', code: '/::|'},
{file: '104', text: '/得意', code: '/:8-)'},
{file: '105', text: '/流泪', code: '/::<'},
{file: '106', text: '/害羞', code: '/::$'},
{file: '107', text: '/闭嘴', code: '/::X'},
{file: '108', text: '/睡', code: '/::Z'},
{file: '109', text: '/大哭', code: '/::\'('},
{file: '110', text: '/尴尬', code: '/::-|'},
{file: '111', text: '/发怒', code: '/::@'},
{file: '112', text: '/调皮', code: '/::P'},
{file: '113', text: '/呲牙', code: '/::D'},
{file: '114', text: '/惊讶', code: '/::O'},
{file: '115', text: '/难过', code: '/::('},
{file: '116', text: '/酷', code: '/::+'},
{file: '117', text: '/冷汗', code: '/:--b'},
{file: '118', text: '/抓狂', code: '/::Q'},
{file: '119', text: '/吐', code: '/::T'},
{file: '120', text: '/偷笑', code: '/:,@P'},
{file: '121', text: '/愉快', code: '/:,@-D'},
{file: '122', text: '/白眼', code: '/::d'},
{file: '123', text: '/傲慢', code: '/:,@o'},
{file: '124', text: '/饥饿', code: '/::g'},
{file: '125', text: '/困', code: '/:|-)'},
{file: '126', text: '/惊恐', code: '/::!'},
{file: '127', text: '/流汗', code: '/::L'},
{file: '128', text: '/憨笑', code: '/::>'},
{file: '129', text: '/悠闲', code: '/::,@'},
{file: '130', text: '/奋斗', code: '/:,@f'},
{file: '131', text: '/咒骂', code: '/::-S'},
{file: '132', text: '/疑问', code: '/:?'},
{file: '133', text: '/嘘', code: '/:,@x'},
{file: '134', text: '/晕', code: '/:,@@'},
{file: '135', text: '/疯了', code: '/::8'},
{file: '136', text: '/衰', code: '/:,@!'},
{file: '137', text: '/骷髅', code: '/:!!!'},
{file: '138', text: '/敲打', code: '/:xx'},
{file: '139', text: '/再见', code: '/:bye'},
{file: '140', text: '/擦汗', code: '/:wipe'},
{file: '141', text: '/抠鼻', code: '/:dig'},
{file: '142', text: '/鼓掌', code: '/:handclap'},
{file: '143', text: '/糗大了', code: '/:&-('},
{file: '144', text: '/坏笑', code: '/:B-)'},
{file: '145', text: '/左哼哼', code: '/:<@'},
{file: '146', text: '/右哼哼', code: '/:@>'},
{file: '147', text: '/哈欠', code: '/::-O'},
{file: '148', text: '/鄙视', code: '/:>-|'},
{file: '149', text: '/委屈', code: '/:P-('},
{file: '150', text: '/快哭了', code: '/::\'|'},
{file: '151', text: '/阴险', code: '/:X-)'},
{file: '152', text: '/亲亲', code: '/::*'},
{file: '153', text: '/吓', code: '/:@x'},
{file: '154', text: '/可怜', code: '/:8*'},
{file: '155', text: '/菜刀', code: '/:pd'},
{file: '156', text: '/西瓜', code: '/:<W>'},
{file: '157', text: '/啤酒', code: '/:beer'},
{file: '158', text: '/篮球', code: '/:basketb'},
{file: '159', text: '/乒乓', code: '/:oo'},
{file: '160', text: '/咖啡', code: '/:coffee'},
{file: '161', text: '/饭', code: '/:eat'},
{file: '162', text: '/猪头', code: '/:pig'},
{file: '163', text: '/玫瑰', code: '/:rose'},
{file: '164', text: '/凋谢', code: '/:fade'},
{file: '165', text: '/嘴唇', code: '/:showlove'},
{file: '166', text: '/爱心', code: '/:heart'},
{file: '167', text: '/心碎', code: '/:break'},
{file: '168', text: '/蛋糕', code: '/:cake'},
{file: '169', text: '/闪电', code: '/:li'},
{file: '170', text: '/炸弹', code: '/:bome'},
{file: '171', text: '/刀', code: '/:kn'},
{file: '172', text: '/足球', code: '/:footb'},
{file: '173', text: '/瓢虫', code: '/:ladybug'},
{file: '174', text: '/便便', code: '/:shit'},
{file: '175', text: '/月亮', code: '/:moon'},
{file: '176', text: '/太阳', code: '/:sun'},
{file: '177', text: '/礼物', code: '/:gift'},
{file: '178', text: '/拥抱', code: '/:hug'},
{file: '179', text: '/强', code: '/:strong'},
{file: '180', text: '/弱', code: '/:weak'},
{file: '181', text: '/握手', code: '/:share'},
{file: '182', text: '/胜利', code: '/:v'},
{file: '183', text: '/抱拳', code: '/:@)'},
{file: '184', text: '/勾引', code: '/:jj'},
{file: '185', text: '/拳头', code: '/:@@'},
{file: '186', text: '/差劲', code: '/:bad'},
{file: '187', text: '/爱你', code: '/:lvu'},
{file: '188', text: '/NO', code: '/:no'},
{file: '189', text: '/OK', code: '/:ok'},
{file: '190', text: '/爱情', code: '/:love'},
{file: '191', text: '/飞吻', code: '/:<L>'},
{file: '192', text: '/跳跳', code: '/:jump'},
{file: '193', text: '/发抖', code: '/:shake'},
{file: '194', text: '/怄火', code: '/:<O>'},
{file: '195', text: '/转圈', code: '/:circle'},
{file: '196', text: '/磕头', code: '/:kotow'},
{file: '197', text: '/回头', code: '/:turn'},
{file: '198', text: '/跳绳', code: '/:skip'},
{file: '199', text: '/投降', code: '/:oY'},
{file: '200', text: '/激动', code: '/:#-O'},
{file: '201', text: '/乱舞', code: '/:hiphot'},
{file: '202', text: '/献吻', code: '/:kiss'},
{file: '203', text: '/左太极', code: '/:<&'},
{file: '204', text: '/右太极', code: '/:&>'}
];
for(var i = 0,len = emojiMap.length; i < len; i++) {
if(emojiMap[i].file === emojiId.toString()) {
for (var i = 0, len = emojiMap.length; i < len; i++) {
if (emojiMap[i].file === emojiId.toString()) {
emojiText = emojiMap[i].text;
emojiCode = emojiMap[i].code;
}
... ... @@ -361,7 +361,19 @@ function toggleAnswer(e) {
*/
function sendOrderInfo(e) {
var tag = $(e.currentTarget),
info = tag.data('info');
no = tag.data('no'),
nm = tag.data('nm'),
time = tag.data('time'),
status = tag.data('status');
var msgContent = ['订单号:', no, '\n',
'金额:', nm, '\n',
'下单时间:', time, '\n',
'状态:', status];
_sendMessage(e, type, msgContent);
}
/**
... ... @@ -389,13 +401,13 @@ function _getMessage(received) {
// 请求人工/接入人工成功/接入人工失败
var tipTpl;
if(recType === 10005) { // 客服评价邀请
if (recType === 10005) { // 客服评价邀请
$('input[name=promoter]').val(2);
$('#makeEvaluation').modal('show');
}
if (recType === 2) {
switch(msgType) {
switch (msgType) {
case 0: // 0是没上班
tipTpl = `<div class="list-item">
<p class="push-tip">
... ... @@ -421,14 +433,14 @@ function _getMessage(received) {
}
// 待重构
if(recType === 3 || recType === 103 || recType === 10003) {
if (recType === 3 || recType === 103 || recType === 10003) {
if (recType === 3 || recType === 10003) {
if (recType === 3 || recType === 10003) {
message.newContent = message.newContent.replace(/src="(\d{3}).gif"/g, 'src="/img/service/emoji/$1.gif"');
message.content = message.content.replace(/src="(\d{3}).gif"/g, 'src="/img/service/emoji/$1.gif"');
}
if(recType === 3) {
if (recType === 3) {
tipTpl = `<div class="list-item host">
<img src="/img/service/cus-avatar.png" class="avatar">
<div class="item-detail">
... ... @@ -437,10 +449,10 @@ function _getMessage(received) {
<div>${message.newContent}</div>
</div>
</div>
</div>`
</div>`;
}
if(recType === 103) {
if (recType === 103) {
message.newContent = message.newContent || '机器人暂时无法提供服务';
tipTpl = `<div class="list-item guest">
... ... @@ -451,10 +463,10 @@ function _getMessage(received) {
<div>${message.newContent}</div>
</div>
</div>
</div>`
</div>`;
}
if(recType === 10003) {
if (recType === 10003) {
tipTpl = `<div class="list-item guest">
<img src="/img/service/agent-avatar.png" class="avatar">
... ... @@ -464,11 +476,11 @@ function _getMessage(received) {
<div>${message.newContent}</div>
</div>
</div>
</div>`
</div>`;
}
}
if(recType === 999999999) {
if (recType === 999999999) {
tipTpl = `<div class="list-item">
<p class="push-tip">
<span class="tip">${message.content}<a class="red-tip reconnect">连线客服</a></span>
... ... @@ -485,17 +497,28 @@ function _getMessage(received) {
* 处理发送消息
* @private
*/
function _sendMessage(e, msgType) {
var tag = $('.msg-area'),
msg = tag.val().trim();
if (!msg) return;
cM.type = 3;
cM.message.content = msg;
cM.message.type = msgType || 1;
cM.uuid = uuid.v4(); // 用于标示当条消息
socketChat.send(JSON.stringify(Object.assign(cM)));
tag.val('');
function _sendMessage(e, msgType, msgContent) {
if (!msgContent) {
var tag = $('.msg-area'),
msg = tag.val().trim();
if (!msg) return;
cM.type = 3;
cM.message.content = msg;
cM.message.type = msgType || 1;
cM.uuid = uuid.v4(); // 用于标示当条消息
socketChat.send(JSON.stringify(Object.assign(cM)));
tag.val('');
} else {
cM.type = 3;
cM.message.content = msgContent;
cM.message.type = msgType || 1;
cM.uuid = uuid.v4(); // 用于标示当条消息
socketChat.send(JSON.stringify(Object.assign(cM)));
}
}
/**
... ... @@ -515,11 +538,11 @@ function leaveMsg() {
// 初始化socket连接
socketChat.init(Object.assign(socketConf, {
onOpen: function (e) {
console.log('websocket opened!')
onOpen: function(e) {
console.log('websocket opened!');
},
onMessage: function (e) {
onMessage: function(e) {
var jsonString = e.data;
var received = JSON.parse(jsonString);
... ... @@ -531,13 +554,13 @@ socketChat.init(Object.assign(socketConf, {
},
onClose: function() {
console.log('websocket closed!')
console.log('websocket closed!');
}
}));
// 提交留言
$('#leaveMsg .submit').click(function () {
$('#leaveMsg .submit').click(function() {
var lMsg = $('#leaveMsg'),
val = lMsg.find('textarea').val().trim();
... ... @@ -550,11 +573,11 @@ $('#leaveMsg .submit').click(function () {
conversationId: cM.newConversationId || cM.conversationId
},
success: function(res) {
if(res && res.code === 200) {
if (res && res.code === 200) {
lMsg.modal('hide');
}
},
error: function () {
error: function() {
lMsg.modal('hide');
}
});
... ... @@ -562,36 +585,47 @@ $('#leaveMsg .submit').click(function () {
// 提交评价
$('#makeEvaluation .submit').click(function () {
$('#makeEvaluation .submit').click(function() {
var mEval = $('#makeEvaluation'),
proInput = $('input[name=promoter]'),
promoter = proInput.val() || 1,
reason = mEval.find('textarea').val().trim();
reason = mEval.find('textarea').val().trim(),
star = mEval.find('.star.positive').length,
reasonTypes = mEval.find('.dis-row .type.chosen');
var reasonIds,
idArray = [];
$.each(reasonTypes, function(item) {
idArray.push($(item).data('id'));
});
reasonIds = idArray.join(':');
$.ajax({
type: 'POST',
url: urls.makeEval,
data: {
conversationId: cM.conversationId, // todo 参数组织
conversationId: cM.conversationId,
csId: cM.csId,
pid: cM.platId,
promoter: promoter,
reasonIds: '2:3',
reasonIds: reasonIds,
reasonMsgs: reason,
stars: 5,
stars: star,
uid: uid
},
success: function(res) {
if(res && res.code === 200) {
if (res && res.code === 200) {
proInput.val('1');
mEval.modal('hide');
operation.savedEval = true;
}
},
error: function () {
error: function() {
mEval.modal('hide');
}
});
... ... @@ -656,15 +690,15 @@ $('.msg-edit .util .icon').on('click', dispatchUtil);
$('.emoji-component .emoji').on('click', setEmoji);
// 重新连线
$('.msg-list').on('click', '.reconnect', function () {
$('.msg-list').on('click', '.reconnect', function() {
socketChat.init(Object.assign(socketConf, {
onOpen: function (e) {
console.log('websocket opened!')
onOpen: function(e) {
console.log('websocket opened!');
},
onMessage: function (e) {
onMessage: function(e) {
var jsonString = e.data;
var received = JSON.parse(jsonString);
... ... @@ -673,7 +707,7 @@ $('.msg-list').on('click', '.reconnect', function () {
},
onClose: function() {
console.log('websocket closed!')
console.log('websocket closed!');
}
}));
... ... @@ -683,8 +717,8 @@ $('.msg-list').on('click', '.reconnect', function () {
$('.msg-edit .send').on('click', _sendMessage);
// 关闭聊天窗口
$('.header .close').click(function () {
if(!operation.savedEval) { // 没有保存过评论
$('.header .close').click(function() {
if (!operation.savedEval) { // 没有保存过评论
$('#makeEvaluation').modal('show');
} else {
window.close();
... ... @@ -696,16 +730,37 @@ $('.msg-area').on('blur', function() {
cursorPo = $(this).getCursorPosition();
});
$('.msg-list').on('click', '.msg-bubble img', function (e) {
// 消息图片放大显示
$('.msg-list').on('click', '.msg-bubble img', function(e) {
var msgZoomIn = $('.img-zoom-in');
msgZoomIn.find('img').attr('src', $(e.target).attr('src'));
msgZoomIn.fadeIn();
});
$('.img-zoom-in').on('click', function (e) {
$('.img-zoom-in').on('click', function(e) {
$(e.currentTarget).fadeOut();
});
// 显示历史记录
$('.about-his.has-his').click(function(e) {
$(e.currentTarget).hide();
$('.list-item.his-msg').show();
$('.panel-main .main-body').scrollTop($('.panel-main .main-body')[0].scrollHeight);
// $('.panel-main .main-body').scrollTop(10);
});
$('.panel-main .main-body').scroll(function(e) {
console.log($(e.target)[0].scrollHeight);
});
... ...
... ... @@ -834,6 +834,8 @@ $color-3a3a3a: #3a3a3a;
color: #000000;
font-size: 25px;
opacity: 1;
border: none;
background-color: transparent;
&:hover {
opacity: 1;
... ... @@ -1000,9 +1002,11 @@ $color-3a3a3a: #3a3a3a;
.type {
position: relative;
display: inline-block;
width: 166px;
height: 40px;
padding: 0 18px;
font-size: 16px;
text-align: center;
line-height: 40px;
border: 1px #999999 solid;
border-radius: 5px;
... ...