Namespace.register("U.MD.U.V"); //查看用户信息弹框
//#region 用户信息查看
//------------------------------------------------------------------------------用户个人信息
//个人信息
U.MD.U.V.UIFZX = U.MD.U.V.ViewOtherUserInfo = function (userid) {
var _userinfoel = $("#U_MD_U_UV").clone(true), // 用户信息元素
_childs = $(_userinfoel[0]).Child(),
_head = _childs[0],
_middle = _childs[1],
_aboutMe = _childs[2];
var _div = $$('div');
_div.appendChild(_head); //个人信息的头部
_div.appendChild(_middle); //个人信息的中间部分
_div.appendChild(_aboutMe); //个人信息的底部
//弹出好友信息弹框
if ($('#U_MD_F_S_TI_Info')[0])
document.body.removeChild($('#U_MD_F_S_TI_Info')[0])
var _form = new U.UF.UI.form("
个人信息
",
_div,
{
"style": {
"min-width": "460px",
"width": "480px",
"height": "400px"
},
id: "U_MD_F_S_TI_Info"
},
{
isenlarge: false,
isnarrow: false
}).form;
//信息加载
U.A.Request(US.USER, ["ViewOtherUserInfo", userid],
U.MD.U.V.ViewOtherUserInfoAsyn, ['', _head, _middle, _aboutMe, _form])
// U.MD.U.V.ViewUserBlogInfo(_bloginfoel, userid, 1, true); //查看用户最新表表的博客
}
//打印用户信息 function(){U.MD.U.L.setLoginCallBack(function(){();});}
U.MD.U.V.ViewOtherUserInfoAsyn = function (r) {
var _userinfo = r.value[0],
_context = r.context,
_form = _context[4],
TN = _userinfo.UserTelephoneNumber; //用户电话号码
$(_context[1]).find('.U_MD_U_UV_Head_Left')[0].firstElementChild.src = U.MD.C.getHeadImage(_userinfo.UserImageHead || _userinfo.UserThumbnailImageHead); //打印用户头像
$(_context[1]).find('.U_MD_U_UV_Name')[0].innerText = _userinfo.TrueName || _userinfo.UserName || "不详"; //打印用户名字
$(_context[1]).find('.U_MD_U_UV_Desc')[0].innerText = _userinfo.UserIndividualitysignature || "不详"; //打印用户介绍
$(_context[3]).find('.U_MD_U_UV_Place')[0].innerText = _userinfo.City || "不详"; //打印用户地址
$(_context[3]).find('.U_MD_U_UV_MailBox')[0].innerText = _userinfo.UserEmail != "null" ? _userinfo.UserEmail : "不详"; //打印用户邮箱
$(_context[3]).find('.U_MD_U_UV_PhoneNum')[0].innerText = TN ? (TN.substring(0, 3) + "****" + TN.substring(7, TN.length)) : "不详"; //打印用户的电话号码
$(_context[3]).find('.U_MD_U_UV_Birthday')[0].innerText = _userinfo.Birthday ? U.UF.D.formatDateToArray(_userinfo.Birthday).slice(0, 3).join('-') : "不详"; //打印用户的出生日期
//获取文件统计数据
U.A.Request(US.CD, [US.DB, 'UseStudio_Users', 'GetStatisticData', _userinfo.UserId], function (data) {
$('.U_MD_U_UV_Friend', _context[1])[0].innerText = data.value[0].friendCount;
$('.U_MD_U_UV_Word', _context[1])[0].innerText = data.value[0].wrodCount;
$('.U_MD_U_UV_Excel', _context[1])[0].innerText = data.value[0].excelCount;
$('.U_MD_U_UV_Cloud', _context[1])[0].innerText = data.value[0].diskFileCount;
});
//添加好友事件处理
var _friendinfo,
_addbutton = $('.U_MD_U_UV_Head_Right_Btn', _context[1])[0],
_functionbtn = $(_context[2]).find('.U_MD_U_UV_FuncArea_MarginBox_Btn'); //获取三个按钮
_functionbtn[2].style.display = '';
if (_userinfo.UserId == US.userInfo.userid) {
_addbutton.onclick = function () {
U.Alert("不可以添加自己为好友哟!");
};
_functionbtn[2].style.display = 'none';
} else if (US.friend.friends && (_friendinfo = U.Json.select(US.friend.friends, { UserId: _userinfo.UserId })[0])) {
_addbutton.onclick = function () {
U.MD.F.R.deleteFriendForm(_friendinfo, function () {
U.UF.F.closeWindow(_form);
});
//U.MD.F.M.deleteFriend(_friendinfo);
//U.UF.F.closeWindow(_form); //关闭窗口函数
};
_addbutton.style.backgroundColor = '#e20f0f';
_addbutton.innerText = '删除好友';
} else {
_addbutton.style.backgroundColor = '';
_addbutton.onclick = function () {
U.MD.F.M.addFriend(_userinfo, function () {
U.UF.F.closeWindow(_form); //关闭窗口函数
});
}
}
//协同文档事件绑定
_functionbtn[0].onclick = function () {
U.MD.D.I.openApplication("disk", { "userid": _userinfo.UserId, "directoryid": US.disk.initTree[1][0] });
}
//协同他人文档事件绑定
_functionbtn[1].onclick = function () {
U.MD.D.I.openApplication("disk", { "userid": _userinfo.UserId, "directoryid": US.disk.initTree[2][0] });
}
//发起对话事件绑定
_functionbtn[2].onclick = function () {
if (!U.MD.U.L.isLogin()) {
var _friendinfo = U.Json.select(US.friend.friends, { UserId: _userinfo.UserId })[0];
if (_friendinfo) {
U.MD.F.W.popupFriendsForm(_friendinfo);
U.UF.F.closeWindow(_form); //关闭窗口函数
} else {
U.UF.UI.confirm((_userinfo.UserNickName || _userinfo.UserName) + "还不是你的好友哟!是否添加" + (_userinfo.UserNickName || _userinfo.UserName) + "为好友呢。", function () {
U.MD.F.M.addFriend(_userinfo, function () {
U.UF.F.closeWindow(_form); //关闭窗口函数
});
});
}
}
}
}
/**
* 添加好友状态切换 暂无使用
* @param {element} button 点击元素
* @param {element} userinfo 用户信息
*/
U.MD.U.V.AddFriend = function (button, userinfo) {
U.MD.F.M.addFriend(userinfo, function () {
button.innerText = '删除好友';
button.style.backgroundColor = '#e20f0f';
button.onclick = function () {
_friendinfo = U.Json.select(US.friend.friends, { UserId: userInfo.userid })[0];
U.MD.F.M.deleteFriend(_friendinfo);
button.innerText = '+好友';
button.style.backgroundColor = '';
button.onclick = function () {
U.MD.U.V.AddFriend(button, userinfo);
}
};
});
}
//滚动加载
U.MD.U.V.GDCKYHDT = function (UDOD, userid) {
_UDFE = U.MD.D.H.ET["UIF"][userid][1];
U.MD.U.V.ViewUserBlogInfo(UDOD, _UDFE, userid, this.P + 2); //分页打印
}
//获取用户最新发表
U.MD.U.V.ViewUserBlogInfo = function (UDOD, UDPE, userid, P, TF) {
var _userinfoel = $(UDOD).Child();
UDPE = U.MD.D.D.FYGBL(UDPE, P); //U.UF.EL.getChildrenNoText()
if (UDPE[0]) {
if (TF) { _userinfoel[1].innerText = ""; }
if (UDPE[0].length) { U.MD.D.Blog.PGBL(_userinfoel[1], UDPE[0], true); }
else if (P === 1) { U.MD.U.V.PCKYHDT(_userinfoel[1]); }
} //打印文章
else { U.A.Request(US.USER, ["GFA", US.EMPTYGUID, (UDPE[1] - 1) * 100, UDPE[1] * 100, userid, US.EMPTYGUID], U.MD.U.V.AsynCKYHDT, [(P == 1 ? [_userinfoel[1], true] : [$("#U_MD_U_UV_PL")[0], 1]), UDOD, userid, P, UDPE[1], _userinfoel]); }
//$("div#U_MD_U_UV_PC", _userinfoel[0])[0].onscroll = U.UF.EV.scrollLoad({ "AF": function () { U.MD.U.V.GDCKYHDT(_bloginfoel, userid); } }).SCH(); //滚动加载
U.UF.EV.scrollLoad($("div#U_MD_U_UV_PC", _userinfoel[0])[0], function () { U.MD.U.V.GDCKYHDT(_bloginfoel, userid); }); //滚动加载
}
//异步获取最新的文章
U.MD.U.V.AsynCKYHDT = function (r) {
var _context = r.context,
UPXD = U.MD.D.H.ET["UIF"][_context[2]];
r = r.value;
if (!UPXD) { UPXD = U.MD.D.H.ET["UIF"][_context[2]] = [], UPXD[1] = [] };
UPXD[1] = UPXD[1] || [];
UPXD[1][_context[4]] = U.MD.D.Blog.ZFSGBL(r);
_context[5][1].innerText = "";
_context[5][0].innerText = r[0] > 0 ? "动静..(" + r[0].SumNumber + ")" : "动静";
U.MD.U.V.ViewUserBlogInfo(_context[1], UPXD[1], _context[2], _context[3]); //打印用户的文章
}
//用户资料没有发表文章
U.MD.U.V.PCKYHDT = function (UDOD) {
var _userinfoel = $$("div", { "className": "U_MD_U_UV_T" }, UDOD);
$$("div", { "className": "U_MD_U_UV_TS", "innerHTML": "他暂时没有相关的消息呢!!稍后再来试试吧~" }, _userinfoel);
$$("div", { "className": "U_MD_U_UV_TX", "innerHTML": "Noting!!" }, _userinfoel);
}
//群介绍
U.MD.U.V.GroupInfo = function (groupinfo) {
var _userinfoel = $("#U_MD_U_GV").clone(true), // 用户信息元素
_childs = $(_userinfoel[0]).Child(),
_content = _childs[0];
U.MD.U.V.syncData(_content, groupinfo);
var _form = new U.UF.UI.form("群信息
",
_content,
{
"style": {
"min-width": "480px",
"width": "480px",
"height": "340px"
},
id: "U_MD_G_Info"
},
{
isenlarge: false,
isnarrow: false
}).form;
}
//同步群介绍的数据
U.MD.U.V.syncData = function (el, groupinfo) {
var _head = el.children[0], //群介绍的头部
_middle = el.children[1], //群介绍的中间部分
_bottom = el.children[2], //群介绍的底部
_groupId = groupinfo.GroupManageID, //群的ID
_groupCreaterId = groupinfo.GroupManageCreateUserID, //群主的ID
_groupCreaterEl = $(_bottom).find('.U_MD_U_GV_GroupInfo_ImgArea_Creater')[0], //群主显示的元素
_groupMember = U.Json.select(US.friend.groupusers, { GroupManageID: _groupId }), //群人数
_cloneEl = $$('img'), //创建图片
_createrImg = _cloneEl.cloneNode(), //克隆图片元素
_groupMemberEl = $(_bottom).find('.U_MD_U_GV_GroupInfo_ImgArea_MemberImg')[0], //群人数显示的元素
_groupBtn = $(_middle).find('.U_MD_U_GV_FuncArea_MarginBox_Btn'); //群的三个按钮
$(_head).find('.U_MD_U_GV_HeadInfo_Name')[0].innerText = groupinfo.GroupManageName; //群的名字
$(_head).find('.U_MD_U_GV_HeadInfo_Desc')[0].innerText = groupinfo.GroupManageDescript; //群的介绍
$(_bottom).find('.U_MD_U_GV_GroupInfo_Img_TextNum')[0].innerText = _groupMember.length; //群的人数
_createrImg.src = U.MD.C.getHeadImage(U.Json.selectOne(US.friend.groupusers, { UserId: _groupCreaterId }).UserThumbnailImageHead) || "/img/UserHead/UseHead.jpg"; //群头像
_groupCreaterEl.appendChild(_createrImg) //把群头像添加到元素里
_groupCreaterEl.onclick = function () {
U.MD.U.V.ViewOtherUserInfo(_groupCreaterId);
}
_groupBtn[2].onclick = function () {
top.U.MD.F.W.popupFriendsForm(groupinfo);
}
for (var i = 0; i < _groupMember.length; i++) {
if (i < 6) {
var _cloneImg = _cloneEl.cloneNode();
_cloneImg.src = U.MD.C.getHeadImage(_groupMember[i].UserThumbnailImageHead) || "/img/UserHead/UseHead.jpg";
_cloneImg.onclick = U.UF.C.closure(function (i) {
U.MD.U.V.ViewOtherUserInfo(_groupMember[i].UserId);
}, [i])
_groupMemberEl.appendChild(_cloneImg);
} else {
$$('span', { className: "U_MD_U_GV_GroupInfo_ImgArea_MemberMore", innerText: "···", onclick: function () {
U.MD.U.V.showAllGroupMember(_groupMember, this, _cloneEl, _groupMemberEl);
}
}, _groupMemberEl);
return;
}
}
}
U.MD.U.V.showAllGroupMember = function (groupmember, el, cloneel, addel) {
addel.style.display = "none";
addel.style.height = "82px";
for (var i = 6; i < groupmember.length; i++) {
var _cloneImg = cloneel.cloneNode();
_cloneImg.src = U.MD.C.getHeadImage(groupmember[i].UserThumbnailImageHead) || "/img/UserHead/UseHead.jpg";
_cloneImg.onclick = U.UF.C.closure(function (i) {
U.MD.U.V.ViewOtherUserInfo(groupmember[i].UserId);
}, [i]);
addel.appendChild(_cloneImg);
}
addel.style.display = "block";
$(el).remove();
}
//#endregion