submit.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. <meta charset="utf-8">
  7. <title>会计自学</title>
  8. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  11. <link rel="stylesheet" href="../css/mui.min.css">
  12. <script src="../js/mui.min.js"></script>
  13. <script src="../js/app.js"></script>
  14. <script src="../js/service.js"></script>
  15. <style>
  16. html,
  17. body {
  18. background-color: #efeff4;
  19. }
  20. header.mui-bar {
  21. /*display: none;*/
  22. }
  23. .mui-bar-nav~.mui-content {
  24. padding: 0;
  25. }
  26. .mui-content-padded {
  27. /*padding: 10px;*/
  28. }
  29. .mui-content-padded a {
  30. margin: 5px;
  31. width: 45px;
  32. height: 45px;
  33. display: inline-block;
  34. border-radius: 5px;
  35. padding-top: 16px;
  36. }
  37. .mui-content-padded a {
  38. margin-top: 12px;
  39. }
  40. .mui-content a {
  41. color: #8F8F94;
  42. }
  43. .mui-content a.active {
  44. color: #007aff;
  45. }
  46. .my-result-span {
  47. color: white;
  48. font-size: 25px;
  49. }
  50. .my-jieguo {
  51. text-align: center;
  52. margin-top: 70px;
  53. font-size: 50px;
  54. font-family: '宋体';
  55. font-weight: 900;
  56. }
  57. .my-dati {
  58. text-align: center;
  59. font-size: 25px;
  60. margin-top: 20px;
  61. }
  62. .my-chengjidan {
  63. text-align: center;
  64. font-size: 1.5em;
  65. font-weight: bold;
  66. color: white;
  67. margin-top: 20px;
  68. margin-bottom: 30px;
  69. }
  70. .my-button {
  71. background-color: #323333;
  72. font-size: 1.3em;
  73. font-weight: bolder;
  74. margin-top: 30px;
  75. margin-bottom: 20px;
  76. color: white;
  77. border: 0px;
  78. padding: 10px 0px;
  79. }
  80. .my-div-outer {
  81. padding-right: 20px;
  82. padding-left: 20px;
  83. }
  84. .my-mui-card {
  85. background-color: #535353;
  86. top: 200px;
  87. margin: 20px;
  88. height: 300px;
  89. width: 90%;
  90. position: absolute;
  91. }
  92. </style>
  93. </head>
  94. <body>
  95. <header class="mui-bar mui-bar-nav">
  96. <a class="mui-action-back mui-icon mui-pull-left" style="font-size: 18px;margin-top:5px;margin-left: 2px;">退出</a>
  97. <h1 class="mui-title">显示结果</h1>
  98. </header>
  99. <div class="mui-content">
  100. <h1 class="my-jieguo" id="result-id"></h1>
  101. <p id="overview-msg-id" class="my-dati"></p>
  102. <div class="mui-content-padded mui-card my-mui-card" style="height: auto;">
  103. <p class="my-chengjidan">成绩单</p>
  104. <div id="exam-order-id" style="text-align: center;">
  105. </div>
  106. <div class="my-div-outer">
  107. <button id="exam-parse" data-href="resolution.html" class="mui-btn mui-btn-block my-button">全部解析</button>
  108. </div>
  109. </div>
  110. </div>
  111. <script type="text/html" id="template-parse-id">
  112. <a style="{isOk}" data-indexed="{indexed}"><span class="my-result-span">{indexed}</span></a>
  113. </script>
  114. <script>
  115. function haveNoLogin() {
  116. mui.openWindow({
  117. id: 'login-win-' + window.sectionId,
  118. url: 'login.html',
  119. waiting: {
  120. autoShow: false
  121. },
  122. extras: {
  123. sectionId: window.sectionId,
  124. gotoUrl: 'resolution.html',
  125. serviceObj: window.serviceObj
  126. }
  127. });
  128. }
  129. function isGotoLogin() {
  130. var isAlreadyLogin = true;//window.localStorage.getItem('isAlreadyLogin');
  131. if (!isAlreadyLogin) {
  132. mui.openWindow({
  133. id: 'login-win-' + window.sectionId,
  134. url: 'login.html',
  135. waiting: {
  136. autoShow: false
  137. },
  138. extras: {
  139. sectionId: window.sectionId,
  140. gotoUrl:'resolution.html',
  141. serviceObj: window.serviceObj
  142. }
  143. });
  144. return false;
  145. }
  146. return true; //已经登陆
  147. }
  148. function parseEvent() {
  149. var examParse = document.getElementById('exam-parse');
  150. examParse.addEventListener('tap', function() {
  151. var href = this.getAttribute('data-href');
  152. alreadyLogin(function() { //已经登陆
  153. mui.openWindow({
  154. id: 'resolution-win-' + window.sectionId,
  155. url: href,
  156. waiting: {
  157. autoShow: false
  158. },
  159. extras: {
  160. sectionId: window.sectionId,
  161. isFromLoginPage: false,
  162. serviceObj: window.serviceObj
  163. }
  164. });
  165. }, haveNoLogin // 还没有登陆
  166. );
  167. });
  168. }
  169. mui("#exam-order-id").on('tap', 'a', function() {
  170. var indexed = this.getAttribute("data-indexed");
  171. alreadyLogin(function() { //已经登陆
  172. mui.openWindow({
  173. id: 'resolution-win-' + window.sectionId,
  174. url: "resolution.html",
  175. waiting: {
  176. autoShow: false
  177. },
  178. extras: {
  179. indexed: indexed,
  180. serviceObj: window.serviceObj
  181. }
  182. });
  183. }, haveNoLogin // 还没有登陆
  184. );
  185. });
  186. mui.plusReady(function() {
  187. var self = plus.webview.currentWebview();
  188. window.sectionId = self.sectionId;
  189. window.serviceObj = minix(self.serviceObj);
  190. window.questionList = window.serviceObj.questionList;
  191. var resultMsg = window.serviceObj.getResultMsg();
  192. if (resultMsg == "2") {
  193. resultMsg = "遗憾,不及格";
  194. document.getElementById("result-id").style.color = "red";
  195. } else {
  196. resultMsg = "恭喜,已及格";
  197. document.getElementById("result-id").style.color = "green";
  198. }
  199. document.getElementById("result-id").innerHTML = resultMsg;
  200. var questionCount = window.questionList.length;
  201. var okCount = 0;
  202. var tp = document.getElementById("template-parse-id").innerHTML;
  203. var htmlStr = '';
  204. for (var i = 0; i < window.questionList.length; i++) {
  205. var questionAll = window.questionList[i]
  206. var isOk = questionAll.question.isOk;
  207. if (isOk) {
  208. okCount = okCount + 1;
  209. isOk = 'padding-top: 13px;background-color: #2EB348';
  210. } else {
  211. isOk = 'padding-top: 13px;background-color: #FB1C1C';
  212. }
  213. htmlStr += render(tp, {
  214. isOk: isOk,
  215. indexed: questionAll.question.indexed
  216. });
  217. }
  218. document.getElementById("exam-order-id").innerHTML = htmlStr;
  219. document.getElementById('overview-msg-id').innerHTML = '共' + questionCount + '题,答对' + okCount + '道题';
  220. parseEvent();
  221. });
  222. var old_back = mui.back;
  223. mui.back = function() {
  224. var wv = plus.webview;
  225. var sectionId = window.serviceObj.getSectionId();
  226. var chapterId = window.serviceObj.getChapterId();
  227. plus.webview.getWebviewById('section-win-' + chapterId).evalJS('initDom();');
  228. wv.close('question-win-' + sectionId);
  229. wv.close('card-win-' + sectionId);
  230. wv.close('submit-win-' + sectionId);
  231. wv.show('section-win-' + chapterId)
  232. //执行mui封装好的窗口关闭逻辑;
  233. // old_back();
  234. };
  235. </script>
  236. </body>
  237. </html>