aaudio play under origami

This commit is contained in:
phyusin
2018-05-29 16:01:56 +06:30
parent 776479a74e
commit e9bbc711dc
3 changed files with 7 additions and 4 deletions

View File

@@ -15,8 +15,11 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
var active_class = "";
if(key==0){
active_class = "tr-active";
if (typeof showNewOrder !== 'undefined' && $.isFunction(showNewOrder)) {
showNewOrder(order[key],shop_code);
if (typeof audioPlayBackground !== 'undefined' && $.isFunction(audioPlayBackground)) {
audioPlayBackground(shop_code);
}
if (typeof showNewOrderAlert !== 'undefined' && $.isFunction(showNewOrderAlert)) {
showNewOrderAlert(order[key],shop_code);
}
}
var rowCount = key+1;

View File

@@ -160,6 +160,7 @@ $(document).ready(function() {
/* start order reservation function */
function audioPlayBackground(shop_code){
console.log(shop_code);
//audio play
var audio = new Audio('/'+shop_code+'-beep.mp3'); // define your audio
// setTimeout(function(){

View File

@@ -484,13 +484,12 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
});
}
function showNewOrder(order_reservation,shop_code){
function showNewOrderAlert(order_reservation,shop_code){
if((order_reservation!=undefined) && (order_reservation!=null) && (order_reservation!="")){
var date = new Date(order_reservation.requested_time);
var time = timeFormat(date);
var requested_date = date.getFullYear() + '-' + (date.getMonth() >= 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ (date.getDate() >= 10? date.getDate() : '0' + date.getDate()) +' '+time;
$('.first-1').click();
audioPlayBackground(shop_code);
swal({
title: 'Information',