合并主分支前

This commit is contained in:
@fawn-nine
2024-10-16 16:50:25 +08:00
parent 2b43488ee9
commit c316123157
5 changed files with 211 additions and 45 deletions

View File

@@ -11,10 +11,31 @@
<view class="scoreBox">
本次考试卷面成绩为<text class="score PM_font">{{exameResult.score}} </text>
</view>
<view class="" v-if="testPaper.type == '2'" style="margin: 20rpx 0; text-align: center;" >
<template v-if="exameResult.score >= 60 && selfStudyCertificate.length > 0">
<view class="">
<view class="congritulations">
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
</view>
<view class="">
<text>恭喜您本次考试获得了自考证书请前往 我的->我的证书查看</text>
<view class="" style="text-align: center;">
<text class="small_btn border_radius_10"
style="display: block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff"
@click="onPageJump('/pages/certificate/certificate')">查看证书</text>
</view>
</view>
</view>
</template>
<template v-else>
<text>很遗憾本次考试您没有获得自考证书,祝您下次考试旗开得胜!!</text>
</template>
</view>
<view class="flex_box flex_between">
<button type="primary" v-if="testPaper.type == '2'" size="mini" @click="goToCourse">返回课程</button>
<button type="primary" v-else size="mini" @click="goToClass">返回班级</button>
<button type="warn" size="mini" @click="goToPaper">查看试卷</button>
<button type="primary" v-if="testPaper.type == '2'" @click="goToCourse">返回课程</button>
<button type="primary" v-else @click="goToClass">返回班级</button>
<button type="warn" @click="goToPaper">查看试卷</button>
</view>
<view class="result_imgBox">
<image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image>
@@ -146,7 +167,7 @@
step: 8, /// 步长
// questIndexList: [],
nowPart: 1,
selfStudyCertificate:[],
maxNumber: 0,
minNumber: 0,
noAnswerList: [],
@@ -187,6 +208,49 @@
},
methods: {
...mapMutations(['setPaperEndTime']),
// 查询证书情况
async getCertificateInfo() {
var list = undefined
await $http.request({
url: "common/userCertificate/getUserCertificateList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"type": '', //证书类型A a证 B b证 ZK自考
"courseId": this.courseId //课程id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code != 0) {
uni.showToast({
title: res.errMsg,
icon: 'none'
})
return
}
if (res.code == 0) {
res.certificateList.forEach(item => {
item.certificateUrl && item.certificateUrl != '' ? item
.certificateUrlList = item.certificateUrl.split(',') : item
.certificateUrlList = []
})
list = res.certificateList
}
console.log('证书接口请求结果', res);
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.errMsg,
icon: 'none'
})
});
return list
},
async getServerTime() {
var time = 0
await $http.request({
@@ -337,7 +401,7 @@
},300)
},
// q请求提交试卷
sumbitPaper(ids) {
async sumbitPaper(ids) {
let that = this
if(that.flag){
return
@@ -346,7 +410,7 @@
uni.showLoading({
title:'正在交卷'
})
$http.request({
await $http.request({
url: "common/classExam/submitExamPaper",
method: "POST",
data: {
@@ -356,7 +420,7 @@
'Content-Type': 'application/json'
},
})
.then(res => {
.then(async res => {
uni.hideLoading()
if (res.code == 0) {
@@ -365,23 +429,28 @@
title: '交卷成功',
icon: 'success'
})
setTimeout( ()=>{
setTimeout(async ()=>{
that.exameResult = res.examPaper
// this.timeup()
that.showQuestIndex = false
that.secondTimeDif = 0
that.isOvertime = true
uni.setStorage({
key:'paperEndTime',
data:{
time: 0,
examId: undefined
},
success: function () {
console.log('时间存储成功');
that.isOvertime = true
if(that.testPaper.type == '2' && that.exameResult.score >= 60) {
// if(that.exameResult.score >= 60){
var newCertificate = await that.getCertificateInfo()
console.log('5555555证书资料', newCertificate);
that.selfStudyCertificate = []
if (newCertificate && newCertificate.length > 0) {
newCertificate.forEach(item => {
if (item.classId != '' && item.classId > 0) {
// this.classCertificate.push(item)
} else {
that.selfStudyCertificate.push(item)
}
})
}
})
// }
}
},300)
}else{
@@ -633,7 +702,17 @@
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.congritulations {
width: 120rpx;
height: 120rpx;
text-align: center;
margin: 10rpx auto;
display: block;
image {
width: 120rpx;
height: 120rpx;
}
}
.questIndx { overflow: hidden;
margin-top: 20rpx;
margin-bottom: 20rpx;