wrongBook.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. <template>
  2. <view class="page-view">
  3. <top-return text="错题本"></top-return>
  4. <view class="icon-view">
  5. <view class="icon-card">
  6. <view class="t-icon t-icon-naozhong1" style="margin-right: 10rpx;"></view>
  7. <view class="time-title">巩固时间</view>
  8. <u-count-down :time="60 * 60 * 1000" format="mm:ss"></u-count-down>
  9. </view>
  10. <view class="icon-card" style="margin-left: auto;">
  11. <view :class="signList.includes(curr)?'t-icon t-icon-ding-copy':'t-icon t-icon-ding'"
  12. @click="addToSignList"></view>
  13. <view :class="showNoteBox? 't-icon t-icon-bianji1-copy':'t-icon t-icon-bianji1'"
  14. @click="showNoteBox = !showNoteBox"></view>
  15. <view :class="answerSheet? 't-icon t-icon-cengji-copy':'t-icon t-icon-cengji'"
  16. @click="answerSheet = !answerSheet" style="margin-right: 0;"></view>
  17. </view>
  18. </view>
  19. <view class="note-view" catchtouchmove="true" v-if="showNoteBox">
  20. <view class="note-box">
  21. <th-autograph :is-download="false" canvas-id="autograph">
  22. </th-autograph>
  23. </view>
  24. </view>
  25. <swiper class="swiper-box" :style="{height: clientHeight?clientHeight+'px':'auto'}" :current="curr"
  26. @change="setCurr">
  27. <swiper-item v-for="(item,i) in mistakeDataList" :key="i">
  28. <scroll-view :style="{height: clientHeight?clientHeight+'px':'auto'}">
  29. <view class="item-card" :id="'card' + i">
  30. <view class="flex-baseline">
  31. <view class="YS-title">{{mistakeData[cardIndex].subject}}错题集</view>
  32. <view class="title" style="color: #4169E1;margin-left: 10rpx;">{{i+1}}</view>
  33. <view class="subtitle" style="margin: 0 10rpx;">/</view>
  34. <view class="subtitle">{{mistakeData[cardIndex].amount}}</view>
  35. <view class="YS-title" style="margin-left: 10rpx;">题</view>
  36. </view>
  37. <view class="tag-fill" style="margin-top: 40rpx;">
  38. <view class="tag-text">{{item.type}}</view>
  39. </view>
  40. <view class="content">{{item.content}}</view>
  41. <view class="answer-container">
  42. <view class="answer-box" v-for="(x,y) in item.options" :key="y">
  43. <view :class="answerList[i].answer == x.option?'answer-tag-select':'answer-tag'"
  44. @click="selectOption(i,y)">
  45. <view class="tag-text">{{x.option}}</view>
  46. </view>
  47. <view class="answer-content" @click="selectOption(i,y)">{{x.answer}}</view>
  48. </view>
  49. </view>
  50. </view>
  51. </scroll-view>
  52. </swiper-item>
  53. <!-- 答题卡 -->
  54. <swiper-item>
  55. <scroll-view :style="{height: clientHeight?clientHeight+'px':'auto'}">
  56. <view class="item-card">
  57. <view class="tag-list">
  58. <view :class="item.answer != ''?'answer-tag-select':'answer-tag'"
  59. v-for="(item,index) in answerList" :key="index" @click="navTopic(index)"
  60. style="margin: 40rpx 20rpx;">
  61. <view class="sign-icon" v-if="signList.includes(index)">
  62. <view class="t-icon t-icon-ding-copy"></view>
  63. </view>
  64. <view class="tag-text">{{item.index + 1}}</view>
  65. </view>
  66. </view>
  67. <view class="btn">
  68. <view class="btn-text">交卷</view>
  69. </view>
  70. </view>
  71. </scroll-view>
  72. </swiper-item>
  73. </swiper>
  74. <u-action-sheet :show="answerSheet" @close="answerSheet = false" title="答题卡" :round="6">
  75. <view style="margin: 20rpx 50rpx;">
  76. <view class="tag-list">
  77. <view :class="item.answer != ''?'answer-tag-select':'answer-tag'" v-for="(item,index) in answerList"
  78. :key="index" @click="navTopic(index)" style="margin: 40rpx 20rpx;">
  79. <view class="sign-icon" v-if="signList.includes(index)">
  80. <view class="t-icon t-icon-ding-copy"></view>
  81. </view>
  82. <view class="tag-text">{{item.index + 1}}</view>
  83. </view>
  84. </view>
  85. <view class="btn">
  86. <view class="btn-text">交卷</view>
  87. </view>
  88. </view>
  89. </u-action-sheet>
  90. </view>
  91. </template>
  92. <script>
  93. import {
  94. mapState
  95. } from 'vuex'
  96. import thAutograph from "../../components/th-autograph/th-autograph.vue"
  97. export default {
  98. components: {
  99. thAutograph
  100. },
  101. computed: {
  102. ...mapState('m_children',['mistakeData'])
  103. },
  104. watch: {
  105. curr: {
  106. handler(newValue) {
  107. if (this.curr <= (this.mistakeDataList.length - 1))
  108. this.getSwiperHeight()
  109. },
  110. immediate: true
  111. },
  112. },
  113. data(){
  114. return {
  115. cardIndex: '',
  116. clientHeight: '',
  117. curr: 0,
  118. showNoteBox: false,
  119. answerSheet: false,
  120. signList: [],
  121. answerList: '',
  122. mistakeDataList: [{
  123. content: '题目内容一的外号对哦奥委会的卡号大家看上课进度吧,阿玛尼的卡乌诺迪克兰的三大我看啦到哪里扣篮代码是你',
  124. type: '单选题',
  125. options: [{
  126. option: 'A',
  127. answer: '模拟答案一'
  128. },
  129. {
  130. option: 'B',
  131. answer: '模拟答案二'
  132. },
  133. {
  134. option: 'C',
  135. answer: '模拟答案三'
  136. },
  137. {
  138. option: 'D',
  139. answer: '模拟答案四'
  140. }
  141. ]
  142. },
  143. {
  144. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。3192087jhcuyastgdjahkgsduyagwd',
  145. type: '单选题',
  146. options: [{
  147. option: 'A',
  148. answer: '模拟答案一'
  149. },
  150. {
  151. option: 'B',
  152. answer: '模拟答案二'
  153. },
  154. {
  155. option: 'C',
  156. answer: '模拟答案三'
  157. },
  158. {
  159. option: 'D',
  160. answer: '模拟答案四'
  161. }
  162. ]
  163. },
  164. {
  165. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。h217893y1jahsdbyugcjhzxbcytfu1231',
  166. type: '单选题',
  167. options: [{
  168. option: 'A',
  169. answer: '模拟答案一'
  170. },
  171. {
  172. option: 'B',
  173. answer: '模拟答案二'
  174. },
  175. {
  176. option: 'C',
  177. answer: '模拟答案三'
  178. },
  179. {
  180. option: 'D',
  181. answer: '模拟答案四'
  182. }
  183. ]
  184. },
  185. {
  186. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快32189371298hjahdsu。',
  187. type: '单选题',
  188. options: [{
  189. option: 'A',
  190. answer: '模拟答案一dkajghcjxzncuktwiajkjbsuydgi2uyhqjkn'
  191. },
  192. {
  193. option: 'B',
  194. answer: '模拟答案二'
  195. },
  196. {
  197. option: 'C',
  198. answer: '模拟答案三312897319hjkabcjhxz'
  199. },
  200. {
  201. option: 'D',
  202. answer: '模拟答案四'
  203. }
  204. ]
  205. },
  206. {
  207. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。2318209uasiohsdjkaxnczuiywa',
  208. type: '单选题',
  209. options: [{
  210. option: 'A',
  211. answer: '模拟答案一123i7auhcjkzxgczx'
  212. },
  213. {
  214. option: 'B',
  215. answer: '模拟答案二'
  216. },
  217. {
  218. option: 'C',
  219. answer: '模拟答案三31289dyasjkdhciuxcz'
  220. },
  221. {
  222. option: 'D',
  223. answer: '模拟答案四'
  224. }
  225. ]
  226. }, {
  227. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。adnauiychkajnwyiujagdhjabyuczxg2',
  228. type: '单选题',
  229. options: [{
  230. option: 'A',
  231. answer: '模拟答案一'
  232. },
  233. {
  234. option: 'B',
  235. answer: '模拟答案二'
  236. },
  237. {
  238. option: 'C',
  239. answer: '模拟答案三'
  240. },
  241. {
  242. option: 'D',
  243. answer: '模拟答案四'
  244. }
  245. ]
  246. }, {
  247. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  248. type: '单选题',
  249. options: [{
  250. option: 'A',
  251. answer: '模拟答案一'
  252. },
  253. {
  254. option: 'B',
  255. answer: '模拟答案二'
  256. },
  257. {
  258. option: 'C',
  259. answer: '模拟答案三'
  260. },
  261. {
  262. option: 'D',
  263. answer: '模拟答案四'
  264. }
  265. ]
  266. }, {
  267. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  268. type: '单选题',
  269. options: [{
  270. option: 'A',
  271. answer: '模拟答案一'
  272. },
  273. {
  274. option: 'B',
  275. answer: '模拟答案二'
  276. },
  277. {
  278. option: 'C',
  279. answer: '模拟答案三'
  280. },
  281. {
  282. option: 'D',
  283. answer: '模拟答案四'
  284. }
  285. ]
  286. }, {
  287. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  288. type: '单选题',
  289. options: [{
  290. option: 'A',
  291. answer: '模拟答案一'
  292. },
  293. {
  294. option: 'B',
  295. answer: '模拟答案二'
  296. },
  297. {
  298. option: 'C',
  299. answer: '模拟答案三'
  300. },
  301. {
  302. option: 'D',
  303. answer: '模拟答案四'
  304. }
  305. ]
  306. }, {
  307. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  308. type: '单选题',
  309. options: [{
  310. option: 'A',
  311. answer: '模拟答案一'
  312. },
  313. {
  314. option: 'B',
  315. answer: '模拟答案二'
  316. },
  317. {
  318. option: 'C',
  319. answer: '模拟答案三'
  320. },
  321. {
  322. option: 'D',
  323. answer: '模拟答案四'
  324. }
  325. ]
  326. }, {
  327. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  328. type: '单选题',
  329. options: [{
  330. option: 'A',
  331. answer: '模拟答案一'
  332. },
  333. {
  334. option: 'B',
  335. answer: '模拟答案二'
  336. },
  337. {
  338. option: 'C',
  339. answer: '模拟答案三'
  340. },
  341. {
  342. option: 'D',
  343. answer: '模拟答案四'
  344. }
  345. ]
  346. }, {
  347. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  348. type: '单选题',
  349. options: [{
  350. option: 'A',
  351. answer: '模拟答案一'
  352. },
  353. {
  354. option: 'B',
  355. answer: '模拟答案二'
  356. },
  357. {
  358. option: 'C',
  359. answer: '模拟答案三'
  360. },
  361. {
  362. option: 'D',
  363. answer: '模拟答案四'
  364. }
  365. ]
  366. }, {
  367. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  368. type: '单选题',
  369. options: [{
  370. option: 'A',
  371. answer: '模拟答案一'
  372. },
  373. {
  374. option: 'B',
  375. answer: '模拟答案二'
  376. },
  377. {
  378. option: 'C',
  379. answer: '模拟答案三'
  380. },
  381. {
  382. option: 'D',
  383. answer: '模拟答案四'
  384. }
  385. ]
  386. }, {
  387. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  388. type: '单选题',
  389. options: [{
  390. option: 'A',
  391. answer: '模拟答案一'
  392. },
  393. {
  394. option: 'B',
  395. answer: '模拟答案二'
  396. },
  397. {
  398. option: 'C',
  399. answer: '模拟答案三'
  400. },
  401. {
  402. option: 'D',
  403. answer: '模拟答案四'
  404. }
  405. ]
  406. }, {
  407. content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
  408. type: '单选题',
  409. options: [{
  410. option: 'A',
  411. answer: '模拟答案一'
  412. },
  413. {
  414. option: 'B',
  415. answer: '模拟答案二'
  416. },
  417. {
  418. option: 'C',
  419. answer: '模拟答案三'
  420. },
  421. {
  422. option: 'D',
  423. answer: '模拟答案四'
  424. }
  425. ]
  426. },
  427. ],
  428. }
  429. },
  430. onLoad(param) {
  431. this.cardIndex = param.index
  432. this.getAnswerList()
  433. },
  434. methods:{
  435. //生成自适应高度swiper
  436. getSwiperHeight() {
  437. let query = uni.createSelectorQuery().in(this)
  438. query.select('#card' + this.curr).boundingClientRect(data => {
  439. this.clientHeight = data.height + 40
  440. console.log('swiper高度', this.clientHeight);
  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>