Showing
4 changed files
with
16 additions
and
2 deletions
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | <a href="javascript:;" class="input-method input-text"></a> | 23 | <a href="javascript:;" class="input-method input-text"></a> |
24 | </span>--}} | 24 | </span>--}} |
25 | <span class="table-cell cell-max"> | 25 | <span class="table-cell cell-max"> |
26 | - <form action=""> | 26 | + <form action="" onsubmit="return false"> |
27 | <input type="text" class="input-in text-in" placeholder="发送新消息"> | 27 | <input type="text" class="input-in text-in" placeholder="发送新消息"> |
28 | </form> | 28 | </form> |
29 | </span> | 29 | </span> |
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | 33 | ||
34 | {{#*inline 'picture'}} | 34 | {{#*inline 'picture'}} |
35 | <div class="msg-content msg-pic"> | 35 | <div class="msg-content msg-pic"> |
36 | - <img src="{{content}}" alt="" class="image chat-image"> | 36 | + <img src="{{content}}?imageView2/0/q/50" alt="" class="image chat-image"> |
37 | </div> | 37 | </div> |
38 | {{/inline}} | 38 | {{/inline}} |
39 | 39 |
@@ -168,6 +168,7 @@ var chat = { | @@ -168,6 +168,7 @@ var chat = { | ||
168 | self.canManualService && self.switchService('human'); | 168 | self.canManualService && self.switchService('human'); |
169 | }) | 169 | }) |
170 | .on('keydown.chat.sendText', '.text-in', function(event) { | 170 | .on('keydown.chat.sendText', '.text-in', function(event) { |
171 | + event.stopPropagation(); | ||
171 | document.body.scrollTop = document.body.scrollHeight; | 172 | document.body.scrollTop = document.body.scrollHeight; |
172 | 173 | ||
173 | if (event.which === 13) { | 174 | if (event.which === 13) { |
@@ -80,6 +80,7 @@ const RatingView = function(elem, socket) { | @@ -80,6 +80,7 @@ const RatingView = function(elem, socket) { | ||
80 | this.rank = 3; | 80 | this.rank = 3; |
81 | this.bindEvents(); | 81 | this.bindEvents(); |
82 | this.socket = socket; | 82 | this.socket = socket; |
83 | + this.isSending = false; | ||
83 | }; | 84 | }; |
84 | 85 | ||
85 | RatingView.prototype = $.extend({}, EventEmitter.prototype, { | 86 | RatingView.prototype = $.extend({}, EventEmitter.prototype, { |
@@ -116,6 +117,12 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, { | @@ -116,6 +117,12 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, { | ||
116 | }, | 117 | }, |
117 | 118 | ||
118 | post(data) { | 119 | post(data) { |
120 | + if (this.isSending) { | ||
121 | + tip.show('正在发送..'); | ||
122 | + return; | ||
123 | + } | ||
124 | + this.isSending = true; | ||
125 | + | ||
119 | const self = this, | 126 | const self = this, |
120 | elem = this.elem; | 127 | elem = this.elem; |
121 | var params = { | 128 | var params = { |
@@ -139,10 +146,16 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, { | @@ -139,10 +146,16 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, { | ||
139 | }) | 146 | }) |
140 | .fail(()=> { | 147 | .fail(()=> { |
141 | tip.show('评价失败'); | 148 | tip.show('评价失败'); |
149 | + }) | ||
150 | + .always(() => { | ||
151 | + self.isSending = false; | ||
142 | }); | 152 | }); |
143 | }, | 153 | }, |
144 | 154 | ||
145 | toggle(willShow) { | 155 | toggle(willShow) { |
156 | + if (willShow === this.elem.is(':visible')) { | ||
157 | + return; | ||
158 | + } | ||
146 | this.elem.toggle(willShow); | 159 | this.elem.toggle(willShow); |
147 | this.rating(4); | 160 | this.rating(4); |
148 | } | 161 | } |
-
Please register or login to post a comment