合并主分支前

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,6 +11,24 @@
<view class="scoreBox">
本次考试卷面成绩为<text class="score PM_font">{{exameResult.score}} </text>
</view>
<view class="" style="margin: 20rpx 0; text-align: center;">
<template v-if="exameResult.score >= 1 && selfStudyCertificate.length > 0">
<view class="">
<view class="congritulations">
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
</view>
<view class="">
<text>恭喜您本次考试获得了自考证书请前往 我的->我的证书查看</text>
<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>
</template>
<template v-else>
<text>很遗憾本次考试您没有获得自考证书,祝您下次考试旗开得胜!!</text>
</template>
</view>
<view class="flex_box flex_between">
<button type="primary" size="mini" @click="goToClass">返回课程</button>
<button type="warn" size="mini" @click="goToPaper">查看试卷</button>
@@ -169,6 +187,7 @@
showQuestIndex:false,
secondTimeDif:undefined,
pagetitle:'', // 页面标题
selfStudyCertificate:[],
}
},
async onLoad(e) {
@@ -356,7 +375,7 @@
},300)
},
// q请求提交试卷
sumbitPaper(ids) {
async sumbitPaper(ids) {
let that = this
if(that.flag){
return
@@ -365,7 +384,7 @@
uni.showLoading({
title:'正在交卷'
})
$http.request({
await $http.request({
url: "common/classExam/submitExamPaper",
method: "POST",
data: {
@@ -375,7 +394,7 @@
'Content-Type': 'application/json'
},
})
.then(res => {
.then(async res => {
uni.hideLoading()
if (res.code == 0) {
console.log('交卷结果',res);
@@ -383,22 +402,26 @@
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('时间存储成功');
}
})
if(that.exameResult.score >= 1){
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{
@@ -476,6 +499,11 @@
console.log('noAnswerList', this.noAnswerList)
// },300)
},
onPageJump(url, id) {
uni.navigateTo({
url: `${url}?id=${id}`,
});
},
setDesc() {
const letterArr = []
// 字母A的code值是65但因为已经到字母D了所以直接从69E开始循环
@@ -573,6 +601,49 @@
},1000)
});
},
// 查询证书情况
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
},
giveZero() {
// 没有完成完成考试记为0分
},
@@ -620,6 +691,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;
}
}
.popup_box {
padding-bottom: 20rpx;
width: 85vw;