blob: 1eef6e46e8c32061f2764725b641307409aa9939 [file] [log] [blame]
var app = {
// Application Constructor
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
onDeviceReady: function() {
var phone = window.localStorage.getItem("phoneX");
if(!isEmpty(phone)){
$("#phone").val(phone)
}else{
phone = window.localStorage.getItem("phone");
$("#phone").val(phone)
}
},
doNext: function() {
var code = $("#code").val();
if(isEmpty(code)){
return;
}
$.showLoading("正在处理");
var param={
"code":code
}
V1Checkcode(param,function(ok,ret){
if(ok){
$.hideLoading();
if(ret.code==200){
window.localStorage.setItem("randomcode",ret.randcode);
window.localStorage.setItem("paypwdtype","find");
window.location="paypwdset.html";
}else{
$.alert(ret.msg, "错误");
}
}else{
$.hideLoading();
$.alert("请求失败了"+ret.status+",请稍后再试", "错误");
}
})
},
getCode :function(){
$.showLoading("请求中");
V1Code(function(ok,ret){
if(ok){
$.hideLoading();
if(ret.code==200){
$("#codebtn").attr("disabled","disabled")
$("#codebtn").addClass("vcodedisabled")
btnTime('codebtn');
}else{
$.alert(ret.msg, "错误");
}
}else{
$.hideLoading();
$.alert("请求失败了"+ret.status+",请稍后再试", "错误");
}
})
}
};
app.initialize();