| var app = { |
| |
| // Application Constructor |
| initialize: function() { |
| document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); |
| }, |
| |
| onDeviceReady: function() { |
| var uid = window.localStorage.getItem("uid"); |
| |
| }, |
| doNext: function() { |
| var pwd = $("#pwd").val(); |
| if (isEmpty(pwd)) { |
| return; |
| } |
| if (pwd.length != 6) { |
| $.alert("支付密码为6位数字", "提示"); |
| return; |
| } |
| var cum = new auiDialog({}); |
| var confirm = cum.alert({ |
| title: "提示", |
| msg: '确定挂失吗', |
| buttons: ['取消', '确定'] |
| }, function(ret) { |
| if (ret.buttonIndex == 2) { |
| $.showLoading("正在处理"); |
| var param = { |
| "paypwd": pwd |
| } |
| V1CardLost(param, function(ok, ret) { |
| if (ok) { |
| $.hideLoading(); |
| if (ret.code == 200) { |
| $.alert("卡片挂失成功", "提示", function() { |
| window.location = "main.html" |
| }); |
| } else { |
| $.alert(ret.msg, "错误"); |
| } |
| } else { |
| $.hideLoading(); |
| $.alert("请求失败了" + ret.status + ",请稍后再试", "错误"); |
| } |
| }) |
| } |
| }) |
| } |
| }; |
| app.initialize(); |