Server IP : 66.29.132.124 / Your IP : 3.144.1.100 Web Server : LiteSpeed System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : wavevlvu ( 1524) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/wavevlvu/book24.ng/public/module/booking/js/ |
Upload File : |
(function ($) { new Vue({ el:'#bravo-checkout-page', data:{ onSubmit:false, message:{ content:'', type:false } }, methods:{ doCheckout(){ var me = this; if(this.onSubmit) return false; if(!this.validate()) return false; this.onSubmit = true; $.ajax({ url:bookingCore.routes.checkout, data:$('.booking-form').find('input,textarea,select').serialize(), method:"post", success:function (res) { if(!res.status && !res.url){ me.onSubmit = false; } if(res.elements){ for(var k in res.elements){ $(k).html(res.elements[k]); } } if(res.message) { me.message.content = res.message; me.message.type = res.status; } if(res.url){ window.location.href = res.url } if(res.errors && typeof res.errors == 'object') { var html = ''; for(var i in res.errors){ html += res.errors[i]+'<br>'; } me.message.content = html; } }, error:function (e) { me.onSubmit = false; if(e.responseJSON){ me.message.content = e.responseJSON.message ? e.responseJSON.message : 'Can not booking'; me.message.type = false; }else{ if(e.responseText){ me.message.content = e.responseText; me.message.type = false; } } } }) }, validate(){ return true; } } }) })(jQuery)