/** layui-v2.4.5 MIT License By https://www.layui.com */
;layui.define(["layer", "laytpl", "upload"], function(i) {
var a = "3.8.0"
, e = layui.$
, t = layui.layer
, n = layui.laytpl
, l = layui.device()
, s = "layui-show"
, o = "layim-this"
, d = 20
, r = {}
, c = function() {
this.v = a,
e("body").on("click", "*[layim-event]", function(i) {
var a = e(this)
, t = a.attr("layim-event");
ti[t] ? ti[t].call(this, a, i) : ""
})
};
c.prototype.config = function(i) {
var a = [];
if (layui.each(Array(5), 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,
voice: "default.mp3"
}, i),
window.JSON && window.JSON.parse)
return H(i),
this
}
,
c.prototype.on = function(i, a) {
return "function" == typeof a && (r[i] ? r[i].push(a) : r[i] = [a]),
this
}
,
c.prototype.cache = function() {
return j
}
,
c.prototype.chat = function(i) {
if (window.JSON && window.JSON.parse)
return z(i),
this
}
,
c.prototype.setChatMin = function() {
return N(),
this
}
,
c.prototype.setChatStatus = function(i) {
var a = _();
if (a) {
var e = a.elem.find(".layim-chat-status");
return e.html(i),
this
}
}
,
c.prototype.getMessage = function(i) {
return K(i),
this
}
,
c.prototype.notice = function(i) {
return J(i),
this
}
,
c.prototype.add = function(i) {
return M(i),
this
}
,
c.prototype.setFriendGroup = function(i) {
return M(i, "setGroup"),
this
}
,
c.prototype.msgbox = function(i) {
return V(i),
this
}
,
c.prototype.addList = function(i) {
return P(i),
this
}
,
c.prototype.removeList = function(i) {
return W(i),
this
}
,
c.prototype.setFriendStatus = function(i, a) {
var t = e(".layim-friend" + i);
t["online" === a ? "removeClass" : "addClass"]("layim-list-gray")
}
,
c.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++; }}", '<li layim-event="chat" data-type="' + i.type + '" data-index="{{ ' + (i.index || "i") + ' }}" class="layim-' + ("history" === i.type ? "{{i}}" : i.type + "{{data.id}}") + ' {{ data.status === "offline" ? "layim-list-gray" : "" }}"><img src="{{ data.avatar }}"><span>{{ data.username||data.groupname||data.name||"佚名" }}</span><p>{{ data.remark||data.sign||"" }}</p><span class="layim-msg-status">new</span></li>', "{{# }); if(length === 0){ }}", '<li class="layim-null">' + (a[i.type] || "暂无数据") + "</li>", "{{# } }}"].join("")
}
, y = ['<div class="layui-layim-main">', '<div class="layui-layim-info">', '<div class="layui-layim-user">{{ d.mine.username }}</div>', '<div class="layui-layim-status">', '{{# if(d.mine.status === "online"){ }}', '<span class="layui-icon layim-status-online" layim-event="status" lay-type="show"></span>', '{{# } else if(d.mine.status === "hide") { }}', '<span class="layui-icon layim-status-hide" layim-event="status" lay-type="show"></span>', "{{# } }}", '<ul class="layui-anim layim-menu-box">', '<li {{d.mine.status === "online" ? "class=layim-this" : ""}} layim-event="status" lay-type="online"><i class="layui-icon"></i><cite class="layui-icon layim-status-online"></cite>在线</li>', '<li {{d.mine.status === "hide" ? "class=layim-this" : ""}} layim-event="status" lay-type="hide"><i class="layui-icon"></i><cite class="layui-icon layim-status-hide"></cite>隐身</li>', "</ul>", "</div>", '<input class="layui-layim-remark" placeholder="编辑签名" value="{{ d.mine.remark||d.mine.sign||"" }}">', "</div>", '<ul class="layui-unselect layui-layim-tab{{# if(!d.base.isfriend || !d.base.isgroup){ }}', " layim-tab-two", '{{# } }}">', '<li class="layui-icon', "{{# if(!d.base.isfriend){ }}", " layim-hide", "{{# } else { }}", " layim-this", "{{# } }}", '" title="联系人" layim-event="tab" lay-type="friend"></li>', '<li class="layui-icon', "{{# if(!d.base.isgroup){ }}", " layim-hide", "{{# } else if(!d.base.isfriend) { }}", " layim-this", "{{# } }}", '" title="群组" layim-event="tab" lay-type="group"></li>', '<li class="layui-icon" title="历史会话" layim-event="tab" lay-type="history"></li>', "</ul>", '<ul class="layui-unselect layim-tab-content {{# if(d.base.isfriend){ }}layui-show{{# } }} layim-list-friend">', '{{# layui.each(d.friend, function(index, item){ var spread = d.local["spread"+index]; }}', "<li>", '<h5 layim-event="spread" lay-type="{{ spread }}"><i class="layui-icon">{{# if(spread === "true"){ }}{{# } else { }}{{# } }}</i><span>{{ item.groupname||"未命名分组"+index }}</span><em>(<cite class="layim-count"> {{ (item.list||[]).length }}</cite>)</em></h5>', '<ul class="layui-layim-list {{# if(spread === "true"){ }}', " layui-show", '{{# } }}">', u({
type: "friend",
item: "item.list",
index: "index"
}), "</ul>", "</li>", "{{# }); if(d.friend.length === 0){ }}", '<li><ul class="layui-layim-list layui-show"><li class="layim-null">暂无联系人</li></ul>', "{{# } }}", "</ul>", '<ul class="layui-unselect layim-tab-content {{# if(!d.base.isfriend && d.base.isgroup){ }}layui-show{{# } }}">', "<li>", '<ul class="layui-layim-list layui-show layim-list-group">', u({
type: "group"
}), "</ul>", "</li>", "</ul>", '<ul class="layui-unselect layim-tab-content {{# if(!d.base.isfriend && !d.base.isgroup){ }}layui-show{{# } }}">', "<li>", '<ul class="layui-layim-list layui-show layim-list-history">', u({
type: "history"
}), "</ul>", "</li>", "</ul>", '<ul class="layui-unselect layim-tab-content">', "<li>", '<ul class="layui-layim-list layui-show" id="layui-layim-search"></ul>', "</li>", "</ul>", '<ul class="layui-unselect layui-layim-tool">', '<li class="layui-icon layim-tool-search" layim-event="search" title="搜索"></li>', "{{# if(d.base.msgbox){ }}", '<li class="layui-icon layim-tool-msgbox" layim-event="msgbox" title="消息盒子"><span class="layui-anim"></span></li>', "{{# } }}", "{{# if(d.base.find){ }}", '<li class="layui-icon layim-tool-find" layim-event="find" title="查找"></li>', "{{# } }}", '<li class="layui-icon layim-tool-skin" layim-event="skin" title="更换背景"></li>', "{{# if(!d.base.copyright){ }}", '<li class="layui-icon layim-tool-about" layim-event="about" title="关于"></li>', "{{# } }}", "</ul>", '<div class="layu
评论0