wrongBook.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. <!-- 错题本页面 -->
  2. <template>
  3. <view class="page-view">
  4. <top-return text="错题本"></top-return>
  5. <view class="icon-view">
  6. <view class="icon-card">
  7. <view class="t-icon t-icon-naozhong1" style="margin-right: 10rpx;"></view>
  8. <view class="time-title">巩固时间</view>
  9. <u-count-down :time="60 * 60 * 1000" format="mm:ss"></u-count-down>
  10. </view>
  11. <view class="icon-card" style="margin-left: auto;">
  12. <view :class="signList.includes(curr)?'t-icon t-icon-ding-copy':'t-icon t-icon-ding'"
  13. @click="addToSignList"></view>
  14. <view :class="showNoteBox? 't-icon t-icon-bianji1-copy':'t-icon t-icon-bianji1'"
  15. @click="showNoteBox = !showNoteBox"></view>
  16. <view :class="answerSheet? 't-icon t-icon-cengji-copy':'t-icon t-icon-cengji'"
  17. @click="answerSheet = !answerSheet" style="margin-right: 0;"></view>
  18. </view>
  19. </view>
  20. <view class="note-view" catchtouchmove="true" v-if="showNoteBox">
  21. <view class="note-box">
  22. <th-autograph :is-download="false" canvas-id="autograph">
  23. </th-autograph>
  24. </view>
  25. </view>
  26. <swiper class="swiper-box" :style="{height: clientHeight?clientHeight+'px':'auto'}" :current="curr"
  27. @change="setCurr">
  28. <swiper-item v-for="(item,i) in mistakeDataList" :key="i">
  29. <scroll-view :style="{height: clientHeight?clientHeight+'px':'auto'}">
  30. <view class="item-card" :id="'card' + i">
  31. <view class="flex-baseline">
  32. <view class="YS-title">{{mistakeData[cardIndex].subject}}错题集</view>
  33. <view class="title" style="color: #4169E1;margin-left: 10rpx;">{{i+1}}</view>
  34. <view class="subtitle" style="margin: 0 10rpx;">/</view>
  35. <view class="subtitle">{{mistakeData[cardIndex].amount}}</view>
  36. <view class="YS-title" style="margin-left: 10rpx;">题</view>
  37. </view>
  38. <view class="tag-fill" style="margin-top: 40rpx;">
  39. <view class="tag-text">{{item.type}}</view>
  40. </view>
  41. <view class="content">{{item.content}}</view>
  42. <view class="answer-container">
  43. <view class="answer-box" v-for="(x,y) in item.options" :key="y">
  44. <view :class="answerList[i].answer == x.option?'answer-tag-select':'answer-tag'"
  45. @click="selectOption(i,y)">
  46. <view class="tag-text">{{x.option}}</view>
  47. </view>
  48. <view class="answer-content" @click="selectOption(i,y)">{{x.answer}}</view>
  49. </view>
  50. </view>
  51. </view>
  52. </scroll-view>
  53. </swiper-item>
  54. <!-- 答题卡 -->
  55. <swiper-item>
  56. <scroll-view :style="{height: clientHeight?clientHeight+'px':'auto'}">
  57. <view class="item-card">
  58. <view class="tag-list">
  59. <view :class="item.answer != ''?'answer-tag-select':'answer-tag'"
  60. v-for="(item,index) in answerList" :key="index" @click="navTopic(index)"
  61. style="margin: 40rpx 20rpx;">
  62. <view class="sign-icon" v-if="signList.includes(index)">
  63. <view class="t-icon t-icon-ding-copy"></view>
  64. </view>
  65. <view class="tag-text">{{item.index + 1}}</view>
  66. </view>
  67. </view>
  68. <view class="btn">
  69. <view class="btn-text">交卷</view>
  70. </view>
  71. </view>
  72. </scroll-view>
  73. </swiper-item>
  74. </swiper>
  75. <u-action-sheet :show="answerSheet" @close="answerSheet = false" title="答题卡" :round="6">
  76. <view style="margin: 20rpx 50rpx;">
  77. <view class="tag-list">
  78. <view :class="item.answer != ''?'answer-tag-select':'answer-tag'" v-for="(item,index) in answerList"
  79. :key="index" @click="navTopic(index)" style="margin: 40rpx 20rpx;">
  80. <view class="sign-icon" v-if="signList.includes(index)">
  81. <view class="t-icon t-icon-ding-copy"></view>
  82. </view>
  83. <view class="tag-text">{{item.index + 1}}</view>
  84. </view>
  85. </view>
  86. <view class="btn">
  87. <view class="btn-text">交卷</view>
  88. </view>
  89. </view>
  90. </u-action-sheet>
  91. </view>
  92. </template>
  93. <script>
  94. import {
  95. mapState
  96. } from 'vuex'
  97. import thAutograph from "../../components/th-autograph/th-autograph.vue"
  98. export default {
  99. components: {
  100. thAutograph
  101. },
  102. computed: {
  103. ...mapState('m_children',['mistakeData'])
  104. },
  105. watch: {
  106. curr: {
  107. handler(newValue) {
  108. if (this.curr <= (this.mistakeDataList.length - 1))
  109. this.getSwiperHeight()
  110. },
  111. immediate: true
  112. },
  113. },
  114. data(){
  115. return {
  116. cardIndex: '',
  117. clientHeight: '',
  118. curr: 0,
  119. showNoteBox: false,
  120. answerSheet: false,
  121. signList: [],
  122. answerList: '',
  123. mistakeDataList: [{
  124. content: '题目内容一的外号对哦奥委会的卡号大家看上课进度吧,阿玛尼的卡乌诺迪克兰的三大我看啦到哪里扣篮代码是你',
  125. type: '单选题',
  126. options: [{
  127. option: 'A',
  128. answer: '模拟答案一'
  129. },
  130. {
  131. option: 'B',
  132. answer: '模拟答案二'
  133. },
  134. {
  135. option: 'C',
  136. answer: '模拟答案三'
  137. },
  138. {
  139. option: 'D',
  140. answer: '模拟答案四'
  141. }
  142. ]
  143. },
  144. {
  145. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。3192087jhcuyastgdjahkgsduyagwd',
  146. type: '单选题',
  147. options: [{
  148. option: 'A',
  149. answer: '模拟答案一'
  150. },
  151. {
  152. option: 'B',
  153. answer: '模拟答案二'
  154. },
  155. {
  156. option: 'C',
  157. answer: '模拟答案三'
  158. },
  159. {
  160. option: 'D',
  161. answer: '模拟答案四'
  162. }
  163. ]
  164. },
  165. {
  166. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。h217893y1jahsdbyugcjhzxbcytfu1231',
  167. type: '单选题',
  168. options: [{
  169. option: 'A',
  170. answer: '模拟答案一'
  171. },
  172. {
  173. option: 'B',
  174. answer: '模拟答案二'
  175. },
  176. {
  177. option: 'C',
  178. answer: '模拟答案三'
  179. },
  180. {
  181. option: 'D',
  182. answer: '模拟答案四'
  183. }
  184. ]
  185. },
  186. {
  187. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快32189371298hjahdsu。',
  188. type: '单选题',
  189. options: [{
  190. option: 'A',
  191. answer: '模拟答案一dkajghcjxzncuktwiajkjbsuydgi2uyhqjkn'
  192. },
  193. {
  194. option: 'B',
  195. answer: '模拟答案二'
  196. },
  197. {
  198. option: 'C',
  199. answer: '模拟答案三312897319hjkabcjhxz'
  200. },
  201. {
  202. option: 'D',
  203. answer: '模拟答案四'
  204. }
  205. ]
  206. },
  207. {
  208. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。2318209uasiohsdjkaxnczuiywa',
  209. type: '单选题',
  210. options: [{
  211. option: 'A',
  212. answer: '模拟答案一123i7auhcjkzxgczx'
  213. },
  214. {
  215. option: 'B',
  216. answer: '模拟答案二'
  217. },
  218. {
  219. option: 'C',
  220. answer: '模拟答案三31289dyasjkdhciuxcz'
  221. },
  222. {
  223. option: 'D',
  224. answer: '模拟答案四'
  225. }
  226. ]
  227. }, {
  228. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。adnauiychkajnwyiujagdhjabyuczxg2',
  229. type: '单选题',
  230. options: [{
  231. option: 'A',
  232. answer: '模拟答案一'
  233. },
  234. {
  235. option: 'B',
  236. answer: '模拟答案二'
  237. },
  238. {
  239. option: 'C',
  240. answer: '模拟答案三'
  241. },
  242. {
  243. option: 'D',
  244. answer: '模拟答案四'
  245. }
  246. ]
  247. }, {
  248. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  249. type: '单选题',
  250. options: [{
  251. option: 'A',
  252. answer: '模拟答案一'
  253. },
  254. {
  255. option: 'B',
  256. answer: '模拟答案二'
  257. },
  258. {
  259. option: 'C',
  260. answer: '模拟答案三'
  261. },
  262. {
  263. option: 'D',
  264. answer: '模拟答案四'
  265. }
  266. ]
  267. }, {
  268. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  269. type: '单选题',
  270. options: [{
  271. option: 'A',
  272. answer: '模拟答案一'
  273. },
  274. {
  275. option: 'B',
  276. answer: '模拟答案二'
  277. },
  278. {
  279. option: 'C',
  280. answer: '模拟答案三'
  281. },
  282. {
  283. option: 'D',
  284. answer: '模拟答案四'
  285. }
  286. ]
  287. }, {
  288. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  289. type: '单选题',
  290. options: [{
  291. option: 'A',
  292. answer: '模拟答案一'
  293. },
  294. {
  295. option: 'B',
  296. answer: '模拟答案二'
  297. },
  298. {
  299. option: 'C',
  300. answer: '模拟答案三'
  301. },
  302. {
  303. option: 'D',
  304. answer: '模拟答案四'
  305. }
  306. ]
  307. }, {
  308. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  309. type: '单选题',
  310. options: [{
  311. option: 'A',
  312. answer: '模拟答案一'
  313. },
  314. {
  315. option: 'B',
  316. answer: '模拟答案二'
  317. },
  318. {
  319. option: 'C',
  320. answer: '模拟答案三'
  321. },
  322. {
  323. option: 'D',
  324. answer: '模拟答案四'
  325. }
  326. ]
  327. }, {
  328. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  329. type: '单选题',
  330. options: [{
  331. option: 'A',
  332. answer: '模拟答案一'
  333. },
  334. {
  335. option: 'B',
  336. answer: '模拟答案二'
  337. },
  338. {
  339. option: 'C',
  340. answer: '模拟答案三'
  341. },
  342. {
  343. option: 'D',
  344. answer: '模拟答案四'
  345. }
  346. ]
  347. }, {
  348. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  349. type: '单选题',
  350. options: [{
  351. option: 'A',
  352. answer: '模拟答案一'
  353. },
  354. {
  355. option: 'B',
  356. answer: '模拟答案二'
  357. },
  358. {
  359. option: 'C',
  360. answer: '模拟答案三'
  361. },
  362. {
  363. option: 'D',
  364. answer: '模拟答案四'
  365. }
  366. ]
  367. }, {
  368. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  369. type: '单选题',
  370. options: [{
  371. option: 'A',
  372. answer: '模拟答案一'
  373. },
  374. {
  375. option: 'B',
  376. answer: '模拟答案二'
  377. },
  378. {
  379. option: 'C',
  380. answer: '模拟答案三'
  381. },
  382. {
  383. option: 'D',
  384. answer: '模拟答案四'
  385. }
  386. ]
  387. }, {
  388. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  389. type: '单选题',
  390. options: [{
  391. option: 'A',
  392. answer: '模拟答案一'
  393. },
  394. {
  395. option: 'B',
  396. answer: '模拟答案二'
  397. },
  398. {
  399. option: 'C',
  400. answer: '模拟答案三'
  401. },
  402. {
  403. option: 'D',
  404. answer: '模拟答案四'
  405. }
  406. ]
  407. }, {
  408. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  409. type: '单选题',
  410. options: [{
  411. option: 'A',
  412. answer: '模拟答案一'
  413. },
  414. {
  415. option: 'B',
  416. answer: '模拟答案二'
  417. },
  418. {
  419. option: 'C',
  420. answer: '模拟答案三'
  421. },
  422. {
  423. option: 'D',
  424. answer: '模拟答案四'
  425. }
  426. ]
  427. },
  428. ],
  429. }
  430. },
  431. onLoad(param) {
  432. this.cardIndex = param.index
  433. this.getAnswerList()
  434. },
  435. methods:{
  436. //生成自适应高度swiper
  437. getSwiperHeight() {
  438. let query = uni.createSelectorQuery().in(this)
  439. query.select('#card' + this.curr).boundingClientRect(data => {
  440. this.clientHeight = data.height + 40
  441. }).exec();
  442. },
  443. setCurr(e) {
  444. let thisCurr = e.detail.current || 0;
  445. this.curr = thisCurr;
  446. },
  447. //生成答题卡
  448. getAnswerList() {
  449. if (this.answerList === '') {
  450. this.answerList = []
  451. this.mistakeDataList.forEach((item, index) => {
  452. let answer = {
  453. index: index,
  454. answer: ''
  455. }
  456. this.answerList.push(answer)
  457. })
  458. console.log(this.answerList);
  459. }
  460. },
  461. //选择选项
  462. selectOption(i, y) {
  463. this.answerList[i].answer = this.mistakeDataList[i].options[y].option
  464. if (this.curr <= (this.mistakeDataList.length - 1)) {
  465. setTimeout(() => {
  466. this.curr = i + 1
  467. }, 300);
  468. }
  469. },
  470. //导航到题目
  471. navTopic(index) {
  472. this.curr = index
  473. this.answerSheet = false
  474. },
  475. //标记题目
  476. addToSignList() {
  477. if(this.curr <= (this.mistakeDataList.length - 1)){
  478. if (this.signList.includes(this.curr)) {
  479. this.signList = this.signList.filter(x => x != this.curr)
  480. } else {
  481. this.signList.push(this.curr)
  482. }
  483. }
  484. }
  485. }
  486. }
  487. </script>
  488. <style lang="scss">
  489. .icon-view {
  490. margin: 120rpx 20rpx 0 20rpx;
  491. display: flex;
  492. align-items: center;
  493. .icon-card {
  494. display: flex;
  495. align-items: center;
  496. padding: 20rpx;
  497. height: 50rpx;
  498. border-radius: $border-radius;
  499. background-color: #FFF;
  500. .t-icon {
  501. margin-right: 40rpx;
  502. width: 50rpx;
  503. height: 50rpx;
  504. }
  505. .time-title {
  506. font-size: 30rpx;
  507. line-height: 30rpx;
  508. margin-right: 10rpx;
  509. }
  510. .u-count-down__text.data-v-463368ae {
  511. line-height: 30rpx !important;
  512. }
  513. }
  514. }
  515. .item-card {
  516. margin: 20rpx;
  517. padding: 40rpx 40rpx 80rpx 40rpx;
  518. border-radius: $border-radius;
  519. background-color: #FFF;
  520. .content {
  521. margin-top: 20rpx;
  522. line-height: 60rpx;
  523. font-size: 35rpx;
  524. color: $title;
  525. word-break: break-all;
  526. }
  527. .YS-title {
  528. line-height: 38rpx;
  529. font-size: 38rpx;
  530. }
  531. .tag-fill {
  532. background-color: #d8deff;
  533. width: fit-content;
  534. margin-left: 0;
  535. padding: 6rpx 12rpx;
  536. .tag-text {
  537. font-size: 28rpx;
  538. color: #4169E1;
  539. }
  540. }
  541. .answer-container {
  542. display: flex;
  543. flex-direction: column;
  544. .answer-box {
  545. margin-top: 40rpx;
  546. display: flex;
  547. align-items: center;
  548. .answer-content {
  549. margin-left: 40rpx;
  550. font-size: 35rpx;
  551. line-height: 60rpx;
  552. color: $title;
  553. word-break: break-all;
  554. }
  555. }
  556. }
  557. }
  558. .answer-tag {
  559. display: flex;
  560. flex-shrink: 0;
  561. align-items: center;
  562. justify-content: center;
  563. height: 66rpx;
  564. width: 66rpx;
  565. border-radius: 50%;
  566. border: 2rpx solid $subtitle;
  567. .tag-text {
  568. font-size: 35rpx;
  569. line-height: 35rpx;
  570. color: $subtitle;
  571. }
  572. }
  573. .answer-tag-select {
  574. display: flex;
  575. flex-shrink: 0;
  576. align-items: center;
  577. justify-content: center;
  578. height: 70rpx;
  579. width: 70rpx;
  580. border-radius: 50%;
  581. background-color: #4169E1;
  582. .tag-text {
  583. font-size: 35rpx;
  584. line-height: 35rpx;
  585. color: #FFF;
  586. }
  587. }
  588. .tag-list {
  589. display: flex;
  590. align-items: center;
  591. align-content: flex-start;
  592. justify-content: space-between;
  593. flex-wrap: wrap;
  594. .sign-icon {
  595. position: relative;
  596. left: 20rpx;
  597. top: -60rpx;
  598. width: 0rpx;
  599. height: 0rpx;
  600. .t-icon {
  601. height: 50rpx;
  602. width: 50rpx;
  603. }
  604. }
  605. }
  606. .btn {
  607. margin: 40rpx 20rpx 0 20rpx;
  608. height: 80rpx;
  609. display: flex;
  610. justify-content: center;
  611. align-items: center;
  612. background-color: #4169E1;
  613. border-radius: 40rpx;
  614. .btn-text {
  615. color: #FFF;
  616. line-height: 36rpx;
  617. font-size: 36rpx;
  618. font-family: YSfont;
  619. }
  620. }
  621. .note-view {
  622. width: 100%;
  623. height: 550rpx;
  624. margin: 20rpx 0 5rpx 0;
  625. .note-box {
  626. width: 710rpx;
  627. height: 100%;
  628. margin: 0 20rpx;
  629. border-radius: $border-radius;
  630. overflow: hidden;
  631. background-color: #FFF;
  632. }
  633. }
  634. </style>