diff --git a/build/css/modules/layim/layim.css b/build/css/modules/layim/layim.css
deleted file mode 100644
index 097cc04..0000000
--- a/build/css/modules/layim/layim.css
+++ /dev/null
@@ -1,2 +0,0 @@
-/** layui-v1.0.0 经典模块化前端框架@LGPL www.layui.com By 贤心 */
-.layui-layim-skin li img:hover,.layui-layim-tab li:hover{opacity:.8;filter:Alpha(opacity=80)}html #layuicss-skinlayimcss{display:none;position:absolute;width:1989px}body .layui-layim,body .layui-layim-chat{border:1px solid #D9D9D9;background-repeat:no-repeat;background-color:#F6F6F6;color:#333;font-family:\5FAE\8F6F\96C5\9ED1}body .layui-layim-chat{background-size:cover}body .layui-layim .layim-show{display:block}body .layui-layim .layui-layer-title{height:110px;border-bottom:none;background:0 0}.layui-layim-main{position:relative;top:-98px;left:0}body .layui-layim .layui-layer-content,body .layui-layim-chat .layui-layer-content{overflow:visible}.layui-layim cite,.layui-layim em,.layui-layim-chat cite,.layui-layim-chat em{font-style:normal}.layui-layim-info{height:50px;font-size:0;padding:0 15px}.layui-layim-info *{font-size:14px}.layim-tab-content li h5 *,.layui-layim-info div,.layui-layim-skin li,.layui-layim-tab li,.layui-layim-tool li{display:inline-block;vertical-align:top;*zoom:1;*display:inline}.layim-tab-content li h5 span,.layui-layim-info .layui-layim-user,.layui-layim-list li p,.layui-layim-list li span,.layui-layim-remark{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layui-layim-info .layui-layim-user{max-width:150px;margin-right:5px;font-size:16px}.layui-layim-status{position:relative;top:2px;cursor:pointer}.layim-status-online{color:#3FDD86}.layim-status-hide{color:#DD691D}.layim-menu-box{display:none;position:absolute;z-index:100;top:24px;left:-31px;padding:5px 0;width:85px;border:1px solid #E2E2E2;border-radius:2px;background-color:#fff;box-shadow:1px 1px 20px rgba(0,0,0,.1)}.layim-menu-box li{position:relative;line-height:22px;padding-left:30px;font-size:12px}.layim-menu-box li cite{padding-right:5px;font-size:14px}.layim-menu-box li i{display:none;position:absolute;left:0;top:0}.layim-menu-box .layim-this i{display:block}.layim-menu-box li:hover{background-color:#eee}.layui-layim-remark{margin-top:10px}.layui-layim-tab{margin-top:10px;padding:9px 0;font-size:0}.layui-layim-tab li{position:relative;width:33.33%;height:24px;line-height:24px;font-size:22px;text-align:center;color:#666;color:rgba(0,0,0,.6);cursor:pointer}.layim-tab-two li{width:50%}.layui-layim-tab li.layim-this:after{content:'';position:absolute;left:0;bottom:-9px;width:100%;height:3px;background-color:#3FDD86}.layui-layim-tab li.layim-hide{display:none}.layim-tab-content{display:none;padding:10px 0;height:349px;overflow:hidden;background-color:#fff;background-color:rgba(255,255,255,.9)}.layim-tab-content:hover{overflow-y:auto}.layim-tab-content li h5{position:relative;margin-right:15px;padding-left:30px;height:28px;line-height:28px;cursor:pointer;font-size:0;white-space:nowrap;overflow:hidden}.layim-tab-content li h5 *{font-size:14px}.layim-tab-content li h5 span{max-width:125px}.layim-tab-content li h5 i{position:absolute;left:12px;top:0;color:#C9BDBB}.layim-tab-content li h5 em{padding-left:5px;color:#999}.layim-tab-content li ul{display:none;margin-bottom:10px}.layui-layim-list li{position:relative;height:42px;padding:5px 15px 5px 60px;font-size:0;cursor:pointer}.layui-layim-list li:hover{background-color:#F2F2F2;background-color:rgba(0,0,0,.05)}.layui-layim-list li.layim-null{height:20px;line-height:20px;padding:0;font-size:14px;color:#999;text-align:center;cursor:default}.layui-layim-list li.layim-null:hover{background:0 0}.layui-layim-list li *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:14px}.layui-layim-list li span{margin-top:4px;max-width:155px}.layui-layim-list li img{position:absolute;left:15px;top:8px;width:36px;height:36px;border-radius:100%}.layui-layim-list li p{display:block;line-height:18px;font-size:12px;color:#999}.layui-layim-tool{padding:0 10px;font-size:0;background-color:#F6F6F6;border-radius:0 0 2px 2px}.layui-layim-tool li{width:45px;height:37px;line-height:37px;text-align:center;font-size:22px;cursor:pointer}.layui-layim-search{display:none;position:absolute;bottom:5px;left:5px;height:28px;line-height:28px}.layui-layim-search input{width:210px;padding:0 30px 0 10px;height:30px;line-height:30px;border:none;border-radius:3px;background-color:#ddd}.layui-layim-search label{position:absolute;right:6px;top:2px;font-size:20px;cursor:pointer;color:#333;font-weight:400}.layui-layim-skin{margin:10px 0 0 10px;font-size:0}.layui-layim-skin li{margin:0 10px 10px 0;line-height:60px;text-align:center;background-color:#f6f6f6}.layui-layim-skin li,.layui-layim-skin li img{width:86px;height:60px;cursor:pointer}.layui-layim-file:hover,.layui-layim-members ul li:hover{opacity:.9}.layui-layim-skin li cite{font-size:14px;font-style:normal}body .layui-layim-chat{background-color:#fff}body .layui-layim-chat-list{width:760px}body .layui-layim-chat .layui-layer-title{height:80px;border-bottom:none;background-color:#F8F8F8;background-color:rgba(245,245,245,.7)}body .layui-layim-chat .layui-layer-content{background:0 0;font-size:0}body .layui-layim-chat .layui-layer-setwin .layui-layer-max{display:none}.layim-chat,.layim-chat-list,.layim-chat-list li *,.layui-layim-min .layui-layer-content *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:14px}.layim-chat-list{display:none;position:relative;top:-80px;width:200px;height:520px;background-color:#D9D9D9;overflow:hidden;font-size:0}.layim-chat-list:hover{overflow-y:auto}.layim-chat-list li,.layui-layim-min .layui-layer-content{position:relative;margin:5px;padding:5px 30px 5px 5px;line-height:40px;cursor:pointer;border-radius:3px}.layim-chat-list li img,.layui-layim-min .layui-layer-content img{width:40px;height:40px;border-radius:100%}.layui-layim-photos{cursor:crosshair}.layim-chat-list li{white-space:nowrap}.layim-chat-list li span,.layui-layim-min .layui-layer-content span{width:100px;padding-left:10px;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layim-chat-list li span cite{color:#999;padding-left:10px}.layim-chat-list li:hover{background-color:#E2E2E2}.layim-chat-list li.layim-this{background-color:#F3F3F3}.layim-chat-list li .layui-icon{display:none;position:absolute;right:5px;top:7px;color:#555;font-size:22px}.layim-chat-list li .layui-icon:hover{color:#c00}.layim-chat-list li:hover .layui-icon{display:inline-block}.layim-chat-system{margin:10px 0;text-align:center}.layim-chat-system span{display:inline-block;line-height:30px;padding:0 15px;border-radius:3px;background-color:#f4f4f4;cursor:default}.layim-chat{position:relative;top:0;left:0;width:600px;background-color:#fff;background-color:rgba(255,255,255,.9)}.layim-chat-other,.layim-chat-other span{left:15px;position:relative}.layim-chat-title{position:absolute;top:-65px}.layim-chat-other img{width:50px;height:50px;border-radius:100%}.layim-chat-other span{top:-25px;font-size:18px}.layim-chat-group .layim-chat-other span{cursor:pointer}.layim-chat-group .layim-chat-other span em{padding:0 10px;color:#999}.layim-chat-main{height:262px;padding:15px 15px 5px;overflow-x:hidden;overflow-y:auto}.layim-chat-main ul li{position:relative;font-size:0;margin-bottom:10px;padding-left:60px;min-height:68px}.layim-chat-text,.layim-chat-user{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:14px}.layim-chat-user{position:absolute;left:3px}.layim-chat-user img{width:40px;height:40px;border-radius:100%}.layim-chat-user cite{position:absolute;left:60px;top:-2px;width:500px;line-height:24px;font-size:12px;white-space:nowrap;color:#999;text-align:left;font-style:normal}.layim-chat-user cite i{padding-left:15px;font-style:normal}.layim-chat-text{position:relative;line-height:22px;margin-top:25px;padding:10px 15px;background-color:#eee;border-radius:3px;color:#333;word-break:break-all;max-width:462px\9}.layim-chat-text:after{content:'';position:absolute;left:-10px;top:15px;width:0;height:0;border-style:solid dashed dashed;border-color:#eee transparent transparent;overflow:hidden;border-width:10px}.layim-chat-text a{color:#33DF83}.layim-chat-text img{max-width:100%;vertical-align:middle}.layim-chat-mine .layim-chat-text .layui-layim-file,.layim-chat-text .layui-layim-file{display:block;text-align:center}.layui-layim-file i{font-size:80px;line-height:80px}.layui-layim-file cite{display:block;line-height:20px;font-size:14px}.layim-chat-main ul .layim-chat-mine{text-align:right;padding-left:0;padding-right:60px}.layim-chat-mine .layim-chat-user{left:auto;right:3px}.layim-chat-mine .layim-chat-user cite{left:auto;right:60px;text-align:right}.layim-chat-mine .layim-chat-user cite i{padding-left:0;padding-right:15px}.layim-chat-mine .layim-chat-text{margin-left:0;text-align:left;background-color:#33DF83;color:#fff}.layim-chat-mine .layim-chat-text:after{left:auto;right:-10px;border-top-color:#33DF83}.layim-chat-mine .layim-chat-text a{color:#fff}.layim-chat-footer{border-top:1px solid #F1F1F1}.layim-chat-tool{position:relative;padding:0 8px;height:38px;line-height:38px;font-size:0}.layim-chat-tool span{position:relative;margin:0 10px;display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:24px;cursor:pointer}.layim-chat-tool .layim-tool-log{position:absolute;right:5px;font-size:14px}.layim-tool-log i{position:relative;top:2px;margin-right:5px;font-size:20px;color:#999}.layim-tool-image input{position:absolute;font-size:0;left:0;top:0;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}body .layui-layim-face{margin:10px 0 0 -18px;border:none;background:0 0}body .layui-layim-face .layui-layer-content{padding:0;background-color:#fff;color:#666;box-shadow:none}.layui-layim-face .layui-layer-TipsG{display:none}.layui-layim-face ul{position:relative;width:372px;padding:10px;border:1px solid #D9D9D9;background-color:#fff;box-shadow:0 0 20px rgba(0,0,0,.2)}.layui-layim-face ul li{cursor:pointer;float:left;border:1px solid #e8e8e8;height:22px;width:26px;overflow:hidden;margin:-1px 0 0 -1px;padding:4px 2px;text-align:center}.layui-layim-face ul li:hover{position:relative;z-index:2;border:1px solid #eb7350;background:#fff9ec}.layim-chat-textarea{margin-left:10px}.layim-chat-textarea textarea{display:block;width:100%;padding:5px 0 0;height:68px;line-height:20px;border:none;overflow:auto;resize:none;background:0 0}.layim-chat-textarea textarea:focus{outline:0}.layim-chat-bottom{position:relative;height:46px}.layim-chat-send{position:absolute;right:15px;top:3px;height:32px;line-height:32px;font-size:0;cursor:pointer}.layim-chat-send span{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:14px;line-height:32px;margin-left:5px;padding:0 20px;background-color:#33DF83;color:#fff;border-radius:3px}.layim-chat-send span:hover{background-color:#22D979}.layim-chat-send span:active{background-color:#20C870}.layim-chat-send .layim-send-btn{border-radius:3px 0 0 3px}.layim-chat-send .layim-send-set{position:relative;width:30px;height:32px;margin-left:0;padding:0;border-left:1px solid #65E7A3;border-radius:0 3px 3px 0}.layim-send-set .layui-edge{top:14px;left:9px;border-width:6px;border-top-style:solid;border-top-color:#fff}.layim-chat-send .layim-menu-box{left:auto;right:0;top:33px;width:180px;padding:10px 0}.layim-chat-send .layim-menu-box li{padding-right:15px;line-height:28px}body .layui-layim-min{border:1px solid #D9D9D9}.layui-layim-min .layui-layer-content{margin:0 5px;padding:5px 10px;white-space:nowrap}.layui-layim-close .layui-layer-content span{width:auto;max-width:120px}body .layui-layim-members{margin:25px 0 0 -81px;border:none;background:0 0}body .layui-layim-members .layui-layer-content{padding:0;background:0 0;color:#666;box-shadow:none}.layui-layim-members .layui-layer-TipsG{display:none}.layui-layim-members ul{position:relative;width:580px;height:200px;padding:10px 10px 0;border:1px solid #D9D9D9;background-color:#fff;background-color:rgba(255,255,255,.9);box-shadow:none;overflow:hidden;font-size:0}.layui-layim-members ul:hover{overflow:auto}.layui-layim-members ul li{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:14px;width:112px;margin:10px 0;text-align:center}.layui-layim-members ul li a{position:relative;display:inline-block}.layui-layim-members ul li a:after{content:'';position:absolute;width:46px;height:46px;left:0;top:0;border:1px solid #eee;border:1px solid rgba(0,0,0,.1);border-radius:100%}.layui-layim-members ul li img{width:48px;height:48px;border-radius:100%}.layui-layim-members ul li p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}body .layui-layim-contextmenu{margin:70px 0 0 30px;width:200px;padding:5px 0;border:1px solid #ccc;background:#fff;border-radius:0;box-shadow:0 0 5px rgba(0,0,0,.2)}body .layui-layim-contextmenu .layui-layer-content{padding:0;background-color:#fff;color:#333;font-size:14px;box-shadow:none}.layui-layim-contextmenu .layui-layer-TipsG{display:none}.layui-layim-contextmenu li{padding:0 15px 0 35px;cursor:pointer;line-height:30px}.layui-layim-contextmenu li:hover{background-color:#F2F2F2}.layim-tab-content,.layui-layim-face ul,.layui-layim-tab{margin-bottom:0}.layim-tab-content li h5{margin-top:0;margin-bottom:0}.layim-chat-other img,.layui-layim-face img{vertical-align:bottom}.layim-chat-other span{color:#444}.layim-chat-other span cite{padding:0 15px;color:#999}.layim-chat-other:hover{text-decoration:none}
\ No newline at end of file
diff --git a/build/css/modules/layim/skin/1.jpg b/build/css/modules/layim/skin/1.jpg
deleted file mode 100644
index 54f6a22..0000000
Binary files a/build/css/modules/layim/skin/1.jpg and /dev/null differ
diff --git a/build/css/modules/layim/skin/2.jpg b/build/css/modules/layim/skin/2.jpg
deleted file mode 100644
index 0bffb50..0000000
Binary files a/build/css/modules/layim/skin/2.jpg and /dev/null differ
diff --git a/build/css/modules/layim/skin/3.jpg b/build/css/modules/layim/skin/3.jpg
deleted file mode 100644
index 53ba921..0000000
Binary files a/build/css/modules/layim/skin/3.jpg and /dev/null differ
diff --git a/build/css/modules/layim/skin/4.jpg b/build/css/modules/layim/skin/4.jpg
deleted file mode 100644
index 941683a..0000000
Binary files a/build/css/modules/layim/skin/4.jpg and /dev/null differ
diff --git a/build/css/modules/layim/skin/logo.jpg b/build/css/modules/layim/skin/logo.jpg
deleted file mode 100644
index 26c7358..0000000
Binary files a/build/css/modules/layim/skin/logo.jpg and /dev/null differ
diff --git a/build/lay/modules/layim.js b/build/lay/modules/layim.js
deleted file mode 100644
index ab32171..0000000
--- a/build/lay/modules/layim.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/** layui-v1.0.0 经典模块化前端框架 LGPL license By www.layui.com */
- ;layui.define(["layer","laytpl","upload"],function(i){var a="2.0.85",e=layui.jquery,t=layui.layer,n=layui.laytpl,l="layim-show",s="layim-this",o=20,r={},d=function(){this.v=a,e("body").on("click","*[layim-event]",function(i){var a=e(this),t=a.attr("layim-event");U[t]?U[t].call(this,a,i):""})};d.prototype.config=function(i){var a=[];if(layui.each(Array(4),function(i){a.push(layui.cache.dir+"css/modules/layim/skin/"+(i+1)+".jpg")}),i=i||{},i.skin=i.skin||[],layui.each(i.skin,function(i,e){a.unshift(e)}),i.skin=a,i=e.extend({isfriend:!0,isgroup:!0},i),window.JSON&&window.JSON.parse)return S(i),this},d.prototype.on=function(i,a){return"function"==typeof a&&(r[i]?r[i].push(a):r[i]=[a]),this},d.prototype.cache=function(){return C},d.prototype.chat=function(i,a){if(window.JSON&&window.JSON.parse)return L(i,a),this},d.prototype.setChatMin=function(){return M(),this},d.prototype.getMessage=function(i){return D(i),this},d.prototype.addList=function(i){return z(i),this},d.prototype.removeList=function(i){return _(i),this},d.prototype.content=function(i){return layui.data.content(i)};var u=function(i){var a={friend:"该分组下暂无好友",group:"暂无群组",history:"暂无历史会话"};return i=i||{},i.item=i.item||"d."+i.type,["{{# var length = 0; layui.each("+i.item+", function(i, data){ length++; }}",'
{{ data.username||data.groupname||data.name||"佚名" }} {{ data.remark||data.sign||"" }}
',"{{# }); if(length === 0){ }}",''+(a[i.type]||"暂无数据")+" ","{{# } }}"].join("")},c=['','
','
{{ d.mine.username }}
','
','{{# if(d.mine.status === "online"){ }}',' ','{{# } else if(d.mine.status === "hide") { }}',' ',"{{# } }}",'","
",'',"
",'
",'
','{{# layui.each(d.friend, function(index, item){ var spread = d.local["spread"+index]; }}',"",'{{# if(spread === "true"){ }}{{# } else { }}{{# } }} {{ item.groupname||"未命名分组"+index }} ( {{ (item.list||[]).length }} ) ','',u({type:"friend",item:"item.list",index:"index"})," "," ","{{# }); if(d.friend.length === 0){ }}",'',"{{# } }}"," ",'
",'
",'
",'
",'
ဇ
',"
"].join(""),y=['',"{{# layui.each(d.skin, function(index, item){ }}",' ',"{{# }); }}",'默认 '," "].join(""),m=['"].join(""),f=function(i){return i<10?"0"+(0|i):i};layui.data.date=function(i){var a=new Date(i||new Date);return a.getFullYear()+"-"+f(a.getMonth()+1)+"-"+f(a.getDate())+" "+f(a.getHours())+":"+f(a.getMinutes())+":"+f(a.getSeconds())},layui.data.content=function(i){var a=function(i){return new RegExp("\\n*\\["+(i||"")+"(pre|div|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)\\]\\n*","g")};return i=(i||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/@(\S+)(\s+?|$)/g,'@$1 $2').replace(/\s{2}/g," ").replace(/img\[([^\s]+?)\]/g,function(i){return' '}).replace(/file\([\s\S]+?\)\[[\s\S]*?\]/g,function(i){var a=(i.match(/file\(([\s\S]+?)\)\[/)||[])[1],e=(i.match(/\)\[([\s\S]*?)\]/)||[])[1];return a?' '+(e||a)+" ":i}).replace(/face\[([^\s\[\]]+?)\]/g,function(i){var a=i.replace(/^face/g,"");return' '}).replace(/a\([\s\S]+?\)\[[\s\S]*?\]/g,function(i){var a=(i.match(/a\(([\s\S]+?)\)\[/)||[])[1],e=(i.match(/\)\[([\s\S]*?)\]/)||[])[1];return a?''+(e||a)+" ":i}).replace(a(),"<$1 $2>").replace(a("/"),"$1>").replace(/\n/g," ")};var p,h,g,v,b,x=['','',"{{# if(d.mine){ }}",'{{ layui.data.date(d.timestamp) }} {{ d.username||"佚名" }}',"{{# } else { }}",'{{ d.username||"佚名" }}{{ layui.data.date(d.timestamp) }} ',"{{# } }}"," ",'{{ layui.data.content(d.content||" ") }}
'," "].join(""),k='{{ d.data.name||"佚名" }} {{# if(!d.base.brief){ }}ဇ {{# } }} ',w=function(i,a,n){return i=i||{},e.ajax({url:i.url,type:i.type||"get",data:i.data,dataType:i.dataType||"json",cache:!1,success:function(i){0==i.code?a&&a(i.data||{}):t.msg(i.msg||(n||"Error")+": LAYIM_NOT_GET_DATA",{time:5e3})},error:function(i,a){window.console&&console.log&&console.error("LAYIM_DATE_ERROR:"+a)}})},C={message:{},chat:[]},S=function(i){var a=i.mine||{},t=layui.data("layim")[a.id]||{},l={base:i,local:t,mine:a,history:t.history||{}};return C=e.extend(C,l),i.brief?layui.each(r.ready,function(i,a){a&&a(l)}):void w(i.init,function(a){var t=i.mine||a.mine||{},l=layui.data("layim")[t.id]||{},s={base:i,local:l,mine:t,friend:a.friend||[],group:a.group||[],history:l.history||{}};C=e.extend(C,s),T(n(c).render(s)),(l.close||i.min)&&j(),layui.each(r.ready,function(i,a){a&&a(s)})},"INIT")},T=function(i){return t.open({type:1,area:["260px","520px"],skin:"layui-box layui-layim",title:"",offset:"rb",id:"layui-layim",shade:!1,moveType:1,shift:2,content:i,success:function(i){var a=layui.data("layim")[C.mine.id]||{},n=a.skin;p=i,p.css({"background-image":n?"url("+n+")":"none"}),C.base.right&&i.css("margin-left","-"+C.base.right),h&&t.close(h.attr("times"));var l=[],s=i.find(".layim-list-history");s.find("li").each(function(){l.push(e(this).prop("outerHTML"))}),l.length>0&&(l.reverse(),s.html(l.join(""))),I()},cancel:function(i){j();var a=layui.data("layim")[C.mine.id]||{};return a.close=!0,layui.data("layim",{key:C.mine.id,value:a}),!1}})},I=function(){p.on("contextmenu",function(i){return i.cancelBubble=!0,i.returnValue=!1,!1});var i=function(){t.closeAll("tips")};p.find(".layim-list-history").on("contextmenu","li",function(a){var n=e(this),l='';n.hasClass("layim-null")||(t.tips(l,this,{tips:1,time:0,shift:5,fix:!0,skin:"layui-box layui-layim-contextmenu",success:function(i){var a=function(i){B(i)};i.off("mousedown",a).on("mousedown",a)}}),e(document).off("mousedown",i).on("mousedown",i),e(window).off("resize",i).on("resize",i))})},j=function(i){return h&&t.close(h.attr("times")),p&&p.hide(),C.mine=C.mine||{},t.open({type:1,title:!1,id:"layui-layim-close",skin:"layui-box layui-layim-min layui-layim-close",shade:!1,closeBtn:!1,shift:2,offset:"rb",content:''+(i||C.base.title||"我的LayIM")+" ",success:function(i,a){h=i,C.base.right&&i.css("margin-left","-"+C.base.right),i.on("click",function(){t.close(a),p.show();var i=layui.data("layim")[C.mine.id]||{};delete i.close,layui.data("layim",{key:C.mine.id,value:i})})}})},L=function(i){i=i||{};var a=e("#layui-layim-chat"),l={data:i,base:C.base,local:C.local};if(!i.id)return t.msg("非法用户");if(a[0]){var s=g.find(".layim-chat-list"),o=s.find(".layim-chatlist-"+i.type+i.id);return"none"===g.css("display")&&g.show(),v&&t.close(v.attr("times")),1!==s.find("li").length||o[0]||(g.css("width","800px"),s.css("display","inline-block")),o[0]||(s.append(n(k).render(l)),a.append(n(m).render(l))),E(s.find(".layim-chatlist-"+i.type+i.id)),o[0]||R(),O(i),$(),b}var d=b=t.open({type:1,area:["600px","520px"],skin:"layui-box layui-layim-chat",id:"layui-layim-chat",title:"",shade:!1,moveType:1,maxmin:!0,closeBtn:!C.base.brief&&1,content:n('"+m).render(l),success:function(a){var e=layui.data("layim")[C.mine.id]||{},n=e.skin;g=a,g.css({"background-image":n?"url("+n+")":"none"}),$(),O(i),layui.each(r.chatChange,function(i,a){a&&a(H())}),R(),q(),a.on("click",".layui-layim-photos",function(){var i=this.src;t.close(L.photosIndex),t.photos({photos:{data:[{alt:"大图模式",src:i}]},shade:.01,closeBtn:2,shift:0,success:function(i,a){L.photosIndex=a}})})},min:function(){return M(),!1},end:function(){t.closeAll("tips")}});return d},M=function(i){var a=i||H().data,n=layui.layim.cache().base;g&&!i&&g.hide(),v&&t.close(v.attr("times")),t.open({type:1,title:!1,id:"layui-layim-min",skin:"layui-box layui-layim-min",shade:!1,closeBtn:!1,shift:a.shift||2,offset:"b",move:"#layui-layim-min img",moveType:1,area:["182px","54px"],content:''+a.name+" ",success:function(a,l){i||(v=a),n.minRight&&t.style(l,{left:e(window).width()-a.outerWidth()-parseFloat(n.minRight)}),a.find(".layui-layer-content span").on("click",function(){t.close(l),i?layui.each(C.chat,function(i,a){L(a)}):g.show(),i&&(C.chat=[],K())}),a.find(".layui-layer-content img").on("click",function(i){B(i)})}})},E=function(i,a){i=i||e(".layim-chat-list ."+s);var n=i.index()===-1?0:i.index(),l=".layim-chat",o=g.find(l).eq(n);if(a){i.hasClass(s)&&E(0===n?i.next():i.prev()),i.remove(),o.remove();var d=g.find(l).length;return 1===d&&(g.find(".layim-chat-list").hide(),g.css("width","600px")),0===d&&t.close(b),!1}i.addClass(s).siblings().removeClass(s),o.css("display","inline-block").siblings(l).hide(),o.find("textarea").focus(),layui.each(r.chatChange,function(i,a){a&&a(H())}),q()},q=function(){var i=H(),a=C.message[i.data.type+i.data.id];a&&delete C.message[i.data.type+i.data.id]},H=function(){var i=e(".layim-chat-list ."+s).index(),a=g.find(".layim-chat").eq(i),t=JSON.parse(decodeURIComponent(a.find(".layim-chat-tool").data("json")));return{elem:a,data:t,textarea:a.find("textarea")}},O=function(i){var a=layui.data("layim")[C.mine.id]||{},e={},t=a.history||{},l=t[i.type+i.id];if(p){var s=p.find(".layim-list-history");if(i.historyTime=(new Date).getTime(),t[i.type+i.id]=i,a.history=t,layui.data("layim",{key:C.mine.id,value:a}),!l){e[i.type+i.id]=i;var o=n(u({type:"history",item:"d.data"})).render({data:e});s.prepend(o),s.find(".layim-null").remove()}}},A=function(){var i={username:C.mine?C.mine.username:"访客",avatar:C.mine?C.mine.avatar:layui.cache.dir+"css/pc/layim/skin/logo.jpg",id:C.mine?C.mine.id:null,mine:!0},a=H(),e=a.elem.find(".layim-chat-main ul"),l=C.base.maxLength||3e3;if(i.content=a.textarea.val(),""!==i.content.replace(/\s/g,"")){if(i.content.length>l)return t.msg("内容最长不能超过"+l+"个字符");e.append(n(x).render(i));var s={mine:i,to:a.data},o={username:s.mine.username,avatar:s.mine.avatar,id:s.to.id,type:s.to.type,content:s.mine.content,timestamp:(new Date).getTime(),mine:!0};N(o),layui.each(r.sendMessage,function(i,a){a&&a(s)})}K(),a.textarea.val("").focus()},D=function(i){i=i||{};var a=e(".layim-chatlist-"+i.type+i.id),t={},l=a.index();if(i.timestamp=i.timestamp||(new Date).getTime(),N(i),!g&&i.content||l===-1){if(C.message[i.type+i.id])C.message[i.type+i.id].push(i);else if(C.message[i.type+i.id]=[i],"friend"===i.type){var s;layui.each(C.friend,function(a,e){if(layui.each(e.list,function(a,e){if(e.id==i.id)return e.type="friend",e.name=e.username,C.chat.push(e),s=!0}),s)return!0}),s||(i.name=i.username,i.temporary=!0,C.chat.push(i))}else if("group"===i.type){var o;layui.each(C.group,function(a,e){if(e.id==i.id)return e.type="group",e.name=e.groupname,C.chat.push(e),o=!0}),o||(i.name=i.groupname,C.chat.push(i))}else i.name=i.name||i.username||i.groupname,C.chat.push(i);return"group"===i.type&&layui.each(C.group,function(a,e){if(e.id==i.id)return t.avatar=e.avatar,!0}),M({name:"收到新消息",avatar:t.avatar||i.avatar,shift:6})}var r=H();r.data.type+r.data.id!==i.type+i.id&&(a.addClass("layui-anim layer-anim-06"),setTimeout(function(){a.removeClass("layui-anim layer-anim-06")},300));var d=g.find(".layim-chat").eq(l),u=d.find(".layim-chat-main ul");""!==i.content.replace(/\s/g,"")&&u.append(n(x).render(i)),K()},N=function(i){var a=layui.data("layim")[C.mine.id]||{},e=a.chatlog||{};e[i.type+i.id]?(e[i.type+i.id].push(i),e[i.type+i.id].length>o&&e[i.type+i.id].shift()):e[i.type+i.id]=[i],a.chatlog=e,layui.data("layim",{key:C.mine.id,value:a})},R=function(){var i=layui.data("layim")[C.mine.id]||{},a=H(),e=i.chatlog||{},t=a.elem.find(".layim-chat-main ul");layui.each(e[a.data.type+a.data.id],function(i,a){t.append(n(x).render(a))}),K()},z=function(i){var a,e=p.find(".layim-list-"+i.type),l={};if(C[i.type])if("friend"===i.type)layui.each(C.friend,function(e,n){if(i.groupid==n.id)return layui.each(C.friend[e].list,function(e,t){if(t.id==i.id)return a=!0}),a?t.msg("好友 ["+(i.username||"")+"] 已经存在列表中",{shift:6}):(C.friend[e].list=C.friend[e].list||[],l[C.friend[e].list.length]=i,i.groupIndex=e,C.friend[e].list.push(i),!0)});else if("group"===i.type){if(layui.each(C.group,function(e,t){if(t.id==i.id)return a=!0}),a)return t.msg("您已是 ["+(i.groupname||"")+"] 的群成员",{shift:6});l[C.group.length]=i,C.group.push(i)}if(!a){var s=n(u({type:i.type,item:"d.data",index:"friend"===i.type?"data.groupIndex":null})).render({data:l});if("friend"===i.type){var o=e.find(">li").eq(i.groupIndex);o.find(".layui-layim-list").append(s),o.find(".layim-count").html(C.friend[i.groupIndex].list.length),o.find(".layim-null")[0]&&o.find(".layim-null").remove()}else"group"===i.type&&(e.append(s),e.find(".layim-null")[0]&&e.find(".layim-null").remove())}},_=function(i){var a=p.find(".layim-list-"+i.type);C[i.type]&&("friend"===i.type?layui.each(C.friend,function(e,t){layui.each(t.list,function(t,n){if(i.id==n.id){var l=a.find(">li").eq(e);l.find(".layui-layim-list>li");return l.find(".layui-layim-list>li").eq(t).remove(),C.friend[e].list.splice(t,1),l.find(".layim-count").html(C.friend[e].list.length),0===C.friend[e].list.length&&l.find(".layui-layim-list").html('该分组下已无好友了 '),!0}})}):"group"===i.type&&layui.each(C.group,function(e,t){if(i.id==t.id)return a.find(">li").eq(e).remove(),C.group.splice(e,1),0===C.group.length&&a.html('暂无群组 '),!0}))},K=function(){var i=H(),a=i.elem.find(".layim-chat-main"),e=a.find("ul");if(e.find("li").length>=o){var t=e.find("li").eq(0);e.prev().hasClass("layim-chat-system")||e.before('查看更多记录
'),t.remove()}a.scrollTop(a[0].scrollHeight),a.find("ul li:last").find("img").load(function(){a.scrollTop(a[0].scrollHeight)})},$=function(){var i=H(),a=i.textarea;a.focus(),a.off("keydown").on("keydown",function(i){var e=layui.data("layim")[C.mine.id]||{},t=i.keyCode;if("Ctrl+Enter"===e.sendHotKey)return void(i.ctrlKey&&13===t&&A());if(13===t){if(i.ctrlKey)return a.val(a.val()+"\n");if(i.shiftKey)return;i.preventDefault(),A()}})},J=function(){var i=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],a={};return layui.each(i,function(i,e){a[e]=layui.cache.dir+"images/face/"+i+".gif"}),a}(),B=layui.stope,F=function(i,a){var e,t=i.value;i.focus(),document.selection?(e=document.selection.createRange(),document.selection.empty(),e.text=a):(e=[t.substring(0,i.selectionStart),a,t.substr(i.selectionEnd)],i.focus(),i.value=e.join(""))},Y="layui-anim-up",U={status:function(i,a){var t=function(){i.next().hide().removeClass(Y)},n=i.attr("lay-type");if("show"===n)B(a),i.next().show().addClass(Y),e(document).off("click",t).on("click",t);else{var l=i.parent().prev();i.addClass(s).siblings().removeClass(s),l.html(i.find("cite").html()),l.removeClass("layim-status-"+("online"===n?"hide":"online")).addClass("layim-status-"+n),layui.each(r.online,function(i,a){a&&a(n)})}},tab:function(i){var a,e=".layim-tab-content",t=p.find(".layui-layim-tab>li");"number"==typeof i?(a=i,i=t.eq(a)):a=i.index(),a>2?t.removeClass(s):(U.tab.index=a,i.addClass(s).siblings().removeClass(s)),p.find(e).eq(a).addClass(l).siblings(e).removeClass(l)},spread:function(i){var a=i.attr("lay-type"),e="true"===a?"false":"true",t=layui.data("layim")[C.mine.id]||{};i.next()["true"===a?"removeClass":"addClass"](l),t["spread"+i.parent().index()]=e,layui.data("layim",{key:C.mine.id,value:t}),i.attr("lay-type",e),i.find(".layui-icon").html("true"===e?"":"")},search:function(i){var a=p.find(".layui-layim-search"),e=p.find("#layui-layim-search"),t=a.find("input"),n=function(i){var a=t.val().replace(/\s/);if(""===a)U.tab(0|U.tab.index);else{for(var n=[],l=C.friend||[],s=C.group||[],o="",r=0;r0)for(var c=0;c'+(n[c].username||n[c].groupname||"佚名")+" "+(n[c].remark||n[c].sign||"")+"
";else o='无搜索结果 ';e.html(o),U.tab(3)}};!C.base.isfriend&&C.base.isgroup?U.tab.index=1:C.base.isfriend||C.base.isgroup||(U.tab.index=2),a.show(),t.focus(),t.off("keyup",n).on("keyup",n)},closeSearch:function(i){i.parent().hide(),U.tab(0|U.tab.index)},skin:function(){t.open({type:1,title:"换肤",shade:!1,area:"300px",skin:"layui-box layui-layer-border",id:"layui-layim-skin",zIndex:66666666,content:n(y).render({skin:C.base.skin})})},find:function(){t.open({type:2,title:"查找",shade:!1,area:["1000px","520px"],skin:"layui-box layui-layer-border",id:"layui-layim-find",content:C.base.find})},about:function(){t.alert("版本: "+a+' 版权所有:layim.layui.com ',{title:"关于 LayIM",shade:!1})},setSkin:function(i){var a=i.attr("src"),e=layui.data("layim")[C.mine.id]||{};e.skin=a,a||delete e.skin,layui.data("layim",{key:C.mine.id,value:e});try{p.css({"background-image":a?"url("+a+")":"none"}),g.css({"background-image":a?"url("+a+")":"none"})}catch(t){}},chat:function(i){var a=layui.data("layim")[C.mine.id]||{},e=i.data("type"),t=i.data("index"),n=i.attr("data-list")||i.index(),l={};"friend"===e?l=C[e][t].list[n]:"group"===e?l=C[e][n]:"history"===e&&(l=(a.history||{})[t]||{}),l.name=l.name||l.username||l.groupname,"history"!==e&&(l.type=e),L(l)},tabChat:function(i){E(i)},closeChat:function(i){E(i.parent(),1)},closeThisChat:function(){E(null,1)},groupMembers:function(i,a){var n=i.find(".layui-icon"),l=function(){n.html(""),i.data("down",null),t.close(U.groupMembers.index)},s=function(i){B(i)};i.data("down")?l():(n.html(""),i.data("down",!0),U.groupMembers.index=t.tips('',i,{tips:3,time:0,shift:5,fix:!0,skin:"layui-box layui-layim-members",success:function(a){var t=C.base.members||{},n=H(),l="";t.data=e.extend(t.data,{id:n.data.id}),w(t,function(e){layui.each(e.list,function(i,a){l+=''+a.username+"
"}),a.find(".layim-members-list").html(l),layui.each(r.members,function(i,a){a&&a(e)}),i.find(".layim-chat-members").html((e.list||[]).length+"人")}),a.on("mousedown",function(i){B(i)})}}),e(document).off("mousedown",l).on("mousedown",l),e(window).off("resize",l).on("resize",l),i.off("mousedown",s).on("mousedown",s))},send:function(){A()},setSend:function(i,a){var t=i.siblings(".layim-menu-box"),n=function(){t.hide().removeClass(Y)},l=i.attr("lay-type");if("show"===l)B(a),t.show().addClass(Y),e(document).off("click",n).on("click",n);else{i.addClass(s).siblings().removeClass(s);var o=layui.data("layim")[C.mine.id]||{};o.sendHotKey=l,layui.data("layim",{key:C.mine.id,value:o})}},face:function(i,a){var n="",l=H(),s=function(){t.close(U.face.index)};for(var o in J)n+=' ';n='",U.face.index=t.tips(n,i,{tips:1,time:0,fix:!0,skin:"layui-box layui-layim-face",success:function(i){i.find(".layim-face-list>li").on("mousedown",function(i){B(i)}).on("click",function(){F(l.textarea[0],"face"+this.title+" "),t.close(U.face.index)})}}),e(document).off("mousedown",s).on("mousedown",s),e(window).off("resize",s).on("resize",s),B(a)},image:function(i){var a=i.data("type")||"images",e={images:"uploadImage",file:"uploadFile"},n=H(),l=C.base[e[a]]||{};layui.upload({url:l.url||"",method:l.type,elem:i.find("input")[0],unwrap:!0,type:a,success:function(i){0==i.code?(i.data=i.data||{},"images"===a?F(n.textarea[0],"img["+(i.data.src||"")+"]"):"file"===a&&F(n.textarea[0],"file("+(i.data.src||"")+")["+(i.data.name||"下载文件")+"]")):t.msg(i.msg||"上传失败")}})},chatLog:function(i){var a=H();return C.base.chatLog?(t.close(U.chatLog.index),U.chatLog.index=t.open({type:2,maxmin:!0,title:"与 "+a.data.name+" 的聊天记录",area:["450px","100%"],shade:!1,offset:"rb",skin:"layui-box",shift:2,id:"layui-layim-chatlog",content:C.base.chatLog+"?id="+a.data.id+"&type="+a.data.type})):t.msg("未开启更多聊天记录")},menuHistory:function(i,a){var n=layui.data("layim")[C.mine.id]||{},l=i.parent(),s=i.data("type"),o=p.find(".layim-list-history"),r='暂无历史会话 ';if("one"===s){var d=n.history;delete d[l.data("index")],n.history=d,layui.data("layim",{key:C.mine.id,value:n}),e("#"+l.data("id")).remove(),0===o.find("li").length&&o.html(r)}else"all"===s&&(delete n.history,layui.data("layim",{key:C.mine.id,value:n}),o.html(r));t.closeAll("tips")}};i("layim",new d)}).addcss("modules/layim/layim.css?v=2.085","skinlayimcss");
\ No newline at end of file