check order reservation update and payment route fixed

This commit is contained in:
phyusin
2018-06-08 16:50:06 +06:30
parent 630e82a306
commit c8642548e5
9 changed files with 111 additions and 101 deletions

View File

@@ -426,13 +426,13 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
access_code = approved_code;
}
$.ajax({
type: "POST",
url: post_url,
data: {url: callback, ref_no: ref_no, status: status, waiting_time: waiting_time, min_type: type, reason: reject_reason},
dataType: "json",
success: function(data) {
if(data.status){
// $.ajax({
// type: "POST",
// url: post_url,
// data: {url: callback, ref_no: ref_no, status: status, waiting_time: waiting_time, min_type: type, reason: reject_reason},
// dataType: "json",
// success: function(data) {
// if(data.status){
$.ajax({
type: "POST",
url: url,
@@ -466,21 +466,21 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
}
}
});
}else{
swal({
title: 'Oops',
text: data.message,
type: 'error',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/order_reservation';
});
}
}
});
// }else{
// swal({
// title: 'Oops',
// text: data.message,
// type: 'error',
// html: true,
// closeOnConfirm: false,
// closeOnCancel: false,
// allowOutsideClick: false
// }, function () {
// window.location.href = '/origami/order_reservation';
// });
// }
// }
// });
}
function showNewOrderAlert(order_reservation,shop_code){

View File

@@ -463,4 +463,21 @@ function showHideNavbar(webview,page){
function createAccessCode(code) {
localStorage.setItem("access_code",code);
}
//get menu item cache
function getAllMenu(){
$.ajax({
type: "GET",
url: '/origami/get_all_menu',
data: {},
success:function(result){
localStorage.setItem("menus", JSON.stringify(result));
var menu = localStorage.getItem("menus");
if (menu != null ) {
$( "#loading_wrapper").hide();
}
}
});
}