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 regels
4.8 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Hello MUI</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link rel="stylesheet" href="css/mui.min.css">
  10. <link rel="stylesheet" href="css/style.css">
  11. <link rel="stylesheet" type="text/css" href="css/mui.picker.min.css" />
  12. <script src="js/mui.min.js"></script>
  13. <script src="js/userinfos.js"></script>
  14. <script src="js/serverurl.js"></script>
  15. <script type="text/javascript" src="js/tools.js"></script>
  16. <script src="js/mui.picker.min.js"></script>
  17. </head>
  18. <body>
  19. <style>
  20. .mui-table-view .mui-media-object {
  21. max-width: 70px;
  22. height: 65px;
  23. }
  24. .mui-control-content {
  25. min-height: 215px;
  26. }
  27. .mui-control-content .mui-loading {
  28. margin-top: 50px;
  29. }
  30. .mui-media-body {
  31. font-size: 14px;
  32. }
  33. .mui-media-body span {
  34. color: #C70F1A;
  35. text-align: left;
  36. float: right;
  37. }
  38. .mui-table-view-cell p {
  39. line-height: 24px;
  40. }
  41. </style>
  42. <script type="text/javascript">
  43. function OpenAndSetPicker(picker, field) {
  44. picker.show(function(items) {
  45. if(confirm("是否修改缴费信息?")) {
  46. var xhr = new plus.net.XMLHttpRequest();
  47. xhr.responseType = "json";
  48. xhr.onreadystatechange = function() {
  49. switch(xhr.readyState) {
  50. case 4:
  51. if(xhr.status == 200) {
  52. plus.nativeUI.closeWaiting();
  53. if(xhr.response.result == "ok") {
  54. GetData();
  55. plus.nativeUI.toast("修改成功。");
  56. } else {
  57. plus.nativeUI.toast("操作失败,请重试。");
  58. }
  59. } else {
  60. plus.nativeUI.closeWaiting();
  61. plus.nativeUI.toast("操作失败,请重试。");
  62. }
  63. break;
  64. default:
  65. break;
  66. }
  67. }
  68. xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=upadtePAYMENT_QUOTA&ID=" + field + "&paymentQuota=" + items[0].value + ""));
  69. xhr.send();
  70. plus.nativeUI.showWaiting("加载中...");
  71. }
  72. });
  73. }
  74. var userPickerpaymentQuota;
  75. mui.plusReady(function() {
  76. CheckLogin();
  77. userPickerpaymentQuota = new mui.PopPicker();
  78. GetDictionaryData(userPickerpaymentQuota, "100009100022000000");
  79. GetData();
  80. });
  81. function GetData() {
  82. var table = document.getElementById("table");
  83. //server data
  84. var xhr = new plus.net.XMLHttpRequest();
  85. xhr.responseType = "json";
  86. xhr.onreadystatechange = function() {
  87. switch(xhr.readyState) {
  88. case 4:
  89. if(xhr.status == 200) {
  90. table.innerHTML = "";
  91. table.innerText = "";
  92. if(xhr.response.msg != null && xhr.response.msg.length > 0) {
  93. for(var i in xhr.response.msg) {
  94. var dataobject = xhr.response.msg;
  95. var li = document.createElement('li');
  96. li.setAttribute("userid",""+dataobject[i].ID+"");
  97. li.addEventListener("tap", function() {
  98. OpenAndSetPicker(userPickerpaymentQuota, '' + this.getAttribute("userid") + '');
  99. });
  100. li.className = 'mui-table-view-cell mui-media';
  101. li.innerHTML = '<a>' +
  102. '<img class="mui-media-object mui-pull-left" src="' + serverdomain + '/' + dataobject[i].userPhoto + '">' +
  103. '<div class="mui-media-body">' +
  104. '姓名:' + dataobject[i].strdentName + ' &nbsp;&nbsp;&nbsp;&nbsp;'+dataobject[i].strMobile+'<span>' + dataobject[i].moneyQuota + '</span>' +
  105. '<p>学院:' + dataobject[i].schoolName + '</p>' +
  106. '<p class="mui-ellipsis">专业:' + dataobject[i].professionName + '</p>' +
  107. '<p>生活费: ' + dataobject[i].professionMoney + ' </p>' +
  108. '<button type="button" class="mui-btn mui-btn-danger" style="float: right;">去缴费</button>' +
  109. '</p>' +
  110. '</div>' +
  111. '</a>';
  112. table.appendChild(li, table.firstChild);
  113. }
  114. } else {}
  115. plus.nativeUI.closeWaiting();
  116. } else {
  117. plus.nativeUI.closeWaiting();
  118. plus.nativeUI.toast('世界上最遥远的距离就是没有网络。');
  119. }
  120. break;
  121. default:
  122. break;
  123. }
  124. }
  125. xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=strdentList&content={'logname':'" + users.phone + "','num':'4'}"));
  126. xhr.send();
  127. plus.nativeUI.showWaiting("数据加载中...");
  128. }
  129. </script>
  130. <header class="mui-bar mui-bar-nav">
  131. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  132. <h1 class="mui-title">学生缴费</h1>
  133. </header>
  134. <div class="mui-content">
  135. <ul class="mui-table-view" id="table">
  136. </ul>
  137. </div>
  138. </body>
  139. </html>