blob: da6e04f20a217b3fb811b9efd745954208b53c1b [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 $.showLoading("加载中");
10 V1Cardinfor(function(ok, ret, err) {
11 if (ok) {
12 $.hideLoading();
13 if(ret.code==200){
14 $("#name").text(ret.name);
15 $("#cardnum").text(ret.cardno);
16 $("#cardstatus").text(ret.cardstatus);
17 }else{
18 $.alert(ret.msg, "错误");
19 }
20 } else {
21 $.hideLoading();
22 $.alert("加载失败了:" + ret.status, "错误");
23 }
24 })
qiaowei8055aa72019-12-05 11:40:00 +080025 },
26 unBindcard: function(){
27 var dialog = new auiDialog({})
28 dialog.prompt({
29 title:"请输入支付密码",
30 text:'请输入支付密码',
31 buttons:['取消','确定']
32 },function(ret){
33 console.log(ret);
34 if(ret.buttonIndex == 2){
35 if(!isEmpty(ret.text)){
36 $.showLoading("正在请求");
37 var param = {
38 "paypwd":ret.text
39 }
40 V1Unbindcard(param,function(ok, ret, err) {
41 if (ok) {
42 $.hideLoading();
43 if(ret.code==200){
44 window.localStorage.removeItem("userid");
45 $.alert('解绑成功', "提示", function() {
46 window.location = 'main.html'
47 });
48 }else{
49 $.alert(ret.msg, "错误");
50 }
51 } else {
52 $.hideLoading();
53 $.alert("请求失败了:" + ret.status, "错误");
54 }
55 })
56 }
57 }
58 });
59 var input = $(".aui-dialog-body").find("input");
60 if(input){
61 input.attr("type","password");
62 }
qiaoweif044a742019-07-10 16:04:20 +080063 }
64};
65app.initialize();