blob: 1eef6e46e8c32061f2764725b641307409aa9939 [file] [log] [blame]
qiaoweif044a742019-07-10 16:04:20 +08001var app = {
2
3 // Application Constructor
4 initialize: function() {
5 document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
6 },
7
8 onDeviceReady: function() {
9 var phone = window.localStorage.getItem("phoneX");
10 if(!isEmpty(phone)){
11 $("#phone").val(phone)
12 }else{
13 phone = window.localStorage.getItem("phone");
14 $("#phone").val(phone)
15 }
16 },
17 doNext: function() {
18 var code = $("#code").val();
19 if(isEmpty(code)){
20 return;
21 }
22 $.showLoading("正在处理");
23 var param={
24 "code":code
25 }
26 V1Checkcode(param,function(ok,ret){
27 if(ok){
28 $.hideLoading();
29 if(ret.code==200){
30 window.localStorage.setItem("randomcode",ret.randcode);
31 window.localStorage.setItem("paypwdtype","find");
32 window.location="paypwdset.html";
33 }else{
34 $.alert(ret.msg, "错误");
35 }
36 }else{
37 $.hideLoading();
38 $.alert("请求失败了"+ret.status+",请稍后再试", "错误");
39 }
40 })
41 },
42 getCode :function(){
43 $.showLoading("请求中");
44 V1Code(function(ok,ret){
45 if(ok){
46 $.hideLoading();
47 if(ret.code==200){
48 $("#codebtn").attr("disabled","disabled")
49 $("#codebtn").addClass("vcodedisabled")
50 btnTime('codebtn');
51 }else{
52 $.alert(ret.msg, "错误");
53 }
54 }else{
55 $.hideLoading();
56 $.alert("请求失败了"+ret.status+",请稍后再试", "错误");
57 }
58 })
59 }
60};
61app.initialize();