blob: a4214fc5ea7d47e342d60a1edd89768a13e423b7 [file] [log] [blame]
var dict;
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").text(phone)
}else{
phone = window.localStorage.getItem("phone");
$("#phone").text(phone)
}
},
doNext: function() {
var code = $("#code").val();
if(isEmpty(code)){
return;
}
var personid = window.localStorage.getItem("personid");
$.showLoading("正在处理");
var param={
"personid":personid,
"code":code,
}
V1Checkcode(param,function(ok,ret){
if(ok){
$.hideLoading();
console.log(ret)
if(ret.code==200){
window.localStorage.setItem("paypwdtype", "new");
window.localStorage.setItem("userid", personid);
var signed = window.localStorage.getItem("signed");
var paypwdset = window.localStorage.getItem("paypwdset");
console.log(paypwdset)
if (!paypwdset||'false'==paypwdset) {
window.location = "paypwdset.html";
} else {
if (!isEmpty(signed) && signed == 'yes') {
window.location = 'main.html'
} else {
window.location = 'signxy.html'
}
}
}else{
$.alert(ret.msg, "错误");
}
}else{
$.hideLoading();
$.alert("请求失败了"+ret.status+",请稍后再试", "错误");
}
})
}
};
app.initialize();