70 lines
2.0 KiB
PHP
70 lines
2.0 KiB
PHP
@if(is_mobile_client())
|
|
<div style="display: none">
|
|
<audio id="daaudio">
|
|
<source src="{{ url('/style/order.mp3') }}" type="audio/mpeg"/>
|
|
</audio>
|
|
<audio id="drawaudio">
|
|
<source src="{{ url('/style/draw.mp3') }}" type="audio/mpeg"/>
|
|
</audio>
|
|
</div>
|
|
|
|
<script>
|
|
timedw = 1000;
|
|
order_tipstime = '{{ config_cache_default('config.order_tips_time',10) }}';
|
|
draw_tipstime='{{ config_cache_default('config.draw_tips_time',30*60) }}'
|
|
setInterval(function () {
|
|
layui.use([], function () {
|
|
var $ = layui.jquery;
|
|
$.ajax({
|
|
url: '{{ admin_url("Api",'index',['type'=>'orderMp3','name'=>'tips']) }}',
|
|
method: 'get',
|
|
data: {
|
|
_token: '{{ csrf_token() }}',
|
|
|
|
},
|
|
success: function (res) {
|
|
console.log(res);
|
|
if (res.error == 0) {
|
|
|
|
if (res.msg) {
|
|
document.getElementById('daaudio').play();
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
}, order_tipstime * timedw)
|
|
|
|
setInterval(function () {
|
|
layui.use([], function () {
|
|
var $ = layui.jquery;
|
|
$.ajax({
|
|
url: '{{ admin_url("Api",'index',['type'=>'draw','name'=>'tips']) }}',
|
|
method: 'get',
|
|
data: {
|
|
_token: '{{ csrf_token() }}',
|
|
|
|
},
|
|
success: function (res) {
|
|
console.log(res);
|
|
if (res.error == 0) {
|
|
|
|
if (res.msg) {
|
|
document.getElementById('drawaudio').play();
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
}, draw_tipstime * timedw)
|
|
|
|
</script>
|
|
@endif |