Commit 25035ae6 authored by zhengke's avatar zhengke

1

parent 568e0327
......@@ -39,7 +39,7 @@
</template>
</view>
</view>
<view class="AnswerContent" v-if="!isOperate&&(ExamStatus==2||ExamStatus==3)">
<view class="AnswerContent" v-if="!isOperate">
<view>
<text style="color: #8c8a94">正确答案:</text>
<text class="isTrueAnswer">{{ item1.Answer }}</text>
......
......@@ -65,7 +65,7 @@
</template>
</view>
</view>
<view class="AnswerContent" v-if="!isOperate&&(ExamStatus==2||ExamStatus==3)">
<view class="AnswerContent" v-if="!isOperate">
<view>
<text style="color: #8c8a94">正确答案:</text>
<text class="isTrueAnswer">{{ item1.Answer }}</text
......
......@@ -20,26 +20,43 @@
alt="" />
</view>
<view class="examContent">
<template v-if="!isShowLate">
<view>1.本场考试满分{{paperData.Publish.ExamScore}}</view>
<view style="margin:18rpx 0">
2.考试时长{{paperData.Publish.ExamTimes}}分钟,开考后{{paperData.Publish.SubmitTimes}}分钟内禁止交卷</view>
<view v-if="paperData.Publish.ExamNotice">
3.<view v-html="paperData.Publish.ExamNotice"></view>
</view>
<!-- 考试已开始 -->
<template v-if="ExamStatus==2">
<template v-if="!isShowLate">
<view>1.本场考试满分{{paperData.Publish.ExamScore}}</view>
<view style="margin:18rpx 0">
2.考试时长{{paperData.Publish.ExamTimes}}分钟,开考后{{paperData.Publish.SubmitTimes}}分钟内禁止交卷</view>
<view v-if="paperData.Publish.ExamNotice" style="display:flex;">
3.<view v-html="paperData.Publish.ExamNotice"></view>
</view>
</template>
<template v-else>
<view style="text-align: center;">对不起,您本次考试迟到{{paperData.Publish.EnterTimes}}分钟,不能参加考试</view>
</template>
</template>
<template v-else>
<view style="text-align: center;">对不起,您本次考试迟到{{paperData.Publish.EnterTimes}}分钟,不能参加考试</view>
<template v-if="ExamStatus==1">
<view style="text-align:center;">对不起,本次考试还未开始</view>
</template>
<template v-if="ExamStatus==4">
<view style="text-align:center;">对不起,本次考试您已缺考</view>
</template>
</view>
</view>
<view class="submitBox">
<view class="submit" :class="{disabled: !canClick}" v-if="!isShowLate" @click="back">
我已知晓<text v-if="totalTime>0">({{totalTime}}s)</text>
</view>
<view class="submit" v-else @click="backToIndex">
我已知晓
</view>
<template v-if="ExamStatus==2">
<view class="submit" :class="{disabled: !canClick}" v-if="!isShowLate" @click="back">
我已知晓<text v-if="totalTime>0">{{totalTime}}s)</text>
</view>
<view class="submit" v-else @click="backToIndex">
我已知晓
</view>
</template>
<!-- 未开始 -->
<template v-if="ExamStatus==1||ExamStatus==4">
<view class="submit" @click="backToIndex">
我已知晓
</view>
</template>
</view>
<van-toast id="van-toast" />
</view>
......@@ -55,15 +72,17 @@
watch,
computed,
onMounted,
} from "vue";
} from "vue";
export default {
props: {
paperData: Object
paperData: Object,
ExamStatus: Number
},
setup(props, ctx) {
let Gid = uni.getStorageSync("userInfo").Id;
let data = reactive({
paperData: props.paperData,
ExamStatus: props.ExamStatus,
totalTime: 5,
   canClick: true ,//添加canClick
isShowLate:false
......@@ -96,17 +115,14 @@
uni.navigateBack();
}
};
onMounted(() => {
if(data.paperData.Publish.EnterTimes&&data.paperData.Publish.EnterTimes>0){
let time1 = data.paperData.Publish.ExamStartTime;
onMounted(() => {
if(props.paperData.Publish.EnterTimes&&props.paperData.Publish.EnterTimes>0){
let time1 = props.paperData.Publish.ExamStartTime;
let time2 = methods.getNowTime();
console.log(time1,'time1');
console.log(time2,'time2');
var d1 = new Date(time1);
var d2 = new Date(time2);
let TimeDis = parseInt(d2 - d1) / 1000 / 60;
console.log(TimeDis,'分钟');
if (TimeDis > data.paperData.Publish.EnterTimes) {
if (TimeDis > props.paperData.Publish.EnterTimes) {
data.isShowLate=true
}
}
......
......@@ -340,12 +340,12 @@
<answerSee
:paperData="peaperDetail"
@chooseTopic="jumpTopic"
@hideAnswer="hideAnswerSheet"
v-if="isShowAnswerSee"
/>
</view>
<view class="answer-con" v-if="isShowNotice">
<examNotice :paperData="peaperDetail" @hideNotice="hideNotice" />
<examNotice :paperData="peaperDetail" :ExamStatus="ExamStatus" @hideNotice="hideNotice" />
</view>
<van-toast id="van-toast" />
</view>
......@@ -433,7 +433,7 @@ export default {
autoTimeStart: false,
isOperate: false, //考试状态 判断是考试还是查看答案
isAutoTime: false,
ExamStatus: -2,
ExamStatus: -1,
StartTime: "", //页面加载后的时间
SubmitTimes: 0, //后台设置几分钟后可提交
isShowNotice: false, //是否显示考前须知
......@@ -457,17 +457,8 @@ export default {
if (res) {
if (res.Code == 1) {
data.peaperDetail = res.Data;
//-1-缺考, 0-未开始,1-已开始,2-已考试,3-已阅卷
this.ExamStatus = res.Data.ExamStatusTemp;
console.log(277, data.peaperDetail);
this.SubmitTimes = res.Data.Publish.SubmitTimes;
//判断是答卷
if (res.Data.ExamStatusTemp == 1) {
this.isShowNotice = true;
this.isOperate = true;
data.autoTimeStart = true;
data.time = res.Data.Publish.ExamTimes * 60 * 1000;
}
data.time = res.Data.Publish.ExamTimes * 60 * 1000;
}
}
},
......@@ -600,12 +591,22 @@ export default {
if (options.Exam_Student_Id) {
this.Exam_Student_Id = options.Exam_Student_Id;
}
if (
options.ExamStatus &&
(options.ExamStatus == 1 || options.ExamStatus == 3)
) {
this.msg.isShowAnswer = true;
//ExamStatus 1未开始 2已开始 3已考试 4缺考 5已阅卷
if (options.ExamStatus) {
this.ExamStatus = options.ExamStatus;
if(this.ExamStatus==3){
this.msg.isShowAnswer = true;
}
if(this.ExamStatus == 2||this.ExamStatus==1||this.ExamStatus==4){
this.isShowNotice = true;
this.isOperate = true;
this.autoTimeStart = true;
}
if(this.ExamStatus == 3||this.ExamStatus==5){
this.isOperate = false
}
}
console.log('1111');
await this.getPaperDetail();
if (options.showScore) {
this.isShowAnswer = true;
......
......@@ -117,7 +117,6 @@
"
>
查看更多
<view @click="goExamScore">跳转</view>
</view>
</van-cell>
</van-cell-group>
......@@ -283,7 +282,8 @@ export default {
},
//根据状态跳转
getItemStatus(item){
if(item.ExamStatus==3){
//ExamStatus 1未开始 2已开始 3已考试 4缺考 5已阅卷
if(item.ExamStatus==5){
this.jumpPage(
`/pages/exam/examScore?GuestId=${item.GuestId}&&PaperId=${item.PaperId}&&Id=${item.Id}&&Exam_Student_Id=${item.Exam_Student_Id}&&ExamStatus=${item.ExamStatus}`
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment