mui.ready(function(){$.ajax({"type":"post","url":base_path+"/WithDrawalsLogs/getWithdrawPage","dataType":"json","data":{"openid":"oaH_GwHCnG8fZPwI8c4D_SqLmV0Y"},"success":function(res){$("#allowMoney").html(accDiv(res.data.amount,100));$("#lessMoney").text(accDiv(res.data.lessMoney,100));$("#withdrawalsCount").text(res.data.withdrawalsCount);var Withdraw=res.data.Withdraw;if(Withdraw){$("#userName").val(Withdraw.withDrawalsName);$("#tel").val(Withdraw.tel);$("#bankCount").val(Withdraw.accountNo);$("#bankLocal").val(Withdraw.bankLocal);}document.querySelector('.loading-bg').style.display='none'}})});function ajaxSendApply(url,data){$.ajax({url:url,data:data,dataType:"json",asyn:false,success:function(data){var obj=eval("("+data+")");mui.alert(data.message)},error:function(data){mui.alert(data.message)}})};var flag=true;function submitOrder(){if(!flag){getAlert("正在处理中，请稍等！")}var limitMoney=parseInt($("#allowMoney").html());var data={"openid":"","withDrawalsName":$.trim($("#userName").val()),"withDrawalsNum":$("#amount").val()==""?0:$("#amount").val(),"tel":$.trim($("#tel").val()),"accountNo":$.trim($("#bankCount").val()),"bankLocal":$("#bankLocal").val()};if(!checkAddress(data.withDrawalsName)){getAlert("用户名为空或者格式不正确");return}else if(!(/^1[3|4|5|7|8]\d{9}$/.test(data.tel))){mui.alert("手机号码有误，请重填");return false}else if(!(/^[1-9]+[0-9]*$/.test(data.withDrawalsNum))){getAlert("请输入正确的金额!");return}else if(data.withDrawalsNum<1){getAlert("金额不能小于0");return}else if(data.withDrawalsNum>limitMoney){getAlert("金额超过账户现有金额！");return}else if(!(/^\d{15}\d{1,4}$/.test(data.accountNo))){mui.alert("请输入正确的银行卡号!");return}else if(!checkAddress(data.bankLocal)){getAlert("支行地址填写不正确！");return}flag=false;data.withDrawalsNum=parseInt(data.withDrawalsNum);$.ajax({"type":"post","url":base_path+"/WithDrawalsLogs/submitWithdraw","dataType":"json","data":data,"success":function(res){flag=true;if(res.status){window.location.href=base_path+"/drp/withdrawalssubmitSuccess"}else{getAlert("申请失败："+res.message=="null"?"":res.message)}}})};function goHistoryWithdrawals(){window.location.href=base_path+"/drp/withdrawalsList"};function getAlert(message){mui.alert(message,'水时代-消息提醒',function(){})};