$(document).ready(function () {
$(".onlogin .headnavbtn li.mymessage").addClass("navcurrent");
loginStatus(); //判断个人是否登录
$("#feedback").hide();
var professorId = GetQueryString("id");
var firstFlag;
$(".list_body").niceScroll({
cursorcolor: "#999999"
});
$(".chat_body.clearfix").niceScroll({
cursorcolor: "#999999"
});
var userid = $.cookie("userid");
if (userid == 'null') {
location.href = "login.html";
}
function websocrket() {
var ws = new WebSocket("ws://192.168.3.233:8081/portal/websocket/msg?id=" + userid + "&pm=www");
ws.onopen = function () {
// console.log(userid);
};
ws.onmessage = function (a) {
var fol = true;
var $info = JSON.parse(a.data);
for (var i = 0; i < $(".list_body").find('.list_item').length; i++) {
if ($(".list_body").find('.list_item').eq(i).attr('data-id') == $info.sender) {
fol = false;
$(".list_body").find('.list_item .last_news').eq(i).html(($info.cnt).replace(/\n/g, "
"));
$(".list_body").find('.list_item .time').eq(i).text(commenTime($info.sendTime));
if ($('.chat_content_nodata').css('display') == "none") {
if ($(".list_body").find('.list_item .user_name').eq(i).text() == $(".usepro .user_name").text()) {
setRead($info.sender, $info.sendTime);
var time1 = $(".chat_body_list").find(".time").last().attr("data-createtime");
if (time1) {
var str1 = '' + compareTime(time1, $info.sendTime) + ''
} else {
var str1 = '' + anTime($info.sendTime) + ''
}
var oStr1 = '