Authored by 陈轩

im fix

... ... @@ -23,7 +23,7 @@
<a href="javascript:;" class="input-method input-text"></a>
</span>--}}
<span class="table-cell cell-max">
<form action="">
<form action="" onsubmit="return false">
<input type="text" class="input-in text-in" placeholder="发送新消息">
</form>
</span>
... ...
... ... @@ -33,7 +33,7 @@
{{#*inline 'picture'}}
<div class="msg-content msg-pic">
<img src="{{content}}" alt="" class="image chat-image">
<img src="{{content}}?imageView2/0/q/50" alt="" class="image chat-image">
</div>
{{/inline}}
... ...
... ... @@ -168,6 +168,7 @@ var chat = {
self.canManualService && self.switchService('human');
})
.on('keydown.chat.sendText', '.text-in', function(event) {
event.stopPropagation();
document.body.scrollTop = document.body.scrollHeight;
if (event.which === 13) {
... ...
... ... @@ -80,6 +80,7 @@ const RatingView = function(elem, socket) {
this.rank = 3;
this.bindEvents();
this.socket = socket;
this.isSending = false;
};
RatingView.prototype = $.extend({}, EventEmitter.prototype, {
... ... @@ -116,6 +117,12 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, {
},
post(data) {
if (this.isSending) {
tip.show('正在发送..');
return;
}
this.isSending = true;
const self = this,
elem = this.elem;
var params = {
... ... @@ -139,10 +146,16 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, {
})
.fail(()=> {
tip.show('评价失败');
})
.always(() => {
self.isSending = false;
});
},
toggle(willShow) {
if (willShow === this.elem.is(':visible')) {
return;
}
this.elem.toggle(willShow);
this.rating(4);
}
... ...