EmotionalAbility.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  1. <template>
  2. <div>
  3. <div class="desc_wrap" v-if="testFlag">
  4. <div style="
  5. width: 70%;
  6. height: 100%;
  7. background: rgb(248, 248, 248);
  8. opacity: 1;
  9. border-radius: 12px;
  10. margin: 0 auto;
  11. ">
  12. <div class="left_part">
  13. <div id="left_top">
  14. <div>
  15. <div id="setting">
  16. <img src="../../assets/9551.png" alt="" />
  17. </div>
  18. <div id="text">
  19. <span>操作提示:</span>
  20. </div>
  21. </div>
  22. </div>
  23. <div style="margin: 100px auto; width: 80%; text-align: justify;text-justify: distribute-all-lines;">
  24. <p v-show="testTypeCode == 0" v-html="subjectInfo.testDescription"></p>
  25. <p v-show="testTypeCode == 1">
  26. “欢迎来到测试阶段!
  27. <br><br>
  28. 在测试阶段将没有答案提示,请你选择正确的情绪类别。此阶段共测试35张图片,当您的正确率达到80%以上,即可进入正式评价阶段。”
  29. </p>
  30. <p v-show="testTypeCode == 2">
  31. “欢迎来到正式测试阶段!<br><br>
  32. 正式测试过程中,需要对出现的表情图片进行吸引力、愉悦度、唤醒度,优势度的评价。评价方式采用九点评分的方式。<br><br>
  33. 吸引力:面孔吸引力,即面孔的美感,对她/他的喜欢程度以及你预期和她/他交流的愉快程度。<br><br>
  34. 吸引力越大,评分越接近9;吸引力越小,评分越接近 0 。<br><br>
  35. 愉悦度:愉快或不愉快的情绪体验(非常积极、愉快--非常消极、忧伤)。<br><br>
  36. 愉悦度越高,评分越接近9,愉悦度越低,评分越接近 0 ;<br><br>
  37. 唤醒度:情绪引起内心的激动程度或者情绪引起身体的激动反应(非常激动--非常平静)。<br><br>
  38. 唤醒度越高,评分越接近9,唤醒度越低,评分越接近0;<br><br>
  39. 优势度:优势度衡量的是“受控——支配”的程度(最受控制、弱小--最可支配、强大有力)。低优势度代表感到完全受控制、影响,是弱小顺从、被引导、受约束、受操纵、屈服的、处于劣势;高优势度表示自己处于支配地位、感到自信、强大、有力量,具有充分的支配权和控制度、完全能制约、操纵、有影响力的、居优势地位的。<br><br>
  40. 优势度越高,评分越接近9,优势度越低,评分越接近0<br><br>
  41. (后面的测试页面可随时查看各个维度的定义)。”
  42. </p>
  43. <!-- <p>{{subjectInfo.description}}</p> -->
  44. </div>
  45. </div>
  46. <div class="right_part" :style="{
  47. background:
  48. 'url(' + require('../../assets/page' + taskId + '.png') + ')',
  49. 'background-size': '100% 100%',
  50. }">
  51. <div id="title">
  52. <span>{{ subjectInfo.name }}</span>
  53. </div>
  54. <div style="position: absolute; bottom: 30px; right: 40%">
  55. <el-button v-if="buttonShow" class="start" @click="startTest()">{{
  56. buttonName
  57. }}</el-button>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <div v-if="!testFlag" class="activeTask">
  63. <img @click="screen()" src="../../assets/small-big.png" alt="" style="
  64. height: 48px;
  65. width: 48px;
  66. position: fixed;
  67. top: 24px;
  68. right: 22px;
  69. cursor: pointer;
  70. " />
  71. <div style="width: 50%; margin-left: 10%; margin-top: 24px; z-index: 10">
  72. <el-progress class="main_progress" :text-inside="true" :format="format" :stroke-width="24"
  73. :percentage="((cumulation + 1) / testList.length) * 100"></el-progress>
  74. </div>
  75. <p v-if="timingShow" class="timingBox">{{ countDownStr }}</p>
  76. <div class="shape_glass">
  77. <img v-show="!crossShow" class="active-img addImg" :src="testList[cumulation].imgUrl" alt="" />
  78. </div>
  79. <div class="btn-content" v-if="!crossShow">
  80. <el-button v-if="testTypeCode == 2" class="butt" @click="prevHandle" :disabled="isLoading">
  81. 上一题
  82. </el-button>
  83. <el-button v-for="item in testList[cumulation].buttonList" :key="item.val" class="butt" :class="{
  84. active: item.val == testList[cumulation].emoType && showGuider,
  85. choose: item.val == testList[cumulation].userResponse,
  86. }" @click="userClick(item.val)">
  87. {{ item.name }}
  88. </el-button>
  89. <el-button v-if="testTypeCode == 2" class="butt" @click="nextHandle" :disabled="isLoading">
  90. 下一题
  91. </el-button>
  92. </div>
  93. <div v-if="testTypeCode == 2 && !crossShow" class="block">
  94. <div class="slider">
  95. <el-tooltip placement="top">
  96. <div slot="content">
  97. 面孔吸引力,即面孔的美感,对她/他的喜欢程度以及你预期和她/他交流的愉快程度。<br />吸引力越大,进度条越靠近右侧,越接近
  98. 9;吸引力越小,进度条越靠近左侧,评分越接近 0 。
  99. </div>
  100. <i class="el-icon-info"></i>
  101. </el-tooltip>
  102. <span>吸引度</span>
  103. <el-rate v-model="testList[cumulation].xiyin" :max="9" void-color="#999999" show-score text-color="#ff9900"
  104. score-template="评分{value}">
  105. </el-rate>
  106. </div>
  107. <div class="slider">
  108. <el-tooltip placement="top">
  109. <div slot="content">
  110. 愉快或不愉快的情绪体验(非常积极、愉快--非常消极、忧伤)。<br />愉悦度越高,评分越接近
  111. 9,愉悦度越低,评分越接近 0 分;
  112. </div>
  113. <i class="el-icon-info"></i>
  114. </el-tooltip>
  115. <span>愉悦度</span>
  116. <el-rate v-model="testList[cumulation].yuyue" :max="9" void-color="#999999" show-score text-color="#ff9900"
  117. score-template="评分{value}">
  118. </el-rate>
  119. </div>
  120. <div class="slider">
  121. <el-tooltip placement="top">
  122. <div slot="content">
  123. 情绪的生理唤醒程度。情绪引起内心的的激动程度或者情绪引起身体的激动反应(非常激动--非常平静)。<br />唤醒度越高,评分越接近
  124. 9,唤醒度越低,评分越接近0;
  125. </div>
  126. <i class="el-icon-info"></i>
  127. </el-tooltip>
  128. <span>唤醒度</span>
  129. <el-rate v-model="testList[cumulation].huanxing" :max="9" void-color="#999999" show-score text-color="#ff9900"
  130. score-template="评分{value}">
  131. </el-rate>
  132. </div>
  133. <div class="slider">
  134. <el-tooltip placement="top">
  135. <div slot="content">
  136. 优势度衡量的是“受控——支配”的程度(最受控制、弱小到最可支配、强大有力)。<br />低优势度代表感到完全受控制、影响,是弱小顺从、被引导、受约束、受操纵、屈服的、处于劣势;<br />高优势度表示自己处于支配地位、感到自信、强大、有力量,具有充分的支配权和控制度、完全能制约、操纵、有影响力的、居优势地位的。<br />优势度越高,评分越接近
  137. 9,优势度越低,评分越接近0。
  138. </div>
  139. <i class="el-icon-info"></i>
  140. </el-tooltip>
  141. <span>优势度</span>
  142. <el-rate v-model="testList[cumulation].youshi" :max="9" void-color="#999999" show-score text-color="#ff9900"
  143. score-template="评分{value}">
  144. </el-rate>
  145. </div>
  146. </div>
  147. <div class="guider" v-show="showGuider && testTypeCode == 0">
  148. <div class="txt">
  149. <p class="explain">
  150. 观察图片中人物的面部表情,下方闪烁的选项是正确的情绪类型。请学习这种对应关系,点击下方按钮,选择正确的情绪类型
  151. </p>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. </template>
  157. <script>
  158. import { oSessionStorage, preloader, preloader2 } from "@/utils/utils";
  159. import screenfull from "screenfull";
  160. import peoples from "../../assets/data/EmotionalAbility";
  161. export default {
  162. name: "ETBexperiment_new",
  163. data() {
  164. return {
  165. marks: {
  166. 0: "0",
  167. 1: "1",
  168. 2: "2",
  169. 3: "3",
  170. 4: "4",
  171. 5: "5",
  172. 6: "6",
  173. 7: "7",
  174. 8: "8",
  175. 9: "9",
  176. 10: "10",
  177. },
  178. buttonShowTime: 2000, //按钮出现的时间
  179. cycles: 71, //循环的次数
  180. showGuider: false, //显示灰色背景当作引导
  181. testFlag: true, //显示提示页面与测试页面控制开关
  182. timingShow: true, //倒计时5秒提示开始
  183. timingFlag: null, // 倒计时名称
  184. countDown: 5, //倒计时5秒
  185. countDownStr: "学习阶段",
  186. crossShow: true, //显示注视点
  187. expressionShow: false, //显示表情图片
  188. buttonShow: true, //显示选择按钮
  189. buttonName: "学习阶段",
  190. timingOne: null,
  191. timingTwo: null,
  192. timingThree: null,
  193. flag: null, //反应时间计时器名
  194. cumulation: 0, //累加器
  195. examImgUrl: "", //展示图片
  196. randomArr: [], //从十个人中随机获取3个人
  197. emoList: {
  198. happy: { name: "开心", val: "happy" },
  199. fear: { name: "害怕", val: "fear" },
  200. angry: { name: "生气", val: "angry" },
  201. disgust: { name: "厌恶", val: "disgust" },
  202. sad: { name: "悲伤", val: "sad" },
  203. surprise: { name: "惊讶", val: "surprise" },
  204. neutral: { name: "中性", val: "neutral" },
  205. },
  206. testList: [], // 当前测试列表
  207. practiceList: [], // 练习测试列表
  208. normalList: [], // 正式测试列表
  209. studyList: [],
  210. testTypeCode: 0,
  211. phone: "",
  212. timer2: null,
  213. isLoading: false,
  214. threeMinStr: "",
  215. };
  216. },
  217. // 页面初始化函数
  218. created() {
  219. this.subjectInfo = JSON.parse(oSessionStorage.getItem("subjectInfo"));
  220. this.userId = sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f");
  221. this.taskId = this.$route.query.taskId;
  222. this.phone = sessionStorage.getItem("f7a42fe7211f98ac7a60a285ac3a9e87");
  223. },
  224. mounted() {
  225. this.buttonShowTime = 20000000;
  226. },
  227. methods: {
  228. screen() {
  229. screenfull.toggle();
  230. },
  231. startTiming() {
  232. if (
  233. sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f") == "" ||
  234. sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f") == null
  235. ) {
  236. this.$message.error("请先登录!");
  237. return;
  238. }
  239. //关闭提示内容窗口
  240. this.testFlag = false;
  241. this.timingShow = true;
  242. this.crossShow = true;
  243. this.timingFlag = window.setInterval(() => {
  244. if (this.countDown == 0) {
  245. clearInterval(this.timingFlag);
  246. this.countDownStr = "开始";
  247. setTimeout(() => {
  248. //关闭倒计时提示页面
  249. this.timingShow = false;
  250. this.crossShow = false;
  251. this.countDown = 5;
  252. if (this.testTypeCode == 0) {
  253. this.showGuider = true;
  254. }
  255. }, 1000);
  256. } else {
  257. this.countDownStr = this.countDown;
  258. this.countDown--;
  259. }
  260. }, 1000);
  261. },
  262. format(percentage) {
  263. return `${this.cumulation + 1}/${this.testList.length}`;
  264. },
  265. shuffle(arr) {
  266. for (let i = 1; i < arr.length; i++) {
  267. const random = Math.floor(Math.random() * (i + 1));
  268. [arr[i], arr[random]] = [arr[random], arr[i]];
  269. }
  270. return arr;
  271. },
  272. // 生成学习列表
  273. async createStudyList() {
  274. this.studyList = [];
  275. let emoList = this.shuffle([
  276. "happy",
  277. "fear",
  278. "angry",
  279. "disgust",
  280. "sad",
  281. "surprise",
  282. "neutral",
  283. ]);
  284. for (let i = 0; i < emoList.length; i++) {
  285. let w = 61 + i;
  286. let m = 71 + i;
  287. let imgList1 = peoples[w][emoList[i]];
  288. let imgList2 = peoples[m][emoList[i]];
  289. // 添加一个女性
  290. this.studyList.push({
  291. name: `${w}-${emoList[i]}-${imgList1[imgList1.length - 1]}`, // 图片名称
  292. imgUrl: require(`../../assets/congnitiveAblitity/EmotionalAbility/${w}/${emoList[i]
  293. }/${imgList1[imgList1.length - 1]}.png`), // 图片url
  294. emoType: `${emoList[i]}`, // 情绪类型
  295. userResponse: "", // 用户反映类型
  296. correct: false, // 是否正确
  297. xiyin: 0, // 吸引力
  298. yuyue: 0, // 愉悦度
  299. huanxing: 0, // 唤醒度
  300. youshi: 0, // 优势度
  301. buttonList: this.createAnwserList(emoList[i], i),
  302. });
  303. // 添加一个男性
  304. this.studyList.push({
  305. name: `${m}-${emoList[i]}-${imgList2[imgList2.length - 1]}`, // 图片名称
  306. imgUrl: require(`../../assets/congnitiveAblitity/EmotionalAbility/${m}/${emoList[i]
  307. }/${imgList2[imgList2.length - 1]}.png`), // 图片url
  308. emoType: `${emoList[i]}`, // 情绪类型
  309. userResponse: "", // 用户反映类型
  310. correct: false, // 是否正确
  311. xiyin: 0, // 吸引力
  312. yuyue: 0, // 愉悦度
  313. huanxing: 0, // 唤醒度
  314. youshi: 0, // 优势度
  315. buttonList: this.createAnwserList(emoList[i], i),
  316. });
  317. }
  318. this.studyList = this.shuffle(this.studyList);
  319. },
  320. // 生成测试列表
  321. async createPriticeList() {
  322. this.practiceList = [];
  323. let roleList = [61, 62, 62, 34, 65, 66, 67, 71, 72, 72, 74, 75, 76, 77];
  324. let tempList = [];
  325. while (tempList.length < 5) {
  326. let index = Math.floor(Math.random() * 14);
  327. if (!tempList.includes(roleList[index])) {
  328. tempList.push(roleList[index]);
  329. }
  330. }
  331. let emoList = this.shuffle([
  332. "happy",
  333. "fear",
  334. "angry",
  335. "disgust",
  336. "sad",
  337. "surprise",
  338. "neutral",
  339. ]);
  340. for (let item of tempList) {
  341. for (let j = 0; j < emoList.length; j++) {
  342. let imgList1 = peoples[item][emoList[j]];
  343. this.practiceList.push({
  344. name: `${item}-${emoList[j]}-${imgList1[imgList1.length - 1]}`, // 图片名称
  345. imgUrl: require(`../../assets/congnitiveAblitity/EmotionalAbility/${item}/${emoList[j]
  346. }/${imgList1[imgList1.length - 1]}.png`), // 图片url
  347. emoType: `${emoList[j]}`, // 情绪类型
  348. userResponse: "", // 用户反映类型
  349. correct: false, // 是否正确
  350. xiyin: 0, // 吸引力
  351. yuyue: 0, // 愉悦度
  352. huanxing: 0, // 唤醒度
  353. youshi: 0, // 优势度
  354. buttonList: this.createAnwserList(emoList[j]),
  355. });
  356. }
  357. }
  358. this.practiceList = this.shuffle(this.practiceList);
  359. },
  360. // 生成正式测试列表
  361. async createNormalList() {
  362. this.normalList = [];
  363. let emoList = [
  364. "happy",
  365. "fear",
  366. "angry",
  367. "disgust",
  368. "sad",
  369. "surprise",
  370. "neutral",
  371. ];
  372. for (let i = 0; i < 50; i++) {
  373. for (const item of emoList) {
  374. let m = Math.floor(Math.random() * 5);
  375. let imgList = peoples[i][item];
  376. this.normalList.push({
  377. name: `${i}-${item}-${imgList[m]}`, // 图片名称
  378. imgUrl: require(`../../assets/congnitiveAblitity/EmotionalAbility/${i}/${item}/${imgList[m]}.png`), // 图片url
  379. emoType: `${item}`, // 情绪类型
  380. userResponse: "", // 用户反映类型
  381. correct: false, // 是否正确
  382. xiyin: 0, // 吸引力
  383. yuyue: 0, // 愉悦度
  384. huanxing: 0, // 唤醒度
  385. youshi: 0, // 优势度
  386. buttonList: this.createAnwserList(item),
  387. });
  388. }
  389. }
  390. this.normalList = this.shuffle(this.normalList);
  391. },
  392. // 随机生成答案
  393. createAnwserList(item, index) {
  394. let arr = [
  395. "happy",
  396. "fear",
  397. "angry",
  398. "disgust",
  399. "sad",
  400. "surprise",
  401. "neutral",
  402. ];
  403. let i = arr.indexOf(item);
  404. arr.splice(i, 1);
  405. let j = Math.floor(Math.random() * 6);
  406. let temp = arr[j];
  407. let btnList = [];
  408. if (this.testTypeCode == 0 && index < 14) {
  409. btnList = [this.emoList[item]];
  410. } else {
  411. btnList = this.shuffle([this.emoList[temp], this.emoList[item]]);
  412. }
  413. return btnList;
  414. },
  415. userClick(param) {
  416. this.testList[this.cumulation].userResponse = param; //用户选择的情绪类型
  417. this.testList[this.cumulation].correct = param == this.testList[this.cumulation].emoType ? true : false;
  418. if (this.testTypeCode != 2) {
  419. this.nextHandle();
  420. }
  421. },
  422. // 上一题
  423. prevHandle() {
  424. if (this.cumulation > 0) {
  425. this.cumulation--;
  426. }
  427. },
  428. // 下一题
  429. nextHandle() {
  430. if (this.cumulation < this.testList.length - 1) {
  431. if (!this.testList[this.cumulation].userResponse) {
  432. this.$message.warning("请选择对应的情绪!");
  433. } else if (
  434. this.testTypeCode === 2 &&
  435. (this.testList[this.cumulation].xiyin == 0 ||
  436. this.testList[this.cumulation].yuyue == 0 ||
  437. this.testList[this.cumulation].huanxing == 0 ||
  438. this.testList[this.cumulation].youshi == 0)
  439. ) {
  440. this.$message.warning("请选择对应的评分!");
  441. } else {
  442. this.cumulation++;
  443. if (this.cumulation % 50 == 0 && this.cumulation < 349) {
  444. this.timingShow = true;
  445. this.crossShow = true;
  446. this.threeMinDown();
  447. }
  448. }
  449. } else {
  450. if (this.testTypeCode == 1) {
  451. let rate = this.getCorrectRate(this.testList);
  452. this.practiceResult(rate);
  453. } else if (this.testTypeCode == 2) {
  454. this.submitData();
  455. } else {
  456. this.showGuider = false;
  457. this.testFlag = true;
  458. this.cumulation = 0;
  459. this.testTypeCode = 1;
  460. this.buttonName = "练习阶段";
  461. this.countDownStr = "练习阶段";
  462. }
  463. }
  464. },
  465. // 计算准确率
  466. getCorrectRate(arr) {
  467. let num = 0;
  468. for (let i = 0; i < arr.length; i++) {
  469. if (arr[i].correct) {
  470. num += 1;
  471. }
  472. }
  473. return num / arr.length;
  474. },
  475. // 练习测试结果处理
  476. practiceResult(rate) {
  477. if (rate >= 0.8) {
  478. this.$message.success("恭喜你,通过练习测试");
  479. this.testTypeCode = 2;
  480. this.buttonName = "正式测试";
  481. this.countDownStr = "正式测试";
  482. } else {
  483. this.testTypeCode = 0;
  484. this.$message.warning("未通过练习测试");
  485. this.countDownStr = "学习阶段";
  486. this.buttonName = "学习阶段";
  487. }
  488. this.countDown = 5;
  489. this.testFlag = true;
  490. this.cumulation = 0;
  491. screenfull.exit();
  492. },
  493. submitData() {
  494. if (this.isLoading) {
  495. return;
  496. }
  497. let results = [];
  498. this.testList.forEach((el) => {
  499. results.push({
  500. name: el.name, // 图片名称
  501. emoType: el.emoType, // 情绪类型
  502. userResponse: el.userResponse, // 用户反映类型
  503. correct: el.correct, // 是否正确
  504. xiyin: el.xiyin, // 吸引力
  505. yuyue: el.yuyue, // 愉悦度
  506. huanxing: el.huanxing, // 唤醒度
  507. youshi: el.youshi, // 优势度
  508. });
  509. });
  510. this.$http.post(
  511. `/cognize/EAT`,
  512. {
  513. userId: this.userId,
  514. testPlanId: this.$route.query.testPlanId || "",
  515. results: results,
  516. },
  517. (response) => {
  518. this.isLoading = false;
  519. if (response && response.code == "200") {
  520. //跳转新测试结果页面
  521. this.goTestResult(response.data);
  522. } else {
  523. this.$message.error("接口数据出错");
  524. }
  525. },
  526. (err) => {
  527. this.isLoading = false;
  528. }
  529. );
  530. screenfull.exit();
  531. this.$message({
  532. message: "测试结束!",
  533. type: "success",
  534. });
  535. },
  536. startTest() {
  537. screenfull.request();
  538. if (this.testTypeCode == 0) {
  539. // 生成学习列表
  540. this.createStudyList().then(() => {
  541. preloader(this.studyList, () => {
  542. this.testList = this.studyList;
  543. this.startTiming();
  544. });
  545. });
  546. } else if (this.testTypeCode == 1) {
  547. // 生成练习测试列表
  548. this.createPriticeList().then(() => {
  549. preloader(this.practiceList, () => {
  550. this.testList = this.practiceList;
  551. this.startTiming();
  552. });
  553. });
  554. } else {
  555. // 生成正式测试列表
  556. this.createNormalList().then(() => {
  557. preloader(this.normalList, () => {
  558. this.testList = this.normalList;
  559. this.startTiming();
  560. });
  561. });
  562. }
  563. },
  564. // 倒计时三分钟
  565. threeMinDown() {
  566. var that = this;
  567. that.countDownStr = "休息一下";
  568. var maxtime = 3 * 60;
  569. var minutes = 0;
  570. var seconds = 0;
  571. var timer = setInterval(function () {
  572. if (maxtime >= 0) {
  573. minutes = Math.floor(maxtime / 60);
  574. seconds = Math.floor(maxtime % 60);
  575. that.countDownStr = `0${minutes}:${seconds < 10 ? "0" + seconds : seconds
  576. }`;
  577. --maxtime;
  578. } else {
  579. that.countDownStr = "";
  580. that.crossShow = false;
  581. this.timingShow = false;
  582. clearInterval(timer);
  583. }
  584. }, 1000);
  585. },
  586. },
  587. destroyed() {
  588. clearInterval(this.timingFlag);
  589. clearInterval(this.timer2);
  590. },
  591. };
  592. </script>
  593. <style scoped>
  594. .butt {
  595. width: 100px;
  596. text-align: center;
  597. border: 1px solid rgb(87, 172, 187);
  598. opacity: 1;
  599. border-radius: 10px;
  600. }
  601. .bgAdd {
  602. width: 150px;
  603. height: 400px;
  604. background: url("../../assets/congnitiveAblitity/whiteFlag-new.png") no-repeat center;
  605. position: absolute;
  606. top: 25%;
  607. left: 50%;
  608. margin-left: -75px;
  609. }
  610. .activeTask {
  611. width: 100%;
  612. height: 100%;
  613. background: url("../../assets/congnitiveAblitity/rememberAbilityTask.png") no-repeat center;
  614. background-size: cover;
  615. position: fixed;
  616. top: 0;
  617. left: 0;
  618. right: 0;
  619. bottom: 0;
  620. }
  621. .timingBox {
  622. position: absolute;
  623. top: 50%;
  624. left: 50%;
  625. transform: translate(-50%, -50%);
  626. color: black;
  627. font-size: 70px;
  628. text-align: center;
  629. line-height: 100px;
  630. margin: 0 auto;
  631. z-index: 10;
  632. }
  633. /* .active-img {
  634. position: absolute;
  635. width: 450px;
  636. height: 450px;
  637. top: 50%;
  638. left: 50%;
  639. transform: translate(-50%, -50%);
  640. z-index: 10;
  641. } */
  642. .btn-content {
  643. text-align: center;
  644. position: absolute;
  645. left: 50%;
  646. transform: translate(-50%);
  647. margin-top: 26px;
  648. z-index: 1000;
  649. }
  650. .scaleName {
  651. margin-top: 70px;
  652. background-size: cover;
  653. }
  654. .scaleButton {
  655. margin-top: 20px;
  656. margin-bottom: 20px;
  657. background-size: cover;
  658. background: rgb(87, 172, 187);
  659. border: 2px solid rgb(255, 255, 255);
  660. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  661. opacity: 1;
  662. border-radius: 39px;
  663. color: #ffffff;
  664. }
  665. .steering {
  666. width: 50%;
  667. position: absolute;
  668. bottom: 20%;
  669. left: 50%;
  670. transform: translateX(-50%);
  671. display: flex;
  672. justify-content: space-between;
  673. }
  674. .steering .left {
  675. width: 60px;
  676. height: 60px;
  677. background: url(../../assets/left.png) no-repeat center;
  678. }
  679. .steering .right {
  680. width: 60px;
  681. height: 60px;
  682. background: url(../../assets/right.png) no-repeat center;
  683. margin-left: 15px;
  684. }
  685. .guider {
  686. position: absolute;
  687. top: 0;
  688. bottom: 0;
  689. left: 0;
  690. right: 0;
  691. z-index: 999;
  692. background: rgba(0, 0, 0, 0.75);
  693. }
  694. .addImg {
  695. width: 40%;
  696. height: auto;
  697. z-index: 1000;
  698. }
  699. .shape_glass {
  700. display: flex;
  701. justify-content: center;
  702. align-items: center;
  703. width: 50%;
  704. height: auto;
  705. margin: 5vh auto 0;
  706. }
  707. .active {
  708. position: relative;
  709. }
  710. .active:after {
  711. background-color: #2ea598;
  712. }
  713. /* 设置动画后颜色 */
  714. .active:before {
  715. background-color: rgba(0, 168, 253, 0.2);
  716. }
  717. /* 设置动画 */
  718. .active:before,
  719. .active:after {
  720. content: "";
  721. width: 80px;
  722. height: 40px;
  723. position: absolute;
  724. left: 50%;
  725. top: 50%;
  726. margin-left: -40px;
  727. margin-top: -20px;
  728. border-radius: 10%;
  729. animation: warn 1.5s ease-out 0s infinite;
  730. }
  731. @keyframes warn {
  732. 0% {
  733. transform: scale(1.3);
  734. opacity: 0.6;
  735. }
  736. 50% {
  737. transform: scale(1.4);
  738. opacity: 0.3;
  739. }
  740. 100% {
  741. transform: scale(1.5);
  742. opacity: 0.1;
  743. }
  744. }
  745. .txt {
  746. width: 300px;
  747. font-weight: PingFang-SC-Medium;
  748. margin: 0 auto;
  749. font-size: 16px;
  750. color: #ffffff;
  751. position: absolute;
  752. left: 50%;
  753. top: 70%;
  754. transform: translateX(-50%);
  755. z-index: 1000;
  756. }
  757. .explain {
  758. padding: 6px 8px;
  759. border: 2px solid #0abdc4;
  760. border-radius: 5px;
  761. }
  762. .block {
  763. width: 30%;
  764. margin: 7vw auto 0;
  765. }
  766. .block .slider {
  767. display: flex;
  768. align-items: center;
  769. margin-top: 10px;
  770. }
  771. .block .slider i {
  772. font-size: 18px;
  773. margin-right: 5px;
  774. }
  775. .el-slider {
  776. width: 80%;
  777. margin-left: 20px;
  778. }
  779. .el-rate {
  780. width: 70%;
  781. margin-left: 40px;
  782. }
  783. .choose {
  784. color: #19b381;
  785. border: 2px solid #19b381;
  786. }</style>