@{ ViewBag.Title = "微信聊天记录"; Layout = "~/Areas/Admin/Views/Shared/_workLayout2.cshtml"; } @{ //List rcontact1 = new List(); List rcontact2 = new List(); List rcontact3 = new List(); List rcontact4 = new List(); //List groupList = ViewBag.grouplist as List; string isShowGroupMsg = ViewBag.isShowGroupMessage as string; foreach (Mini.Model.ViewModel.WX_WorkRCONTACT rcontact in ViewBag.rcontactList as List) { if (rcontact.USERNAME.StartsWith("fake_") || rcontact.USERNAME == "filehelper" || rcontact.NICKNAME == "微信团队") { continue; } string txt = Mini.Web.WebHelper.WxMessageHandler.GetRcontactNickName(rcontact); string title = "昵 称:" + rcontact.NICKNAME; title += "\n用 户 名:" + rcontact.USERNAME; title += "\n备 注:" + rcontact.CONREMARK; title += "\n" + "最近聊天:" + (rcontact.LASTCHARTIME == 0 ? "" : Mini.Common.DateTimeTool.GetTimeFromLinuxTime(Convert.ToInt64(rcontact.LASTCHARTIME)).ToString("yyyy-MM-dd")); if (rcontact.isblacklist == 1) { rcontact4.Add(new { title = txt, id = rcontact.PKID, username = rcontact.USERNAME, txt = title }); } else if (!string.IsNullOrEmpty(rcontact.WUSERNAME) || !string.IsNullOrEmpty(rcontact.NUSERNAME) || rcontact.NICKNAME.IndexOf("懂牛") > -1 || rcontact.NICKNAME.IndexOf("千本嘉") > -1 || rcontact.NICKNAME.IndexOf("东方高圣") > -1) { rcontact3.Add(new { title = txt, id = rcontact.PKID, username = rcontact.USERNAME, txt = title }); } //else if (!string.IsNullOrEmpty(rcontact.FUSERNAME)) //{ // //rcontact1.Add(rcontact); // rcontact1.Add(new { title = txt, id = rcontact.PKID, username = rcontact.USERNAME, txt = title }); //} else { //rcontact2.Add(rcontact); rcontact2.Add(new { title = txt, id = rcontact.PKID, username = rcontact.USERNAME, txt = title }); } } var obj = new List { //new { title = "被加 ("+rcontact1.Count+"人)", id = 1,children=rcontact1 }, new { title = "好友 ("+rcontact2.Count+"人)", id = -2,children=rcontact2 }, new { title = "拉黑/删除 ("+rcontact4.Count+"人)", id = -3,children=rcontact4 }, new { title = "同事 ("+rcontact3.Count+"人)", id = -4,children=rcontact3 } }; if (isShowGroupMsg == "true") { List grouplist = new List() { }; List groupList = ViewBag.grouplist as List; foreach (var group in groupList) { if (group.chatRoomName.StartsWith("fake_") || group.chatRoomName == "filehelper" || group.chatRoomName == "微信团队") { continue; } string txt = string.IsNullOrEmpty(group.groupName) ? group.shortName : group.groupName; string title = "群 名 称:" + group.groupName; title += "\n群号:" + group.chatRoomName; title += "\n备注:" + group.shortName; title += "\n" + "最近聊天:" + (group.LASTCHARTIME == 0 ? "" : Mini.Common.DateTimeTool.GetTimeFromLinuxTime(Convert.ToInt64(group.LASTCHARTIME)).ToString("yyyy-MM-dd")); grouplist.Add(new { title = txt, id = group.chatRoomName, username = group.chatRoomName, txt = title }); } obj.Add(new { title = "微信群 (" + grouplist.Count + "个)", id = -5, children = grouplist }); } } @section leftmenu{ @{ string myvalue = ViewBag.column; string sort = ViewBag.sort; string allstr = string.Format("{0}_{1}", myvalue, sort); } 客户添加时间倒序↓ 客户添加时间顺序↑ 最后聊天时间倒序↓ 最后聊天时间顺序↑ 显示 部分好友 全部好友 } @section rightcontent{ }