bug修复

This commit is contained in:
binbin_pan 2024-11-27 16:47:03 +08:00
parent 21a6266149
commit 7cff02d9ca
3 changed files with 79 additions and 329 deletions

View File

@ -723,14 +723,17 @@ export default {
.options {
margin-top: 10px;
margin-bottom: 30px;
max-height: 330px;
overflow: auto;
.option-wrapper {
max-height: 500px;
max-height: 200px;
overflow: auto;
.option {
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 10px;
margin-bottom: 5px;
background: #f4f9fe;
border-radius: 5px;
&.isActive {

View File

@ -1,6 +1,6 @@
<template>
<view>
<div class="content">
<div class="content" @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd">
<div class="top-content">
<div class="top-wrapper">
<div class="all" :class="{ isAllActive: isActive !== 1 }" @click="handleTab(1)">全部</div>
@ -50,20 +50,34 @@
</div>
</div>
<div class="question">{{ currentIndex + 1 }}. {{ item.examTopic }}</div>
<u-image
v-if="item.examTopicUrl"
:showLoading="true"
:src="fileUrl + item.examTopicUrl || ''"
width="60px"
height="60px"
style="margin-bottom: 10px"
@click="clickImg(fileUrl + item.examTopicUrl)"
/>
<div class="options">
<div
class="option"
v-for="(option, optionIndex) in item.listOption"
:key="optionIndex"
:class="{ isRight: option.isRight, isError: option.isError }"
>
<div class="option-item">{{ option.optionIdent }}.</div>
<div class="option-content">
<div>{{ option.optionContent }}</div>
<u-icon v-if="option.isRight" name="/static/images/correct.png" />
<u-icon v-if="option.isError" name="/static/images/error.png" />
<div class="option-wrapper" v-for="(option, optionIndex) in item.listOption" :key="optionIndex">
<div class="option" :class="{ isRight: option.isRight, isError: option.isError }">
<div class="option-item">{{ option.optionIdent }}.</div>
<div class="option-content">
<div>{{ option.optionContent }}</div>
<u-icon v-if="option.isRight" name="/static/images/correct.png" />
<u-icon v-if="option.isError" name="/static/images/error.png" />
</div>
</div>
<u--image
v-if="option.optionUrl"
:showLoading="true"
:src="fileUrl + option.optionUrl || ''"
width="60px"
height="60px"
style="margin-bottom: 10px"
@click="clickImg(fileUrl + option.optionUrl)"
/>
</div>
</div>
</div>
@ -143,325 +157,15 @@ export default {
unAnsweredCount: 0,
//
questionList: [],
// questionList: [
// {
// type: 1,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// },
// {
// label: '',
// value: 'C'
// },
// {
// label: '',
// value: 'D'
// }
// ],
// correctGrade: 'A',
// selectAnswer: 'B',
// analysis: ''
// },
// {
// type: 2,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// },
// {
// label: '',
// value: 'C'
// },
// {
// label: '',
// value: 'D'
// }
// ],
// correctGrade: ['B', 'D'],
// selectAnswer: ['B', 'C'],
// analysis: ''
// },
// {
// type: 3,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// }
// ],
// correctGrade: 'A',
// selectAnswer: 'A',
// analysis: ''
// },
// {
// type: 1,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// },
// {
// label: '',
// value: 'C'
// },
// {
// label: '',
// value: 'D'
// }
// ],
// correctGrade: 'A',
// userAnswer: 'A',
// analysis: ''
// },
// {
// type: 2,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// },
// {
// label: '',
// value: 'C'
// },
// {
// label: '',
// value: 'D'
// }
// ],
// correctGrade: ['B', 'D'],
// userAnswer: ['B', 'C'],
// analysis: ''
// },
// {
// type: 2,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// },
// {
// label: '',
// value: 'C'
// },
// {
// label: '',
// value: 'D'
// }
// ],
// correctGrade: ['B', 'D'],
// userAnswer: ['B', 'D'],
// analysis: ''
// },
// {
// type: 3,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// }
// ],
// correctGrade: 'A',
// userAnswer: 'A',
// analysis: ''
// },
// {
// type: 1,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// },
// {
// label: '',
// value: 'C'
// },
// {
// label: '',
// value: 'D'
// }
// ],
// rightAnswer: 'A',
// userAnswer: 'B',
// analysis: ''
// },
// {
// type: 2,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// },
// {
// label: '',
// value: 'C'
// },
// {
// label: '',
// value: 'D'
// }
// ],
// rightAnswer: ['B', 'D'],
// userAnswer: ['B', 'C'],
// analysis: ''
// },
// {
// type: 3,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// }
// ],
// rightAnswer: 'A',
// userAnswer: 'A',
// analysis: ''
// },
// {
// type: 1,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// },
// {
// label: '',
// value: 'C'
// },
// {
// label: '',
// value: 'D'
// }
// ],
// rightAnswer: 'A',
// userAnswer: 'B',
// analysis: ''
// },
// {
// type: 2,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// },
// {
// label: '',
// value: 'C'
// },
// {
// label: '',
// value: 'D'
// }
// ],
// rightAnswer: ['B', 'D'],
// userAnswer: ['B', 'C'],
// analysis: ''
// },
// {
// type: 3,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// }
// ],
// rightAnswer: 'A',
// userAnswer: 'A',
// analysis: ''
// },
// {
// type: 3,
// question: '线',
// options: [
// {
// label: '',
// value: 'A'
// },
// {
// label: '',
// value: 'B'
// }
// ],
// correctGrade: 'A',
// userAnswer: '',
// analysis: ''
// }
// ],
//
fileUrl: config.fileUrl,
rightList: [],
//
wrongList: [],
//
unAnsweredList: [],
list: []
list: [],
startX: 0, // X
endX: 0 // X
}
},
onLoad(opt) {
@ -618,6 +322,44 @@ export default {
element.isActive = false
})
item.isActive = true
},
clickImg(url) {
this.isHide = true
uni.previewImage({
urls: [url]
})
// this.screenCount--
},
touchStart(event) {
this.startX = 0
this.endX = 0
console.log('🚀 ~ 开始 ~ event:', event)
//
this.startX = event.touches[0].clientX
console.log('🚀 ~ touchStart ~ this.startX:', this.startX)
},
touchMove(event) {
console.log('🚀 ~ 移动 ~ event:', event)
//
this.endX = event.touches[0].clientX
console.log('🚀 ~ touchMove ~ this.endX:', this.endX)
},
touchEnd() {
//
if (this.startX != 0 && this.endX != 0 && this.startX - this.endX > 10) {
//
console.log('向左滑动')
this.currentIndex++
} else if (this.startX != 0 && this.endX != 0 && this.endX - this.startX > 10) {
//
console.log('向右滑动')
this.currentIndex--
}
if (this.currentIndex < 0) {
this.currentIndex = 0
} else if (this.currentIndex > this.questionList.length - 1) {
this.currentIndex = this.questionList.length - 1
}
}
}
}
@ -736,11 +478,16 @@ export default {
.options {
margin-top: 10px;
.option-wrapper {
max-height: 500px;
overflow: auto;
}
.option {
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 10px;
margin-bottom: 5px;
background: #f4f9fe;
border-radius: 5px;

View File

@ -1,6 +1,6 @@
<template>
<view class="wrapper">
<u-navbar title="学习项目" @leftClick="leftClick" placeholder />
<u-navbar title="练习" @leftClick="leftClick" placeholder />
<!-- <div class="top-container">
<u-avatar :src="avatar" size="60" />
<div class="name">{{ userName }}</div>