暂存
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template style="">
|
||||
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
|
||||
<public-module></public-module>
|
||||
<z-nav-bar title="正在考试" backState="2000">
|
||||
<z-nav-bar :title="pagetitle" backState="2000">
|
||||
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
|
||||
@click="showPopup = true">考试说明</text>
|
||||
</z-nav-bar>
|
||||
@@ -107,6 +107,27 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup :show="protocolShow" mode="center" round="6" :key="3">
|
||||
<view class="popup_box">
|
||||
<view class="title">温馨提示</view>
|
||||
<view class="content">
|
||||
<view class="center">
|
||||
用户您好,本次考试时间为 <text style="color: red; font-weight: bold; font-size: 30rpx;">{{testDuration}}</text> 分钟<br />
|
||||
<view style="color: red; font-weight: bold"> 注: </view>
|
||||
<view>
|
||||
<text>①、每位学员共有两次考试的机会,考试成绩以两次成绩的最高分作为最终的卷面成绩,请认真对待每次考试;<br />
|
||||
②、请在倒计时结束前完成答题,倒计时结束后将自动交卷。</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="button_box">
|
||||
<u-button size="small" text="稍后再考" @click="cancelClick"></u-button>
|
||||
<u-button text="开始考试" color="#258feb" size="small" @click="onHandleClickBuy"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -118,6 +139,8 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
testDuration:undefined, // 考试时长
|
||||
protocolShow:false,
|
||||
showPopup: false,
|
||||
code: 0, // 英文code
|
||||
classId: undefined,
|
||||
@@ -142,17 +165,16 @@
|
||||
haveAnswerList:[],
|
||||
exameResult:{},
|
||||
showQuestIndex:false,
|
||||
secondTimeDif:undefined
|
||||
secondTimeDif:undefined,
|
||||
pagetitle:'', // 页面标题
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
console.log('收到得值');
|
||||
this.classId = e.classId
|
||||
// this.examId = e.id
|
||||
if (this.testPaper.length <= 0) {
|
||||
this.getTestPage()
|
||||
}
|
||||
// this.questIndexList = await this.getNowList('add')
|
||||
this.testDuration = e.testDuration
|
||||
this.protocolShow = true
|
||||
this.pagetitle = '准备考试'
|
||||
},
|
||||
onHide() {
|
||||
if (!this.isOvertime) {}
|
||||
@@ -178,6 +200,25 @@
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setPaperEndTime']),
|
||||
cancelClick(){
|
||||
this.protocolShow = false
|
||||
uni.navigateTo({
|
||||
url: `/pages/miniClass/classInfo?id=${this.classId}`
|
||||
})
|
||||
},
|
||||
onHandleClickBuy(){ // 确定开始考试
|
||||
this.protocolShow = false
|
||||
if (this.testPaper.length <= 0) {
|
||||
this.pagetitle = '获取试卷'
|
||||
this.getTestPage()
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'页面发生错误,请退出后重新进入页面或联系客服人员',
|
||||
icon:'none',
|
||||
duration:3000
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取服务器时间
|
||||
async getServerTime() {
|
||||
var time = 0
|
||||
@@ -461,37 +502,26 @@
|
||||
this.endTime = res.planEndTime
|
||||
var severNowTime = await this.getServerTime()
|
||||
this.secondTimeDif = this.endTime - severNowTime // 时间差 毫秒
|
||||
if(this.secondTimeDif > 0){
|
||||
// this.setPaperEndTime({time:this.endTime})
|
||||
// uni.setStorage({
|
||||
// key:'paperEndTime',
|
||||
// data:{
|
||||
// time: this.endTime,
|
||||
// examId: this.examId,
|
||||
// },
|
||||
// success: function () {
|
||||
// console.log('时间存储成功');
|
||||
// }
|
||||
// })
|
||||
let that = this
|
||||
if(this.secondTimeDif > 0){
|
||||
this.timeDif.hour = parseInt((this.secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
|
||||
this.timeDif.minutes = parseInt((this.secondTimeDif % (1000 * 60 * 60)) / (1000 * 60))
|
||||
this.timeDif.second = (this.secondTimeDif % (1000 * 60)) / 1000
|
||||
console.log('this.endTime',this.timeDif.hour, this.timeDif.minutes, this.timeDif.second);
|
||||
|
||||
}else{
|
||||
uni.setStorage({
|
||||
key:'paperEndTime',
|
||||
data:{
|
||||
time: 0,
|
||||
examId: undefined,
|
||||
},
|
||||
success: function () {
|
||||
console.log('时间存储成功');
|
||||
}
|
||||
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:'您的时间已经结束,即将返回班级',
|
||||
confirmText:'好的',
|
||||
showCancel:fals,
|
||||
success: (res) => {
|
||||
if(res.confirm){
|
||||
that.goToClass()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log('本地存储的结束时间', this.$store.state.paperEndTime);
|
||||
}
|
||||
|
||||
this.curQuestion = {
|
||||
...this.testPaper[this.curIndex1]
|
||||
}
|
||||
@@ -501,9 +531,7 @@
|
||||
icon: 'success'
|
||||
})
|
||||
console.log(res, '试卷', this.curQuestion)
|
||||
// setTimeout(() => {
|
||||
// this.getClassInfo()
|
||||
// }, 500)
|
||||
this.pagetitle = '正在考试'
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.errMsg,
|
||||
@@ -570,7 +598,66 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/style/mixin.scss";
|
||||
.popup_box {
|
||||
padding-bottom: 20rpx;
|
||||
width: 85vw;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
height: auto;
|
||||
|
||||
.title {
|
||||
font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
|
||||
font-weight: normal;
|
||||
font-size: 46rpx;
|
||||
color: $themeColor;
|
||||
background-color: #f5f5f5;
|
||||
// line-height: 46rpx;
|
||||
padding: 20rpx;
|
||||
// border-leradius: 6px;
|
||||
border-top-left-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 26rpx;
|
||||
letter-spacing: 0.15rpx;
|
||||
padding: 20rpx;
|
||||
color: #3f3f3f;
|
||||
|
||||
.top {
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
|
||||
.center {
|
||||
line-height: 40rpx;
|
||||
// padding:0 10rpx;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
width: 100%;
|
||||
margin-top: 60rpx;
|
||||
|
||||
font-size: 24rpx;
|
||||
line-height: 26rpx;
|
||||
color: #b0b0b0;
|
||||
}
|
||||
}
|
||||
|
||||
.button_box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.u-button {
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
|
||||
.u-button:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.questIndx { overflow: hidden;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
Reference in New Issue
Block a user