gong_zuo_ji_yi.js 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021
  1. // pages/memory/memory.js
  2. const { throttle } = require('../../utils/util.js')
  3. const app = getApp();
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. isGzjy: true,
  10. isAnswer: false,
  11. statusBar: app.globalData.statusBar,
  12. mentalRotation:0,
  13. graphicReasoning:0,
  14. spaceImagination:0,
  15. executionFunctionality:0,
  16. visualSearch:0,
  17. workingMemory:0,
  18. times: 0,
  19. level:0,
  20. isOneShow:true,
  21. isOnePointShow:true,
  22. isOneImgShow: false,
  23. isYes1:false,
  24. isYes2:false,
  25. isYes3: false,
  26. isYes4: false,
  27. yesImg:'../../image/zheng_que.png',
  28. noImg:'../../image/cuo_wu.png',
  29. isWhite:false,
  30. allList: [
  31. [
  32. {
  33. idx: 0,
  34. imgTitle: '../../image/lianxi_title_four.png',
  35. header: '正式测试前先练习一下吧:',
  36. title: '仔细观察下列图形。',
  37. titleOne:'请找出哪张图片发生了变化。',
  38. titleList: [
  39. {
  40. img: '../../image/lianxi_three_as_a.png',
  41. text: 'A',
  42. isAnswer: 0,
  43. status: ''
  44. },
  45. {
  46. img: '../../image/lianxi_three_as_c.png',
  47. text: 'B',
  48. isAnswer: 0,
  49. status: ''
  50. },
  51. {
  52. img: '../../image/lianxi_three_as_d.png',
  53. text: 'C',
  54. isAnswer: 0,
  55. status: ''
  56. }
  57. ],
  58. answerList: [
  59. {
  60. img: '../../image/lianxi_three_as_b.png',
  61. text: 'A',
  62. isAnswer: 1,
  63. status: ''
  64. },
  65. {
  66. img: '../../image/lianxi_three_as_c.png',
  67. text: 'B',
  68. isAnswer: 0,
  69. status: ''
  70. },
  71. {
  72. img: '../../image/lianxi_three_as_d.png',
  73. text: 'C',
  74. isAnswer: 0,
  75. status: ''
  76. }
  77. ],
  78. },
  79. ],
  80. [
  81. {
  82. id: 1,
  83. imgTitle: '../../image/lianxi_title_four.png',
  84. title: '仔细观察下列图形。',
  85. titleOne: '请找出哪张图片发生了变化。',
  86. titleList: [
  87. {
  88. img: '../../image/the_first_pass_five_as_a.png',
  89. text: 'A',
  90. isAnswer: 0,
  91. status: ''
  92. },
  93. {
  94. img: '../../image/the_first_pass_five_as_c.png',
  95. text: 'B',
  96. isAnswer: 0,
  97. status: ''
  98. },
  99. {
  100. img: '../../image/the_first_pass_five_as_d.png',
  101. text: 'C',
  102. isAnswer: 0,
  103. status: ''
  104. }
  105. ],
  106. answerList: [
  107. {
  108. img: '../../image/the_first_pass_five_as_a.png',
  109. text: 'A',
  110. isAnswer: 0,
  111. status: ''
  112. },
  113. {
  114. img: '../../image/the_first_pass_five_as_b.png',
  115. text: 'B',
  116. isAnswer: 1,
  117. status: ''
  118. },
  119. {
  120. img: '../../image/the_first_pass_five_as_d.png',
  121. text: 'C',
  122. isAnswer: 0,
  123. status: ''
  124. }
  125. ],
  126. },
  127. {
  128. idx: 2,
  129. imgTitle: '../../image/lianxi_title_four.png',
  130. title: '仔细观察下列图形。',
  131. titleOne: '请找出哪张图片发生了变化。',
  132. titleList: [
  133. {
  134. img: '../../image/the_first_pass_five1_as_b.png',
  135. text: 'A',
  136. isAnswer: 0,
  137. status: ''
  138. },
  139. {
  140. img: '../../image/the_first_pass_five1_as_c.png',
  141. text: 'B',
  142. isAnswer: 0,
  143. status: ''
  144. },
  145. {
  146. img: '../../image/the_first_pass_five1_as_d.png',
  147. text: 'C',
  148. isAnswer: 0,
  149. status: ''
  150. }
  151. ],
  152. answerList: [
  153. {
  154. img: '../../image/the_first_pass_five1_as_a.png',
  155. text: 'A',
  156. isAnswer: 1,
  157. status: ''
  158. },
  159. {
  160. img: '../../image/the_first_pass_five1_as_c.png',
  161. text: 'B',
  162. isAnswer: 0,
  163. status: ''
  164. },
  165. {
  166. img: '../../image/the_first_pass_five1_as_d.png',
  167. text: 'C',
  168. isAnswer: 0,
  169. status: ''
  170. }
  171. ],
  172. },
  173. ],
  174. [
  175. {
  176. id: 1,
  177. title: '仔细观察下列图形。',
  178. titleOne: '请找出哪张图片发生了变化。',
  179. titleList: [
  180. {
  181. img: '../../image/the_second_pass_five_as_a.png',
  182. text: 'A',
  183. isAnswer: 0,
  184. status: ''
  185. },
  186. {
  187. img: '../../image/the_second_pass_five_as_b.png',
  188. text: 'B',
  189. isAnswer: 0,
  190. status: ''
  191. },
  192. {
  193. img: '../../image/the_second_pass_five_as_d.png',
  194. text: 'C',
  195. isAnswer: 0,
  196. status: ''
  197. },
  198. {
  199. img: '../../image/the_second_pass_five_as_e.png',
  200. text: 'C',
  201. isAnswer: 0,
  202. status: ''
  203. },
  204. ],
  205. answerList: [
  206. {
  207. img: '../../image/the_second_pass_five_as_a.png',
  208. text: 'A',
  209. isAnswer: 0,
  210. status: ''
  211. },
  212. {
  213. img: '../../image/the_second_pass_five_as_c.png',
  214. text: 'B',
  215. isAnswer: 1,
  216. status: ''
  217. },
  218. {
  219. img: '../../image/the_second_pass_five_as_d.png',
  220. text: 'C',
  221. isAnswer: 0,
  222. status: ''
  223. },
  224. {
  225. img: '../../image/the_second_pass_five_as_e.png',
  226. text: 'C',
  227. isAnswer: 0,
  228. status: ''
  229. },
  230. ],
  231. },
  232. {
  233. id: 2,
  234. title: '仔细观察下列图形。',
  235. titleOne: '请找出哪张图片发生了变化。',
  236. titleList: [
  237. {
  238. img: '../../image/the_second_pass_five1_as_a.png',
  239. text: 'A',
  240. isAnswer: 0,
  241. status: ''
  242. },
  243. {
  244. img: '../../image/the_second_pass_five1_as_b.png',
  245. text: 'B',
  246. isAnswer: 0,
  247. status: ''
  248. },
  249. {
  250. img: '../../image/the_second_pass_five1_as_c.png',
  251. text: 'C',
  252. isAnswer: 0,
  253. status: ''
  254. },
  255. {
  256. img: '../../image/the_second_pass_five1_as_e.png',
  257. text: 'C',
  258. isAnswer: 0,
  259. status: ''
  260. },
  261. ],
  262. answerList: [
  263. {
  264. img: '../../image/the_second_pass_five1_as_a.png',
  265. text: 'A',
  266. isAnswer: 0,
  267. status: ''
  268. },
  269. {
  270. img: '../../image/the_second_pass_five1_as_b.png',
  271. text: 'B',
  272. isAnswer:0,
  273. status: ''
  274. },
  275. {
  276. img: '../../image/the_second_pass_five1_as_c.png',
  277. text: 'C',
  278. isAnswer: 0,
  279. status: ''
  280. },
  281. {
  282. img: '../../image/the_second_pass_five1_as_d.png',
  283. text: 'C',
  284. isAnswer: 1,
  285. status: ''
  286. },
  287. ],
  288. },
  289. ],
  290. [
  291. {
  292. id: 1,
  293. title: '仔细观察下列图形。',
  294. titleOne: '请找出哪张图片发生了变化。',
  295. titleList: [
  296. {
  297. img: '../../image/the_third_pass_five_as_a.png',
  298. text: 'A',
  299. isAnswer: 0,
  300. status: ''
  301. },
  302. {
  303. img: '../../image/the_third_pass_five_as_b.png',
  304. text: 'B',
  305. isAnswer: 0,
  306. status: ''
  307. },
  308. {
  309. img: '../../image/the_third_pass_five_as_c.png',
  310. text: 'C',
  311. isAnswer: 0,
  312. status: ''
  313. },
  314. {
  315. img: '../../image/the_third_pass_five_as_d.png',
  316. text: 'C',
  317. isAnswer: 0,
  318. status: ''
  319. },
  320. {
  321. img: '../../image/the_third_pass_five_as_f.png',
  322. text: 'C',
  323. isAnswer: 0,
  324. status: ''
  325. },
  326. ],
  327. answerList: [
  328. {
  329. img: '../../image/the_third_pass_five_as_a.png',
  330. text: 'A',
  331. isAnswer: 0,
  332. status: ''
  333. },
  334. {
  335. img: '../../image/the_third_pass_five_as_b.png',
  336. text: 'B',
  337. isAnswer: 0,
  338. status: ''
  339. },
  340. {
  341. img: '../../image/the_third_pass_five_as_c.png',
  342. text: 'C',
  343. isAnswer: 0,
  344. status: ''
  345. },
  346. {
  347. img: '../../image/the_third_pass_five_as_e.png',
  348. text: 'C',
  349. isAnswer:1,
  350. status: ''
  351. },
  352. {
  353. img: '../../image/the_third_pass_five_as_f.png',
  354. text: 'C',
  355. isAnswer: 0,
  356. status: ''
  357. },
  358. ],
  359. },
  360. {
  361. id: 2,
  362. title: '仔细观察下列图形。',
  363. titleOne: '请找出哪张图片发生了变化。',
  364. titleList: [
  365. {
  366. img: '../../image/the_third_pass_five1_as_a.png',
  367. text: 'A',
  368. isAnswer: 0,
  369. status: ''
  370. },
  371. {
  372. img: '../../image/the_third_pass_five1_as_b.png',
  373. text: 'B',
  374. isAnswer: 0,
  375. status: ''
  376. },
  377. {
  378. img: '../../image/the_third_pass_five1_as_c.png',
  379. text: 'C',
  380. isAnswer: 0,
  381. status: ''
  382. },
  383. {
  384. img: '../../image/the_third_pass_five1_as_e.png',
  385. text: 'C',
  386. isAnswer: 0,
  387. status: ''
  388. },
  389. {
  390. img: '../../image/the_third_pass_five1_as_f.png',
  391. text: 'C',
  392. isAnswer: 0,
  393. status: ''
  394. },
  395. ],
  396. answerList: [
  397. {
  398. img: '../../image/the_third_pass_five1_as_a.png',
  399. text: 'A',
  400. isAnswer: 0,
  401. status: ''
  402. },
  403. {
  404. img: '../../image/the_third_pass_five1_as_b.png',
  405. text: 'B',
  406. isAnswer: 0,
  407. status: ''
  408. },
  409. {
  410. img: '../../image/the_third_pass_five1_as_d.png',
  411. text: 'C',
  412. isAnswer: 1,
  413. status: ''
  414. },
  415. {
  416. img: '../../image/the_third_pass_five1_as_e.png',
  417. text: 'C',
  418. isAnswer: 0,
  419. status: ''
  420. },
  421. {
  422. img: '../../image/the_third_pass_five1_as_f.png',
  423. text: 'C',
  424. isAnswer: 0,
  425. status: ''
  426. },
  427. ],
  428. },
  429. ],
  430. [
  431. {
  432. id: 1,
  433. title: '仔细观察下列图形。',
  434. titleOne: '请找出哪张图片发生了变化。',
  435. titleList: [
  436. {
  437. img: '../../image/the_fourth_pass_five_as_a.png',
  438. text: 'A',
  439. isAnswer: 0,
  440. status: ''
  441. },
  442. {
  443. img: '../../image/the_fourth_pass_five_as_b.png',
  444. text: 'B',
  445. isAnswer: 0,
  446. status: ''
  447. },
  448. {
  449. img: '../../image/the_fourth_pass_five_as_c.png',
  450. text: 'C',
  451. isAnswer: 0,
  452. status: ''
  453. },
  454. {
  455. img: '../../image/the_fourth_pass_five_as_d.png',
  456. text: 'C',
  457. isAnswer: 0,
  458. status: ''
  459. },
  460. {
  461. img: '../../image/the_fourth_pass_five_as_e.png',
  462. text: 'C',
  463. isAnswer: 0,
  464. status: ''
  465. },
  466. {
  467. img: '../../image/the_fourth_pass_five_as_f.png',
  468. text: 'C',
  469. isAnswer: 0,
  470. status: ''
  471. },
  472. ],
  473. answerList: [
  474. {
  475. img: '../../image/the_fourth_pass_five_as_a.png',
  476. text: 'A',
  477. isAnswer: 1,
  478. status: ''
  479. },
  480. {
  481. img: '../../image/the_fourth_pass_five_as_b.png',
  482. text: 'B',
  483. isAnswer: 0,
  484. status: ''
  485. },
  486. {
  487. img: '../../image/the_fourth_pass_five_as_g.png',
  488. text: 'C',
  489. isAnswer: 1,
  490. status: ''
  491. },
  492. {
  493. img: '../../image/the_fourth_pass_five_as_d.png',
  494. text: 'C',
  495. isAnswer: 0,
  496. status: ''
  497. },
  498. {
  499. img: '../../image/the_fourth_pass_five_as_e.png',
  500. text: 'C',
  501. isAnswer: 0,
  502. status: ''
  503. },
  504. {
  505. img: '../../image/the_fourth_pass_five_as_f.png',
  506. text: 'C',
  507. isAnswer: 0,
  508. status: ''
  509. }
  510. ],
  511. },
  512. {
  513. id: 2,
  514. title: '仔细观察下列图形。',
  515. titleOne: '请找出哪张图片发生了变化。',
  516. titleList: [
  517. {
  518. img: '../../image/the_fourth_pass_five1_as_a.png',
  519. text: 'A',
  520. isAnswer: 0,
  521. status: ''
  522. },
  523. {
  524. img: '../../image/the_fourth_pass_five1_as_b.png',
  525. text: 'B',
  526. isAnswer: 0,
  527. status: ''
  528. },
  529. {
  530. img: '../../image/the_fourth_pass_five1_as_c.png',
  531. text: 'C',
  532. isAnswer: 0,
  533. status: ''
  534. },
  535. {
  536. img: '../../image/the_fourth_pass_five1_as_e.png',
  537. text: 'C',
  538. isAnswer: 0,
  539. status: ''
  540. },
  541. {
  542. img: '../../image/the_fourth_pass_five1_as_f.png',
  543. text: 'C',
  544. isAnswer: 0,
  545. status: ''
  546. },
  547. {
  548. img: '../../image/the_fourth_pass_five1_as_g.png',
  549. text: 'C',
  550. isAnswer: 0,
  551. status: ''
  552. },
  553. ],
  554. answerList: [
  555. {
  556. img: '../../image/the_fourth_pass_five1_as_a.png',
  557. text: 'A',
  558. isAnswer: 0,
  559. status: ''
  560. },
  561. {
  562. img: '../../image/the_fourth_pass_five1_as_b.png',
  563. text: 'B',
  564. isAnswer: 0,
  565. status: ''
  566. },
  567. {
  568. img: '../../image/the_fourth_pass_five1_as_c.png',
  569. text: 'C',
  570. isAnswer: 0,
  571. status: ''
  572. },
  573. {
  574. img: '../../image/the_fourth_pass_five1_as_e.png',
  575. text: 'C',
  576. isAnswer: 0,
  577. status: ''
  578. },
  579. {
  580. img: '../../image/the_fourth_pass_five1_as_f.png',
  581. text: 'C',
  582. isAnswer: 0,
  583. status: ''
  584. },
  585. {
  586. img: '../../image/the_fourth_pass_five1_as_d.png',
  587. text: 'C',
  588. isAnswer: 1,
  589. status: ''
  590. },
  591. ],
  592. },
  593. ],
  594. [
  595. {
  596. id: 1,
  597. title: '仔细观察下列图形。',
  598. titleOne: '请找出哪张图片发生了变化。',
  599. titleList: [
  600. {
  601. img: '../../image/the_fifth_pass_five_as_a.png',
  602. text: 'A',
  603. isAnswer: 0,
  604. status: ''
  605. },
  606. {
  607. img: '../../image/the_fifth_pass_five_as_b.png',
  608. text: 'B',
  609. isAnswer: 0,
  610. status: ''
  611. },
  612. {
  613. img: '../../image/the_fifth_pass_five_as_c.png',
  614. text: 'C',
  615. isAnswer: 0,
  616. status: ''
  617. },
  618. {
  619. img: '../../image/the_fifth_pass_five_as_d.png',
  620. text: 'C',
  621. isAnswer: 0,
  622. status: ''
  623. },
  624. {
  625. img: '../../image/the_fifth_pass_five_as_e.png',
  626. text: 'C',
  627. isAnswer: 0,
  628. status: ''
  629. },
  630. {
  631. img: '../../image/the_fifth_pass_five_as_f.png',
  632. text: 'C',
  633. isAnswer: 0,
  634. status: ''
  635. },
  636. {
  637. img: '../../image/the_fifth_pass_five_as_h.png',
  638. text: 'C',
  639. isAnswer: 0,
  640. status: ''
  641. },
  642. ],
  643. answerList: [
  644. {
  645. img: '../../image/the_fifth_pass_five_as_a.png',
  646. text: 'A',
  647. isAnswer: 0,
  648. status: ''
  649. },
  650. {
  651. img: '../../image/the_fifth_pass_five_as_b.png',
  652. text: 'B',
  653. isAnswer: 0,
  654. status: ''
  655. },
  656. {
  657. img: '../../image/the_fifth_pass_five_as_c.png',
  658. text: 'C',
  659. isAnswer: 0,
  660. status: ''
  661. },
  662. {
  663. img: '../../image/the_fifth_pass_five_as_d.png',
  664. text: 'C',
  665. isAnswer: 0,
  666. status: ''
  667. },
  668. {
  669. img: '../../image/the_fifth_pass_five_as_e.png',
  670. text: 'C',
  671. isAnswer: 0,
  672. status: ''
  673. },
  674. {
  675. img: '../../image/the_fifth_pass_five_as_f.png',
  676. text: 'C',
  677. isAnswer: 0,
  678. status: ''
  679. },
  680. {
  681. img: '../../image/the_fifth_pass_five_as_g.png',
  682. text: 'C',
  683. isAnswer: 1,
  684. status: ''
  685. },
  686. ],
  687. },
  688. {
  689. id: 2,
  690. title: '仔细观察下列图形。',
  691. titleOne: '请找出哪张图片发生了变化。',
  692. titleList: [
  693. {
  694. img: '../../image/the_fifth_pass_five1_as_a.png',
  695. text: 'A',
  696. isAnswer: 0,
  697. status: ''
  698. },
  699. {
  700. img: '../../image/the_fifth_pass_five1_as_b.png',
  701. text: 'B',
  702. isAnswer: 0,
  703. status: ''
  704. },
  705. {
  706. img: '../../image/the_fifth_pass_five1_as_d.png',
  707. text: 'C',
  708. isAnswer: 0,
  709. status: ''
  710. },
  711. {
  712. img: '../../image/the_fifth_pass_five1_as_e.png',
  713. text: 'C',
  714. isAnswer: 0,
  715. status: ''
  716. },
  717. {
  718. img: '../../image/the_fifth_pass_five1_as_f.png',
  719. text: 'C',
  720. isAnswer: 0,
  721. status: ''
  722. },
  723. {
  724. img: '../../image/the_fifth_pass_five1_as_g.png',
  725. text: 'C',
  726. isAnswer: 0,
  727. status: ''
  728. },
  729. {
  730. img: '../../image/the_fifth_pass_five1_as_h.png',
  731. text: 'C',
  732. isAnswer: 0,
  733. status: ''
  734. },
  735. ],
  736. answerList: [
  737. {
  738. img: '../../image/the_fifth_pass_five1_as_a.png',
  739. text: 'A',
  740. isAnswer: 0,
  741. status: ''
  742. },
  743. {
  744. img: '../../image/the_fifth_pass_five1_as_c.png',
  745. text: 'C',
  746. isAnswer: 1,
  747. status: ''
  748. },
  749. {
  750. img: '../../image/the_fifth_pass_five1_as_d.png',
  751. text: 'C',
  752. isAnswer: 0,
  753. status: ''
  754. },
  755. {
  756. img: '../../image/the_fifth_pass_five1_as_e.png',
  757. text: 'C',
  758. isAnswer: 0,
  759. status: ''
  760. },
  761. {
  762. img: '../../image/the_fifth_pass_five1_as_f.png',
  763. text: 'C',
  764. isAnswer: 0,
  765. status: ''
  766. },
  767. {
  768. img: '../../image/the_fifth_pass_five1_as_g.png',
  769. text: 'C',
  770. isAnswer: 1,
  771. status: ''
  772. },
  773. {
  774. img: '../../image/the_fifth_pass_five1_as_h.png',
  775. text: 'B',
  776. isAnswer: 0,
  777. status: ''
  778. }
  779. ],
  780. },
  781. ],
  782. ]
  783. },
  784. /**
  785. * 生命周期函数--监听页面加载
  786. */
  787. onLoad: function (options) {
  788. this.setData(options);
  789. console.log(options)
  790. this.setData({
  791. isOne: Math.round(Math.random())
  792. })
  793. },
  794. /**
  795. * 生命周期函数--监听页面初次渲染完成
  796. */
  797. onReady: function () {
  798. },
  799. /**
  800. * 生命周期函数--监听页面显示
  801. */
  802. onShow: function () {
  803. },
  804. /**
  805. * 生命周期函数--监听页面隐藏
  806. */
  807. onHide: function () {
  808. },
  809. /**
  810. * 生命周期函数--监听页面卸载
  811. */
  812. onUnload: function () {
  813. },
  814. /**
  815. * 页面相关事件处理函数--监听用户下拉动作
  816. */
  817. onPullDownRefresh: function () {
  818. },
  819. /**
  820. * 页面上拉触底事件的处理函数
  821. */
  822. onReachBottom: function () {
  823. },
  824. /**
  825. * 用户点击右上角分享
  826. */
  827. onShareAppMessage: function () {
  828. if (app.sharePageDefaultCtl) {
  829. return app.sharePageDefaultCtl()
  830. }
  831. },
  832. /**
  833. * 底部导航跳转
  834. */
  835. redirectCtl: app.redirectCtl,
  836. /**
  837. * 返回上一级页面
  838. */
  839. blockCtl: function () {
  840. this.redirectCtl({ url: 'me', method: {} }, true)
  841. this.endSetInter();
  842. },
  843. /**
  844. * 选择答案
  845. */
  846. selectItems:throttle(function(e){
  847. const {lindex, mindex,sindex } = e.currentTarget.dataset;
  848. const { allList, times, graphicReasoning, ageGroup} = this.data;
  849. console.log(lindex, mindex,sindex)
  850. var that = this;
  851. var temp = {};
  852. for (var i in allList[lindex][mindex].answerList) {
  853. temp[`allList[${lindex}][${mindex}].answerList[${i}].status`] = '';
  854. }
  855. temp[`allList[${lindex}][${mindex}].answerList[${sindex}].status`]='active';
  856. this.setData(temp);
  857. if (allList[lindex][mindex].answerList[sindex].isAnswer == 1) {
  858. that.setData({ isYes: true,isAnswer: true })
  859. if(lindex!=0){
  860. that.integraeRule(1)
  861. }
  862. that.endSetInter();
  863. // that.startSetInter()
  864. } else {
  865. that.setData({ isYes: false,isAnswer: true })
  866. if(lindex!=0){
  867. that.integraeRule(0)
  868. }
  869. that.endSetInter();
  870. // that.startSetInter()
  871. }
  872. setTimeout(
  873. function () {
  874. if(lindex+1==6){
  875. that.endSetInter();
  876. that.tenEndTimes()
  877. }else{
  878. that.setData({ level:lindex+1,isAnswer:false,times: 0,isOne: Math.round(Math.random()),isWhite:true,isOneShow:true,isOneImgShow:false})
  879. that.hiddenShow()
  880. }
  881. }, 300)
  882. },1000),
  883. /**
  884. * 第四题显示
  885. */
  886. hiddenShow:function(){
  887. const { isOneShow,isOneImgShow } = this.data;
  888. var that = this;
  889. setTimeout(function () {
  890. that.setData({isWhite:false})
  891. setTimeout(function () {
  892. that.setData({ isOneImgShow:true})
  893. setTimeout(function () {
  894. that.setData({ isOneShow: false,isWhite:true})
  895. setTimeout(function () {
  896. that.setData({ isWhite:false})
  897. that.startSetInter()
  898. }, Math.floor(Math.random()*(400 - 800) + 800))
  899. }, 2000)
  900. }, 500)
  901. }, Math.floor(Math.random()*(400 - 800) + 800))
  902. },
  903. /**
  904. * 积分规则处理
  905. */
  906. integraeRule: function (str) {
  907. const { ageGroup, times,workingMemory } = this.data;
  908. var that = this;
  909. that.saveCase(str)
  910. // console.log(times,workingMemory)
  911. if(str==1){
  912. that.setData({ workingMemory: Number(workingMemory)+20 });
  913. // if (ageGroup == 1) {
  914. // if (0 < times && times <= 5) {
  915. // that.setData({ workingMemory: Number(workingMemory)+20 });
  916. // } else if (5 < times && times <= 8) {
  917. // that.setData({ workingMemory: Number(workingMemory)+16 });
  918. // } else if (8 < times) {
  919. // that.setData({ workingMemory: Number(workingMemory)+12 });
  920. // }
  921. // } else if (ageGroup == 2) {
  922. // if (0 < times && times <= 3) {
  923. // that.setData({ workingMemory: Number(workingMemory)+20 });
  924. // } else if (3< times && times <= 5) {
  925. // that.setData({ workingMemory: Number(workingMemory)+16 });
  926. // } else if (5 < times) {
  927. // that.setData({ workingMemory: Number(workingMemory)+12 });
  928. // }
  929. // } else {
  930. // if (0 < times && times <= 2) {
  931. // that.setData({ workingMemory: Number(workingMemory)+20 });
  932. // } else if (2 < times && times <= 4) {
  933. // that.setData({ workingMemory: Number(workingMemory)+16 });
  934. // } else if (4< times) {
  935. // that.setData({ workingMemory: Number(workingMemory)+12 });
  936. // }
  937. // }
  938. }else{
  939. that.setData({ workingMemory: Number(workingMemory)+0 });
  940. }
  941. },
  942. /**
  943. * 开始计时
  944. */
  945. startSetInter: function () {
  946. var that = this;
  947. const { graphicReasoning } = that.data;
  948. //将计时器赋值给setInter
  949. that.data.setInter = setInterval(
  950. function () {
  951. var numVal = that.data.times + 0.1;
  952. that.setData({ times: numVal });
  953. }
  954. , 100);
  955. },
  956. /**
  957. * 结束计时
  958. */
  959. endSetInter: function () {
  960. var that = this;
  961. clearInterval(that.data.setInter)
  962. },
  963. /**
  964. * 页面跳转定时器
  965. */
  966. tenEndTimes: function (str) {
  967. var that = this;
  968. const { graphicReasoning, level, ageGroup,spaceImagination,executionFunctionality,visualSearch,workingMemory,mentalRotation,gameRespondentId} = that.data;
  969. setTimeout(
  970. function () {
  971. that.redirectCtl({ url: 'zhi_xing_gong_neng', method: { graphicReasoning, level:0, ageGroup,spaceImagination,executionFunctionality,visualSearch,workingMemory,mentalRotation,gameRespondentId} }, true)
  972. }, 300
  973. )
  974. },
  975. /**
  976. * 开始答题
  977. */
  978. actionAnswer: function () {
  979. const { isGzjy } = this.data;
  980. var that = this;
  981. this.setData({ isGzjy: false,isWhite:true })
  982. setTimeout(function () {
  983. that.setData({isWhite:false})
  984. setTimeout(function () {
  985. that.setData({ isOneImgShow:true})
  986. setTimeout(function () {
  987. that.setData({ isOneShow: false,isWhite:true})
  988. setTimeout(function () {
  989. that.setData({ isWhite:false})
  990. // that.startSetInter()
  991. }, Math.floor(Math.random()*(400 - 800) + 800))
  992. }, 2000)
  993. }, 500)
  994. }, Math.floor(Math.random()*(400 - 800) + 800))
  995. },
  996. /**
  997. * 答题情况保存
  998. */
  999. saveCase:function(str){
  1000. const postData = { fn: this.getPersonInfo, param: { ...arguments } }
  1001. const {level,times,gameRespondentId}=this.data
  1002. app.post('/api/game/v2/answerInfoSave', {gameRespondentId,moduleCode:5,questionCode:level,usedTime:Math.round(times*1000),answerResult:str+1}, 0, postData).then(res => {
  1003. })
  1004. },
  1005. })