Browse Source

聊天修正

jack 7 years ago
parent
commit
44f18b551a
1 changed files with 10 additions and 11 deletions
  1. 10 11
      js/tidings.js

+ 10 - 11
js/tidings.js

58
						} else {
58
						} else {
59
							var oNu = Number($(".list_body").find('.list_item .tips_num').eq(i).text()) + 1;
59
							var oNu = Number($(".list_body").find('.list_item .tips_num').eq(i).text()) + 1;
60
							$(".list_body").find('.list_item .tips_num').eq(i).text(oNu).show();
60
							$(".list_body").find('.list_item .tips_num').eq(i).text(oNu).show();
61
							if($(".badge").css("display")=="none") {
62
								$(".badge").show();
63
							}
64
							$('.badge').text(Number($('.badge').text())+1)
61
							$('.badge').text(Number($('.badge').text())+1)
65
						}
62
						}
66
					} else {
63
					} else {
67
						var oNu = Number($(".list_body").find('.list_item .tips_num').eq(i).text()) + 1;
64
						var oNu = Number($(".list_body").find('.list_item .tips_num').eq(i).text()) + 1;
68
						$(".list_body").find('.list_item .tips_num').eq(i).text(oNu).show();
65
						$(".list_body").find('.list_item .tips_num').eq(i).text(oNu).show();
69
						if($(".badge").css("display")=="none") {
70
							$(".badge").show();
71
						}
72
						$('.badge').text(Number($('.badge').text())+1)
66
						$('.badge').text(Number($('.badge').text())+1)
73
					}
67
					}
74
					if(i > 0)
68
					if(i > 0)
96
				var $str = $(ostr);
90
				var $str = $(ostr);
97
				$(".list_body").prepend($str);
91
				$(".list_body").prepend($str);
98
				personMess($info.sender, $str.find('img'), $str.find(".user_name"), $str.find(".authiconNew"));
92
				personMess($info.sender, $str.find('img'), $str.find(".user_name"), $str.find(".authiconNew"));
93
				
94
						$('.badge').text(Number($('.badge').text())+1)
99
			}
95
			}
100
		};
96
		};
101
		ws.onclose = function() {
97
		ws.onclose = function() {
322
					if($data.title) {
318
					if($data.title) {
323
						if($data.orgName) {
319
						if($data.orgName) {
324
							if($data.office) {
320
							if($data.office) {
325
								str = $data.title + " " + $data.orgName + "," + $data.office;
321
								str = $data.title + " " + $data.orgName + "" + $data.office;
326
							} else {
322
							} else {
327
								str = $data.title + " " + $data.orgName;
323
								str = $data.title + " " + $data.orgName;
328
							}
324
							}
336
					} else {
332
					} else {
337
						if($data.orgName) {
333
						if($data.orgName) {
338
							if($data.office) {
334
							if($data.office) {
339
								str = $data.orgName + "," + $data.office;
335
								str = $data.orgName + "" + $data.office;
340
							} else {
336
							} else {
341
								str = $data.orgName;
337
								str = $data.orgName;
342
							}
338
							}
492
		if($(this).find(".tips_num").css("display")=="block") {
488
		if($(this).find(".tips_num").css("display")=="block") {
493
			$('.badge').text(Number($('.badge').text())-Number($(this).find(".tips_num").text()));
489
			$('.badge').text(Number($('.badge').text())-Number($(this).find(".tips_num").text()));
494
			if($('.badge').text()==0) {
490
			if($('.badge').text()==0) {
495
				$(".badge").hide();
491
				$(".badge").text("");
496
			}
492
			}
497
		}
493
		}
498
		$(this).find(".tips_num").text(0).hide();
494
		$(this).find(".tips_num").text(0).hide();
499
		if($(this).find(".user_name").text() == $(".usepro .user_name").text()) {
500
			return;
495
		if($(".usepro .user_name").css("display")=="block") {
496
			if($(this).find(".user_name").text() == $(".usepro .user_name").text()) {
497
				return;
498
			}
501
		}
499
		}
502
		$(".chat_content_nodata").hide();
500
		$(".chat_content_nodata").hide();
503
		$(".chat_content").show();
501
		$(".chat_content").show();
613
					$(this).remove();
611
					$(this).remove();
614
					$(".chat_content_nodata").show();
612
					$(".chat_content_nodata").show();
615
					$(".chat_content").hide();
613
					$(".chat_content").hide();
614
					unReadedCount(userid);
616
				}
615
				}
617
			},
616
			},
618
			"error": function() {
617
			"error": function() {