You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

152 lines
4.7 KiB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link href="css/mui.min.css" rel="stylesheet" />
  8. <link href="css/style.css" rel="stylesheet" />
  9. <script src="js/mui.min.js"></script>
  10. <script src="js/userinfos.js"></script>
  11. <script src="js/serverurl.js"></script>
  12. <script type="text/javascript">
  13. mui.plusReady(function() {
  14. CheckLogin();
  15. GetData();
  16. document.getElementById("binding").addEventListener("tap", function() {
  17. mui.openWindow({
  18. url: 'binding.html',
  19. id: 'binding',
  20. show: {
  21. aniShow: 'pop-in'
  22. }
  23. });
  24. });
  25. });
  26. function longPress(id) {
  27. timeOutEvent = 0;
  28. var btnArray = [{
  29. title: "修改银行卡",
  30. style: "destructive"
  31. }];
  32. plus.nativeUI.actionSheet({
  33. cancel: "取消",
  34. buttons: btnArray
  35. }, function(e) {
  36. var index = e.index;
  37. if(index == 1) {
  38. EditCard(id);
  39. }
  40. });
  41. }
  42. function EditCard(id) {
  43. mui.openWindow({
  44. url: 'binding.html',
  45. id: 'binding',
  46. extras: {
  47. id: id
  48. },
  49. show: {
  50. aniShow: 'pop-in'
  51. }
  52. });
  53. }
  54. function GetData() {
  55. var table = document.getElementById("table");
  56. //server data
  57. // var xhr = new plus.net.XMLHttpRequest();
  58. // xhr.responseType = "json";
  59. // xhr.onreadystatechange = function() {
  60. // switch(xhr.readyState) {
  61. // case 4:
  62. // if(xhr.status == 200) {
  63. // table.innerHTML = "";
  64. // table.innerText = "";
  65. // if(xhr.response.msg != null && xhr.response.msg.length > 0) {
  66. // document.getElementById("binding").style.display = 'none';
  67. // for(var i = 0; i < xhr.response.msg.length; i++) {
  68. // //load list
  69. // var dataobject = xhr.response.msg;
  70. // var li = document.createElement('div');
  71. // li.setAttribute("bankNumber", "" + users.ID + "");
  72. // li.addEventListener("touchstart", function(e) {
  73. // timeOutEvent = setTimeout("longPress('" + this.getAttribute('bankNumber') + "')", 500);
  74. // e.preventDefault();
  75. // });
  76. // li.addEventListener("touchend", function(e) {
  77. // clearTimeout(timeOutEvent);
  78. // if(timeOutEvent != 0) {}
  79. // return false;
  80. // });
  81. // li.className = 'yhk';
  82. // li.innerHTML = '<div>' +
  83. // '<h4>' + dataobject[i].bankName + '</h4>' +
  84. // '<p style="color: #FFFFFF;">' + users.username + '</p>' +
  85. // '<span>' + dataobject[i].bankNumber + '</span>' +
  86. // '</div>';
  87. // table.appendChild(li, table.firstChild);
  88. // }
  89. // } else {
  90. // document.getElementById("binding").style.display = 'block';
  91. // }
  92. // plus.nativeUI.closeWaiting();
  93. // } else {
  94. // plus.nativeUI.closeWaiting();
  95. // plus.nativeUI.toast('世界上最遥远的距离就是没有网络。');
  96. // }
  97. // break;
  98. // default:
  99. // break;
  100. // }
  101. // }
  102. // xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=getBanksList&content={'userID':'" + users.ID + "'}"));
  103. // xhr.send();
  104. plus.nativeUI.showWaiting("数据加载中...");
  105. mui.post(api+'/user/bankinfo',{data:users.ID},function(res){
  106. if(res.code=="200"){
  107. plus.nativeUI.closeWaiting();
  108. document.getElementById("binding").style.display = 'none';
  109. for(var i = 0; i < res.data.length; i++) {
  110. //load list
  111. var dataobject = res.data;
  112. var li = document.createElement('div');
  113. li.setAttribute("bankNumber", "" + users.ID + "");
  114. li.addEventListener("touchstart", function(e) {
  115. timeOutEvent = setTimeout("longPress('" + this.getAttribute('bankNumber') + "')", 500);
  116. e.preventDefault();
  117. });
  118. li.addEventListener("touchend", function(e) {
  119. clearTimeout(timeOutEvent);
  120. if(timeOutEvent != 0) {}
  121. return false;
  122. });
  123. li.className = 'yhk';
  124. li.innerHTML = '<div>' +
  125. '<h4>' + dataobject[i].bankName + '</h4>' +
  126. '<p style="color: #FFFFFF;">' + users.username + '</p>' +
  127. '<span>' + dataobject[i].bankNumber + '</span>' +
  128. '</div>';
  129. table.appendChild(li, table.firstChild);
  130. }
  131. }
  132. },'json')
  133. }
  134. </script>
  135. <style></style>
  136. </head>
  137. <body>
  138. <header class="mui-bar mui-bar-nav">
  139. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  140. <h1 class="mui-title">银行卡<p style="color: #FFFFFF; float: right;" id="binding">绑定银行卡</p></h1>
  141. </header>
  142. <div class="mui-content" id="table">
  143. </div>
  144. </body>
  145. </html>