|
@@ -24,6 +24,22 @@
|
|
|
$location.hash("bottom");
|
|
$location.hash("bottom");
|
|
|
$anchorScroll();
|
|
$anchorScroll();
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ var getFileName = function(item) {
|
|
|
|
|
+ var arr = item.fileName.split("\\");
|
|
|
|
|
+ return arr[arr.length - 1];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ var getFileSize = function(item) {
|
|
|
|
|
+ var fileSize = item.length;
|
|
|
|
|
+ if (fileSize > 1024 * 1024 * 1024)
|
|
|
|
|
+ return (Math.round(fileSize * 100 / (1024 * 1024 * 1024)) / 100).toString() + 'GB';
|
|
|
|
|
+ else if (fileSize > 1024 * 1024)
|
|
|
|
|
+ return (Math.round(fileSize * 100 / (1024 * 1024)) / 100).toString() + 'MB';
|
|
|
|
|
+ else
|
|
|
|
|
+ return (Math.round(fileSize * 100 / 1024) / 100).toString() + 'KB';
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
var replaceSystemFace = function(content) {
|
|
var replaceSystemFace = function(content) {
|
|
|
//匹配表情
|
|
//匹配表情
|
|
|
var g = (/\/\:([\w]+)/).exec(content);
|
|
var g = (/\/\:([\w]+)/).exec(content);
|
|
@@ -114,16 +130,17 @@
|
|
|
'</span>';
|
|
'</span>';
|
|
|
} else if (scope.msg.contentType == 3) {
|
|
} else if (scope.msg.contentType == 3) {
|
|
|
element.css({
|
|
element.css({
|
|
|
- width: '275px'
|
|
|
|
|
|
|
+ width: '290px'
|
|
|
});
|
|
});
|
|
|
//element.addClass('file-message');
|
|
//element.addClass('file-message');
|
|
|
- var reg = /\?[\W\w]*/;
|
|
|
|
|
- var fileName = decodeURIComponent(reg.exec(scope.msg.content).toString().substr(1));
|
|
|
|
|
-
|
|
|
|
|
|
|
+ var content = JSON.parse(scope.msg.content);
|
|
|
|
|
+ console.log(content);
|
|
|
html = '<div class="file-message">' +
|
|
html = '<div class="file-message">' +
|
|
|
'<img src="../img/unkown.png" onError= "this.src = \'../img/file/unkown.png\'">' +
|
|
'<img src="../img/unkown.png" onError= "this.src = \'../img/file/unkown.png\'">' +
|
|
|
- '<span style="float:left; margin:5px 0px 0px 0px">文件名:' + fileName + '<br/>大小:' + scope.msg.length + '</span>' +
|
|
|
|
|
|
|
+ '<p><input type="text" readonly="readonly" value="' + getFileName(content) + '"></p>' +
|
|
|
|
|
+ '<span>大小:' + getFileSize(content) + '</span>' +
|
|
|
'<div class="p-t-sm text-right">' +
|
|
'<div class="p-t-sm text-right">' +
|
|
|
|
|
+ '<span id="transinfo"><span style="color:green;" class="glyphicon glyphicon-ok"></span><span>传输完成</span></span>' +
|
|
|
'<a class="text-primary" role="button"><span>打开</span></a>  ' +
|
|
'<a class="text-primary" role="button"><span>打开</span></a>  ' +
|
|
|
'<a class="text-primary" role="button"><span>打开文件夹</span></a>' +
|
|
'<a class="text-primary" role="button"><span>打开文件夹</span></a>' +
|
|
|
'</div>' +
|
|
'</div>' +
|