<script type="text/javascript">
//播放音乐函数
function playSound()
{
var borswer = window.navigator.userAgent.toLowerCase();
if (borswer.indexOf("ie") >= 0)
{
var strEmbed = '<embed name="embedPlay" src="/plugins/orderTip/music/order_tip.mp3" autostart="true" hidden="true" loop="false"></embed>';
if ($("body").find("embed").length <= 0)
{
$("body").append(strEmbed);
}
var embed = document.embedPlay;
embed.volume = 100;
}
else
{
var strAudio = "<audio id='audioPlay' src='/plugins/orderTip/music/order_tip.mp3' hidden='true'>";
if ($("body").find("audio").length <= 0)
{
$("body").append(strAudio);
}
var audio = document.getElementById("audioPlay");
audio.play();
}
}
setInterval('refreshQuery()', 15000);
/* 刷新查询 */
function refreshQuery()
{
$.getJSON("/plugins/getNewOrder",{"seller_id":"0","time":"2018-03-13 14:30:43"},function (json)
{
if(json == '')
{
return;
}
art.dialog(
{
id: 'newOrderTip',
title: '新订单提醒',
content: json.text,
left: '100%',
top: '100%',
fixed: true,
drag: false,
resize: false,
init: function ()
{
//播放音乐
playSound();
},
ok: function ()
{
window.location.href=json.jumpUrl;
},
okVal: '立即查看',
})
})
}
</script>
网友评论