Authored by 陈轩

Merge branch 'feature/service' of http://git.yoho.cn/fe/yohobuywap-node into feature/service

... ... @@ -209,7 +209,7 @@ var chat = {
data: data,
success: function(result) {
if (result && result.code === 200) {
for (let item of result.data) {
for (let item of result.data.reverse()) {
self.getMessage(item);
}
}
... ... @@ -232,6 +232,7 @@ var chat = {
case allTypes.ENTER:
this.enterSuccess(message);
resizeFooter();
break;
case allTypes.LINK_SUCCESS:
... ... @@ -363,7 +364,7 @@ $('.menu-trigger').on('touchend', function() {
fileType: 'image/*',
uploadScript: '/api/upload/image',
fileObjName: 'filename',
fileSizeLimit: 999999,
fileSizeLimit: 5000000,
height: '100%',
width: '100%',
multi: false,
... ...
... ... @@ -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() {
}
});
}
... ...