withdraw_information.html
3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
{include file="public/head"/}
<link rel="stylesheet" href="__CDN__/assets/advertising/css/input.css">
<body>
<div class="perfect_input">
<div class="input_single layout align_center flex_row">
<div class="input_l">姓名</div>
<input type="text" id="name" placeholder="请输入姓名" value="{$user.name}">
</div>
<div class="input_single layout align_center flex_row">
<div class="input_l">身份证号</div>
<input type="text" id="card" placeholder="请输入身份证号" value="{$user.card}">
</div>
<div class="input_single layout align_center flex_row" style="border:none">
<div class="input_l">手机号</div>
<input type="text" id="mobile" placeholder="请输入手机号" value="{$user.mobile}">
</div>
</div>
<!-- 提示 -->
<div class="personal_msg_tips layout align_center flex_row">
<div class="personal_tips_icon">
<img src="__CDN__/assets/advertising/img/sun_34@2x.png" alt="">
</div>
<div>
请如实填写提现信息,填写有误将提现失败
</div>
</div>
<div class="sure_submit">
<input type="hidden" id="user_id" value="{$user.id}"/>
<div class="btn">确认</div>
</div>
{include file="public/js" /}
</body>
<script>
$(function(){
$('.btn').click(function(){
var user_id = $('#user_id').val();
var name = $('#name').val().replace(/\s+/g, "");
var card = $('#card').val().replace(/\s+/g, "");
var card_regular = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
var mobile = $('#mobile').val().replace(/\s+/g, "");
var mobile_regular = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
if(name == ''){
toast('请输入姓名');
return false;
}else if(card == ''){
toast('请输入身份证吗');
return false;
}else if(!card_regular.test(card)){
toast('请输入正确的身份证号');
return false;
}else if(mobile == ''){
toast('请输入手机号');
return false;
}else if(!mobile_regular.test(mobile)){
toast('请输入正确手机号');
return false;
}
$.ajax({
url:"{:url('update_withdraw_information')}",
type:"POST",
data:{'user_id':user_id,'name':name,'card':card,'mobile':mobile},
success:function(res){
if(res.code == 1){
toast('更新成功');
setTimeout(function(){
window.location.href = "{:url('member/my_withdraw')}";
},2000);
}else{
toast(res.msg);
}
},
error:function(res){
toast("与服务器断开连接");
}
})
});
})
</script>
</html>