...
|
...
|
@@ -6,7 +6,7 @@ |
|
|
'use strict';
|
|
|
|
|
|
import {
|
|
|
time
|
|
|
time
|
|
|
} from './time';
|
|
|
import {
|
|
|
tip
|
...
|
...
|
@@ -17,12 +17,10 @@ import { |
|
|
OrderListView
|
|
|
} from './view';
|
|
|
|
|
|
require('../../home/jquery.upload');
|
|
|
var saveImage = require('../../home/save-image');
|
|
|
|
|
|
var socket = require('./socket-chat'),
|
|
|
socketConf = require('./socket-config'),
|
|
|
cmEntity = socketConf.conversationMessage;
|
|
|
cmEntity = socketConf.conversationMessage,
|
|
|
lastTimeShow = 0;
|
|
|
|
|
|
const chatBox = $('#chat-window'),
|
|
|
encryptedUid = $('#encrypteduid').val();
|
...
|
...
|
@@ -57,6 +55,8 @@ var chat = { |
|
|
state: {
|
|
|
lastMSGTime: ''
|
|
|
},
|
|
|
$ratingView: $('#chat-comment'),
|
|
|
|
|
|
|
|
|
messageT: require('service/chat/msg.hbs'),
|
|
|
|
...
|
...
|
@@ -149,12 +149,23 @@ var chat = { |
|
|
.on('selectOrder.OrderListView', function(event, data) {
|
|
|
let msg = {
|
|
|
type: 'order',
|
|
|
data
|
|
|
data,
|
|
|
style: 'send-msg',
|
|
|
};
|
|
|
|
|
|
self.sendMSG(msg);
|
|
|
});
|
|
|
|
|
|
this.$ratingView.on('click', '.submit', function() {
|
|
|
self.ratingView.post({
|
|
|
encryptedUid,
|
|
|
conversationId: cmEntity.conversationId,
|
|
|
});
|
|
|
}).on('rating-success', function(e, data) {
|
|
|
append(tip(`您对我们的服务评价为:${data}`).onLine());
|
|
|
resizeFooter();
|
|
|
});
|
|
|
|
|
|
window.addEventListener('online', function() {
|
|
|
self._networkSick(false);
|
|
|
});
|
...
|
...
|
@@ -455,39 +466,11 @@ var chat = { |
|
|
chat.init();
|
|
|
|
|
|
// 触发菜单
|
|
|
$('.menu-trigger').on('touchend', function() {
|
|
|
$('.menu-trigger').on('click', function() {
|
|
|
let $menu = $('.menu');
|
|
|
|
|
|
if ($menu.css('display') === 'none') {
|
|
|
$menu.show();
|
|
|
resizeFooter();
|
|
|
} else {
|
|
|
$menu.hide();
|
|
|
resizeFooter();
|
|
|
}
|
|
|
|
|
|
$('.upload-img').upload({
|
|
|
auto: true,
|
|
|
fileType: 'image/*',
|
|
|
uploadScript: '/api/upload/image',
|
|
|
fileObjName: 'filename',
|
|
|
fileSizeLimit: 5000000,
|
|
|
height: '100%',
|
|
|
width: '100%',
|
|
|
multi: false,
|
|
|
formData: {
|
|
|
bucket: 'suggest'
|
|
|
},
|
|
|
onUploadComplete: function(file, data) {
|
|
|
let url;
|
|
|
|
|
|
data = saveImage.saveImage(data);
|
|
|
url = data.imgList[0].imgRelUrl + '?imageView2/2/w/640/q/90';
|
|
|
url = 'http://img11.static.yhbimg.com/suggest' + url;
|
|
|
sendMsg(2, url);
|
|
|
}
|
|
|
});
|
|
|
$('.uploadifive-button').css('position', 'absolute');
|
|
|
$menu.toggle();
|
|
|
resizeFooter();
|
|
|
});
|
|
|
|
|
|
|
...
|
...
|
|