用户提现

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

@@ -99,6 +99,25 @@
display: none;
}
.cash-out {
position: fixed;
width: 400px;
height: 320px;
left: 50%;
top: 50%;
margin-left: -200px;
margin-top: -160px;
z-index: 3;
background: #fff;
border-radius: 10px;
box-shadow: 0px 6px 8px 6px #ccc;
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 30px;
display: none;
}
.chargeList form {
width: 100%;
}
@@ -173,6 +192,28 @@
</p>
</form>
</div>
@*提现*@
<div class="cash-out">
<form>
<div class="form-group">
<label>提现金额:</label>
<input type="number" id="cash-out-money" class="form-control" placeholder="请输入提现金额" >
</div>
<div class="form-group">
<label>提现理由:</label>
<input type="text" id="cash-out-reason" class="form-control" placeholder="请输入提现理由" >
</div>
<div class="form-group">
<label>提现支付宝账号(目前仅支持支付宝)</label>
<input type="text" id="alipay-account" class="form-control" placeholder="请输入支付宝账号" >
</div>
<p class="text-center">
<button type="button" class="btn btn-primary" onclick="cash_out()">确认提现</button>
<button type="button" class="btn btn-danger quxiao" style="margin-left:20px;" onclick="$('.cash-out').hide()">取消</button>
</p>
</form>
</div>
<div class="row">
<div class="col-lg-5">
@@ -227,6 +268,7 @@
<div class="col-lg-3">
<div class="zhanghu">
<div class="accout_tit"><span class="lineBar"></span>余额</div>
<p class="charge" onclick="$('.cash-out').show()" style="float:left;font-size:25px;"><a>提现</a></p>
<p class="charge" onclick="$('.chargeList').show()" style="font-size:25px;"><a>充值</a></p>
<div class="money" style="padding: 20px 30px;">¥<span>@Model.UserModel.RestAmount</span></div>
<p class="grayText text-center">可通过淘宝充值,或联系管理员充值</p>
@@ -426,4 +468,51 @@
}
});
}
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>