优化通知展示

master
xm 4 years ago
parent 93ec550c3b
commit e9bf1fa3b9

@ -55,21 +55,26 @@
ws.onopen = function(){ ws.onopen = function(){
ws.send("power_"+userId); ws.send("power_"+userId);
console.log("连接...") console.log("连接...")
} };
//处理服务器发送来的数据 //处理服务器发送来的数据
ws.onmessage = function(e){ ws.onmessage = function(e){
var msg = e.data.split(strSplit); var msg = e.data.split(strSplit);
narn('warn',msg[0],msg[1],msg[2]); var a1 = msg[0];
} if(a1=="借阅通知"){
narn1('warn',msg[0],msg[1],msg[2]);
}else{
narn('warn',msg[0],msg[1],msg[2]);
}
};
ws.onclose = function(){ ws.onclose = function(){
console.log("连接关闭"); console.log("连接关闭");
} };
ws.onerror = function(){ ws.onerror = function(){
console.log('连接失败'); console.log('连接失败');
} };
function narn (type,title,text,noticeId) { function narn (type,title,text,noticeId) {
debugger debugger
@ -85,4 +90,12 @@
}] }]
}) })
} }
function narn1 (type,title,text,noticeId) {
debugger
naranja()[type]({
title: title,
text: text,
timeout: 1000*60
})
}
</script> </script>

Loading…
Cancel
Save