...
|
...
|
@@ -2,6 +2,7 @@ const loading = require('../../plugin/loading'), |
|
|
lazyLoad = require('yoho-jquery-lazyload');
|
|
|
|
|
|
require('../../common');
|
|
|
|
|
|
import {EventEmitter, bus, api} from './store';
|
|
|
|
|
|
|
...
|
...
|
@@ -61,9 +62,10 @@ LeaveMSGView.prototype.constructer = LeaveMSGView; |
|
|
评价view
|
|
|
*/
|
|
|
class RatingView {
|
|
|
constructor(elem) {
|
|
|
constructor(elem, socket) {
|
|
|
this.elem = elem;
|
|
|
this.init();
|
|
|
this.socket = socket;
|
|
|
}
|
|
|
|
|
|
init() {
|
...
|
...
|
@@ -80,8 +82,8 @@ class RatingView { |
|
|
4: '非常满意',
|
|
|
};
|
|
|
|
|
|
let self = this.elem,
|
|
|
stars = self.find('.stars i');
|
|
|
let self = this,
|
|
|
stars = self.elem.find('.stars i');
|
|
|
|
|
|
stars.each(function(index) {
|
|
|
$(this).on('touchstart', function() {
|
...
|
...
|
@@ -89,8 +91,33 @@ class RatingView { |
|
|
for (let i = 0; i <= index; i++) {
|
|
|
stars.eq(i).addClass('rated');
|
|
|
}
|
|
|
self.find('.rank').text(rank[index]);
|
|
|
self.elem.find('.rank').text(rank[index]);
|
|
|
});
|
|
|
self.rank = index;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
post(data) {
|
|
|
const elem = this.elem;
|
|
|
var params = {
|
|
|
stars: this.rank,
|
|
|
promoter: 1,
|
|
|
reasonMsg: elem.find('.words-to-say').val(),
|
|
|
};
|
|
|
|
|
|
Object.assign(params, data);
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: 'http://192.168.102.18:60101/api/evalute/saveEvalute',
|
|
|
data: params,
|
|
|
success: function(res) {
|
|
|
if (res && res.code === 200) {
|
|
|
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
|