This commit is contained in:
@fawn-nine
2024-09-05 17:10:11 +08:00
parent a9f706e96f
commit 409e808a3c
6 changed files with 578 additions and 408 deletions

View File

@@ -38,6 +38,58 @@
class="mainTxt">{{students.length}}/{{thisClass.number}}</text></view>
<view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text></view>
</view>
<view class="pingfenBox testBox"
v-if="(thisClass.state == '3' || thisClass.state == '2') && classModel.isExam == 1">
<view class="scoreTitle">
<view class="titles flex_box">
<text>笔试分</text><uni-icons type="help" size="18" color="#fff"
@click="showTestTips = true"></uni-icons>
</view>
</view>
<view class="optionsBox" v-if="thisClass.state == '3'">
<view class=" ">
<view class="">
<!-- -->
<view class="gotoExams" @click="goTest" v-if="paperList.length <= 0">
<text>去考试{{showCountDown}}</text>
</view>
<view class="" v-if="paperList.length > 0 && showCountDown">
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false"
:hour="timeDif.hour"
:minute="timeDif.minutes"
:second="timeDif.second"
color="#ffaa7f" />
</view>
<view class="flex_box flex_center align-items_box userScore" v-else
style="color: #666; justify-content: space-around !important">
<view class="flex_box align-items_box">
<text><text class="PM_font mainTxt" style="font-size: 60rpx; ">{{paperSore}}</text>
</text>
<uni-icons type="eye" size="20" color="#999" @click="showPaperList = true"></uni-icons>
</view>
<view class="" v-if="paperList.length == 1">
<text class="small_btn retake border_radius_10" @click="goTest">再考一次</text>
</view>
</view>
</view>
</view>
<view class="chengji" v-show="thisClass.state == '2'">
<view>恭喜您获得<text class="greenScore">A证</text> <text
class="small_btn border_radius_10 zhengshu">查看证书</text></view>
<view style="margin-top: 20rpx; text-align: center;">很遗憾您的成绩未达标</view>
<view class="" style="margin-top: 20rpx; text-align: center;">
<text class="small_btn chongxiu border_radius_10">加入新班级重修</text>
</view>
<!-- <view style="margin-top: 20rpx;">总成绩为<text class="scoreNumber greenScore">90</text> <text
class="c999">50考试分+40平时表现分</text></view> -->
</view>
</view>
</view>
<view class="pingfenBox" v-if="thisClass.state != 0">
<view class="scoreTitle">
<view class="titles flex_box">
@@ -67,29 +119,7 @@
<text class="ciyao"><i class="mainTxt PM_font">{{performanceScore.questionScore}}</i></text>
</view> -->
</view>
<view class="optionsBox">
<view class=" ">
<view class="">
<view class="gotoExams" @click="goTest">
<text>去考试</text>
</view>
<view class="">
<text>卷面成绩60</text><text class="small_btn retake border_radius_10">再考一次</text>
</view>
</view>
</view>
<view class="chengji">
<view>恭喜您获得<text class="greenScore">A证</text> <text
class="small_btn border_radius_10 zhengshu">查看证书</text></view>
<view style="margin-top: 20rpx; text-align: center;">很遗憾您的成绩未达标</view>
<view class="" style="margin-top: 20rpx; text-align: center;">
<text class="small_btn chongxiu border_radius_10">加入新班级重修</text>
</view>
<view style="margin-top: 20rpx;">总成绩为<text class="scoreNumber greenScore">90</text> <text
class="c999">50考试分+40平时表现分</text></view>
</view>
</view>
</view>
<view class="mainBox">
<view class="">
@@ -178,7 +208,7 @@
考试成绩
</view>
<text class="score">{{item.student.score.testScoreNumber}} </text>
</view>
</view>
</template>
</template>
</view>
@@ -212,7 +242,7 @@
<view class="" v-if="tijiaoTitleId == 2 && false" style="margin: 20rpx 0;">
<radio-group @change="radioChange1" class="flex_box">
<view class="" style="margin-right:20rpx ;">
<radio value="0" />全部同学的</label>
<radio value="0" />全部同学的</label>
</view>
<view class="">
<radio value="1" checked="true" />只看我自己的</label>
@@ -237,7 +267,8 @@
<view class="leve3">
<view class="tips flex_box">
<view class="btn1" @click.stop="changeZheDie(item, index)">
{{item.zhedie ? '收起' : '展开'}}</view>
{{item.zhedie ? '收起' : '展开'}}
</view>
<!-- <text>发布者{{item.createUser.nickname != null && item.createUser.nickname != '' ? item.createUser.nickname : '匿名用户'}}</text> -->
<text style="" class="date">日期{{item.createTime}}</text>
</view>
@@ -254,10 +285,12 @@
<view class="leve3" v-show="item.reply && tijiaoTitleId != 2">
<text>已提交答案</text>
</view>
<view class="leve3 no" v-show="!item.reply && tijiaoTitleId != 2 && thisClass.state == '1'">
<view class="leve3 no"
v-show="!item.reply && tijiaoTitleId != 2 && thisClass.state == '1'">
<text>未提交答案 点击开始答题</text>
</view>
<view class="leve3 cantAnswer" v-show="!item.reply && tijiaoTitleId != 2 && (thisClass.state == '2' || thisClass.state == '3')">
<view class="leve3 cantAnswer"
v-show="!item.reply && tijiaoTitleId != 2 && (thisClass.state == '2' || thisClass.state == '3')">
<text>未作答 已不可作答</text>
</view>
</template>
@@ -332,6 +365,50 @@
</view>
</view>
</u-popup>
<u-popup key="2" :show="showTestTips" :round="10" @close="closeManager">
<view class="guanli">
<h3>考试说明</h3>
<view class="tips border_radius_10">
<text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br />
请在倒计时结束前完成答题倒计时结束后将自动交卷</text>
</view>
</view>
</u-popup>
<u-popup key="3" :show="showPaperList" :round="10" @close="closeManager">
<view class="upopBox" style="">
<h3 style="margin-bottom: 20rpx; text-align: center;">
试卷列表
</h3>
<view class="scoreBox flex_box flex_between border_radius_10 " >
<template v-if="classModel.isExam == 1">
<template v-if="paperList.length == 0">
<view class="">
<view class="">
未参加考试
</view>
</view>
</template>
<template v-else >
<view class="" v-for="(item1, index1) in paperList">
<view class="ciyao">
{{index1 == 0 ? '一' : '二'}}次考试成绩
</view>
<view class="flex_box flex_center" @click.stop="goToPaper(item1.id)">
<text class="score">{{item1.score}} </text>
<view class="seePaper">
<image src="../../static/icon/testPaperIcon.png" mode="widthFix" ></image>
</view>
</view>
</view>
</template>
</template>
<!-- && thisClass.state == '2' -->
<!-- <view v-if="classModel.isExam == 1" :class="['PM_font','zhengshu',thisStudent.student.score.certificateType == 'A' ? 'Azheng' : 'Bzheng']"
></view> -->
</view>
</view>
</u-popup>
<!-- <z-navigation></z-navigation> -->
</view>
@@ -373,6 +450,8 @@
active: false
},
],
timeDif:{},
showCountDown:false,
thisClass: {},
students: [],
@@ -481,7 +560,11 @@
},
roleCode: [],
firstLoad: true, // 是否是第一次请求
blankNumber: 0
blankNumber: 0,
paperList: [],
paperSore: 0, // 最终的笔试成绩
showTestTips: false,
showPaperList:false,
}
},
onLoad(e) {
@@ -515,10 +598,32 @@
this.getList()
uni.stopPullDownRefresh()
},
onShow() {
this.getClassInfo()
async onShow() {
var ss = await this.getClassInfo()
this.getScore()
console.log('this.thisClass.state', this.thisClass.state);
console.log('this.$store.state.paperEndTime',this.$store.state);
if(this.$store.state.paperEndTime && this.$store.state.paperEndTime.time - Date.now() > 0){
var secondTimeDif = this.$store.state.paperEndTime.time - Date.now()
this.timeDif.hour = (secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
this.timeDif.minutes = (secondTimeDif % (1000 * 60 * 60)) / (1000 * 60);
this.timeDif.second = (secondTimeDif % (1000 * 60)) / 1000
this.showCountDown = true
console.log('时间符合吗?',this.showCountDown, secondTimeDif);
}
if (this.thisClass.state == '3') {
var ll = await this.getPaperList()
console.log('this.paperList.length',this.paperList.length);
if (!this.showAlert && this.paperList.length <= 0 ) {
uni.showModal({
title: '提示',
content: '您好当前教学进度已进入考试周请尽快完成最终的笔试考试如在结班endTime之前未完成考试则卷面成绩记为0分',
confirmText: '好的',
showCancel: false
})
this.showAlert = true
}
}
},
computed: {
...mapState(["userInfo"]),
@@ -552,6 +657,7 @@
}
return list
},
// 获得提交项目的tab
getTijiaoTitleList() {
var _list = []
@@ -589,6 +695,65 @@
}
},
methods: {
goToPaper(id){
uni.navigateTo({
url: `/pages/miniClass/paperBack?id=${id}`
})
},
timeup(){
this.showCountDown = false
},
// 获取试卷列表
async getPaperList() {
console.log('--------------',parseInt(this.classId),this.userInfo.id);
await $http.request({
url: "common/classExam/getExamPaperList",
method: "POST",
data: {
"classId": parseInt(this.classId),
"userId": this.userInfo.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then((res) => {
if (res.code == 0) {
console.log('获取试卷列表', res);
this.paperList = res.examPaper
if (this.paperList.length > 0) {
var _list = [...this.paperList]
_list = _list.map(item => {
return item.score
})
var maxNmber = 0
for (var i = 0; i < _list.length; i++) {
if (_list[i] > maxNmber) {
maxNmber = _list[i]
}
}
this.paperSore = maxNmber
} else {
this.paperSore = 0
}
} else {
this.paperSore = 0
uni.showToast({
title: errMsg,
icon: 'none'
})
}
}).catch(e => {
this.paperSore = 0
console.log('获取试卷列表失败', e);
uni.showToast({
title: '获取试卷列表失败',
icon: 'none'
})
});
},
// 查询考试成绩
getPaperScore() {
console.log('获取卷面成绩');
@@ -761,6 +926,7 @@
}
})
},
getList() {
console.log('进入函数了吗');
this.status = 1;
@@ -943,6 +1109,8 @@
},
closeManager() {
this.showMan = false
this.showTestTips = false
this.showPaperList = false
},
fabClick() {
// uni.showToast({
@@ -1088,7 +1256,7 @@
uni.showLoading({
title: '正在加载'
})
$http.request({
await $http.request({
url: "common/class/getClassInfo",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
@@ -1103,16 +1271,7 @@
if (res.code == 0) {
res = classData // 测试数据
this.isHave = res.result.isJoin
this.thisClass = res.result.class
if (!this.showAlert && this.thisClass.state == '3') {
uni.showModal({
title: '提示',
content: '您好当前教学进度已进入考试周请尽快完成最终的笔试考试如在结班endTime之前未完成考试则卷面成绩记为0分',
confirmText: '好的',
showCancel: false
})
this.showAlert = true
}
this.thisClass = res.result.class
if (this.thisClass.state == '0') {
this.tabId = '0'
} else {
@@ -1288,6 +1447,15 @@
}
}
.testBox {
.mainTxt{color: #55aa00 !important;}
.scoreTitle {
.titles {
background-color: #55aa00;
}
}
}
.pingfenBox {
border: 2px dotted #bed4ee;
padding: 20rpx;
@@ -1321,6 +1489,11 @@
}
}
.testBox {
border-color: #aee5b5;
margin-bottom: 20rpx;
}
.zhengshu {
color: #ffaa7f;
border: 1px solid #ffaa7f
@@ -1346,7 +1519,29 @@
.scoreNumber {
font-size: 60rpx;
}
.upopBox {
padding: 40rpx;
max-height: 80vh;
overflow-y: scroll;
color: #666;
.item {
padding: 10rpx 0;
border-bottom: 1px solid #eee;
}
}
.scoreBox{
align-items: center;
border: none !important;
margin-top: 20rpx;
text-align: center; background-color: #fff; padding: 10rpx 20rpx;
.ciyao{color: #999; margin-bottom: 20rpx;}
.score{color: #258feb; font-weight: bold; font-size: 36rpx;}
.seePaper{width: 50rpx; height: 50rpx;
image{width: 100%; height: 100%;}
}
}
.chengji {
padding-top: 20rpx;
margin-top: 20rpx;
@@ -1461,6 +1656,7 @@
color: #ff9277;
text-align: center;
}
.leve3.cantAnswer {
color: #999;
text-align: center;
@@ -1537,9 +1733,7 @@
}
.gotoExams {
margin: 20rpx 0;
margin-top: -10rpx;
margin: 60rpx 0;
text {
display: block;
text-align: center;
@@ -1552,15 +1746,17 @@
}
}
.scoreBox { border-top: 1px solid #eee; padding-top: 10rpx;
justify-content: space-around;
.scoreBox {
border-top: 1px solid #eee;
padding-top: 10rpx;
justify-content: space-around;
align-items: center;
margin-top: 20rpx;
text-align: center;
background-color: #fff;
font-size: 26rpx;
.ciyao {
color: #999;
}
@@ -1570,7 +1766,7 @@
font-weight: bold;
font-size: 36rpx;
}
}
.classMateBox {
@@ -1826,8 +2022,10 @@
}
}
.optionsBox {}
.retake {
border: 1px solid #5049cf;
color: #5049cf;
border: 1px solid #55aa00;
color: #55aa7f;
}
</style>