reportSingle.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>耀荣康健</title>
  6. <link rel="stylesheet" type="text/css" href="/analysis/css/styles.css">
  7. <link rel="stylesheet" type="text/css" href="/analysis/js/layui/css/layui.css">
  8. <script src="/analysis/js/jquery-3.2.1.min.js"></script>
  9. <script src="/analysis/js/layer.js"></script>
  10. <script src="/analysis/js/timeUtils.js"></script>
  11. <script src="/analysis/js/chart.js"></script>
  12. <script src="/analysis/js/laydate.js"></script>
  13. <script src="/analysis/js/layui/layui.js"></script>
  14. <style>
  15. /*body{ color: #333333 }*/
  16. </style>
  17. </head>
  18. <body>
  19. <div style="margin: 0 auto; height: 100%; width: 100%; text-align: center">
  20. <div style="display: flex; width: 100%; height: 112px; align-items: center; justify-content: center;background-color: #0044CB; color:#ffffff">
  21. <div style="width: 60%; display: flex; height: 100%; align-items: center">
  22. <a href="/analysis/index.html">
  23. <div style="width:50%; float: left; text-align: left"><img src="/analysis/img/LOGO.png"></div>
  24. </a>
  25. <div style="width:50%;float: right; text-align: right">
  26. <!-- <a href="/index.html" style="text-decoration: none; color: #ffffff; font-size: 24px"><span>主页</span></a>-->
  27. <!-- <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>-->
  28. <!-- <a href="/analysis.html" style="text-decoration: none; color: #ffffff; font-size: 24px"> <span>认知测试</span></a>-->
  29. </div>
  30. </div>
  31. </div>
  32. <div style="width: 100%; height: 730px; display: flex; justify-content: center; align-items: center">
  33. <div style="width: 371px; height: 441px; display: flex; flex-direction: column; padding: 20px; align-items: center;
  34. background-image: url('/analysis/img/singleBg.png');background-repeat: no-repeat;background-size: cover;background-position: center;background-size: 100% 100%;
  35. ">
  36. <div>&nbsp;</div>
  37. <div>&nbsp;</div>
  38. <div style="color: #0044CB; font-size: 20px; font-weight: bold">测试结果</div>
  39. <div>&nbsp;</div>
  40. <div>&nbsp;</div>
  41. <div id="circle" style="width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; flex-direction: column;
  42. background-image: url('/analysis/img/greenCircle.png');background-repeat: no-repeat;background-size: cover;background-position: center;background-size: 100% 100%;
  43. ">
  44. <div id="score" style="font-size: 66px; font-weight: bold"></div>
  45. <div class="title9">百分比准确率</div>
  46. </div>
  47. <div id="aveTime">平均反应时间:</div>
  48. <div>&nbsp;</div>
  49. <div>&nbsp;</div>
  50. <div style="width: 100%; height: 30px; display: flex; justify-content: center">
  51. <a href="/analysis/report/reportTable.html" style="width:100px;height:30px;color: white; line-height: 30px;
  52. background-image: url('/analysis/img/btnBg.png'); background-repeat: no-repeat;background-size: cover;background-position: center;background-size: 100% 100%;
  53. ">测试历史</a>
  54. <div>&nbsp;&nbsp;&nbsp;&nbsp;</div>
  55. <a href="/analysis/analysis.html" style="width:100px;height:30px;color: white; line-height: 30px;
  56. background-image: url('/analysis/img/btnBg.png'); background-repeat: no-repeat;background-size: cover;background-position: center;background-size: 100% 100%;
  57. ">再玩一次</a>
  58. </div>
  59. </div>
  60. <div style="width: 371px; height: 441px;display: flex; flex-direction: column; padding: 20px; align-items: center;
  61. background-image: url('/analysis/img/singleBg.png');background-repeat: no-repeat;background-size: cover;background-position: center;background-size: 100% 100%;
  62. ">
  63. <div>&nbsp;</div>
  64. <div>&nbsp;</div>
  65. <!-- <div style="color: #0044CB; font-size: 20px; font-weight: bold">结果分析</div>-->
  66. <div style="color: #0044CB; font-size: 20px; font-weight: bold">&nbsp;</div>
  67. <div>&nbsp;</div>
  68. <div>&nbsp;</div>
  69. <div style="width: 100%; display: flex;flex-direction: column; align-items: center; justify-content: center">
  70. <div id="analysis" class="title9" style="font-size: 24px"></div>
  71. <div>&nbsp;</div>
  72. <div id="totalRight" class="title9" style="font-size: 18px"></div>
  73. <div id="totalWrong" class="title9" style="font-size: 18px"></div>
  74. <div id="totalTimeout" class="title9" style="font-size: 18px"></div>
  75. </div>
  76. </div>
  77. </div>
  78. <div style="font-size:14px; height: 98px; color: #999999; display: flex;
  79. align-items: center; justify-content: center; background: url(/analysis/img/d97f28a59f20114dad3adbeb0dab456f.png) 100% no-repeat;">
  80. 地址:&nbsp;北京市朝阳区东四环中路41号嘉泰国际A座16层1619室&nbsp;&nbsp;&nbsp;&nbsp;联系电话:400-086-1638<br/>
  81. 湘ICP备2024059687号-3
  82. </div>
  83. </div>
  84. <script>
  85. function checkLogin() {
  86. $.ajax({
  87. url: '/analysis/login/checkLogin',
  88. type: 'POST',
  89. dataType: 'json',
  90. success: function (res) {
  91. if (res.code == 0) {
  92. getReport(res.data.phone)
  93. } else {
  94. isLogin = false
  95. LAYER_ID = layer.open({
  96. // icon: 2,
  97. type: 2,
  98. title: ["请先登录", "font-size:18px"],
  99. // title: false,
  100. content: '/analysis/login.html',
  101. scrollbar: false,
  102. area: ['800px', '500px'],
  103. // offset:'100px',
  104. anim: 0,
  105. closeBtn: 0
  106. });
  107. }
  108. },
  109. error: function (xhr, status, error) {
  110. console.error('错误:', error);
  111. layer.alert("服务器繁忙,请稍后重试!", {icon: 2});
  112. }
  113. });
  114. }
  115. function afterLogin(data) {
  116. getReport(data.phone)
  117. }
  118. function getReport(phone) {
  119. const param = {
  120. "phone": phone,
  121. }
  122. $.ajax({
  123. url: '/analysis/detect/singleReport',
  124. type: 'POST',
  125. dataType: 'json',
  126. contentType: "application/json",
  127. data: JSON.stringify(param),
  128. success: function (res) {
  129. if (res.code == 0) {
  130. // alert(JSON.stringify(res.data))
  131. $("#score").html(res.data.score + "%")
  132. $("#aveTime").html("平均反应时间:" + res.data.aveTime + "秒")
  133. // if (res.data.score < 20) {
  134. // $("#circle").css('background-image', 'url(/analysis/img/redCircle.png)')
  135. // if (res.data.aveTime < 2.5) {
  136. // $("#analysis").html("您回答的速度很快,但是准确率太低。请认真思考提高准确率!加油!")
  137. // } else if (res.data.aveTime > 10) {
  138. // $("#analysis").html("您回答的速度太慢了,您的准确率和速度都有待提高哦!加油!")
  139. // this.node.getChildByName("Label6").getComponent(Label).string = ""
  140. // } else {
  141. // $("#analysis").html("您的准确率和答题速度都有待提高哦!加油!")
  142. // }
  143. // } else if (res.data.score > 50) {
  144. // $("#circle").css('background-image', "url('/analysis/img/greenCircle.png')")
  145. // if (res.data.aveTime < 2.5) {
  146. // $("#analysis").html("太棒了!您的准确率和答题速度都非常棒!请继续保持!")
  147. // } else if (res.data.aveTime > 10) {
  148. // $("#analysis").html("您的准确率很棒哦,但是您答题的速度太慢。请多加练习,提高速度。加油!")
  149. // } else {
  150. // $("#analysis").html("您的准确率很棒哦,答题速度也不错。请继续加油哦!")
  151. // }
  152. // } else {
  153. // $("#circle").css('background-image', 'url(/analysis/img/yellowCircle.png)')
  154. // if (res.data.aveTime < 2.5) {
  155. // $("#analysis").html("您的答题准确率一般哦,但是您的回答速度很快。请您多加练习,提高准确率!")
  156. // } else if (res.data.aveTime > 10) {
  157. // $("#analysis").html("您的答题准确率一般哦,而且您的回答速度太慢。请您多加练习,加油哦!")
  158. // } else {
  159. // $("#analysis").html("您的准确率和反应速度都一般哦,请您多加练习,加油哦!")
  160. // }
  161. // }
  162. // if (res.data.score < 20) {
  163. // $("#circle").css('background-image', 'url(/analysis/img/redCircle.png)')
  164. // if (res.data.aveTime < 2.5) {
  165. // $("#analysis").html("您回答的速度太快了,并且准确率太低。建议您找专业医护人员进行检查!")
  166. // } else if (res.data.aveTime > 10) {
  167. // $("#analysis").html("您回答的速度太慢了,您的准确率和速度都不太理想,建议您找专业医护人员进行检查!")
  168. // this.node.getChildByName("Label6").getComponent(Label).string = ""
  169. // } else {
  170. // $("#analysis").html("您的答题速度还不错,但准确率太低了,建议您找专业医护人员进行检查!")
  171. // }
  172. // } else if (res.data.score > 50) {
  173. // $("#circle").css('background-image', "url('/analysis/img/greenCircle.png')")
  174. // if (res.data.aveTime < 2.5) {
  175. // $("#analysis").html("太棒了!您的准确率和答题速度都非常棒!请继续保持!")
  176. // } else if (res.data.aveTime > 10) {
  177. // $("#analysis").html("您的准确率很棒哦,但是您答题的速度太慢。请多加练习,提高速度。加油!")
  178. // } else {
  179. // $("#analysis").html("您的准确率很棒哦,答题速度也不错。请继续加油哦!")
  180. // }
  181. // } else {
  182. // $("#circle").css('background-image', 'url(/analysis/img/yellowCircle.png)')
  183. // if (res.data.aveTime < 2.5) {
  184. // $("#analysis").html("您的答题准确率一般哦,但是您的回答速度很快。请您多加练习,提高准确率!")
  185. // } else if (res.data.aveTime > 10) {
  186. // $("#analysis").html("您的答题准确率一般哦,而且您的回答速度太慢。请您多加练习,加油哦!")
  187. // } else {
  188. // $("#analysis").html("您的准确率和反应速度都一般哦,请您多加练习,加油哦!")
  189. // }
  190. // }
  191. if (res.data.score <= 30) {
  192. $("#circle").css('background-image', 'url(/analysis/img/redCircle.png)')
  193. $("#analysis").html("您属于高风险人群")
  194. $("#analysis").css("color", "red")
  195. } else if (res.data.score > 70) {
  196. $("#circle").css('background-image', "url('/analysis/img/greenCircle.png')")
  197. $("#analysis").html("您属于低风险人群")
  198. $("#analysis").css("color", "green")
  199. } else {
  200. $("#circle").css('background-image', 'url(/analysis/img/yellowCircle.png)')
  201. $("#analysis").html("您属于中风险人群")
  202. $("#analysis").css("color", "black")
  203. }
  204. $("#totalRight").html("您答对了" + res.data.totalRight + "道题")
  205. $("#totalWrong").html("您答错了" + res.data.totalWrong + "道题")
  206. $("#totalTimeout").html("您超时了" + res.data.totalTimeout + "道题")
  207. } else {
  208. layer.alert(res.message, {icon: 2})
  209. }
  210. },
  211. error: function (xhr, status, error) {
  212. console.error('错误:', error);
  213. layer.alert("服务器繁忙,请稍后重试!", {icon: 2});
  214. }
  215. });
  216. }
  217. $(function () {
  218. checkLogin()
  219. })
  220. </script>
  221. </body>
  222. </html>