ECATAddiction.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889
  1. <template>
  2. <div>
  3. <van-nav-bar
  4. :title="subjectInfo.name"
  5. left-arrow
  6. left-text="返回"
  7. @click-left="goBack"
  8. />
  9. <div v-if="!testFlag" class="explan">
  10. <div>
  11. <p>{{ subjectInfo.mobileTestDescription }}</p>
  12. </div>
  13. <div class="btnArea">
  14. <van-button
  15. v-if="button0Show"
  16. block
  17. round
  18. type="primary"
  19. @click="startTest(1)"
  20. >开始测试
  21. </van-button>
  22. </div>
  23. </div>
  24. <!-- <div class="desc_wrap">-->
  25. <!-- <div-->
  26. <!-- style="-->
  27. <!-- width: 70%;-->
  28. <!-- height: 100%;-->
  29. <!-- background: rgb(248, 248, 248);-->
  30. <!-- opacity: 1;-->
  31. <!-- border-radius: 12px;-->
  32. <!-- margin: 0 auto;-->
  33. <!-- "-->
  34. <!-- >-->
  35. <!-- <div style="float: left; width: 50%; height: 100%; overflow-y: auto">-->
  36. <!-- <div id="left_top">-->
  37. <!-- <div>-->
  38. <!-- <div id="setting">-->
  39. <!-- <img src="../../assets/9551.png" alt="" />-->
  40. <!-- </div>-->
  41. <!-- <div id="text">-->
  42. <!-- <span>操作提示:</span>-->
  43. <!-- </div>-->
  44. <!-- <div-->
  45. <!-- class="voiceBg"-->
  46. <!-- :class="{ active: isActive }"-->
  47. <!-- @click="videoPlay"-->
  48. <!-- ></div>-->
  49. <!-- </div>-->
  50. <!-- </div>-->
  51. <!-- <audio-->
  52. <!-- id="video"-->
  53. <!-- ref="video"-->
  54. <!-- :src="require('../../assets/voice/description/description44.mp3')"-->
  55. <!-- ></audio>-->
  56. <!-- <div style="margin: 100px auto; width: 80%; text-align: justify;text-justify: distribute-all-lines;">-->
  57. <!-- <p>-->
  58. <!-- 请你注视眼前屏幕,注视点“+”过后,你将陆续看到一些词语,如果觉得这个词您很喜欢,按鼠标左键表示您【喜欢】,觉得这个词您不喜欢,按鼠标右键表示您【不喜欢】。-->
  59. <!-- </p>-->
  60. <!-- </div>-->
  61. <!-- </div>-->
  62. <!-- <div-->
  63. <!-- class="right_part"-->
  64. <!-- :style="{-->
  65. <!-- background: 'url(' + require('../../assets/page28.png') + ')',-->
  66. <!-- 'background-size': '100% 100%',-->
  67. <!-- }"-->
  68. <!-- >-->
  69. <!-- <div id="title">-->
  70. <!-- <span>情绪分类任务(ECAT)(成瘾版)</span>-->
  71. <!-- </div>-->
  72. <!-- <div style="position: absolute; bottom: 30px; right: 38%">-->
  73. <!-- <el-button class="start" @click="startTest(1)">开始测试</el-button>-->
  74. <!-- </div>-->
  75. <!-- </div>-->
  76. <!-- </div>-->
  77. <!-- </div>-->
  78. <div
  79. v-if="testFlag"
  80. :class="{ testMainDiv: !testState, activeTask: testState }"
  81. >
  82. <!-- <div style="width: 50%; margin-left: 10%; margin-top: 24px">-->
  83. <!-- <el-progress-->
  84. <!-- class="main_progress"-->
  85. <!-- :text-inside="true"-->
  86. <!-- :format="format"-->
  87. <!-- :stroke-width="48"-->
  88. <!-- :percentage="(currentIndex / 41) * 100"-->
  89. <!-- ></el-progress>-->
  90. <!-- </div>-->
  91. <div class="progress-content">
  92. <van-progress
  93. :percentage="(currentIndex / 41) * 100"
  94. color="#f2826a"
  95. pivot-text="任务进度"
  96. />
  97. </div>
  98. <p
  99. v-show="showlist"
  100. style="margin-top: 20%; font-size: 50px; color: black"
  101. >
  102. {{ wordlist[currentIndex].currentword }}
  103. </p>
  104. <!-- <p v-show="countDownShow" class="imgBox1">{{ countDownStr }}</p>-->
  105. <!-- <img-->
  106. <!-- v-show="showWhiteFlag"-->
  107. <!-- src="../../assets/congnitiveAblitity/whiteFlag-new.png"-->
  108. <!-- alt=""-->
  109. <!-- style="width: 50px; height: 50px; margin-top: 20%"-->
  110. <!-- />-->
  111. <p v-show="countDownShow" class="timingBox">{{ countDownStr }}</p>
  112. <div v-show="showWhiteFlag" class="look-point">
  113. <img alt="" src="../../assets/congnitiveAblitity/whiteFlag-new.png" />
  114. </div>
  115. <div v-show="flag" class="btn-content">
  116. <div class="btn-item">
  117. <van-button
  118. block
  119. round
  120. size="small"
  121. type="primary"
  122. @click="userClick('L')"
  123. >
  124. <van-icon name="arrow-left" />
  125. </van-button>
  126. </div>
  127. <div class="btn-item">
  128. <van-button
  129. block
  130. round
  131. size="small"
  132. type="primary"
  133. @click="userClick('R')"
  134. >
  135. <van-icon name="arrow" />
  136. </van-button>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </template>
  142. <script>
  143. // import cognitiveAbilityTaskList from "@/assets/data/cognitiveAbilityData.js";
  144. export default {
  145. name: "ECATAddiction",
  146. data() {
  147. return {
  148. userId: "",
  149. userTestResult: {},
  150. imgUrl: "",
  151. examImgUrl: "",
  152. taskId: "", // 认知任务id
  153. testFlag: false,
  154. testState: false,
  155. saveFlag: false, //结果保存按钮显示标志
  156. subjectInfo: "", //认知任务详情
  157. button0Show: false, // 控制按钮显示隐藏
  158. button1Show: true, // 控制按钮显示隐藏
  159. button2Show: false,
  160. testTypeCode: 0,
  161. countDownStr: "马上开始!",
  162. countDownShow: true,
  163. countDownTime: 6,
  164. showWhiteFlag: false,
  165. showlist: false, //控制文字显示
  166. // showbutton: false, //控制选择按钮显示
  167. timeOne: "",
  168. timeTwo: "",
  169. timeThree: "",
  170. timeFour: "",
  171. currentIndex: 0,
  172. amount: 0,
  173. negamount: 0,
  174. average: 0,
  175. negaverage: 0,
  176. flag: false,
  177. startMilliSeconds: 0, //反应时
  178. userResponseRecords: [], //记录喜欢反应
  179. // milliSecondsCount:0,
  180. wordlist: [
  181. {
  182. index: 1,
  183. currentword: "水杯",
  184. wordtype: "positive",
  185. userResponse: "",
  186. responseTime: 500
  187. },
  188. {
  189. index: 2,
  190. currentword: "鼠标",
  191. wordtype: "positive",
  192. userResponse: "",
  193. responseTime: 500
  194. },
  195. {
  196. index: 3,
  197. currentword: "瓜子",
  198. wordtype: "positive",
  199. userResponse: "",
  200. responseTime: 500
  201. },
  202. {
  203. index: 4,
  204. currentword: "苹果",
  205. wordtype: "positive",
  206. userResponse: "",
  207. responseTime: 500
  208. },
  209. {
  210. index: 5,
  211. currentword: "琵琶",
  212. wordtype: "positive",
  213. userResponse: "",
  214. responseTime: 500
  215. },
  216. {
  217. index: 6,
  218. currentword: "小溪",
  219. wordtype: "positive",
  220. userResponse: "",
  221. responseTime: 500
  222. },
  223. {
  224. index: 7,
  225. currentword: "墨汁",
  226. wordtype: "positive",
  227. userResponse: "",
  228. responseTime: 500
  229. },
  230. {
  231. index: 8,
  232. currentword: "钢笔",
  233. wordtype: "positive",
  234. userResponse: "",
  235. responseTime: 500
  236. },
  237. {
  238. index: 9,
  239. currentword: "布鞋",
  240. wordtype: "positive",
  241. userResponse: "",
  242. responseTime: 500
  243. },
  244. {
  245. index: 10,
  246. currentword: "纱窗",
  247. wordtype: "positive",
  248. userResponse: "",
  249. responseTime: 500
  250. },
  251. {
  252. index: 11,
  253. currentword: "剪纸",
  254. wordtype: "positive",
  255. userResponse: "",
  256. responseTime: 500
  257. },
  258. {
  259. index: 12,
  260. currentword: "拖把",
  261. wordtype: "positive",
  262. userResponse: "",
  263. responseTime: 500
  264. },
  265. {
  266. index: 13,
  267. currentword: "笔记本",
  268. wordtype: "positive",
  269. userResponse: "",
  270. responseTime: 500
  271. },
  272. {
  273. index: 14,
  274. currentword: "枸杞",
  275. wordtype: "positive",
  276. userResponse: "",
  277. responseTime: 500
  278. },
  279. {
  280. index: 15,
  281. currentword: "太阳",
  282. wordtype: "positive",
  283. userResponse: "",
  284. responseTime: 500
  285. },
  286. {
  287. index: 16,
  288. currentword: "衬衫",
  289. wordtype: "positive",
  290. userResponse: "",
  291. responseTime: 500
  292. },
  293. {
  294. index: 17,
  295. currentword: "枕头",
  296. wordtype: "positive",
  297. userResponse: "",
  298. responseTime: 500
  299. },
  300. {
  301. index: 18,
  302. currentword: "松树",
  303. wordtype: "positive",
  304. userResponse: "",
  305. responseTime: 500
  306. },
  307. {
  308. index: 19,
  309. currentword: "马蹄",
  310. wordtype: "positive",
  311. userResponse: "",
  312. responseTime: 500
  313. },
  314. {
  315. index: 20,
  316. currentword: "肥皂",
  317. wordtype: "positive",
  318. userResponse: "",
  319. responseTime: 500
  320. },
  321. {
  322. index: 21,
  323. currentword: "电灯",
  324. wordtype: "positive",
  325. userResponse: "",
  326. responseTime: 500
  327. },
  328. {
  329. index: 22,
  330. currentword: "冰毒",
  331. wordtype: "negative",
  332. userResponse: "",
  333. responseTime: 500
  334. },
  335. {
  336. index: 23,
  337. currentword: "冰",
  338. wordtype: "negative",
  339. userResponse: "",
  340. responseTime: 500
  341. },
  342. {
  343. index: 24,
  344. currentword: "溜冰",
  345. wordtype: "negative",
  346. userResponse: "",
  347. responseTime: 500
  348. },
  349. {
  350. index: 25,
  351. currentword: "毒品",
  352. wordtype: "negative",
  353. userResponse: "",
  354. responseTime: 500
  355. },
  356. {
  357. index: 26,
  358. currentword: "海洛因",
  359. wordtype: "negative",
  360. userResponse: "",
  361. responseTime: 500
  362. },
  363. {
  364. index: 27,
  365. currentword: "可卡因",
  366. wordtype: "negative",
  367. userResponse: "",
  368. responseTime: 500
  369. },
  370. {
  371. index: 28,
  372. currentword: "新型毒品",
  373. wordtype: "negative",
  374. userResponse: "",
  375. responseTime: 500
  376. },
  377. {
  378. index: 29,
  379. currentword: "摇头丸",
  380. wordtype: "negative",
  381. userResponse: "",
  382. responseTime: 500
  383. },
  384. {
  385. index: 30,
  386. currentword: "快乐丸",
  387. wordtype: "negative",
  388. userResponse: "",
  389. responseTime: 500
  390. },
  391. {
  392. index: 31,
  393. currentword: "钻石",
  394. wordtype: "negative",
  395. userResponse: "",
  396. responseTime: 500
  397. },
  398. {
  399. index: 32,
  400. currentword: "开心果",
  401. wordtype: "negative",
  402. userResponse: "",
  403. responseTime: 500
  404. },
  405. {
  406. index: 33,
  407. currentword: "大麻",
  408. wordtype: "negative",
  409. userResponse: "",
  410. responseTime: 500
  411. },
  412. {
  413. index: 34,
  414. currentword: "白粉",
  415. wordtype: "negative",
  416. userResponse: "",
  417. responseTime: 500
  418. },
  419. {
  420. index: 35,
  421. currentword: "杜冷丁",
  422. wordtype: "negative",
  423. userResponse: "",
  424. responseTime: 500
  425. },
  426. {
  427. index: 36,
  428. currentword: "十字架",
  429. wordtype: "negative",
  430. userResponse: "",
  431. responseTime: 500
  432. },
  433. {
  434. index: 37,
  435. currentword: "吗啡",
  436. wordtype: "negative",
  437. userResponse: "",
  438. responseTime: 500
  439. },
  440. {
  441. index: 38,
  442. currentword: "氯胺酮",
  443. wordtype: "negative",
  444. userResponse: "",
  445. responseTime: 500
  446. },
  447. {
  448. index: 39,
  449. currentword: "K粉",
  450. wordtype: "negative",
  451. userResponse: "",
  452. responseTime: 500
  453. },
  454. {
  455. index: 40,
  456. currentword: "甲基苯丙胺",
  457. wordtype: "negative",
  458. userResponse: "",
  459. responseTime: 500
  460. },
  461. {
  462. index: 41,
  463. currentword: "冷东西",
  464. wordtype: "negative",
  465. userResponse: "",
  466. responseTime: 500
  467. },
  468. {
  469. index: 42,
  470. currentword: "笑气",
  471. wordtype: "negative",
  472. userResponse: "",
  473. responseTime: 500
  474. }
  475. ], //词语列表
  476. isActive: false, //音频播放按钮
  477. testPlanId: ""
  478. };
  479. },
  480. created() {
  481. // this.taskId = this.$route.query.taskId;
  482. // this.testPlanId = this.$route.query.testPlanId;
  483. // this.init(this.taskId);
  484. this.testPlanId = this.$route.query.testPlanId || "";
  485. this.userId = JSON.parse(sessionStorage.getItem("userInfo")).id;
  486. this.subjectInfo = JSON.parse(sessionStorage.getItem("subjectInfo"));
  487. this.userTestPicListCreate();
  488. },
  489. mounted() {
  490. //进入页面即开始测试任务
  491. // this.startTest(1)
  492. },
  493. destroyed() {
  494. // 清除定时器
  495. clearTimeout(this.timeOne);
  496. clearTimeout(this.timeTwo);
  497. clearTimeout(this.timeThree);
  498. clearTimeout(this.timeFour);
  499. },
  500. methods: {
  501. format(percentage) {
  502. return percentage === 100 ? "任务已完成" : "任务进度";
  503. },
  504. countDown() {
  505. // 测试时间倒计时
  506. this.myInterval = setInterval(() => {
  507. this.countDownTime--;
  508. this.countDownStr = this.countDownTime;
  509. if (this.countDownTime == 0) {
  510. this.countDownShow = false;
  511. //计算测试结果
  512. this.showTargetNow();
  513. // 清除定时器
  514. clearInterval(this.myInterval);
  515. this.countDownTime = 5;
  516. }
  517. }, 1000);
  518. },
  519. // screen() {
  520. // screenfull.toggle();
  521. // },
  522. // exitFullscreen() {
  523. // if (document.exitFullscreen) {
  524. // document.exitFullscreen();
  525. // } else if (document.msExitFullscreen) {
  526. // document.msExitFullscreen();
  527. // } else if (document.mozCancelFullScreen) {
  528. // document.mozCancelFullScreen();
  529. // } else if (document.webkitExitFullscreen) {
  530. // document.webkitExitFullscreen();
  531. // }
  532. // },
  533. // init(taskId) {
  534. // console.log(taskId);
  535. // console.log(cognitiveAbilityTaskList);
  536. // this.subjectInfo = JSON.parse(oSessionStorage.getItem("subjectInfo"));
  537. // console.log(this.subjectInfo);
  538. // },
  539. userClick(clickFlag) {
  540. if (!this.flag) {
  541. return;
  542. }
  543. if (clickFlag === "L") {
  544. this.showlist = false;
  545. this.showWhiteFlag = true;
  546. let milliSecondsCount = new Date().getTime() - this.startMilliSeconds;
  547. console.log(milliSecondsCount);
  548. //记录用户喜欢反应
  549. // 积极词同意统计
  550. if (this.wordlist[this.currentIndex].index <= 20) {
  551. (this.amount = ++this.amount), //积极词同意个数
  552. this.userResponseRecords.push({
  553. index: this.wordlist[this.currentIndex].index,
  554. // currentword:this.wordlist[this.currentIndex].currentword,
  555. wordtype: this.wordlist[this.currentIndex].wordtype,
  556. responseTime: milliSecondsCount,
  557. userSelectWordType: "1" //用户选择的情绪类型 1(积极),0(消极)
  558. });
  559. }
  560. // 消极词同意统计
  561. else if (this.wordlist[this.currentIndex].index > 20) {
  562. (this.negamount = ++this.negamount), //消极词同意个数
  563. this.userResponseRecords.push({
  564. index: this.wordlist[this.currentIndex].index,
  565. // currentword:this.wordlist[this.currentIndex].currentword,
  566. wordtype: this.wordlist[this.currentIndex].wordtype,
  567. responseTime: milliSecondsCount,
  568. userSelectWordType: "1" //用户选择的情绪类型 1(积极),0(消极)
  569. });
  570. }
  571. } else if (clickFlag === "R") {
  572. this.showlist = false;
  573. this.showWhiteFlag = true;
  574. let negSecondsCount = new Date().getTime() - this.startMilliSeconds;
  575. // 积极词不同意统计
  576. if (this.wordlist[this.currentIndex].index <= 20) {
  577. this.userResponseRecords.push({
  578. index: this.wordlist[this.currentIndex].index,
  579. // currentword:this.wordlist[this.currentIndex].currentword,
  580. wordtype: this.wordlist[this.currentIndex].wordtype,
  581. responseTime: negSecondsCount,
  582. userSelectWordType: "0" //用户选择的情绪类型 1(积极),0(消极)
  583. });
  584. }
  585. // 消极词不同意统计
  586. else if (this.wordlist[this.currentIndex].index > 20) {
  587. this.userResponseRecords.push({
  588. index: this.wordlist[this.currentIndex].index,
  589. wordtype: this.wordlist[this.currentIndex].wordtype,
  590. responseTime: negSecondsCount,
  591. userSelectWordType: "0" //用户选择的情绪类型 1(积极),0(消极)
  592. });
  593. }
  594. }
  595. this.flag = false;
  596. },
  597. startTest(testType) {
  598. // if (
  599. // sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f") == "" ||
  600. // sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f") == null
  601. // ) {
  602. // this.$message.error("请先登录!");
  603. // return;
  604. // }
  605. if (!sessionStorage.getItem("userInfo")) {
  606. this.$toast("请先登录!");
  607. this.$router.push("/login");
  608. return;
  609. }
  610. if (testType == 0) {
  611. this.testTypeCode = 0;
  612. } else {
  613. this.testTypeCode = 1;
  614. }
  615. // this.userId = sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f");
  616. if (this.testTypeCode == 1) {
  617. this.screen();
  618. this.userTestPicList = [];
  619. this.testFlag = true;
  620. this.testState = true;
  621. this.countDown();
  622. }
  623. },
  624. // 时间定时器
  625. showTargetNow() {
  626. // var time = 4000;
  627. var time = 1500;
  628. this.showWhiteFlag = true;
  629. this.flag = false;
  630. this.showlist = false;
  631. this.timeTwo = setTimeout(() => {
  632. this.showWhiteFlag = false;
  633. this.showlist = true;
  634. this.flag = true;
  635. this.startMilliSeconds = new Date().getTime();
  636. this.timeThree = setTimeout(() => {
  637. this.showlist = false;
  638. }, 1000);
  639. }, 500);
  640. this.timeOne = setInterval(() => {
  641. this.showWhiteFlag = true;
  642. this.showlist = false;
  643. this.flag = false;
  644. // this.showbutton = false;
  645. this.timeTwo = setTimeout(() => {
  646. this.flag = true;
  647. this.showWhiteFlag = false;
  648. this.showlist = true;
  649. this.startMilliSeconds = new Date().getTime();
  650. this.timeThree = setTimeout(() => {
  651. this.showlist = false;
  652. // this.showbutton = true;
  653. }, 1000);
  654. }, 500);
  655. if (this.currentIndex == 42) {
  656. this.testEnd();
  657. } else {
  658. this.currentIndex++;
  659. }
  660. }, time);
  661. },
  662. // 打乱数组顺序
  663. userTestPicListCreate() {
  664. for (var i = this.wordlist.length - 1; i >= 0; i--) {
  665. var randomIndex = Math.floor(Math.random() * (i + 1));
  666. var itemAtIndex = this.wordlist[randomIndex];
  667. this.wordlist[randomIndex] = this.wordlist[i];
  668. this.wordlist[i] = itemAtIndex;
  669. }
  670. },
  671. meanresponseTime() {
  672. var sum = 0,
  673. index = 0,
  674. negsum = 0,
  675. oppcount = 0,
  676. negcount = 0;
  677. for (var i = 0; i < this.userResponseRecords.length; i++) {
  678. if (this.userResponseRecords[index].index <= 20) {
  679. sum += this.userResponseRecords[index].responseTime;
  680. index++;
  681. oppcount++;
  682. } else if (this.userResponseRecords[index].index > 20) {
  683. negsum += this.userResponseRecords[index].responseTime;
  684. index++;
  685. negcount++;
  686. }
  687. }
  688. this.average = sum / index; // 计算积极词语平均反应时
  689. this.negaverage = negsum / negcount; // 计算消极词语平均反应时
  690. },
  691. testEnd() {
  692. clearInterval(this.timeOne);
  693. clearInterval(this.timeTwo);
  694. this.showWhiteFlag = false;
  695. this.testFlag = false;
  696. this.testState = false;
  697. this.button1Show = false;
  698. this.meanresponseTime();
  699. let result = {
  700. data: this.userResponseRecords,
  701. result: {
  702. posNum: this.amount + "个", //积极个数
  703. negNum: this.negamount + "个", //消极个数
  704. posAverageTime: this.average.toFixed(2) + "ms", //积极平均反应时
  705. negAverageTime: this.negaverage.toFixed(2) + "ms" //消极平均反应时
  706. }
  707. };
  708. this.$store.dispatch("setVocabularyClassify", result);
  709. this.$alert(
  710. "词汇分类任务结束,接下来进行词汇回忆测试,请按确定按钮继续。",
  711. "提示",
  712. {
  713. confirmButtonText: "确定",
  714. showClose: false,
  715. callback: action => {
  716. this.$router.push(
  717. `/welcome/CognitiveAbilityTask/ERECAddiction?testPlanId=${this.testPlanId}`
  718. );
  719. }
  720. }
  721. );
  722. // this.$message({
  723. // message: "测试结束!",
  724. // type: "success",
  725. // });
  726. this.$toast.success("试结束!");
  727. },
  728. videoPlay() {
  729. let video = document.getElementById("video");
  730. if (this.isActive == false) {
  731. this.isActive = true;
  732. video.loop = false;
  733. video.addEventListener("ended", () => {
  734. this.isActive = false;
  735. });
  736. video.play();
  737. } else {
  738. this.isActive = false;
  739. video.pause();
  740. }
  741. }
  742. }
  743. };
  744. </script>
  745. <style scoped>
  746. .explan {
  747. box-sizing: border-box;
  748. padding: 15px 15px 0;
  749. }
  750. .explan h1 {
  751. font-size: 16px;
  752. color: #222222;
  753. text-align: center;
  754. }
  755. .explan p {
  756. font-size: 14px;
  757. color: #666666;
  758. line-height: 26px;
  759. text-indent: 15px;
  760. margin-bottom: 20px;
  761. }
  762. .testMainDiv {
  763. margin: 0 auto;
  764. margin-top: 10px;
  765. background: gray;
  766. background-size: cover;
  767. width: 500px;
  768. height: 300px;
  769. }
  770. .activeTask {
  771. background: url("../../assets/congnitiveAblitity/rememberAbilityTask.png")
  772. no-repeat center;
  773. background-size: cover;
  774. position: fixed;
  775. top: 0;
  776. left: 0;
  777. right: 0;
  778. bottom: 0;
  779. }
  780. .scaleButton {
  781. margin-top: 20px;
  782. margin-bottom: 20px;
  783. background-size: cover;
  784. background: rgb(87, 172, 187);
  785. border: 2px solid rgb(255, 255, 255);
  786. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  787. opacity: 1;
  788. border-radius: 39px;
  789. color: #ffffff;
  790. }
  791. /*.voiceBg {*/
  792. /* width: 40px;*/
  793. /* height: 40px;*/
  794. /* background: url(../../assets/voice.png);*/
  795. /* background-size: cover;*/
  796. /* float: left;*/
  797. /* margin-left: 60px;*/
  798. /* cursor: pointer;*/
  799. /*}*/
  800. /*.voiceBg.active {*/
  801. /* width: 40px;*/
  802. /* height: 40px;*/
  803. /* background: url(../../assets/voice.gif);*/
  804. /* background-size: cover;*/
  805. /*}*/
  806. .progress-content {
  807. position: absolute;
  808. width: 100%;
  809. height: 20px;
  810. left: 0;
  811. top: 60px;
  812. box-sizing: border-box;
  813. padding: 4px 10px;
  814. }
  815. .look-point {
  816. position: absolute;
  817. width: 100%;
  818. top: 50%;
  819. left: 50%;
  820. transform: translate(-50%, -50%);
  821. z-index: 10;
  822. text-align: center;
  823. }
  824. .look-point img {
  825. width: 50px;
  826. height: 50px;
  827. }
  828. .timingBox {
  829. position: absolute;
  830. top: 50%;
  831. left: 50%;
  832. transform: translate(-50%, -50%);
  833. color: black;
  834. font-size: 18px;
  835. text-align: center;
  836. line-height: 50px;
  837. margin: 0 auto;
  838. z-index: 10;
  839. }
  840. .btn-content {
  841. position: absolute;
  842. width: 100%;
  843. left: 50%;
  844. bottom: 10%;
  845. transform: translate(-50%, 0);
  846. text-align: center;
  847. z-index: 10;
  848. display: flex;
  849. flex-direction: row;
  850. justify-content: space-around;
  851. align-items: center;
  852. box-sizing: border-box;
  853. padding: 0 5px;
  854. }
  855. .btn-content .btn-item {
  856. width: 30%;
  857. display: flex;
  858. flex-direction: column;
  859. justify-content: space-around;
  860. }
  861. .btn-content .btn-item /deep/ .van-button {
  862. margin: 35px 0;
  863. }
  864. </style>