127 lines
4.1 KiB
JavaScript
127 lines
4.1 KiB
JavaScript
window.onload = function () {
|
|
dynamicLoading.css("../Css/messageshow.css");
|
|
dynamicLoading.js("../Js/yanue.pop.js");
|
|
$.ajax({
|
|
type: "POST",
|
|
contentType: "application/json",
|
|
url: "../Common/checkisnewmsg.asmx/chckvideostate",
|
|
data: {},
|
|
dataType: 'json',
|
|
success: function (result) {
|
|
var code = result.d;
|
|
if (code != '') {
|
|
formstate = code.split(',')[0];
|
|
videostate = code.split(',')[1];
|
|
videoname = code.split(',')[2];
|
|
if (formstate == 1) {
|
|
setInterval("msgcheck()", 2000);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function msgshow() {
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
contentType: "application/json",
|
|
url: "../Common/checkmsg.asmx/getmsg",
|
|
data: {},
|
|
dataType: 'json',
|
|
success: function (result) {
|
|
var code = result.d;
|
|
if ($("#pop").length == 0) {
|
|
if (videostate == 1) {
|
|
$("body").append('<div id="pop" style="display:none;z-index:99"><div id="popHead"><a id="popClose" title="关闭" onclick="setmsgzt()">关闭</a><h2>系统提醒</h2></div><div id="popContent"><dl><dd id="popIntro">' + code + '</dd></dl><p id="popMore"><a href="#" onclick="setmsgzt()">查看 »</a></p></div><audio id="ado_play"><source src="../UseFile/video/' + videoname + '" type="audio/mp3" /><embed src="../UseFile/video/' + videoname + '" type="audio/mp3"/></audio></div>');
|
|
document.getElementById("ado_play").play();
|
|
} else {
|
|
$("body").append('<div id="pop" style="display:none;z-index:99"><div id="popHead"><a id="popClose" style="color:#ffffff" title="关闭" onclick="setmsgzt()">关闭</a><h2>系统提醒</h2></div><div id="popContent"><dl><dd id="popIntro">' + code + '</dd></dl><p id="popMore"><a href="#" onclick="setmsgzt()">查看 »</a></p></div></div>');
|
|
}
|
|
var pop = new Pop("",
|
|
"../Framework_File/Message.aspx",
|
|
code);
|
|
} else {
|
|
$("#pop").css("display","");
|
|
$("#popIntro").html(code);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function msgcheck() {
|
|
$.ajax({
|
|
type: "POST",
|
|
contentType: "application/json",
|
|
url: "../Common/checkisnewmsg.asmx/chckisnew",
|
|
data: {},
|
|
dataType: 'json',
|
|
success: function (result) {
|
|
var code = result.d;
|
|
if (code > 0) {
|
|
if ($("#showselect").length == 0) {
|
|
msgshow();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
//点击关闭或查看更改所有消息状态
|
|
function setmsgzt() {
|
|
if ($("#ado_play").length > 0) {
|
|
document.getElementById("ado_play").pause();
|
|
}
|
|
$.ajax({
|
|
type: "POST",
|
|
contentType: "application/json",
|
|
url: "../Common/checkmsg.asmx/setzt",
|
|
data: {},
|
|
dataType: 'json',
|
|
success: function (result) {
|
|
|
|
}
|
|
});
|
|
}
|
|
//点击消息更改状态
|
|
function setonemsgzt(idval) {
|
|
$.ajax({
|
|
type: "POST",
|
|
contentType: "application/json",
|
|
url: "../Common/checkmsg.asmx/setonezt",
|
|
data: "{id:"+idval+"}",
|
|
dataType: 'json',
|
|
success: function (result) {
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
var formstate;
|
|
var videostate;
|
|
var videoname;
|
|
var dynamicLoading = {
|
|
css: function (path) {
|
|
if (!path || path.length === 0) {
|
|
throw new Error('argument "path" is required !');
|
|
}
|
|
var head = document.getElementsByTagName('head')[0];
|
|
var link = document.createElement('link');
|
|
link.href = path;
|
|
link.rel = 'stylesheet';
|
|
link.type = 'text/css';
|
|
head.appendChild(link);
|
|
},
|
|
js: function (path) {
|
|
if (!path || path.length === 0) {
|
|
throw new Error('argument "path" is required !');
|
|
}
|
|
var head = document.getElementsByTagName('head')[0];
|
|
var script = document.createElement('script');
|
|
script.src = path;
|
|
script.type = 'text/javascript';
|
|
head.appendChild(script);
|
|
}
|
|
}
|
|
|
|
|
|
|