样式优化

This commit is contained in:
binbin_pan 2024-12-31 15:56:22 +08:00
parent 48df6fd6e7
commit 0400ac61ce
4 changed files with 55 additions and 30 deletions

View File

@ -21,12 +21,14 @@
</div> </div>
</div> </div>
<div class="explain">*进入考试后计时结束将自动交卷退出后将会继续计时考试期间请勿登录其他设备否则成绩作废</div> <div class="explain">
*进入考试后计时结束将自动交卷退出后将会继续计时考试期间请勿登录其他设备否则成绩作废
</div>
<!-- 底部固定按钮 --> <!-- 底部固定按钮 -->
<div class="bottom-btn"> <div class="bottom-btn">
<div class="btn"> <div class="btn">
<u-button type="primary" size="small" shape="circle" text="进入考试" @click="openModal" /> <u-button type="primary" shape="circle" text="进入考试" @click="openModal" />
</div> </div>
</div> </div>
@ -117,7 +119,7 @@ export default {
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
background-color: #fff; background-color: #fff;
height: 90vh; height: calc(100vh - 90px);
box-sizing: border-box; box-sizing: border-box;
.title { .title {
@ -129,14 +131,14 @@ export default {
.subtitle { .subtitle {
font-size: 14px; font-size: 14px;
color: #666; color: #3185f0;
margin-top: 10px; margin-top: 10px;
} }
.info { .info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 20px; margin-top: 50px;
.duration-wrapper, .duration-wrapper,
.count-wrapper, .count-wrapper,
@ -182,6 +184,7 @@ export default {
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 50px;
background-color: #fff; background-color: #fff;
padding: 10px 0; padding: 10px 0;
display: flex; display: flex;

View File

@ -2,9 +2,19 @@
<view :style="{ fontSize: fontSize + 'px' }"> <view :style="{ fontSize: fontSize + 'px' }">
<u-navbar leftIcon="" title="考试" :placeholder="true"> <u-navbar leftIcon="" title="考试" :placeholder="true">
<view class="u-nav-slot" slot="right"> <view class="u-nav-slot" slot="right">
<u-tag text="小" :type="fontSize == 19 ? 'primary' : 'info'" @click="changeFont(19)" style="margin-right: 8px" ></u-tag> <u-tag
<u-tag text="中" :type="fontSize == 21 ? 'primary' : 'info'" @click="changeFont(21)" style="margin-right: 8px"></u-tag> text="小"
<u-tag text="大" :type="fontSize == 23 ? 'primary' : 'info'" @click="changeFont(23)"></u-tag> :type="fontSize == 19 ? 'primary' : 'info'"
@click="changeFont(19)"
style="margin-right: 8px"
></u-tag>
<u-tag
text="中"
:type="fontSize == 21 ? 'primary' : 'info'"
@click="changeFont(20.5)"
style="margin-right: 8px"
></u-tag>
<u-tag text="大" :type="fontSize == 23 ? 'primary' : 'info'" @click="changeFont(22)"></u-tag>
</view> </view>
</u-navbar> </u-navbar>
<div class="content" @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd"> <div class="content" @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd">
@ -70,27 +80,30 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 题目 --> <!-- 题目 -->
<div class="question-wrapper" v-for="(item, index) in questionList" :key="index" v-show="index == currentIndex"> <div class="question-wrapper" v-for="(item, index) in questionList" :key="index" v-show="index == currentIndex">
<div class="question-type-wrapper"> <div class="question-type-wrapper">
<div class="line" /> <div class="line" :style="{ height: fontSize - 8 + 'px' }" />
<div class="question-type"> <div class="question-type" :style="{ fontSize: fontSize - 2 + 'px' }">
<div v-if="item.examType == 1">单选题{{ item.questionScore }}</div> <div v-if="item.examType == 1">单选题{{ item.questionScore }}</div>
<div v-if="item.examType == 2">多选题{{ item.questionScore }}</div> <div v-if="item.examType == 2">多选题{{ item.questionScore }}</div>
<div v-if="item.examType == 3">判断题{{ item.questionScore }}</div> <div v-if="item.examType == 3">判断题{{ item.questionScore }}</div>
</div> </div>
</div> </div>
<div class="question">{{ currentIndex + 1 }}. {{ item.examTopic }}</div> <div class="question" :style="{ fontSize: fontSize + 2 + 'px' }">
<u--image {{ currentIndex + 1 }}. {{ item.examTopic }}
</div>
<u-image
v-if="item.examTopicUrl" v-if="item.examTopicUrl"
:showLoading="true" :showLoading="true"
:src="fileUrl + item.examTopicUrl || ''" :src="fileUrl + item.examTopicUrl || ''"
width="60px" width="60px"
height="60px" height="60px"
style="margin-bottom: 10px" style="margin: 0 10px 15px 0"
@click="clickImg(fileUrl + item.examTopicUrl)" @click="clickImg(fileUrl + item.examTopicUrl)"
/> />
<u-line />
<div class="options"> <div class="options">
<div class="option-wrapper" v-for="(option, optionIndex) in item.listOption" :key="optionIndex"> <div class="option-wrapper" v-for="(option, optionIndex) in item.listOption" :key="optionIndex">
<div <div
@ -101,13 +114,13 @@
<div class="option-item">{{ option.optionIdent }}.</div> <div class="option-item">{{ option.optionIdent }}.</div>
<div class="option-content">{{ option.optionContent }}</div> <div class="option-content">{{ option.optionContent }}</div>
</div> </div>
<u--image <u-image
v-if="option.optionUrl" v-if="option.optionUrl"
:showLoading="true" :showLoading="true"
:src="fileUrl + option.optionUrl || ''" :src="fileUrl + option.optionUrl || ''"
width="60px" width="60px"
height="60px" height="60px"
style="margin-bottom: 10px" style="margin: 15px 10px 5px 0"
@click="clickImg(fileUrl + option.optionUrl)" @click="clickImg(fileUrl + option.optionUrl)"
/> />
</div> </div>
@ -117,7 +130,7 @@
<!-- 底部按钮 --> <!-- 底部按钮 -->
<div style="height: 75px"></div> <div style="height: 75px"></div>
<div class="bottom-btn"> <div class="bottom-btn">
<div class="btn" v-show="currentIndex != 0"> <div class="btn" v-if="currentIndex != 0">
<u-button shape="circle" text="上一题" @click="currentIndex--" /> <u-button shape="circle" text="上一题" @click="currentIndex--" />
</div> </div>
<div class="btn" v-if="currentIndex !== questionList.length - 1"> <div class="btn" v-if="currentIndex !== questionList.length - 1">
@ -162,8 +175,10 @@ import {
updStudyDurationExamPractice updStudyDurationExamPractice
} from '@/api/eduApp' } from '@/api/eduApp'
import config from '@/config' import config from '@/config'
import uLine from '../../../uni_modules/uview-ui/components/u-line/u-line.vue'
export default { export default {
components: { uLine },
data() { data() {
return { return {
isLoading: false, isLoading: false,
@ -686,6 +701,7 @@ export default {
height: 90vh; height: 90vh;
.top-content { .top-content {
margin: 10px;
background: #fff; background: #fff;
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
@ -749,15 +765,13 @@ export default {
.question-wrapper { .question-wrapper {
padding: 10px; padding: 10px;
.question-type-wrapper { .question-type-wrapper {
margin: 20px 0; margin: 20px 0 10px;
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
.line { .line {
width: 2px; border: 2px solid #1989fa;
height: 11px;
background: #1989fa;
margin-right: 3px; margin-right: 3px;
} }
.question-type { .question-type {
@ -766,13 +780,13 @@ export default {
} }
.question { .question {
margin-bottom: 8px;
font-weight: 800; font-weight: 800;
color: #333333; color: #333333;
} }
} }
.options { .options {
margin-top: 10px; margin: 5px 0 30px 20px;
margin-bottom: 30px;
overflow: auto; overflow: auto;
.option-wrapper { .option-wrapper {
max-height: 200px; max-height: 200px;
@ -797,7 +811,7 @@ export default {
color: #333; color: #333;
} }
.option-content { .option-content {
margin-left: 10px; /* margin-left: 10px; */
color: #333; color: #333;
} }
} }
@ -812,12 +826,17 @@ export default {
padding: 15px 0; padding: 15px 0;
padding-bottom: 18px; padding-bottom: 18px;
display: flex; display: flex;
justify-content: flex-end; justify-content: space-between;
align-items: center; align-items: center;
.btn { .btn {
width: 100px; width: 100px;
margin-right: 10px; &:first-child {
margin-left: 15px;
}
&:last-child {
margin-right: 15px;
}
} }
} }
} }

View File

@ -63,7 +63,7 @@
/> />
</div> --> </div> -->
<div class="btn"> <div class="btn">
<u-button type="primary" size="small" shape="circle" text="重新考试" @click="handleResetExamination" /> <u-button type="primary" shape="circle" text="重新考试" @click="handleResetExamination" />
</div> </div>
</div> </div>
</view> </view>
@ -274,7 +274,7 @@ export default {
.center-container { .center-container {
margin: 0 10px; margin: 0 10px;
width: calc(100% - 20px); width: calc(100% - 20px);
height: 250px; height: 275px;
background: #e8f2fe; background: #e8f2fe;
border-radius: 20px; border-radius: 20px;
display: flex; display: flex;
@ -287,7 +287,7 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
margin: 0 10px; margin: 30px 10px 10px;
.item { .item {
margin-top: 25px; margin-top: 25px;

View File

@ -289,6 +289,7 @@ export default {
return return
} }
const params = { const params = {
...item,
id: item.examMsg.id, // id id: item.examMsg.id, // id
cutNum: item.examMsg.isCut, // cutNum: item.examMsg.isCut, //
examNum: item.examMsg.examNum, // examNum: item.examMsg.examNum, //
@ -297,7 +298,9 @@ export default {
studyId: this.studyId, // id studyId: this.studyId, // id
responseTime: item.examMsg.responseTime, // responseTime: item.examMsg.responseTime, //
score: item.examMsg.score, // score: item.examMsg.score, //
passScore: item.examMsg.passScore // passScore: item.examMsg.passScore, //
name: item.examMsg.name, //
validityDate: item.examMsg.validityDate //
} }
console.log('🚀 ~ toggleTheoryExam ~ params:', params) console.log('🚀 ~ toggleTheoryExam ~ params:', params)
uni.navigateTo({ uni.navigateTo({