function getNotice() {
$.ajax({
url: 'notice!getNotice.action',
dataType: "json",
type: "GET",
cache: false,
success: function(ret) {
var len = ret.length;
if (len > 0) {
$(".message .num").remove();
var html = '
';
html += "- [全部已读]
";
$.each(ret, function(index, item) {
if ($.inArray(item.xxid, readedNotice) == -1) {
if ($.inArray(item.xxid, noticeIds) == -1) {
noticeIds.push(item.xxid);
newNoticeIds.push(item.xxid);
}
if (item.type === "") {
html += "- " + item.msg + " [已读]
";
} else if (item.type.endWith('sh')) {
var shData = $.parseJSON(item.msg);
html += "- " + shData.subject + "," + shData.status + ((typeof(shData.feedback) == 'undefined') ? "" : ",审核意见:" + shData.feedback) + " [已读]
";
} else if (item.type.endWith('cjtz')) {
var shData = $.parseJSON(item.msg);
html += "- <<" + shData.kcmc + ">> 的成绩出来了,总成绩:" + shData.zcj + ",绩点:" + shData.jd + " [已读]
";
} else if (item.type.endWith('xkcl')) {
var shData = $.parseJSON(item.msg);
html += "- 您一选未选中<<" + shData.kcmc + ">> ,请关注下一轮选课开放时间。 [已读]
";
}
}
});
html += '';
if (noticeIds.length > 0) {
$(".message").append('' + noticeIds.length + '');
NoticeHtml = html;
} else {
NoticeHtml = "无未读通知";
}
$(".message").poshytip('update', NoticeHtml);
if (newNoticeIds.length > 0) {
inotify(newNoticeIds.length);
newNoticeIds = [];
}
}
}
});
}