Authored by 陈轩

im fix

... ... @@ -16,9 +16,10 @@ const chatQa = require(`${cRoot}/chatQa`); // 问题搜索列表页
// middlware
const authGuard = require('../../doraemon/middleware/auth');
const disableBFCache = require('../../doraemon/middleware/disable-bfcache');
// Your controller here
router.get('/im', chat.appAdapter, authGuard, chat.page);
router.get('/im', disableBFCache, chat.appAdapter, authGuard, chat.page);
router.get('/im/fetchHistory', chat.fetchHistory);
router.get('/getOrders', chat.getOrders);
router.get('/im/global-list', chat.queryGlobalOrder);
... ...
... ... @@ -13,6 +13,7 @@ const LeaveMSGView = function(elem) {
this.$input = this.$elem.find('.leave-text');
this.$doc = $(document);
this.bindEvents();
this.isSending = false;
};
LeaveMSGView.prototype = $.extend({}, EventEmitter.prototype, {
... ... @@ -48,6 +49,13 @@ LeaveMSGView.prototype = $.extend({}, EventEmitter.prototype, {
* 提交留言的hanlder
*/
submit() {
if (this.isSending) {
tip.show('正在发送..');
return;
}
this.isSending = true;
let self = this;
let content = $.trim(this.$input.val());
... ... @@ -61,6 +69,9 @@ LeaveMSGView.prototype = $.extend({}, EventEmitter.prototype, {
})
.fail(function() {
self.trigger('save.LeaveMSGView', '留言失败');
})
.always(function() {
self.isSending = false;
});
self.toggleHide(true);
... ...
... ... @@ -136,6 +136,7 @@
}
.msg-content {
max-width: 90%;
margin: 0 0 0 10px;
background: #646464;
color: #fff;
... ...