Commit 4b4dd98a authored by 罗超's avatar 罗超

新增表情包

parent 0f8b0000
...@@ -11,6 +11,8 @@ const electron = require('electron') ...@@ -11,6 +11,8 @@ const electron = require('electron')
const screenshot = require('screenshot-desktop') const screenshot = require('screenshot-desktop')
const SDK = require('../../static/sdk/NIM_Web_SDK_nodejs_v6.9.0.js') const SDK = require('../../static/sdk/NIM_Web_SDK_nodejs_v6.9.0.js')
const http = require('http') const http = require('http')
const https = require('https')
const cheerio = require("cheerio")
// const unhandled = require('electron-unhandled'); // const unhandled = require('electron-unhandled');
// unhandled(); // unhandled();
...@@ -68,6 +70,7 @@ let messageProtocol = null ...@@ -68,6 +70,7 @@ let messageProtocol = null
let CAP_IMG = '' let CAP_IMG = ''
let nim = null let nim = null
let SCREENCOUNT = 0 let SCREENCOUNT = 0
global.defaultdownloaddir = require('os').userInfo().homedir + '\\Downloads\\' global.defaultdownloaddir = require('os').userInfo().homedir + '\\Downloads\\'
global.DEFAULT_SCREENSHOT_PATH = require('os').userInfo().homedir + '\\Pictures\\demo.png' global.DEFAULT_SCREENSHOT_PATH = require('os').userInfo().homedir + '\\Pictures\\demo.png'
global.AUDIO_PATH = process.execPath.substring(0, process.execPath.lastIndexOf('\\') + 1) global.AUDIO_PATH = process.execPath.substring(0, process.execPath.lastIndexOf('\\') + 1)
...@@ -519,6 +522,30 @@ ipc.on('create-message-session', function(event) { ...@@ -519,6 +522,30 @@ ipc.on('create-message-session', function(event) {
}, 3000) }, 3000)
} }
}) })
ipc.on('get-face', function(event, keyword) {
let html = "",
list = [],
buffer = null,
newslist = [];
let req = https.request("https://www.doutula.com/search?keyword=" + keyword, function(res) {
res.on("data", function(data) {
list.push(data)
})
res.on("end", function() {
buffer = Buffer.concat(list)
html = buffer.toString()
let $ = cheerio.load(html)
for (var i = 1; i <= 3; i++) {
$("img[referrerpolicy='no-referrer']").each((index, ele) => {
newslist.push($(ele).attr("data-original"))
})
}
event.sender.send('show-network-face', newslist)
})
})
req.end()
})
ipc.on('download', (evt, pdownloadpath, pfolderpath, dfileName, pmsgId) => { ipc.on('download', (evt, pdownloadpath, pfolderpath, dfileName, pmsgId) => {
try { try {
downloadpath = pdownloadpath downloadpath = pdownloadpath
...@@ -955,7 +982,6 @@ let getNoticeWindows = function() { ...@@ -955,7 +982,6 @@ let getNoticeWindows = function() {
width: 300, width: 300,
height: 115, height: 115,
skipTaskbar: true, skipTaskbar: true,
alwaysOnTop: false,
focusable: false focusable: false
}) })
noticeWindows.setBounds({ noticeWindows.setBounds({
...@@ -966,7 +992,8 @@ let getNoticeWindows = function() { ...@@ -966,7 +992,8 @@ let getNoticeWindows = function() {
}) })
} }
noticeWindows.loadURL(noticeUrl) noticeWindows.loadURL(noticeUrl)
mainWindow.setFocusable(true) //mainWindow.setFocusable(true)
noticeWindows.setFocusable(false)
noticeWindows.setMenu(null) noticeWindows.setMenu(null)
noticeWindows.once('ready-to-show', () => { noticeWindows.once('ready-to-show', () => {
noticeWindows.show() noticeWindows.show()
......
import md5 from 'js-md5' import md5 from 'js-md5'
import MsgBus from './msgBus' import MsgBus from './msgBus'
export default { export default {
install (Vue, options) { install(Vue, options) {
Vue.prototype.MsgBus = MsgBus; Vue.prototype.MsgBus = MsgBus;
Vue.prototype.GLOBALSENDING = []; Vue.prototype.GLOBALSENDING = [];
Vue.prototype.TOPSESSION = []; Vue.prototype.TOPSESSION = [];
Vue.prototype.isOnline = function() { Vue.prototype.isOnline = function() {
return process.env.NODE_ENV !== 'development'; return process.env.NODE_ENV !== 'development';
} }
Vue.prototype.domainManager = function() { Vue.prototype.domainManager = function() {
var domainUrl = "http://reborn.oytour.com";//主域名 var domainUrl = "http://reborn.oytour.com"; //主域名
if (this.isOnline()) { if (this.isOnline()) {
domainUrl = "http://reborn.oytour.com"; domainUrl = "http://reborn.oytour.com";
} }
var obj = { var obj = {
//主地址 //主地址
DomainUrl: domainUrl, DomainUrl: domainUrl,
//常用提交数据URL //常用提交数据URL
PostUrl: domainUrl + "/api/common/post" PostUrl: domainUrl + "/api/common/post"
}; };
return obj; return obj;
} }
Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) { Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
var apiurl = this.domainManager().PostUrl; var apiurl = this.domainManager().PostUrl;
var timestamp = (new Date()).valueOf(); var timestamp = (new Date()).valueOf();
this.apiurl = apiurl; this.apiurl = apiurl;
var token = ""; var token = "";
var key = ""; var key = "";
if (localStorage.user && localStorage.user != '') { if (localStorage.user && localStorage.user != '') {
token = JSON.parse(localStorage.user).token; token = JSON.parse(localStorage.user).token;
key = JSON.parse(localStorage.user).SecretKey; key = JSON.parse(localStorage.user).SecretKey;
} }
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase(); var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd = $ {cmd} & msg = $ {encodeMsg} & timestamp = $ {timestamp} & token = $ {token} & key = $ {key}`); var md5Str = md5(`cmd = $ {cmd} & msg = $ {encodeMsg} & timestamp = $ {timestamp} & token = $ {token} & key = $ {key}`);
var postData = { var postData = {
"msg":msg, "msg": msg,
"cmd":cmd, "cmd": cmd,
"timestamp":timestamp, "timestamp": timestamp,
"token":token, "token": token,
"sign":md5Str "sign": md5Str
} }
this.$http.post(apiurl, postData, { this.$http.post(apiurl, postData, {
headers: { headers: {
'Content-Type':'application/json', 'Content-Type': 'application/json',
'Referer-Viitto':this.$route.path 'Referer-Viitto': this.$route.path
}, },
timeout:1000*15 timeout: 1000 * 15
}) })
.then(res => { .then(res => {
if (res.resultCode == 10000 || res.resultCode == 10001) { if (res.resultCode == 10000 || res.resultCode == 10001) {
this.$router.push( { this.$router.push({
path:'/login' path: '/login'
}) })
}else if (res.resultCode == 10005) { } else if (res.resultCode == 10005) {
this.$router.go(-1) this.$router.go(-1)
}else { } else {
successCall(res) successCall(res)
} }
}, faildCall) }, faildCall)
} }
Vue.prototype.apiRequest = function(path, msg, successCall, faildCall) { Vue.prototype.apiRequest = function(path, msg, successCall, faildCall) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
this.$http.post(path, msg, { this.$http.post(path, msg, {
headers: { headers: {
'Content-Type':'application/json' 'Content-Type': 'application/json'
} }
}) })
.then(res => { .then(res => {
successCall(res) successCall(res)
}, faildCall) }, faildCall)
} }
Vue.prototype.getLocalStorage = function () { Vue.prototype.getNetRequest = function(url, successCall, faildCall) {
var localStorageData = window.localStorage["userInfo"]; this.$http.post(url)
if (localStorageData !== undefined && localStorageData != 'undefined') { .then(res => {
return JSON.parse(localStorageData); successCall(res)
}else { }, faildCall)
return null; }
} Vue.prototype.getLocalStorage = function() {
} var localStorageData = window.localStorage["userInfo"];
if (localStorageData !== undefined && localStorageData != 'undefined') {
return JSON.parse(localStorageData);
} else {
return null;
}
}
Vue.prototype.loadFileICON = function (suffix,size) { Vue.prototype.loadFileICON = function(suffix, size) {
size=size?size:1 size = size ? size : 1
let icons = [{ let icons = [{
"name": "\u7f51\u76d8BT\u79bb\u7ebf\u4e0b\u8f7d", "name": "\u7f51\u76d8BT\u79bb\u7ebf\u4e0b\u8f7d",
"filesType": "*.bt,*.torrent", "filesType": "*.bt,*.torrent",
"filesIcon": { "filesIcon": {
"bt": ["fileicon-small-bt", "fileicon-large-bt", "fileicon-middle-bt"], "bt": ["fileicon-small-bt", "fileicon-large-bt", "fileicon-middle-bt"],
"torrent": ["fileicon-small-bt", "fileicon-large-bt", "fileicon-middle-bt"] "torrent": ["fileicon-small-bt", "fileicon-large-bt", "fileicon-middle-bt"]
}, },
"entranceFile": "file-widget-1:bt\/start.js" "entranceFile": "file-widget-1:bt\/start.js"
}, },
{ {
"name": "\u6d69\u8fb0CAD", "name": "\u6d69\u8fb0CAD",
"group": "com.gstarcad.web", "group": "com.gstarcad.web",
"notSupport": "ie6", "notSupport": "ie6",
"filesIcon": { "filesIcon": {
"dws": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"], "dws": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"],
"dwt": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"], "dwt": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"],
"dxf": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"], "dxf": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"],
"dwg": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"], "dwg": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"],
"cad": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"] "cad": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"]
}, },
"entranceFile": "file-widget-1:cad\/start.js" "entranceFile": "file-widget-1:cad\/start.js"
}, },
{ {
"name": "\u7f51\u76d8\u4ee3\u7801\u9605\u8bfb\u5668", "name": "\u7f51\u76d8\u4ee3\u7801\u9605\u8bfb\u5668",
"notSupport": "ie", "notSupport": "ie",
"filesType": "*.txt,*.as,*.sh,*.c,*.cpp,*.h,*.cs,*.asp,*.css,*.pas,*.diff,*.patch,*.erl,*.groovy,*.java,*.jsp,*.js,*.json,*.pl,*.php,*.py,*.rb,*.sass,*.scss,*.scala,*.sql,*.vb,*.xml,*.xhtml,*.html,*.htm,*.md,*.less,*.lua,*.go,*.bat,*.wml", "filesType": "*.txt,*.as,*.sh,*.c,*.cpp,*.h,*.cs,*.asp,*.css,*.pas,*.diff,*.patch,*.erl,*.groovy,*.java,*.jsp,*.js,*.json,*.pl,*.php,*.py,*.rb,*.sass,*.scss,*.scala,*.sql,*.vb,*.xml,*.xhtml,*.html,*.htm,*.md,*.less,*.lua,*.go,*.bat,*.wml",
"filesIcon": { "filesIcon": {
"as": ["fileicon-small-code", "fileicon-large-code"], "as": ["fileicon-small-code", "fileicon-large-code"],
"sh": ["fileicon-small-code", "fileicon-large-code"], "sh": ["fileicon-small-code", "fileicon-large-code"],
"c": ["fileicon-small-code", "fileicon-large-code"], "c": ["fileicon-small-code", "fileicon-large-code"],
"cpp": ["fileicon-small-code", "fileicon-large-code"], "cpp": ["fileicon-small-code", "fileicon-large-code"],
"h": ["fileicon-small-code", "fileicon-large-code"], "h": ["fileicon-small-code", "fileicon-large-code"],
"cs": ["fileicon-small-code", "fileicon-large-code"], "cs": ["fileicon-small-code", "fileicon-large-code"],
"asp": ["fileicon-small-code", "fileicon-large-code"], "asp": ["fileicon-small-code", "fileicon-large-code"],
"css": ["fileicon-small-code", "fileicon-large-code"], "css": ["fileicon-small-code", "fileicon-large-code"],
"pas": ["fileicon-small-code", "fileicon-large-code"], "pas": ["fileicon-small-code", "fileicon-large-code"],
"diff": ["fileicon-small-code", "fileicon-large-code"], "diff": ["fileicon-small-code", "fileicon-large-code"],
"patch": ["fileicon-small-code", "fileicon-large-code"], "patch": ["fileicon-small-code", "fileicon-large-code"],
"erl": ["fileicon-small-code", "fileicon-large-code"], "erl": ["fileicon-small-code", "fileicon-large-code"],
"groovy": ["fileicon-small-code", "fileicon-large-code"], "groovy": ["fileicon-small-code", "fileicon-large-code"],
"java": ["fileicon-small-code", "fileicon-large-code"], "java": ["fileicon-small-code", "fileicon-large-code"],
"jsp": ["fileicon-small-code", "fileicon-large-code"], "jsp": ["fileicon-small-code", "fileicon-large-code"],
"js": ["fileicon-small-code", "fileicon-large-code"], "js": ["fileicon-small-code", "fileicon-large-code"],
"json": ["fileicon-small-code", "fileicon-large-code"], "json": ["fileicon-small-code", "fileicon-large-code"],
"pl": ["fileicon-small-code", "fileicon-large-code"], "pl": ["fileicon-small-code", "fileicon-large-code"],
"php": ["fileicon-small-code", "fileicon-large-code"], "php": ["fileicon-small-code", "fileicon-large-code"],
"py": ["fileicon-small-code", "fileicon-large-code"], "py": ["fileicon-small-code", "fileicon-large-code"],
"rb": ["fileicon-small-code", "fileicon-large-code"], "rb": ["fileicon-small-code", "fileicon-large-code"],
"sass": ["fileicon-small-code", "fileicon-large-code"], "sass": ["fileicon-small-code", "fileicon-large-code"],
"scss": ["fileicon-small-code", "fileicon-large-code"], "scss": ["fileicon-small-code", "fileicon-large-code"],
"scala": ["fileicon-small-code", "fileicon-large-code"], "scala": ["fileicon-small-code", "fileicon-large-code"],
"sql": ["fileicon-small-code", "fileicon-large-code"], "sql": ["fileicon-small-code", "fileicon-large-code"],
"vb": ["fileicon-small-code", "fileicon-large-code"], "vb": ["fileicon-small-code", "fileicon-large-code"],
"xml": ["fileicon-small-code", "fileicon-large-code"], "xml": ["fileicon-small-code", "fileicon-large-code"],
"xhtml": ["fileicon-small-code", "fileicon-large-code"], "xhtml": ["fileicon-small-code", "fileicon-large-code"],
"html": ["fileicon-small-code", "fileicon-large-code"], "html": ["fileicon-small-code", "fileicon-large-code"],
"htm": ["fileicon-small-code", "fileicon-large-code"], "htm": ["fileicon-small-code", "fileicon-large-code"],
"md": ["fileicon-small-code", "fileicon-large-code"], "md": ["fileicon-small-code", "fileicon-large-code"],
"less": ["fileicon-small-code", "fileicon-large-code"], "less": ["fileicon-small-code", "fileicon-large-code"],
"lua": ["fileicon-small-code", "fileicon-large-code"], "lua": ["fileicon-small-code", "fileicon-large-code"],
"go": ["fileicon-small-code", "fileicon-large-code"], "go": ["fileicon-small-code", "fileicon-large-code"],
"bat": ["fileicon-small-code", "fileicon-large-code"], "bat": ["fileicon-small-code", "fileicon-large-code"],
"wml": ["fileicon-small-code", "fileicon-large-code"] "wml": ["fileicon-small-code", "fileicon-large-code"]
}, },
"entranceFile": "file-widget-1:codeReader\/start.js" "entranceFile": "file-widget-1:codeReader\/start.js"
}, },
{ {
"name": "\u7f51\u76d8\u89e3\u538b\u7f29", "name": "\u7f51\u76d8\u89e3\u538b\u7f29",
"filesType": "*.rar,*.zip", "filesType": "*.rar,*.zip",
"notSupport": "ie6", "notSupport": "ie6",
"filesIcon": { "filesIcon": {
"rar": ["fileicon-small-zip", "fileicon-large-zip", "fileicon-middle-zip"], "rar": ["fileicon-small-zip", "fileicon-large-zip", "fileicon-middle-zip"],
"zip": ["fileicon-small-zip", "fileicon-large-zip", "fileicon-middle-zip"] "zip": ["fileicon-small-zip", "fileicon-large-zip", "fileicon-middle-zip"]
}, },
"depsFiles": ["file-widget-1:zip\/util\/css\/fileUnzip.css", "file-widget-1:zip\/util\/css\/list-view.css"], "depsFiles": ["file-widget-1:zip\/util\/css\/fileUnzip.css", "file-widget-1:zip\/util\/css\/list-view.css"],
"entranceFile": "file-widget-1:zip\/start.js" "entranceFile": "file-widget-1:zip\/start.js"
}, },
{ {
"name": "\u7f51\u76d8\u6587\u6863\u9605\u8bfb\u5668", "name": "\u7f51\u76d8\u6587\u6863\u9605\u8bfb\u5668",
"filesType": "*.txt,*.pdf,*.doc,*.docx,*.ppt,*.pptx,*.xls,*.xlsx,*.rtf", "filesType": "*.txt,*.pdf,*.doc,*.docx,*.ppt,*.pptx,*.xls,*.xlsx,*.rtf",
"filesIcon": { "filesIcon": {
"txt": ["fileicon-small-txt", "fileicon-large-txt", "fileicon-middle-txt"], "txt": ["fileicon-small-txt", "fileicon-large-txt", "fileicon-middle-txt"],
"rtf": ["fileicon-small-txt", "fileicon-large-txt", "fileicon-middle-txt"], "rtf": ["fileicon-small-txt", "fileicon-large-txt", "fileicon-middle-txt"],
"pdf": ["fileicon-small-pdf", "fileicon-large-pdf", "fileicon-middle-pdf"], "pdf": ["fileicon-small-pdf", "fileicon-large-pdf", "fileicon-middle-pdf"],
"doc": ["fileicon-small-doc", "fileicon-large-doc", "fileicon-middle-doc"], "doc": ["fileicon-small-doc", "fileicon-large-doc", "fileicon-middle-doc"],
"docx": ["fileicon-small-doc", "fileicon-large-doc", "fileicon-middle-doc"], "docx": ["fileicon-small-doc", "fileicon-large-doc", "fileicon-middle-doc"],
"ppt": ["fileicon-small-ppt", "fileicon-large-ppt", "fileicon-middle-ppt"], "ppt": ["fileicon-small-ppt", "fileicon-large-ppt", "fileicon-middle-ppt"],
"pptx": ["fileicon-small-ppt", "fileicon-large-ppt", "fileicon-middle-ppt"], "pptx": ["fileicon-small-ppt", "fileicon-large-ppt", "fileicon-middle-ppt"],
"xls": ["fileicon-small-xls", "fileicon-large-xls", "fileicon-middle-xls"], "xls": ["fileicon-small-xls", "fileicon-large-xls", "fileicon-middle-xls"],
"xlsx": ["fileicon-small-xls", "fileicon-large-xls", "fileicon-middle-xls"], "xlsx": ["fileicon-small-xls", "fileicon-large-xls", "fileicon-middle-xls"],
"vsd": ["fileicon-small-vsd", "fileicon-large-vsd", "fileicon-middle-vsd"] "vsd": ["fileicon-small-vsd", "fileicon-large-vsd", "fileicon-middle-vsd"]
}, },
"depsFiles": ["file-widget-1:doc\/util\/docReader.css", "file-widget-1:doc\/pdfJsReader\/pdfJsReader.less", "base:thirdParty\/pdfjs\/_nomd5_nomod\/web\/trans-viewer.less", "base:thirdParty\/pdfjs\/_nomd5_nomod\/web\/viewer.less"], "depsFiles": ["file-widget-1:doc\/util\/docReader.css", "file-widget-1:doc\/pdfJsReader\/pdfJsReader.less", "base:thirdParty\/pdfjs\/_nomd5_nomod\/web\/trans-viewer.less", "base:thirdParty\/pdfjs\/_nomd5_nomod\/web\/viewer.less"],
"entranceFile": "file-widget-1:doc\/start.js" "entranceFile": "file-widget-1:doc\/start.js"
}, },
{ {
"name": "\u7f51\u76d8\u56fe\u7247\u9884\u89c8", "name": "\u7f51\u76d8\u56fe\u7247\u9884\u89c8",
"filesType": "*.jpg,*.jpeg,*.livp,*.gif,*bmp,*.png,*jpe,*.cur,*.svgz,*.ico,*.heic,*.heif,*.avci,*.webp", "filesType": "*.jpg,*.jpeg,*.livp,*.gif,*bmp,*.png,*jpe,*.cur,*.svgz,*.ico,*.heic,*.heif,*.avci,*.webp",
"filesIcon": { "filesIcon": {
"jpg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "jpg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"jpeg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "jpeg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"livp": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "livp": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"gif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "gif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"bmp": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "bmp": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"png": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "png": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"jpe": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "jpe": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"cur": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "cur": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"svgz": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "svgz": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"tif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "tif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"tiff": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "tiff": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"ico": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "ico": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"heic": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "heic": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"heif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "heif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"avci": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"] "avci": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"]
}, },
"depsFiles": ["file-widget-1:image\/util\/picCategory-dialog\/css\/picCategory-dialog.css", "file-widget-1:image\/util\/picPreview\/css\/picPreview.css", "file-widget-1:image\/util\/picPreviewAside\/css\/picPreviewAside.css", "file-widget-1:image\/util\/showPic\/css\/showPic.css", "file-widget-1:image\/util\/thumbnailPic\/css\/thumbnailPic.css", "base:thirdParty\/videojs\/_nomd5_nomod\/video-js.css"], "depsFiles": ["file-widget-1:image\/util\/picCategory-dialog\/css\/picCategory-dialog.css", "file-widget-1:image\/util\/picPreview\/css\/picPreview.css", "file-widget-1:image\/util\/picPreviewAside\/css\/picPreviewAside.css", "file-widget-1:image\/util\/showPic\/css\/showPic.css", "file-widget-1:image\/util\/thumbnailPic\/css\/thumbnailPic.css", "base:thirdParty\/videojs\/_nomd5_nomod\/video-js.css"],
"entranceFile": "file-widget-1:image\/start.js" "entranceFile": "file-widget-1:image\/start.js"
}, },
{ {
"name": "\u767e\u5ea6\u8111\u56fe", "name": "\u767e\u5ea6\u8111\u56fe",
"group": "com.baidu.naotu", "group": "com.baidu.naotu",
"filesType": "*.mmap,*.xmind,*.mm", "filesType": "*.mmap,*.xmind,*.mm",
"notSupport": "ie6", "notSupport": "ie6",
"filesIcon": { "filesIcon": {
"mmap": ["fileicon-small-mmap", "fileicon-large-mmap", "fileicon-middle-mmap"], "mmap": ["fileicon-small-mmap", "fileicon-large-mmap", "fileicon-middle-mmap"],
"xmind": ["fileicon-small-xmind", "fileicon-large-xmind", "fileicon-middle-xmind"], "xmind": ["fileicon-small-xmind", "fileicon-large-xmind", "fileicon-middle-xmind"],
"mm": ["fileicon-small-mm", "fileicon-large-mm", "fileicon-middle-mm"] "mm": ["fileicon-small-mm", "fileicon-large-mm", "fileicon-middle-mm"]
}, },
"entranceFile": "file-widget-1:mindmap\/start.js" "entranceFile": "file-widget-1:mindmap\/start.js"
}, },
{ {
"name": "\u7f51\u76d8\u97f3\u9891\u64ad\u653e\u5668", "name": "\u7f51\u76d8\u97f3\u9891\u64ad\u653e\u5668",
"notSupport": "ie6", "notSupport": "ie6",
"filesType": "*.wma,*.wav,*.mp3,*.aac,*.ra,*.ram,*.mp2,*.ogg,*.aif,*.mpega,*.amr,*.mid,*.midi,*.m4a", "filesType": "*.wma,*.wav,*.mp3,*.aac,*.ra,*.ram,*.mp2,*.ogg,*.aif,*.mpega,*.amr,*.mid,*.midi,*.m4a",
"filesIcon": { "filesIcon": {
"wma": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "wma": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"wav": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "wav": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"mp3": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "mp3": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"aac": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "aac": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"ra": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "ra": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"ram": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "ram": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"mp2": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "mp2": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"ogg": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "ogg": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"aif": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "aif": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"mpega": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "mpega": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"amr": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "amr": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"mid": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "mid": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"midi": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"], "midi": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"m4a": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"] "m4a": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"]
}, },
"buttons": [{ "buttons": [{
"title": "\u97f3\u4e50\u64ad\u653e", "title": "\u97f3\u4e50\u64ad\u653e",
"name": "play-music", "name": "play-music",
"position": "listTools", "position": "listTools",
"index": 2, "index": 2,
"disabled": "none", "disabled": "none",
"icon": "icon-play", "icon": "icon-play",
"buttonStyle": "normal", "buttonStyle": "normal",
"conditions": { "conditions": {
"pageModule": "list,share,search,category,searchGlobal", "pageModule": "list,share,search,category,searchGlobal",
"filesType": "wma,wav,mp3,aac,ra,ram,mp2,ogg,aif,mpega,amr,mid,midi,m4a", "filesType": "wma,wav,mp3,aac,ra,ram,mp2,ogg,aif,mpega,amr,mid,midi,m4a",
"filesTypeStrongMatch": true "filesTypeStrongMatch": true
} }
}], }],
"depsFiles": ["file-widget-1:musicPlay\/util\/mbox\/musicbox.css"], "depsFiles": ["file-widget-1:musicPlay\/util\/mbox\/musicbox.css"],
"entranceFile": "file-widget-1:musicPlay\/start.js" "entranceFile": "file-widget-1:musicPlay\/start.js"
}, },
{ {
"name": "\u7f51\u76d8\u5927\u56fe\u9884\u89c8", "name": "\u7f51\u76d8\u5927\u56fe\u9884\u89c8",
"filesType": "*.jpg,*.jpeg,*.gif,*bmp,*.png,*jpe,*.cur,*.svgz,*.ico", "filesType": "*.jpg,*.jpeg,*.gif,*bmp,*.png,*jpe,*.cur,*.svgz,*.ico",
"filesIcon": { "filesIcon": {
"jpg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "jpg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"jpeg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "jpeg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"gif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "gif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"bmp": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "bmp": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"png": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "png": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"jpe": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "jpe": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"cur": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "cur": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"svgz": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "svgz": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"tif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "tif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"tiff": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"], "tiff": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"ico": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"] "ico": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"]
}, },
"depsFiles": ["file-widget-1:preview\/picPreview.css"], "depsFiles": ["file-widget-1:preview\/picPreview.css"],
"entranceFile": "file-widget-1:preview\/start.js" "entranceFile": "file-widget-1:preview\/start.js"
}, },
{ {
"name": "sysIcon", "name": "sysIcon",
"filesType": "*.exe,*.msi,*.dmg,*.pkg,*.psd,*.apk,*.key,*.ai,*.ipa", "filesType": "*.exe,*.msi,*.dmg,*.pkg,*.psd,*.apk,*.key,*.ai,*.ipa",
"filesIcon": { "filesIcon": {
"exe": ["fileicon-sys-s-exe", "fileicon-sys-l-exe"], "exe": ["fileicon-sys-s-exe", "fileicon-sys-l-exe"],
"msi": ["fileicon-sys-s-exe", "fileicon-sys-l-exe"], "msi": ["fileicon-sys-s-exe", "fileicon-sys-l-exe"],
"dmg": ["fileicon-sys-s-exe", "fileicon-sys-l-dmg"], "dmg": ["fileicon-sys-s-exe", "fileicon-sys-l-dmg"],
"pkg": ["fileicon-sys-s-exe", "fileicon-sys-l-dmg"], "pkg": ["fileicon-sys-s-exe", "fileicon-sys-l-dmg"],
"psd": ["fileicon-sys-s-psd", "fileicon-sys-l-psd"], "psd": ["fileicon-sys-s-psd", "fileicon-sys-l-psd"],
"apk": ["fileicon-sys-s-apk", "fileicon-sys-l-apk"], "apk": ["fileicon-sys-s-apk", "fileicon-sys-l-apk"],
"key": ["fileicon-sys-s-key", "fileicon-sys-l-key"], "key": ["fileicon-sys-s-key", "fileicon-sys-l-key"],
"ai": ["fileicon-sys-s-ai", "fileicon-sys-l-ai"], "ai": ["fileicon-sys-s-ai", "fileicon-sys-l-ai"],
"ipa": ["fileicon-sys-s-ipa", "fileicon-sys-l-ipa"], "ipa": ["fileicon-sys-s-ipa", "fileicon-sys-l-ipa"],
"pages": ["fileicon-sys-s-pages", "fileicon-sys-l-pages"], "pages": ["fileicon-sys-s-pages", "fileicon-sys-l-pages"],
"numbers": ["fileicon-sys-s-numbers", "fileicon-sys-l-numbers"], "numbers": ["fileicon-sys-s-numbers", "fileicon-sys-l-numbers"],
"eot": ["fileicon-sys-s-fonts", "fileicon-sys-l-fonts"], "eot": ["fileicon-sys-s-fonts", "fileicon-sys-l-fonts"],
"ttf": ["fileicon-sys-s-fonts", "fileicon-sys-l-fonts"], "ttf": ["fileicon-sys-s-fonts", "fileicon-sys-l-fonts"],
"woff": ["fileicon-sys-s-fonts", "fileicon-sys-l-fonts"], "woff": ["fileicon-sys-s-fonts", "fileicon-sys-l-fonts"],
"eps": ["fileicon-sys-s-eps", "fileicon-sys-l-eps"], "eps": ["fileicon-sys-s-eps", "fileicon-sys-l-eps"],
"lnk": ["fileicon-sys-s-links", "fileicon-sys-l-links"], "lnk": ["fileicon-sys-s-links", "fileicon-sys-l-links"],
"link": ["fileicon-sys-s-links", "fileicon-sys-l-links"], "link": ["fileicon-sys-s-links", "fileicon-sys-l-links"],
"swf": ["fileicon-sys-s-swf", "fileicon-sys-l-swf"], "swf": ["fileicon-sys-s-swf", "fileicon-sys-l-swf"],
"php": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "php": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"c": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "c": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"js": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "js": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"css": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "css": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"html": ["fileicon-sys-s-web", "fileicon-sys-l-web"], "html": ["fileicon-sys-s-web", "fileicon-sys-l-web"],
"htm": ["fileicon-sys-s-web", "fileicon-sys-l-web"], "htm": ["fileicon-sys-s-web", "fileicon-sys-l-web"],
"xhtml": ["fileicon-sys-s-web", "fileicon-sys-l-web"], "xhtml": ["fileicon-sys-s-web", "fileicon-sys-l-web"],
"java": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "java": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"cc": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "cc": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"python": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "python": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"json": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "json": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"sh": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "sh": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"bat": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "bat": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"ejs": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "ejs": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"xml": ["fileicon-sys-s-code", "fileicon-sys-l-code"], "xml": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"ts": ["fileicon-sys-s-video", "fileicon-sys-l-video"] "ts": ["fileicon-sys-s-video", "fileicon-sys-l-video"]
} }
}, },
{ {
"name": "\u7f51\u76d8\u89c6\u9891", "name": "\u7f51\u76d8\u89c6\u9891",
"filesType": "*.wmv,*.rmvb,*.mpeg4,*.mpeg2,*.flv,*.avi,*.3gp,*.mpga,*.qt,*.rm,*.wmz,*.wmd,*.wvx,*.wmx,*.wm,*.mpg,*.mp4,*.mkv,*.mpeg,*mov,*.asf,*.m4v,*.m3u8", "filesType": "*.wmv,*.rmvb,*.mpeg4,*.mpeg2,*.flv,*.avi,*.3gp,*.mpga,*.qt,*.rm,*.wmz,*.wmd,*.wvx,*.wmx,*.wm,*.mpg,*.mp4,*.mkv,*.mpeg,*mov,*.asf,*.m4v,*.m3u8",
"filesIcon": { "filesIcon": {
"wmv": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "wmv": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"rmvb": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "rmvb": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mpeg4": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "mpeg4": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mpeg2": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "mpeg2": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"flv": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "flv": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"avi": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "avi": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"3gp": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "3gp": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mpga": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "mpga": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"qt": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "qt": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"rm": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "rm": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"wmz": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "wmz": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"wmd": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "wmd": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"wvx": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "wvx": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"wmx": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "wmx": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"wm": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "wm": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mpg": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "mpg": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mp4": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "mp4": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mkv": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "mkv": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mpeg": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "mpeg": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mov": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "mov": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"asf": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "asf": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"m4v": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"], "m4v": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"m3u8": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"] "m3u8": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"]
}, },
"preload": true, "preload": true,
"entranceFile": "file-widget-1:video\/start.js" "entranceFile": "file-widget-1:video\/start.js"
} }
] ]
if (suffix == "") if (suffix == "")
return "dir-small" return "dir-small"
let css = "" let css = ""
icons.forEach(x => { icons.forEach(x => {
if (x.filesIcon.hasOwnProperty(suffix)) { if (x.filesIcon.hasOwnProperty(suffix)) {
css = x.filesIcon[suffix][size] css = x.filesIcon[suffix][size]
return false return false
} }
}) })
if (css == '') { if (css == '') {
css = 'default-small' css = 'default-small'
}
return css;
} }
return css;
} }
} }
} \ No newline at end of file
...@@ -102,7 +102,6 @@ export default { ...@@ -102,7 +102,6 @@ export default {
}; };
}, },
mounted() { mounted() {
console.log(this.$electron.remote.getGlobal("LOGINUSER"))
const updateOnlineStatus = () => { const updateOnlineStatus = () => {
if(navigator.onLine && this.isdissconnection){ if(navigator.onLine && this.isdissconnection){
this.isdissconnection=false this.isdissconnection=false
...@@ -199,6 +198,7 @@ export default { ...@@ -199,6 +198,7 @@ export default {
that.MsgBus.$emit("close-copy") that.MsgBus.$emit("close-copy")
that.MsgBus.$emit("hide-this-winShow") that.MsgBus.$emit("hide-this-winShow")
}); });
}, },
methods: { methods: {
reconnect(){ reconnect(){
...@@ -245,7 +245,6 @@ export default { ...@@ -245,7 +245,6 @@ export default {
}, },
computed: { computed: {
netState(){ netState(){
return this.$store.state.isNetError return this.$store.state.isNetError
} }
} }
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
v-on:add-emoji="addEmoji" v-on:add-emoji="addEmoji"
v-on:hide-emoji="hideEmoji" v-on:hide-emoji="hideEmoji"
></chat-emoji> ></chat-emoji>
<net-work-face v-if='faces && faces.length>0' :faces="faces" @close-face="closeNetworkFace" :scene=scene :to=to></net-work-face>
<div id="dirtyData" style="display:none"></div> <div id="dirtyData" style="display:none"></div>
</div> </div>
</template> </template>
...@@ -61,10 +62,12 @@ import BMF from "browser-md5-file"; ...@@ -61,10 +62,12 @@ import BMF from "browser-md5-file";
import kscreenshot from "kscreenshot"; import kscreenshot from "kscreenshot";
import contentEditor from "../tools/contenteditor"; import contentEditor from "../tools/contenteditor";
import pageUtil from "../../../utils/page"; import pageUtil from "../../../utils/page";
import NetWorkFace from './networkFace'
export default { export default {
components: { components: {
ChatEmoji, ChatEmoji,
contentEditor contentEditor,
NetWorkFace
}, },
updated() { updated() {
window.document.body.addEventListener("click", () => { window.document.body.addEventListener("click", () => {
...@@ -106,6 +109,9 @@ export default { ...@@ -106,6 +109,9 @@ export default {
} }
that.MsgBus.$emit("update-sending"); that.MsgBus.$emit("update-sending");
}); });
this.$electron.ipcRenderer.on('show-network-face', (event,faces) => {
that.faces=faces
})
}, },
props: { props: {
type: String, type: String,
...@@ -160,6 +166,11 @@ export default { ...@@ -160,6 +166,11 @@ export default {
inputObj: { inputObj: {
handler(val, oldVal) { handler(val, oldVal) {
this.msgToSent = val.txt; this.msgToSent = val.txt;
if(val.txt.length>0 && val.txt.length<5){
this.getNetworkFace()
}else if(val.txt.length==0){
this.faces=[]
}
}, },
deep: true deep: true
} }
...@@ -183,6 +194,8 @@ export default { ...@@ -183,6 +194,8 @@ export default {
top: 0, top: 0,
left: 0, left: 0,
hideThisWinShow: false, hideThisWinShow: false,
faces:[],
}; };
}, },
computed: { computed: {
...@@ -209,6 +222,16 @@ export default { ...@@ -209,6 +222,16 @@ export default {
} }
}, },
methods: { methods: {
closeNetworkFace(t){
this.faces=[]
if(t==1){
this.$refs.editor.clearContent();
}
},
getNetworkFace(){
this.faces=[]
this.$electron.ipcRenderer.send('get-face',encodeURIComponent(this.msgToSent));
},
setWinActive(){ setWinActive(){
this.hideThisWinActive = this.hideThisWinActive == '1' ? '' : '1'; this.hideThisWinActive = this.hideThisWinActive == '1' ? '' : '1';
window.localStorage.hideThisWinActive = this.hideThisWinActive window.localStorage.hideThisWinActive = this.hideThisWinActive
......
...@@ -516,7 +516,6 @@ export default { ...@@ -516,7 +516,6 @@ export default {
item.emojiCnt = emojiCnt item.emojiCnt = emojiCnt
item.type = "custom-type4"; item.type = "custom-type4";
} else { } else {
console.log(item)
this.formatCustom(item); this.formatCustom(item);
item.showText = util.parseCustomMsg(item); item.showText = util.parseCustomMsg(item);
if (item.showText == "[自定义消息]") { if (item.showText == "[自定义消息]") {
...@@ -539,7 +538,14 @@ export default { ...@@ -539,7 +538,14 @@ export default {
} else if (item.type === "file") { } else if (item.type === "file") {
item.fileLink = item.file.url; item.fileLink = item.file.url;
item.showText = item.file.name; item.showText = item.file.name;
this.formatFile(item); if(item.file.name.indexOf('.png')!=-1||item.file.name.indexOf('.gif')!=-1||item.file.name.indexOf('.jpg')!=-1)
{
item.type="image";
item.originLink = item.file.url;
this.$electron.ipcRenderer.send("addPrevImgs", item.file.url);
}else{
this.formatFile(item);
}
} else if (item.type === "notification") { } else if (item.type === "notification") {
if (item.scene === "team") { if (item.scene === "team") {
item.showText = util.generateTeamSysmMsg(item); item.showText = util.generateTeamSysmMsg(item);
...@@ -619,6 +625,7 @@ export default { ...@@ -619,6 +625,7 @@ export default {
return result; return result;
}, },
formatCustom(item) { formatCustom(item) {
console.log(item)
if (item.content) { if (item.content) {
item.customData = JSON.parse(item.content).data; item.customData = JSON.parse(item.content).data;
...@@ -629,6 +636,15 @@ export default { ...@@ -629,6 +636,15 @@ export default {
ext: item.customData.content.fileName, ext: item.customData.content.fileName,
name: item.customData.content.fileName name: item.customData.content.fileName
}; };
} else if (/(.png|.gif|.jpg|.bmp)/i.test(item.customData.content.fileName)) {
item.type = "image";
item.originLink = item.customData.content.fileUrl;
item.file = {
url: item.customData.content.fileUrl,
ext: item.customData.content.fileName,
name: item.customData.content.fileName
};
this.$electron.ipcRenderer.send("addPrevImgs", item.customData.content.fileUrl);
} else { } else {
if (item.customData.content.fileName) { if (item.customData.content.fileName) {
let exts = item.customData.content.fileName.split("."); let exts = item.customData.content.fileName.split(".");
......
...@@ -655,7 +655,7 @@ export default { ...@@ -655,7 +655,7 @@ export default {
if (item.to == "684cb79fe92f46888888") { if (item.to == "684cb79fe92f46888888") {
if(this.noticeLastTime<item.lastMsg.time){ if(this.noticeLastTime<item.lastMsg.time){
this.noticeLastTime=item.lastMsg.time this.noticeLastTime=item.lastMsg.time
this.showNotice() //this.showNotice()
} }
this.noticeObj = item; this.noticeObj = item;
return; return;
...@@ -677,7 +677,7 @@ export default { ...@@ -677,7 +677,7 @@ export default {
} }
}); });
if (item.unread > 0 && !item.isMute) { if (item.unread > 0 && !item.isMute) {
if (item.lastMsg.tip && item.lastMsg.tip.indexOf("抖了一下") != -1) { if (item.lastMsg && item.lastMsg.tip && item.lastMsg.tip.indexOf("抖了一下") != -1) {
this.dou(); this.dou();
this.enterChat(item); this.enterChat(item);
} }
......
<template>
<div class="net-work-face" @mouseover="clearTime" @mouseout="addTime">
<div class="arrow" :class="{'dis':index==0}" @click="changePage(-1)">
<i class="el-icon-arrow-left"></i>
</div>
<div class="face-content">
<template v-for="(item, index) in showFaces">
<img :src="item" :key="index" @click="sendFace(item)" />
</template>
</div>
<div class="arrow" :class="{'dis':index==maxPage-1}" @click="changePage(1)">
<i class="el-icon-arrow-right"></i>
</div>
</div>
</template>
<script>
export default {
props: {
faces: {
type: Array,
default: []
},
scene: {
type: String,
default: ""
},
to: {
type: String,
default: ""
}
},
data() {
return {
showFaces: [],
index: 0,
maxPage: 0,
timer: null
};
},
mounted() {
this.maxPage = Math.ceil(this.faces.length / 6);
this.init();
},
methods: {
clearTime() {
clearTimeout(this.timer);
},
addTime() {
this.timer = setTimeout(() => {
this.close(0);
}, 1000 * 5);
},
init() {
if (this.index >= 0 && this.index < this.maxPage) {
this.showFaces = [];
for (let i = this.index * 6; i < this.index * 6 + 6; i++) {
this.showFaces.push(this.faces[i]);
}
}
},
changePage(i) {
let t = this.index + i;
if (t < 0 || t > this.maxPage - 1) return;
this.index = t;
this.init();
},
close(t) {
this.$emit("close-face",t);
},
sendFace(url) {
let t = url.split("/");
let fileName = t[t.length - 1];
this.$store.dispatch("sendMsg", {
type: "custom",
scene: this.scene,
to: this.to,
pushContent: "表情消息",
content: {
msgtype: "custom_file",
data: {
pushContent: "表情消息",
Height: "84",
content: {
fileType: "image",
fileUrl: url,
fileName: fileName,
fileSize: "230KB"
},
recentContent: fileName,
Width: "210"
}
}
});
this.close(1)
}
}
};
</script>
<style scoped>
.net-work-face {
position: absolute;
left: 10px;
top: -90px;
/* right: 0; */
/* border-top: 1px solid #eee; */
/* border-bottom: 1px solid #ccc; */
background-color: #fff;
z-index: 2017;
width: 482px;
height: 82px;
box-shadow: 0 0 5px #ccc;
border-radius: 2px;
display: flex;
}
.net-work-face .arrow {
width: 20px;
text-align: center;
line-height: 82px;
font-size: 14px;
color: #666;
cursor: pointer;
}
.net-work-face .arrow.dis {
color: #bbb;
cursor: no-drop;
}
.net-work-face .face-content {
display: flex;
flex: 1;
padding-top: 5px;
justify-content: space-between;
}
.net-work-face .face-content img {
width: 70px;
height: 70px;
cursor: pointer;
}
.net-work-face .face-content img:hover {
outline: 1px solid #ccc;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment