@{ ViewBag.Title = "微信聊天记录"; Layout = "~/Areas/Admin/Views/Shared/_workLayout2.cshtml"; } @using Mini.Web.WebHelper @{ string corpid = ViewBag.corp; List roomlist = (List)ViewBag.roomList; string roomErro = ViewBag.roomErro; List rcontact = ViewBag.rcontact as List; List showrcontact = ViewBag.showlist as List; List innerUser = ViewBag.inneruser as List;//内部联系人 List objlist = new List(); foreach (var model in showrcontact) { string remark_mobiles = ""; if (!string.IsNullOrEmpty(model.remark_mobiles)) { remark_mobiles = model.remark_mobiles.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "").Replace("[\"","").Replace("\"]","").Replace("\"", ""); } string title = "昵 称:" + model.name; title += "\n联系人ID:" + model.external_userid; title += "\n备 注:" + model.remark; title += "\n备注号码:" + remark_mobiles; title += "\n最近聊天:" + (!model.lmsgtime.HasValue ? "" : model.lmsgtime.Value.ToString("yyyy-MM-dd HH:mm:ss")); string userid = model.external_userid; string uname = userid; if (!string.IsNullOrEmpty(model.name) && string.IsNullOrEmpty(model.remark)) { uname = model.name; } else if (!string.IsNullOrEmpty(model.name) && !string.IsNullOrEmpty(model.remark)) { uname = string.Format("{0}({1})", model.name, model.remark); } else if (!string.IsNullOrEmpty(model.remark)) { uname = model.remark; } objlist.Add(new { ntitle = uname, txt = title, remarks = model.remark, mobile = remark_mobiles, title = " " + uname, id = userid, isgroup = false, isOk = true, corpid = model.corpid }); } List innerobjlist = new List(); foreach (var model in innerUser) { string title = "昵 称:" + model.name; title += "\n内部联系人ID:" + model.deptuserid; title += "\n最近聊天:" + (!model.lmsgtime.HasValue ? "" : model.lmsgtime.Value.ToString("yyyy-MM-dd HH:mm:ss")); innerobjlist.Add(new { ntitle = model.name, txt = title, remarks = model.name, title = " " + model.name, id = model.deptuserid, isgroup = false, isOk = true, corpid = model.corpid }); } List roomlistdata = new List(); if (!string.IsNullOrEmpty(roomErro)) { roomlistdata.Add(new { title = "出现错误:" + roomErro, id = "0", isgroup = true, isOk = false, corpid = corpid }); } else if (roomlist.Count > 0) { foreach (Mini.Model.ViewModel.Ww_MsgRoom item in roomlist) { string title = "群名称:" + item.roomname; title += "\n群 ID:" + item.roomid; //title += "\n成员数:" + item.membernum; //title += "\n时 间:" + item.ctimestr; if (!string.IsNullOrEmpty(item.roomname)) { roomlistdata.Add(new { title = item.roomname,txt= title, id = item.roomid, isgroup = true, isOk = true, corpid = corpid }); } else { //没有设置群名称,就直接显示群ID roomlistdata.Add(new { title = item.roomid, txt = title, id = item.roomid, isgroup = true, isOk = true, corpid = corpid }); } } } var obj = new List { new { title = "外部联系人 ("+rcontact.Count+"人)", id = "1", spread = true,children=objlist }, new { title = "内部联系人 ("+innerUser.Count+"人)", id = "4", spread = true,children=innerobjlist }, new { title = "群聊 ("+roomlistdata.Count+"个)", id = "2", spread = true ,children=roomlistdata} }; } @section leftmenu{
显示
} @section rightcontent{