|
@ -6,6 +6,7 @@ var oPhoneCode=document.getElementById("phoneCode");
|
6
|
6
|
var weiChatName=document.getElementById("weiChatName");
|
7
|
7
|
var setpassword=document.getElementById("setpassword");
|
8
|
8
|
var binding=document.getElementById("binding");
|
|
9
|
var changImage = document.getElementById("changImage")
|
9
|
10
|
var state = 0;
|
10
|
11
|
var phoneCode = false;
|
11
|
12
|
document.getElementById("weiChatName").value=ws.name;
|
|
@ -20,7 +21,7 @@ phone.addEventListener("keyup",function(){
|
20
|
21
|
}
|
21
|
22
|
})
|
22
|
23
|
/*校验提交按钮显示状态*/
|
23
|
|
mui('.frmboxNew').on('keyup', "#weiChatName,#phone,#phoneCode,#setpassword", function() {
|
|
24
|
mui('.frmboxNew').on('keyup', "#weiChatName,#imgCode,#phone,#phoneCode,#setpassword", function() {
|
24
|
25
|
if(weiChatName.value == "" || phone.value == "" || oPhoneCode.value == "" || setpassword.value == "") {
|
25
|
26
|
binding.setAttribute("disabled","disabled");
|
26
|
27
|
} else {
|
|
@ -30,12 +31,18 @@ phone.addEventListener("keyup",function(){
|
30
|
31
|
binding.removeAttribute("disabled");
|
31
|
32
|
}
|
32
|
33
|
});
|
33
|
|
|
|
34
|
changImage.addEventListener("tap",function(){
|
|
35
|
this.setAttribute("src","http://www.ekexiu.com/ajax/PictureVC?"+new Date().getTime());
|
|
36
|
})
|
34
|
37
|
/*校验手机号*/
|
35
|
38
|
getPhoneCode.addEventListener("tap",function(){
|
36
|
39
|
phoneVal();
|
37
|
40
|
})
|
38
|
41
|
function phoneVal() {
|
|
42
|
if(imgCode.value=="") {
|
|
43
|
plus.nativeUI.toast("请输入图形验证码", toastStyle);
|
|
44
|
return;
|
|
45
|
}
|
39
|
46
|
var hunPhone = /^1[3|4|5|7|8]\d{9}$/;
|
40
|
47
|
if(hunPhone.test(phone.value)) {
|
41
|
48
|
isReg();
|
|
@ -80,10 +87,15 @@ phone.addEventListener("keyup",function(){
|
80
|
87
|
}
|
81
|
88
|
/*手机发送验证码*/
|
82
|
89
|
function sendAuthentication() {
|
83
|
|
console.log("send code")
|
84
|
|
mui.ajax(baseUrl + '/ajax/regmobilephone_onlyphone', {
|
|
90
|
var cookieValue=plus.navigator.getCookie("http://www.ekexiu.com/ajax/PictureVC");
|
|
91
|
console.log(cookieValue)
|
|
92
|
mui.ajax(baseUrl + '/ajax/regmobilephone', {
|
|
93
|
header:{
|
|
94
|
"Cookie":cookieValue
|
|
95
|
},
|
85
|
96
|
data: {
|
86
|
|
mobilePhone: phone.value
|
|
97
|
mobilePhone: phone.value,
|
|
98
|
vcode: imgCode.value
|
87
|
99
|
},
|
88
|
100
|
dataType: 'json', //数据格式类型
|
89
|
101
|
type: 'GET', //http请求类型
|
|
@ -95,6 +107,11 @@ phone.addEventListener("keyup",function(){
|
95
|
107
|
state = data.data;
|
96
|
108
|
console.log(state);
|
97
|
109
|
doClick();
|
|
110
|
}else{
|
|
111
|
if(data.code==20001) {
|
|
112
|
plus.nativeUI.toast("请输入正确的图形验证码", toastStyle);
|
|
113
|
changImage.setAttribute("src","http://www.ekexiu.com/ajax/PictureVC?"+new Date().getTime());
|
|
114
|
}
|
98
|
115
|
}
|
99
|
116
|
},
|
100
|
117
|
error: function() {
|
|
@ -120,6 +137,7 @@ phone.addEventListener("keyup",function(){
|
120
|
137
|
getPhoneCode.style.display = "block";
|
121
|
138
|
getCodeOff.style.display = "none";
|
122
|
139
|
getPhoneCode.value = "获取验证码";
|
|
140
|
changImage.setAttribute("src","http://www.ekexiu.com/ajax/PictureVC?"+new Date().getTime());
|
123
|
141
|
}
|
124
|
142
|
}, 1000);
|
125
|
143
|
}
|
|
@ -175,6 +193,15 @@ phone.addEventListener("keyup",function(){
|
175
|
193
|
plus.nativeUI.toast("请输入正确的手机号码", toastStyle);
|
176
|
194
|
return;
|
177
|
195
|
}
|
|
196
|
if(imgCode.value.length==0) {
|
|
197
|
plus.nativeUI.toast("请输入图形验证码", toastStyle);
|
|
198
|
return;
|
|
199
|
}else if(imgCode.value.length==4){
|
|
200
|
|
|
201
|
}else{
|
|
202
|
plus.nativeUI.toast("图形验证码4位", toastStyle);
|
|
203
|
return;
|
|
204
|
}
|
178
|
205
|
if(!oNum.test(oPhoneCode.value)) {
|
179
|
206
|
plus.nativeUI.toast("验证码为4位数字", toastStyle);
|
180
|
207
|
return;
|
|
@ -220,6 +247,12 @@ phone.addEventListener("keyup",function(){
|
220
|
247
|
aniShow: "slide-in-right"
|
221
|
248
|
}
|
222
|
249
|
});
|
|
250
|
}else{
|
|
251
|
if(data.code==-1){
|
|
252
|
plus.nativeUI.toast("验证码已过期,请重新获取", toastStyle);
|
|
253
|
}else if(data.code==-2 || data.code==-3 ||data.code==0){
|
|
254
|
plus.nativeUI.toast("验证码错误,请检查后重试", toastStyle);
|
|
255
|
}
|
223
|
256
|
}
|
224
|
257
|
},
|
225
|
258
|
error: function() {
|