用户提现

This commit is contained in:
wanyongkang
2020-10-10 18:20:40 +08:00
parent 14d6f0b7aa
commit 3a4bfb28eb
3 changed files with 189 additions and 21 deletions

View File

@@ -109,7 +109,11 @@
</div>
</div>
<!-- 余额 -->
<div class="accout_tit"><span class="lineBar"></span>余额 <button class="btnXq" onclick="$('#chargeBox').show()">充值</button></div>
<div class="accout_tit">
<span class="lineBar"></span>余额
<button class="btnXq" onclick="$('#chargeBox').show()">充值</button>
<button class="btnXq" onclick="$('#cash-out').show()">提现</button>
</div>
<div class="model">
<div class="item">
余额:
@@ -264,6 +268,30 @@
</div>
</form>
</div>
<!-- 提现 -->
<div class="layerTable" id="cash-out" style="margin-right:10em;">
<form id="cashForm">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>提现金额:</td>
<td><input type="number" id="cash-out-money" class="inputBox" placeholder="请输入提现金额"/></td>
</tr>
<tr>
<td>提现理由:</td>
<td><input type="number" id="cash-out-reason" class="inputBox" placeholder="请输入提现理由"/></td>
</tr>
<tr>
<td>提现支付宝账号:</td>
<td><input type="number" id="alipay-account" class="inputBox" placeholder="请输入支付宝账号"/></td>
</tr>
</table>
<div class="" style="text-align:center;">
<button type="button" class="btnXq" onclick="$('#cash-out').hide()">返回</button>
<button type="button" class="btnXq" onclick="cash_out()">确定</button>
</div>
</form>
</div>
<!-- 支付弹窗 -->
<div id="aliPayBox" style="display:none"></div>
@@ -354,6 +382,52 @@
}
});
}
function cash_out() {
let cash_out_money = $('#cash-out-money').val(),
reason = $('#cash-out-reason').val(),
alipay_account = $('#alipay-account').val();
if(cash_out_money > @Model.UserModel.RestAmount){
alert("抱歉!您提现的额度大于余额,请重新输入提现金额!");
return;
}
if(cash_out_money <= 0){
alert("抱歉!请重新输入提现金额!");
return;
}
//
let reg = /^(?:1[3-9]\d{9}|[a-zA-Z\d._-]*\@@[a-zA-Z\d.-]{1,10}\.[a-zA-Z\d]{1,20})$/;
if(alipay_account.length <= 0 || alipay_account.match(reg) == null){
alert("抱歉!请重新输入支付宝账号!");
return;
}
let cashOutData = {
cash_out_money: cash_out_money,
reason: reason,
alipay_account: alipay_account,
cookie:document.cookie
}
$.ajax({
type: 'POST',
url: 'http://autophp.wyk/order/index/index',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(cashOutData),
beforeSend: function(xhr) {
xhr.withCredentials = true;
},
crossDomain: true,
success: function (res) {
console.log(res);
if (res.Code == 10000) {
$('.cash-out').hide();
alert('提现请求发送成功,我们会在一到两个工作日进行处理,请注意查看资金明细。');
} else {
alert('提现异常!请重试或联系客服。');
}
}
});
}
</script>