Commit 25035ae6 authored by zhengke's avatar zhengke

1

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