|
|
@@ -35,7 +35,7 @@
|
|
|
<div class="cz00">
|
|
|
<form id="fromRecharge">
|
|
|
<span class="cz-font"><span class="xinghao" >*</span>充值金额:</span>
|
|
|
- <input type="text" name="orderAmount" placeholder="" class="cz">
|
|
|
+ <input type="number" name="orderAmount" id="orderAmount" placeholder="" class="cz">
|
|
|
<button type="button" onclick="toRecharge()" class="cz-but">充值</button>
|
|
|
</form>
|
|
|
|
|
|
@@ -51,11 +51,17 @@
|
|
|
</body>
|
|
|
<script>
|
|
|
function toRecharge() {
|
|
|
+ var amount = $("#orderAmount").val();
|
|
|
+ if (isNaN(amount) || amount <= 0){
|
|
|
+ $("#orderAmount").val(0);
|
|
|
+ swal("请输入正确的金额!");
|
|
|
+ return
|
|
|
+ }
|
|
|
$.post("<%=basePath%>/open/myAccount/toRecharge.action",$("#fromRecharge").serialize(),function (ret) {
|
|
|
if(ret.stateCode==200) {
|
|
|
location.href="<%=basePath%>/open/myAccount/payment.htm?orderNumber="+ret.data.orderNumber+"&orderAmount="+ret.data.orderAmount;
|
|
|
}else {
|
|
|
- alert("充值失败")
|
|
|
+ swal("充值失败")
|
|
|
}
|
|
|
})
|
|
|
}
|