合并主分支前

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

@@ -6,9 +6,9 @@ if (process.env.NODE_ENV === 'development') {
// socketUrl = "ws://localhost:6001/"; // socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/"; // baseUrl = "https://twin-ui.com/demo/";
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境 // baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
baseUrl = "https://api.nuttyreading.com/"; // 线上正式 // baseUrl = "https://api.nuttyreading.com/"; // 线上正式
// baseUrl = "http://192.168.110.110:9200/pb/"; // 磊哥 // baseUrl = "http://192.168.110.110:9200/pb/"; // 磊哥
// baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑 baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
// baseUrl = "http://59.110.212.44:9200/pb/"; // baseUrl = "http://59.110.212.44:9200/pb/";
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑 // baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
// baseUrl = "http://192.168.110.110:9200/pb/"; // baseUrl = "http://192.168.110.110:9200/pb/";

View File

@@ -11,12 +11,13 @@
<view class="flex_box flex_between align-items_box"> <view class="flex_box flex_between align-items_box">
<h3 style="font-size: 28rpx;">编号{{item.certificateNo}}</h3> <h3 style="font-size: 28rpx;">编号{{item.certificateNo}}</h3>
<text style="font-size: 26rpx; color: #999;">获得时间{{item.createTime.substring(0, 10)}}</text> <text style="font-size: 26rpx; color: #999;">获得时间{{item.createTime.substring(0, 10)}}</text>
</view>
<view class="flex_box flex_center" v-if="item.certificateUrlList.length <= 0" >
<text class="small_btn border_radius_10" <text class="small_btn border_radius_10"
style="display: block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff" style="display: block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff"
v-if="item.certificateUrlList.length <= 0"
@click="showSubmit(item.id)">立即获取证书</text> @click="showSubmit(item.id)">立即获取证书</text>
</view> </view>
<view class="imgBox flex_box flex_between" v-if="item.certificateUrlList.length > 0"> <view class="imgBox flex_box flex_between" v-if="item.certificateUrlList.length > 0">
<view class="img" v-for="(item1,index1) in item.certificateUrlList" :key="index1"> <view class="img" v-for="(item1,index1) in item.certificateUrlList" :key="index1">
<image @click="preveImg(item1)" :src="item1" mode="heightFix"></image> <image @click="preveImg(item1)" :src="item1" mode="heightFix"></image>

View File

@@ -70,8 +70,10 @@
<!-- 自考入口 没有加入班级的时候暴漏入口--> <!-- 自考入口 没有加入班级的时候暴漏入口-->
<view class="selfStudyBox" <view class="selfStudyBox"
v-if="course.canzk == '1' && librayList[curIndex] && (!classInfo.id || classInfo.state == '2' || selfStudyCertificate.length >= 0)"> v-if="course.canzk == '1' && librayList[curIndex] && (!classInfo.id || classInfo.state == '2' || selfStudyCertificate.length >= 0)">
<view style="padding: 20rpx;" <view style="padding: 20rpx;"
v-if="(selfStudyCertificate.length == 0 || selfStudyPaperList.length > 0 && !testingPaper.id) && (!classInfo.id || classInfo.state == '2')"> v-if="selfStudyCertificate.length > 0 || selfStudyCertificate.length == 0 && (!classInfo.id || classInfo.state == '2')">
<view class=""> <view class="">
<view class="" style="line-height: 40rpx; font-size: 28rpx;" <view class="" style="line-height: 40rpx; font-size: 28rpx;"
v-if="selfStudyCertificate.length == 0"> v-if="selfStudyCertificate.length == 0">
@@ -107,10 +109,12 @@
</view> </view>
</view> </view>
<view class=" " style="margin-top: 20rpx; text-align: center;"> <view class=" " style="margin-top: 20rpx; text-align: center;">
<!-- <view class=""> --> <!-- <view class=""> -->
<!-- {{canJoinTestTime}} --> <!-- {{canJoinTestTime}} -->
<!-- {{selfStudyPaperList.length % 2}} --> <!-- {{selfStudyPaperList.length % 2}} -->
<template v-if="selfStudyCertificate.length <= 0 && (!classInfo.id || classInfo.state == '2')"> <template v-if="selfStudyCertificate.length <= 0 && (!classInfo.id || classInfo.state == '2')">
<template v-if="!testingPaper.id"> <template v-if="!testingPaper.id">
<button @click="onPageJump('/pages/selfStudy/selfStudy',courseId)" <button @click="onPageJump('/pages/selfStudy/selfStudy',courseId)"
style="padding: 0 20rpx" type="primary" style="padding: 0 20rpx" type="primary"
@@ -169,7 +173,6 @@
</view> </view>
</view> </view>
</view> </view>
<!-- {{classInfo.id}} -->
<view class="classEntrance" v-if="classInfo.id"> <view class="classEntrance" v-if="classInfo.id">
<view class="flex_box" style="justify-content: space-between;"> <view class="flex_box" style="justify-content: space-between;">
<view class="flex_box classTitleBox"> <view class="flex_box classTitleBox">
@@ -949,6 +952,7 @@
.then(async (res) => { .then(async (res) => {
if (res.code == 0 && res.result.length > 0) { if (res.code == 0 && res.result.length > 0) {
this.linkClassList = res.result this.linkClassList = res.result
this.classInfo = {}
} else { } else {
this.linkClassList = [] this.linkClassList = []
// 查询是否有所在的班级 // 查询是否有所在的班级

View File

@@ -11,10 +11,31 @@
<view class="scoreBox"> <view class="scoreBox">
本次考试卷面成绩为<text class="score PM_font">{{exameResult.score}} </text> 本次考试卷面成绩为<text class="score PM_font">{{exameResult.score}} </text>
</view> </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"> <view class="flex_box flex_between">
<button type="primary" v-if="testPaper.type == '2'" size="mini" @click="goToCourse">返回课程</button> <button type="primary" v-if="testPaper.type == '2'" @click="goToCourse">返回课程</button>
<button type="primary" v-else size="mini" @click="goToClass">返回班级</button> <button type="primary" v-else @click="goToClass">返回班级</button>
<button type="warn" size="mini" @click="goToPaper">查看试卷</button> <button type="warn" @click="goToPaper">查看试卷</button>
</view> </view>
<view class="result_imgBox"> <view class="result_imgBox">
<image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image> <image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image>
@@ -146,7 +167,7 @@
step: 8, /// 步长 step: 8, /// 步长
// questIndexList: [], // questIndexList: [],
nowPart: 1, nowPart: 1,
selfStudyCertificate:[],
maxNumber: 0, maxNumber: 0,
minNumber: 0, minNumber: 0,
noAnswerList: [], noAnswerList: [],
@@ -187,6 +208,49 @@
}, },
methods: { methods: {
...mapMutations(['setPaperEndTime']), ...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() { async getServerTime() {
var time = 0 var time = 0
await $http.request({ await $http.request({
@@ -337,7 +401,7 @@
},300) },300)
}, },
// q请求提交试卷 // q请求提交试卷
sumbitPaper(ids) { async sumbitPaper(ids) {
let that = this let that = this
if(that.flag){ if(that.flag){
return return
@@ -346,7 +410,7 @@
uni.showLoading({ uni.showLoading({
title:'正在交卷' title:'正在交卷'
}) })
$http.request({ await $http.request({
url: "common/classExam/submitExamPaper", url: "common/classExam/submitExamPaper",
method: "POST", method: "POST",
data: { data: {
@@ -356,7 +420,7 @@
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
}) })
.then(res => { .then(async res => {
uni.hideLoading() uni.hideLoading()
if (res.code == 0) { if (res.code == 0) {
@@ -365,23 +429,28 @@
title: '交卷成功', title: '交卷成功',
icon: 'success' icon: 'success'
}) })
setTimeout( ()=>{ setTimeout(async ()=>{
that.exameResult = res.examPaper that.exameResult = res.examPaper
// this.timeup() // this.timeup()
that.showQuestIndex = false that.showQuestIndex = false
that.secondTimeDif = 0 that.secondTimeDif = 0
that.isOvertime = true that.isOvertime = true
uni.setStorage({ if(that.testPaper.type == '2' && that.exameResult.score >= 60) {
key:'paperEndTime', // if(that.exameResult.score >= 60){
data:{ var newCertificate = await that.getCertificateInfo()
time: 0, console.log('5555555证书资料', newCertificate);
examId: undefined that.selfStudyCertificate = []
}, if (newCertificate && newCertificate.length > 0) {
success: function () { newCertificate.forEach(item => {
console.log('时间存储成功'); if (item.classId != '' && item.classId > 0) {
// this.classCertificate.push(item)
} else {
that.selfStudyCertificate.push(item)
}
})
} }
}) // }
}
},300) },300)
}else{ }else{
@@ -633,7 +702,17 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/mixin.scss"; @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; .questIndx { overflow: hidden;
margin-top: 20rpx; margin-top: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;

View File

@@ -11,6 +11,24 @@
<view class="scoreBox"> <view class="scoreBox">
本次考试卷面成绩为<text class="score PM_font">{{exameResult.score}} </text> 本次考试卷面成绩为<text class="score PM_font">{{exameResult.score}} </text>
</view> </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"> <view class="flex_box flex_between">
<button type="primary" size="mini" @click="goToClass">返回课程</button> <button type="primary" size="mini" @click="goToClass">返回课程</button>
<button type="warn" size="mini" @click="goToPaper">查看试卷</button> <button type="warn" size="mini" @click="goToPaper">查看试卷</button>
@@ -169,6 +187,7 @@
showQuestIndex:false, showQuestIndex:false,
secondTimeDif:undefined, secondTimeDif:undefined,
pagetitle:'', // 页面标题 pagetitle:'', // 页面标题
selfStudyCertificate:[],
} }
}, },
async onLoad(e) { async onLoad(e) {
@@ -356,7 +375,7 @@
},300) },300)
}, },
// q请求提交试卷 // q请求提交试卷
sumbitPaper(ids) { async sumbitPaper(ids) {
let that = this let that = this
if(that.flag){ if(that.flag){
return return
@@ -365,7 +384,7 @@
uni.showLoading({ uni.showLoading({
title:'正在交卷' title:'正在交卷'
}) })
$http.request({ await $http.request({
url: "common/classExam/submitExamPaper", url: "common/classExam/submitExamPaper",
method: "POST", method: "POST",
data: { data: {
@@ -375,7 +394,7 @@
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
}) })
.then(res => { .then(async res => {
uni.hideLoading() uni.hideLoading()
if (res.code == 0) { if (res.code == 0) {
console.log('交卷结果',res); console.log('交卷结果',res);
@@ -383,22 +402,26 @@
title: '交卷成功', title: '交卷成功',
icon: 'success' icon: 'success'
}) })
setTimeout( ()=>{ setTimeout( async ()=>{
that.exameResult = res.examPaper that.exameResult = res.examPaper
// this.timeup() // this.timeup()
that.showQuestIndex = false that.showQuestIndex = false
that.secondTimeDif = 0 that.secondTimeDif = 0
that.isOvertime = true that.isOvertime = true
uni.setStorage({ if(that.exameResult.score >= 1){
key:'paperEndTime', var newCertificate = await that.getCertificateInfo()
data:{ console.log('5555555证书资料', newCertificate);
time: 0, that.selfStudyCertificate = []
examId: undefined if (newCertificate && newCertificate.length > 0) {
}, newCertificate.forEach(item => {
success: function () { if (item.classId != '' && item.classId > 0) {
console.log('时间存储成功'); // this.classCertificate.push(item)
} } else {
}) that.selfStudyCertificate.push(item)
}
})
}
}
},300) },300)
}else{ }else{
@@ -476,6 +499,11 @@
console.log('noAnswerList', this.noAnswerList) console.log('noAnswerList', this.noAnswerList)
// },300) // },300)
}, },
onPageJump(url, id) {
uni.navigateTo({
url: `${url}?id=${id}`,
});
},
setDesc() { setDesc() {
const letterArr = [] const letterArr = []
// 字母A的code值是65但因为已经到字母D了所以直接从69E开始循环 // 字母A的code值是65但因为已经到字母D了所以直接从69E开始循环
@@ -573,6 +601,49 @@
},1000) },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() { giveZero() {
// 没有完成完成考试记为0分 // 没有完成完成考试记为0分
}, },
@@ -620,6 +691,17 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/mixin.scss"; @import "@/style/mixin.scss";
.congritulations {
width: 120rpx;
height: 120rpx;
text-align: center;
margin: 10rpx auto;
display: block;
image {
width: 120rpx;
height: 120rpx;
}
}
.popup_box { .popup_box {
padding-bottom: 20rpx; padding-bottom: 20rpx;
width: 85vw; width: 85vw;