123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670 |
- <template>
- <view class="page-view">
- <top-return text="评测练习"></top-return>
- <view class="icon-view">
- <view class="icon-card">
- <view class="t-icon t-icon-naozhong1" style="margin-right: 10rpx;"></view>
- <view class="time-title">练习时间</view>
- <u-count-down :time="60 * 60 * 1000" format="mm:ss"></u-count-down>
- </view>
- <view class="icon-card" style="margin-left: auto;">
- <view :class="signList.includes(curr)?'t-icon t-icon-ding-copy':'t-icon t-icon-ding'"
- @click="addToSignList"></view>
- <view :class="showNoteBox? 't-icon t-icon-bianji1-copy':'t-icon t-icon-bianji1'"
- @click="showNoteBox = !showNoteBox"></view>
- <view :class="answerSheet? 't-icon t-icon-cengji-copy':'t-icon t-icon-cengji'"
- @click="answerSheet = !answerSheet" style="margin-right: 0;"></view>
- </view>
- </view>
- <view class="note-view" catchtouchmove="true" v-if="showNoteBox">
- <view class="note-box">
- <th-autograph :is-download="false" canvas-id="autograph">
- </th-autograph>
- </view>
- </view>
- <swiper class="swiper-box" :style="{height: clientHeight?clientHeight+'px':'auto'}" :current="curr"
- @change="setCurr">
- <swiper-item v-for="(item,i) in practiceData" :key="i">
- <scroll-view :style="{height: clientHeight?clientHeight+'px':'auto'}">
- <view class="item-card" :id="'card' + i">
- <view class="flex-baseline">
- <view class="YS-title">{{examPractice[cardIndex].title}}{{examPractice[cardIndex].modality}}
- </view>
- <view class="title" style="color: #4169E1;margin-left: 10rpx;">{{i+1}}</view>
- <view class="subtitle" style="margin: 0 10rpx;">/</view>
- <view class="subtitle">{{examPractice[cardIndex].amount}}</view>
- <view class="YS-title" style="margin-left: 10rpx;">题</view>
- </view>
- <view class="tag-fill" style="margin-top: 40rpx;">
- <view class="tag-text">{{item.type}}</view>
- </view>
- <view class="content">{{item.content}}</view>
- <view class="answer-container">
- <view class="answer-box" v-for="(x,y) in item.options" :key="y">
- <view :class="answerList[i].answer == x.option?'answer-tag-select':'answer-tag'"
- @click="selectOption(i,y)">
- <view class="tag-text">{{x.option}}</view>
- </view>
- <view class="answer-content" @click="selectOption(i,y)">{{x.answer}}</view>
- </view>
- </view>
- </view>
- </scroll-view>
- </swiper-item>
- <!-- 答题卡 -->
- <swiper-item>
- <scroll-view :style="{height: clientHeight?clientHeight+'px':'auto'}">
- <view class="item-card">
- <view class="tag-list">
- <view :class="item.answer != ''?'answer-tag-select':'answer-tag'"
- v-for="(item,index) in answerList" :key="index" @click="navTopic(index)"
- style="margin: 40rpx 20rpx;">
- <view class="sign-icon" v-if="signList.includes(index)">
- <view class="t-icon t-icon-ding-copy"></view>
- </view>
- <view class="tag-text">{{item.index + 1}}</view>
- </view>
- </view>
- <view class="btn">
- <view class="btn-text">交卷</view>
- </view>
- </view>
- </scroll-view>
- </swiper-item>
- </swiper>
- <u-action-sheet :show="answerSheet" @close="answerSheet = false" title="答题卡" :round="6">
- <view style="margin: 20rpx 50rpx;">
- <view class="tag-list">
- <view :class="item.answer != ''?'answer-tag-select':'answer-tag'" v-for="(item,index) in answerList"
- :key="index" @click="navTopic(index)" style="margin: 40rpx 20rpx;">
- <view class="sign-icon" v-if="signList.includes(index)">
- <view class="t-icon t-icon-ding-copy"></view>
- </view>
- <view class="tag-text">{{item.index + 1}}</view>
- </view>
- </view>
- <view class="btn">
- <view class="btn-text">交卷</view>
- </view>
- </view>
- </u-action-sheet>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex'
- import thAutograph from "../../components/th-autograph/th-autograph.vue"
- export default {
- components: {
- thAutograph
- },
- computed: {
- ...mapState('m_children', ['examPractice'])
- },
- watch: {
- curr: {
- handler(newValue) {
- if (this.curr <= (this.practiceData.length - 1))
- this.getSwiperHeight()
- },
- immediate: true
- },
- },
- data() {
- return {
- cardIndex: '',
- clientHeight: '',
- curr: 0,
- showNoteBox: false,
- answerSheet: false,
- signList: [],
- answerList: '',
- practiceData: [{
- content: '题目内容一的外号对哦奥委会的卡号大家看上课进度吧,阿玛尼的卡乌诺迪克兰的三大我看啦到哪里扣篮代码是你',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- },
- {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。3192087jhcuyastgdjahkgsduyagwd',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- },
- {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。h217893y1jahsdbyugcjhzxbcytfu1231',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- },
- {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快32189371298hjahdsu。',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一dkajghcjxzncuktwiajkjbsuydgi2uyhqjkn'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三312897319hjkabcjhxz'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- },
- {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。2318209uasiohsdjkaxnczuiywa',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一123i7auhcjkzxgczx'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三31289dyasjkdhciuxcz'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- }, {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。adnauiychkajnwyiujagdhjabyuczxg2',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- }, {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- }, {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- }, {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- }, {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- }, {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- }, {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- }, {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- }, {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- }, {
- content: '打完就都i阿娇的罗马里克电脑i经常兄长,达瓦ui带坏我很单纯进行只能催啊挖好的快回家,没齿难忘i垃圾我i的急啊离开你们死定了埃及低洼降低AMD扩散低洼会加大科技那么快。',
- type: '单选题',
- options: [{
- option: 'A',
- answer: '模拟答案一'
- },
- {
- option: 'B',
- answer: '模拟答案二'
- },
- {
- option: 'C',
- answer: '模拟答案三'
- },
- {
- option: 'D',
- answer: '模拟答案四'
- }
- ]
- },
- ],
- }
- },
- onLoad(param) {
- this.cardIndex = param.index
- this.getAnswerList()
- },
- methods: {
- //生成自适应高度swiper
- getSwiperHeight() {
- let query = uni.createSelectorQuery().in(this)
- query.select('#card' + this.curr).boundingClientRect(data => {
- this.clientHeight = data.height + 40
- console.log('swiper高度', this.clientHeight);
- }).exec();
- },
- setCurr(e) {
- let thisCurr = e.detail.current || 0;
- this.curr = thisCurr;
- },
- //生成答题卡
- getAnswerList() {
- if (this.answerList === '') {
- this.answerList = []
- this.practiceData.forEach((item, index) => {
- let answer = {
- index: index,
- answer: ''
- }
- this.answerList.push(answer)
- })
- console.log(this.answerList);
- }
- },
- //选择选项
- selectOption(i, y) {
- this.answerList[i].answer = this.practiceData[i].options[y].option
- if (this.curr <= (this.practiceData.length - 1)) {
- setTimeout(() => {
- this.curr = i + 1
- }, 300);
- }
- },
- //导航到题目
- navTopic(index) {
- this.curr = index
- this.answerSheet = false
- },
- //标记题目
- addToSignList() {
- if(this.curr <= (this.practiceData.length - 1)){
- if (this.signList.includes(this.curr)) {
- this.signList = this.signList.filter(x => x != this.curr)
- } else {
- this.signList.push(this.curr)
- }
- }
- }
- }
- }
- </script>
- <style lang="scss">
- .icon-view {
- margin: 120rpx 20rpx 0 20rpx;
- display: flex;
- align-items: center;
- .icon-card {
- display: flex;
- align-items: center;
- padding: 20rpx;
- height: 50rpx;
- border-radius: $border-radius;
- background-color: #FFF;
- .t-icon {
- margin-right: 40rpx;
- width: 50rpx;
- height: 50rpx;
- }
- .time-title {
- font-size: 30rpx;
- line-height: 30rpx;
- margin-right: 10rpx;
- }
- .u-count-down__text.data-v-463368ae {
- line-height: 30rpx !important;
- }
- }
- }
- .item-card {
- margin: 20rpx;
- padding: 40rpx 40rpx 80rpx 40rpx;
- border-radius: $border-radius;
- background-color: #FFF;
- .content {
- margin-top: 20rpx;
- line-height: 60rpx;
- font-size: 35rpx;
- color: $title;
- word-break: break-all;
- }
- .YS-title {
- line-height: 38rpx;
- font-size: 38rpx;
- }
- .tag-fill {
- background-color: #d8deff;
- width: fit-content;
- margin-left: 0;
- padding: 6rpx 12rpx;
- .tag-text {
- font-size: 28rpx;
- color: #4169E1;
- }
- }
- .answer-container {
- display: flex;
- flex-direction: column;
- .answer-box {
- margin-top: 40rpx;
- display: flex;
- align-items: center;
- .answer-content {
- margin-left: 40rpx;
- font-size: 35rpx;
- line-height: 60rpx;
- color: $title;
- word-break: break-all;
- }
- }
- }
- }
- .answer-tag {
- display: flex;
- flex-shrink: 0;
- align-items: center;
- justify-content: center;
- height: 66rpx;
- width: 66rpx;
- border-radius: 50%;
- border: 2rpx solid $subtitle;
- .tag-text {
- font-size: 35rpx;
- line-height: 35rpx;
- color: $subtitle;
- }
- }
- .answer-tag-select {
- display: flex;
- flex-shrink: 0;
- align-items: center;
- justify-content: center;
- height: 70rpx;
- width: 70rpx;
- border-radius: 50%;
- background-color: #4169E1;
- .tag-text {
- font-size: 35rpx;
- line-height: 35rpx;
- color: #FFF;
- }
- }
- .tag-list {
- display: flex;
- align-items: center;
- align-content: flex-start;
- justify-content: space-between;
- flex-wrap: wrap;
- .sign-icon {
- position: relative;
- left: 20rpx;
- top: -60rpx;
- width: 0rpx;
- height: 0rpx;
- .t-icon {
- height: 50rpx;
- width: 50rpx;
- }
- }
- }
- .btn {
- margin: 40rpx 20rpx 0 20rpx;
- height: 80rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- background-color: #4169E1;
- border-radius: 40rpx;
- .btn-text {
- color: #FFF;
- line-height: 36rpx;
- font-size: 36rpx;
- font-family: YSfont;
- }
- }
- .note-view {
- width: 100%;
- height: 550rpx;
- margin: 20rpx 0 5rpx 0;
- .note-box {
- width: 710rpx;
- height: 100%;
- margin: 0 20rpx;
- border-radius: $border-radius;
- overflow: hidden;
- background-color: #FFF;
- }
- }
- </style>
|