用户提现
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
|
||||
@@ -141,13 +141,14 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-4 text-right">
|
||||
余额抵扣:
|
||||
余额:
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<input type="checkbox" v-model="OneBuyModel.UseAccountAmount" value="1"> 使用余额抵扣,当前账户余额<span class="blueText">@(userEntity.RestAmount)</span>元
|
||||
当前账户余额<span class="blueText">@(userEntity.RestAmount)</span>元
|
||||
<a href="/User/Index">前往充值</a>
|
||||
</div>
|
||||
<div class="col-lg-4 text-left">
|
||||
<span></span>
|
||||
<div class="col-lg-4">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -155,36 +156,37 @@
|
||||
支付方式:
|
||||
</div>
|
||||
<div class="col-lg-4 zhifufangshi">
|
||||
<input type="radio" name="OPayType" value="100" checked v-model="OneBuyModel.OPayType"> <img src="~/img/zfb.png">支付宝支付
|
||||
<input type="radio" name="OPayType" value="70" v-model="OneBuyModel.OPayType"> <img src="~/img/wx.png">微信支付
|
||||
<input id="zhifubaopay_s1" type="radio" name="OPayType" value="100" checked v-model="OneBuyModel.OPayType"> <img src="~/img/zfb.png"><label for="zhifubaopay_s1">支付宝支付</label>
|
||||
<input id="weixinpay_s1" type="radio" name="OPayType" value="70" v-model="OneBuyModel.OPayType"> <img src="~/img/wx.png"><label for="weixinpay_s1">微信支付</label>
|
||||
<input id="UseAccountAmount_s1" type="radio" name="OPayType" value="1" v-model="OneBuyModel.UseAccountAmount"> <label for="UseAccountAmount_s1">余额支付</label>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-4 text-left">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-4 text-right">
|
||||
总金额:
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<span class="blueText">{{TotalAmount}}</span>元
|
||||
</div>
|
||||
<div class="col-lg-4 text-left">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-4 text-right">
|
||||
应付款:
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<span style="font-size: 30px;font-weight: bold;">{{PayAmount}}</span>元
|
||||
<span class="blueText">{{TotalAmount}}</span>元
|
||||
</div>
|
||||
<div class="col-lg-4 text-left">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
@* <div class="row">
|
||||
<div class="col-lg-4 text-right">
|
||||
应付款:
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<span style="font-size: 30px;font-weight: bold;">{{PayAmount}}</span>元
|
||||
</div>
|
||||
<div class="col-lg-4 text-left">
|
||||
<span></span>
|
||||
</div>
|
||||
</div> *@
|
||||
<p class="ijiao-tip" style="color:red">{{Tip}}</p>
|
||||
<p class="tijiao"><button class="btn btn-primary" type="button" v-on:click="onePay">确认支付</button></p>
|
||||
|
||||
@@ -283,6 +285,7 @@
|
||||
},
|
||||
'OneBuyModel.OPayType': { //加引号监听对象里的属性
|
||||
handler: function (newValue, oldValue) {
|
||||
this.OneBuyModel.UseAccountAmount = false;
|
||||
this.OneBuyModel.PayChannel = newValue == 70 ? 30 : 50;
|
||||
},
|
||||
immediate: true
|
||||
@@ -307,8 +310,10 @@
|
||||
})
|
||||
},
|
||||
onePay: function () {
|
||||
if (this.PayAmount == 0 || this.OneBuyModel.UseAccountAmount) {
|
||||
if (!confirm('余额和微信支付宝组合支付时,余额将立即扣除,请务必完成后续差额支付!')) return;
|
||||
if (this.PayAmount > 0 ) {
|
||||
if (this.OneBuyModel.UseAccountAmount){
|
||||
alert('余额不足,请充值。您也可以使用微信、支付宝支付。');return;
|
||||
}
|
||||
}
|
||||
var that = this;
|
||||
if (this.OneBuyModel.UseAccountAmount === true) this.OneBuyModel.UseAccountAmount = 1;
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user