comprehensiveMemoryAbilityEnter.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <div class="cma-warp">
  3. <div class="cma-first-line">
  4. <div class="cma-list-item" @click="goList(0)">
  5. <img src="../../assets/congnitiveAblitity/ability1.png" alt="">
  6. <p style="color: rgb(87, 172, 187)">(一)指向记忆</p>
  7. </div>
  8. <div class="cma-list-item" @click="goList(1)">
  9. <img src="../../assets/congnitiveAblitity/ability2.png" alt="">
  10. <p style="color: rgb(87, 172, 187)">(二)词汇联想</p>
  11. </div>
  12. <div class="cma-list-item" @click="goList(2)">
  13. <img src="../../assets/congnitiveAblitity/ability3.png" alt="">
  14. <p style="color: rgb(87, 172, 187)">(三)图像自由回忆</p>
  15. </div>
  16. </div>
  17. <div class="cma-second-line">
  18. <div class="cma-list-item" @click="goList(3)">
  19. <img src="../../assets/congnitiveAblitity/ability1.png" alt="">
  20. <p style="color: rgb(87, 172, 187)">(四)图片联想</p>
  21. </div>
  22. <div class="cma-list-item" @click="goList(4)">
  23. <img src="../../assets/congnitiveAblitity/ability2.png" alt="">
  24. <p style="color: rgb(87, 172, 187)">(五)人物特点回忆</p>
  25. </div>
  26. <div class="cma-list-item" @click="goList(5)">
  27. <img src="../../assets/congnitiveAblitity/ability3.png" alt="">
  28. <p style="color: rgb(87, 172, 187)">(六)视觉空间记忆</p>
  29. </div>
  30. <div class="cma-list-item" @click="goList(6)">
  31. <img src="../../assets/congnitiveAblitity/ability4.png" alt="">
  32. <p style="color: rgb(87, 172, 187)">(七)前瞻记忆</p>
  33. </div>
  34. </div>
  35. <go-back />
  36. </div>
  37. </template>
  38. <script>
  39. import GoBack from "@/components/goBack/index.vue";
  40. export default {
  41. name: "comprehensiveMemoryAbilityEnter",
  42. components: {GoBack},
  43. data() {
  44. return {
  45. subjectInfo: "",
  46. userId: "",
  47. taskId: "",
  48. webSocket: "",
  49. wholeProcess: "1", //0-流程测试1-分项测试是否进行全流程测试
  50. wholeProcessNo: null, //全流程延时记忆关卡
  51. phone: '',
  52. };
  53. },
  54. watch: {
  55. },
  56. created() {
  57. this.init();
  58. },
  59. mounted() {
  60. this.open();
  61. },
  62. computed: {
  63. },
  64. methods: {
  65. init() {
  66. this.subjectInfo = JSON.parse(sessionStorage.getItem("subjectInfo"));
  67. this.userId = sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f");
  68. this.phone = sessionStorage.getItem("f7a42fe7211f98ac7a60a285ac3a9e87");
  69. this.taskId = this.$route.query.taskId;
  70. },
  71. goList(id) {
  72. switch (id) {
  73. case 0:
  74. this.$router.push("pointMemory");
  75. break;
  76. case 1:
  77. this.$router.push("lexicalAssociation");
  78. break;
  79. case 2:
  80. this.$router.push("imageFreeRecall");
  81. break;
  82. case 3:
  83. this.$router.push("imageAssociation");
  84. break;
  85. case 4:
  86. this.$router.push("peopleRecall");
  87. break;
  88. case 5:
  89. this.$router.push("visualSpatialMemory");
  90. break;
  91. case 6:
  92. this.$router.push("prospectRecall");
  93. break;
  94. }
  95. },
  96. check() {
  97. this.$confirm('检测到你有未完成延时记忆,请选择继续测试还是重新开始测试?', '提示', {
  98. confirmButtonText: '继续测试',
  99. cancelButtonText: '重新开始',
  100. type: 'warning',
  101. closeOnClickModal: false,
  102. distinguishCancelAndClose: true,
  103. }).then(() => {
  104. //继续测试
  105. if (this.wholeProcess == '0') {
  106. // switch (this.wholeProcessNo) {
  107. // case 8:
  108. // // this.$router.push("pointMemory");
  109. // this.$router.push({
  110. // path: 'pointMemory',
  111. // query: {
  112. // wholeProcess: true
  113. // }
  114. // });
  115. // break;
  116. // case 9:
  117. // // this.$router.push("lexicalAssociation");
  118. // this.$router.push({
  119. // path: 'lexicalAssociation',
  120. // query: {
  121. // wholeProcess: true
  122. // }
  123. // });
  124. // break;
  125. // case 10:
  126. // // this.$router.push("imageFreeRecall");
  127. // this.$router.push({
  128. // path: 'imageFreeRecall',
  129. // query: {
  130. // wholeProcess: true
  131. // }
  132. // });
  133. // break;
  134. // case 11:
  135. // // this.$router.push("imageAssociation");
  136. // this.$router.push({
  137. // path: 'imageAssociation',
  138. // query: {
  139. // wholeProcess: true
  140. // }
  141. // });
  142. // break;
  143. // case 12:
  144. // // this.$router.push("peopleRecall");
  145. // this.$router.push({
  146. // path: 'peopleRecall',
  147. // query: {
  148. // wholeProcess: true
  149. // }
  150. // });
  151. // break;
  152. // }
  153. //如果是全流程默认进入第一个页面会自动分配未完成延时测试页面
  154. this.$router.push({
  155. path: 'pointMemory',
  156. query: {
  157. wholeProcess: '0'
  158. }
  159. });
  160. }
  161. }).catch(action => {
  162. if (action === 'close') {
  163. this.$router.push({
  164. name: "CognitiveAbility",
  165. });
  166. } else {
  167. //重新开始
  168. this.Renew();
  169. }
  170. });
  171. },
  172. open() {
  173. this.$confirm('是否进行全流程测试?', '提示', {
  174. confirmButtonText: '全流程测试',
  175. cancelButtonText: '选择单个测试',
  176. type: 'warning',
  177. closeOnClickModal: false,
  178. distinguishCancelAndClose: true,
  179. beforeClose: (action, instance, done) => {
  180. if (action == "close") {
  181. this.$router.push({
  182. name: "CognitiveAbility",
  183. });
  184. done();
  185. } else {
  186. done()
  187. }
  188. }
  189. }).then(() => {
  190. //全流程
  191. this.wholeProcess = "0";
  192. // this.$router.push({
  193. // path: 'pointMemory',
  194. // query: {
  195. // wholeProcess: true
  196. // }
  197. // });
  198. //检测是否有延时测试
  199. this.checkProcess();
  200. }).catch(() => {
  201. //单个测试
  202. this.wholeProcess = "1";
  203. //检测是否有延时测试
  204. // this.checkProcess();
  205. });
  206. },
  207. checkProcess() {
  208. this.$http.post("memory/getIfUsable", {
  209. phone: this.phone,
  210. type: 'RTC_CHILD',
  211. testType: this.wholeProcess, //流程类型0-全流程,1-分项测试
  212. }, (msg) => {
  213. if (msg.msg == "需要先进行即时测试") {
  214. if (this.wholeProcess == '0') {
  215. this.$router.push({
  216. path: 'pointMemory',
  217. query: {
  218. wholeProcess: '0'
  219. }
  220. });
  221. }
  222. } else {
  223. this.wholeProcessNo = msg.data.length;
  224. //开启是否进行延时测试弹窗选择
  225. this.check();
  226. }
  227. });
  228. },
  229. Renew() {
  230. this.$http.post("memory/clearMemory", {
  231. phone: this.phone,
  232. // questionNo: '',
  233. type: 'RTC_CHILD',
  234. testType: this.wholeProcess, //流程类型0-全流程,1-分项测试
  235. }, (msg) => {
  236. if (msg.code == 200) {
  237. if (this.wholeProcess == '0') {
  238. this.$router.push({
  239. path: 'pointMemory',
  240. query: {
  241. wholeProcess: '0'
  242. }
  243. });
  244. }
  245. }
  246. });
  247. },
  248. },
  249. beforeDestroy() {
  250. },
  251. destroyed() {
  252. },
  253. }
  254. </script>
  255. <style scoped>
  256. .cma-first-line,
  257. .cma-second-line {
  258. display: flex;
  259. flex-direction: row;
  260. justify-content: space-around;
  261. align-items: center;
  262. }
  263. .cma-first-line {
  264. box-sizing: border-box;
  265. margin: 30px 0;
  266. }
  267. .cma-list-item {
  268. width: 180px;
  269. height: 221px;
  270. background: rgb(255, 255, 255);
  271. box-shadow: 0px 3px 6px rgb(87, 172, 187);
  272. border-radius: 4px;
  273. /*margin: 30px 38px;*/
  274. }
  275. .cma-list-item img {
  276. width: 100%;
  277. }
  278. .cma-list-item p {
  279. width: 180px;
  280. font-size: 18px;
  281. font-family: PingFang SC;
  282. font-weight: 500;
  283. line-height: 90px;
  284. color: #333333;
  285. text-align: center;
  286. /*margin-left: 9px;*/
  287. overflow: hidden;
  288. text-overflow: ellipsis;
  289. white-space: nowrap;
  290. }
  291. </style>