...
|
...
|
@@ -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);
|
|
|
}
|
...
|
...
|
|