edit_phone2.html
4.3 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_0ml90wdq5hzm.css">
<link rel="stylesheet" href="__INDEX__/css/base.css">
<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
<script type="text/javascript" src="__INDEX__/js/base.js"></script>
<title>编辑手机号</title>
<style>
body,html{
width:100%;
height:100%;
background: RGBA(245, 246, 250, 1);
}
.phone{
width:6.96rem;
margin: 0 auto;
height:1rem;
background: #fff;
border-radius: 0.5rem;
font-size: 0.28rem;
color: RGBA(151, 160, 168, 1);
/*padding: 0.37rem 0.52rem;*/
margin-top: 0.32rem;
}
.enterphone{
width:6.96rem;
margin: 0 auto;
height:1rem;
background: #fff;
border-radius: 0.5rem;
font-size: 0.28rem;
color: RGBA(151, 160, 168, 1);
padding: 0.37rem 0.52rem;
border:none;
outline:none;
}
.code{
font-size: 0;
display:flex;
justify-content: space-between;
align-content: center;
width:6.96rem;
margin: 0 auto;
height:1rem;
background: #fff;
border-radius: 0.5rem;
color: RGBA(151, 160, 168, 1);
margin-top: 0.32rem;
}
.code_num{
height:1rem;
line-height: 1rem;
font-size: 0.28rem;
margin-left: 0.52rem;
}
.entercode{
height:1rem;
line-height: 1rem;
font-size: 0.28rem;
outline:none;
border:none;
border-radius: 0.5rem;
color: RGBA(151, 160, 168, 1);
}
.sendcode{
width:2.44rem;
font-size: 0.28rem;
height:0.72rem;
background: RGBA(254, 10, 1, 1);
color:#fff;
border-radius: 0.36rem;
line-height: 0.72rem;
text-align: center;
margin-top: 0.15rem;
margin-right: 0.37rem;
}
.nextstep{
width:6.86rem;
height:0.88rem;
text-align: center;
line-height: 0.88rem;
background:RGBA(254, 10, 1, 1);
font-size: 0.32rem;
color:#fff;
border-radius: 0.44rem;
position:fixed;
bottom:0.55rem;
left:0;
right:0;
margin: 0 auto;
box-shadow:0px 15px 30px 0px rgba(254,10,1,0.24);
}
</style>
</head>
<body>
<div class="container">
<div class="phone">
<input type="text" class="enterphone" placeholder="输入新的手机号">
</div>
</div>
<div class="code">
<p class="code_num">
<input type="text" class="entercode" placeholder="验证码">
</p>
<p class="sendcode">发送验证码</p>
</div>
<p class="nextstep">
确定
</p>
</body>
<script src="__INDEX__/js/jquery.min.js"></script>
<script>
$(".sendcode").click(function () {
var mobile = $(".enterphone").val();
var pattern = /^1[34578]\d{9}$/;
if(pattern.test(mobile)) {
$.ajax({
url: "{:url('sms/Sms/sendSms')}",
data: {
mobile: mobile
},
type: "POST",
dataType: "JSON",
})
}else {
alert('请输入正确的手机号');
}
})
$(".nextstep").click(function(){
var mobile = $(".enterphone").val();
$.ajax({
url:"{:url('sms/Sms/checkCode')}",
data:{
mobile:mobile,
code:$(".entercode").val()
},
type:"POST",
dataType:"JSON",
success: function (data) {
if(data.data === true) {
window.location.href="{:url('user/Center/userInfo')}"
}else {
alert(data.msg);
}
}
})
})
</script>
</html>