添加证书

This commit is contained in:
@fawn-nine
2024-09-14 16:06:35 +08:00
parent d3097edd2c
commit 5ee3ec4398
15 changed files with 407 additions and 133 deletions

View File

@@ -2,8 +2,8 @@
<view>
<public-module></public-module>
<z-nav-bar title="班级详情"></z-nav-bar>
<!-- <text class="small_btn retake border_radius_10" @click="goTest()">再考一次</text> -->
<text class="" @click="showSubmit">提交证件资料</text>
<text class="small_btn retake border_radius_10" @click="goTest()">再考一次</text>
<!-- <text class="" @click="showSubmit">提交证件资料</text> -->
<view class="mainContent" v-if="thisClass.id">
<view :class="['classStatus',
thisClass.state == '0' ? 'daikai' :'',
@@ -53,11 +53,11 @@
<!-- v-if="thisClass.state == '3'" -->
<view class="optionsBox">
<!-- v-show="thisClass.state == '2'" -->
<view class="chengji" style="text-align: center;">
<view class="chengji zong" style="text-align: center;">
<view style="margin-top: 20rpx;">总成绩
<text class="scoreNumber greenScore">{{performanceScore.userScore}}</text>
<view class="">
<view class="">
<view class="" style="margin: 20rpx 0;">
<text class="c999">{{performanceScore.examScore}}分考试分 <uni-icons type="eye"
size="20" color="#999" @click="showPaperList = true"></uni-icons></text>
<text class="c999">{{performanceScore.usualScore}}分平时表现分</text>
@@ -70,12 +70,16 @@
<text class="blueScore" v-else-if="performanceScore.userScore >= 60 && performanceScore.userScore < 70"> B </text>
<text class="small_btn border_radius_10 zhengshu" @click="showSubmit">{{certificate && certificate.id ? '查看证书' : '生成证书'}}</text>
</view>
<!-- <view style="margin-top: 20rpx; text-align: center;">很遗憾您的成绩未达标</view> -->
<view class="" style="margin-top: 20rpx; text-align: center;"
v-if="performanceScore.userScore < 60 && newCLass && newCLass.id">
<text class="small_btn chongxiu border_radius_10"
@click="onPageJump('/pages/miniClass/classInfo',newCLass.id)">加入新班级重修</text>
</view>
<template v-if="performanceScore.userScore < 60">
<view class="flex_box flex_center align-items_box">
<text style="margin-top: 20rpx; text-align: center;">很遗憾您的成绩未达标</text>
<view class="" style="margin-top: 20rpx; text-align: center;"
v-if="newCLass && newCLass.id">
<text class="small_btn chongxiu border_radius_10"
@click="onPageJump('/pages/miniClass/classInfo',newCLass.id)">加入新班级重修</text>
</view>
</view>
</template>
</view>
</view>
</view>
@@ -127,7 +131,7 @@
</view>
</view>
<view class="pingfenBox"
v-if="thisClass.state == '1' || thisClass.state == '3' || thisClass.state == '2'">
v-if="thisClass.state != '0' && tijiaoTitleList.length > 0">
<view class="scoreTitle">
<view class="titles flex_box">
<text>表现分</text><uni-icons type="help" size="18" color="#fff"
@@ -431,11 +435,36 @@
</u-popup>
<!-- <addCerInfo v-if="showSubmitInfoBlank" :submitInfo="submitInfo" @close="closeManager" ></addCerInfo> -->
<u-popup key="5" :show="showSubmitInfoBlank" :round="10" @close="closeManager">
<view class="guanli">
<h3>信息展示</h3>
<view class="guanli userinfoPup">
<view class="" style="text-align: center; margin-bottom: 40rpx;">
<h3>信息确认</h3>
<text style="color: #666;">请确认以下证书信息证书一经生成后不可更改</text>
</view>
<view class="tips border_radius_10">
{{submitInfo.name}}-{{submitInfo.photo}}
<!-- {{submitInfo.name}}-{{submitInfo.photo}} -->
<view class="flex_box align-items_box item">
<text class="mr20rpx">证书姓名</text>
<text class="mr20rpx">
{{submitInfo.name && submitInfo.name != '' && submitInfo.name != null ? submitInfo.name : '未设置'}}
</text>
<text class="small_btn border_radius_10"
v-if="!submitInfo.name || submitInfo.name != '' || submitInfo.name != null"
@click="onPageJump('/pages/mine/userInfo/persData')" style="display: block; height: 30px;">
{{submitInfo.name && submitInfo.name != '' && submitInfo.name != null ? '去修改' : '去设置'}}
</text>
</view>
<view class="flex_box align-items_box item">
<text class="mr20rpx">证书照片</text>
<image @click="preveImg(submitInfo.photo)" class="mr20rpx" v-if="submitInfo.photo && submitInfo.photo != '' && submitInfo.photo != null"
:src="submitInfo.photo" mode="widthFix" style="width:100rpx; height:140rpx;"></image>
<text class="mr20rpx" v-else>未上传</text>
<text class="small_btn border_radius_10" v-if="!submitInfo.photo || submitInfo.photo != '' || submitInfo.photo != null"
@click="onPageJump('/pages/mine/userInfo/persData')" style="display: block; height: 30px;">{{submitInfo.photo && submitInfo.photo != '' && submitInfo.photo != null ? '去修改' : '去上传'}}</text>
</text>
</view>
</view>
<view class="btn_box_certificate"><button @click="createCertificate">立即生成证书</button></view>
</view>
</u-popup>
<!-- <z-navigation></z-navigation> -->
@@ -609,7 +638,8 @@
this.pPage = 0
this.taskList = []
this.getList()
})
})
// uni.$on('refreshUserAnswerList',() => {
// console.log('开始刷新用户提交列表');
// this.pPage = 0
@@ -658,16 +688,18 @@
console.log('正在进行中的试卷信息', historyPaper);
this.ingPaper = historyPaper
// console.log('对比----------------', historyPaper.classId, this.classId);
if (historyPaper && historyPaper != null && historyPaper.classId == this.classId) {
var planEndTimeDate = new Date(historyPaper.planEndTime)
paperEndTime = planEndTimeDate.getTime(); // 结束的时间戳
if (historyPaper && historyPaper != null && historyPaper.relationId == this.classId) {
// var planEndTimeDate = new Date(historyPaper.planEndTime)
// paperEndTime = planEndTimeDate.getTime(); // 结束的时间戳
paperEndTime = historyPaper.planEndTime
console.log('+++++++++',paperEndTime);
this.examId = historyPaper.id
} else {
this.examId = undefined
paperEndTime = 0
}
severNowTime = await this.getServerTime()
// console.log('//////////////', paperEndTime, severNowTime);
console.log('//////////////', paperEndTime, severNowTime);
if (severNowTime > -1 && paperEndTime - severNowTime > 0) {
var secondTimeDif = paperEndTime - severNowTime
this.timeDif.hour = parseInt((secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
@@ -681,6 +713,14 @@
}
}
if(this.thisClass.state == '2'){
var userObj = await this.getUserData()
if(userObj){
this.submitInfo.name = userObj.name
this.submitInfo.photo = userObj.photo
// this.showSubmitInfoBlank = true
}
}
},
components: {
sutdentScoreList,
@@ -768,22 +808,17 @@
if(this.certificate && this.certificate.id){
// 已生成
uni.navigateTo({
url:'去个人中心'
url:'/pages/certificate/certificate'
})
}else{ // 未生成
var userObj = await this.getUserData()
if(userObj){
this.submitInfo.name = userObj.name
this.submitInfo.photo = userObj.photo
this.showSubmitInfoBlank = true
}
}else{ // 未生成
this.showSubmitInfoBlank = true
}
},
async getUserData() {
let that = this;
var Ss = undefined
var Ss = undefined
// 获取个人信息
if (this.userInfo.id != undefined) {
await this.$http
@@ -865,7 +900,7 @@
})
.then((res) => {
if (res.code == 0) {
console.log('获取试卷列表', res);
// console.log('获取试卷列表', res);
this.paperList = res.examPaper
if (this.paperList.length > 0) {
var _list = [...this.paperList]
@@ -991,6 +1026,75 @@
});
},
// 生成证书
createCertificate(){
if(this.submitInfo.name && this.submitInfo.name != null && this.submitInfo.name != ''
&& this.submitInfo.photo && this.submitInfo.photo != null && this.submitInfo.photo != ''){
}else{
uni.showModal({
title:'提示',
content:"真实姓名或证书照片未设置,请设置完成后再来生成证书吧",
cancelText:'稍后设置',
confirmText:'立即设置',
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url:'/pages/mine/userInfo/persData'
})
}
}
})
return
}
var type = undefined
if(this.performanceScore.userScore >= 60 && this.performanceScore.userScore < 70){
type = 'B'
}else if(this.performanceScore.userScore >= 70){
type = 'A'
}else{
uni.showToast({
title:'您的成绩未达到证书水平,请继续努力'
})
return
}
var data = {
"type": type, //证书类型A a证 B b证 ZK自考
"relationId": this.classId //小班id、课程id
}
// console.log('证书提交数据',data,this.performanceScore.userScore);
$http.request({
url: "common/class/generateCertificateClass",
method: "POST",
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async (res) => {
if (res.code == 0) {
console.log('证书返回值', res);
uni.showToast({
title: '生成成功',
icon: 'none'
})
setTimeout(()=>{
this.closeManager()
this.getScore()
},300)
} else {
uni.showToast({
title: res.errMsg,
icon: 'none'
})
}
}).catch(e => {
uni.showToast({
title: e.errMsg,
icon: 'none'
})
});
},
// 查询平时表现分+ 最终成绩 + 可加入的新班级 + 证书信息
async getScore() {
$http.request({
@@ -1013,11 +1117,13 @@
}else{
// >= 60
if(this.thisClass.state == '2' ){
var certificate = await this.getCertificateInfo()
if(certificate && certificate.id){
this.certificate = certificate
var certificate = await this.getCertificateInfo()
if(certificate && certificate.length > 0 && certificate[0].id){
this.certificate = certificate[0]
}
console.log('this.certificate',certificate);
}
}
} else {
uni.showToast({
@@ -1035,7 +1141,7 @@
// 查询证书获得情况
async getCertificateInfo(){
var _obj = undefined
$http.request({
await $http.request({
url: "common/class/getUserCertificateByClassId",
method: "POST",
data: {
@@ -1046,7 +1152,7 @@
'Content-Type': 'application/json'
},
})
.then((res) => {
.then( (res) => {
if (res.code == 0) {
// this.newCLass = res.result
console.log('证书数据', res);
@@ -1100,7 +1206,7 @@
// 继续考试
continueTest(id) {
uni.navigateTo({
url: `/pages/miniClass/continueTest?id=${id}`
url: `/pages/miniClass/continueTest?id=${id}&classId=${this.classId}`
})
},
radioChange1(e) {
@@ -1448,6 +1554,14 @@
taskEdit(item) {
console.log('taskEdit'.item);
},
// 图片预览
preveImg(url){
console.log('dianjile fangda tu');
uni.previewImage({
urls: [url],
current: 0
});
},
// 退出班级 // 踢出班级
outClass(userId) {
let that = this
@@ -1530,7 +1644,7 @@
},
})
.then(async res => {
// console.log('班级信息', res);
console.log('班级信息', res);
this.refresh = false
if (res.code == 0) {
// res = classData // 测试数据
@@ -1740,8 +1854,9 @@
margin-bottom: 20rpx;
}
.zhengshu {
.zhengshu { margin-left: 20rpx;
color: #ffaa7f;
font-size: 28rpx;
border: 1px solid #ffaa7f
}
@@ -1765,6 +1880,7 @@
}
.scoreNumber {
// display: block; margin: 20rpx 0;
font-size: 60rpx;
}
@@ -1815,6 +1931,11 @@
margin-top: 20rpx;
border-top: 1px solid #eee;
}
.chengji.zong{
margin-top: 0;
padding-top: 0;
border-top: none;
}
.manBtnBox {
justify-content: center;
@@ -2292,9 +2413,29 @@
}
.optionsBox {}
.btn_box_certificate {
margin-top: 70rpx;
padding-bottom: 20rpx;
button {
font-size: 32rpx;
@include theme('btn_bg') color: #fff;
height: 80rpx;
line-height: 80rpx;
border-radius: 50rpx;
}
}
.retake {
border: 1px solid #55aa00;
color: #55aa7f;
}
.mr20rpx{
margin-right: 20rpx;
}
.userinfoPup{
.tips{
// .item{justify-content: space-around;}
}
.small_btn{color: #55aaff; border: #55aaff 1px solid ;}
}
</style>

View File

@@ -35,13 +35,13 @@
<image v-else src="/static/icon/morenAvavter.png" mode="aspectFit"></image>
</view>
<view :class="['textItems','flex_box']">
<text class="txt555"
<view class="txt555"
v-if="item.user.nickname != null && item.user.nickname != ''">
{{item.user.nickname}}
<template>
<text>{{item.user.tel}}</text>
</template>
</text>
</view>
<text class="txt555" v-else>
匿名用户
</text>
@@ -66,20 +66,9 @@
<view class="" style="color: #ff9496;">
未考试
</view>
</view>
<!-- <view class="" v-if="thisClass.state == '2'">
<view class="ciyao">
考试成绩
</view>
<text class="score">0</text>
</view> -->
</view>
</template>
<template v-else >
<!-- <view class="" v-if="thisClass.state == '3'">
<view class="" style="color: #55aa7f;">
等待公布分数
</view>
</view> -->
<template v-else >
<view >
<view class="ciyao">
考试成绩
@@ -95,8 +84,17 @@
</template>
</template>
<!-- -->
<!-- <view v-if="classModel.isExam == 1 && thisClass.state == '2'" :class="['PM_font','zhengshu',item.student.score.certificateType == 'A' ? 'Azheng' : 'Bzheng']"
></view> -->
<template v-if="classModel.isExam == 1 && thisClass.state == '2'" >
<view v-if="item.userScore >= 60 && item.userScore < 70"
:class="['PM_font','zhengshu','Bzheng']"
></view>
<view v-else-if="item.userScore >= 70"
:class="['PM_font','zhengshu','Azheng']"
></view>
<view v-else
:class="['PM_font','zhengshu','bujige']"
></view>
</template>
</view>
</view>
</view>
@@ -114,6 +112,9 @@
}
},
beforeUpdate() {
console.log('进来了吗beforeUpdate-----------');
} ,
methods:{
clickStudent(item) {
// console.log('item', item);
@@ -212,6 +213,7 @@
}
}
.zhengshu{width: 80rpx; height: 80rpx; background-size: contain;}
.bujige{background-image: url(@/static/icon/lz.png);}
.Azheng{background-image: url(@/static/icon/Az.png);}
.Bzheng{background-image: url(@/static/icon/Bz.png);}
.classMateBox {

View File

@@ -149,6 +149,7 @@
questionList:[],
answerIdsList:[],
wantSubmit:false, // 想要提交
}
},
async onLoad(e) {
@@ -162,9 +163,7 @@
onHide() {
if (!this.isOvertime) {}
},
onShow() {
// this.endTime = this.hourUp(1)
// console.log('this.endTime', this.endTime.getTime());
async onShow() {
},
beforeDestroy() {
@@ -484,43 +483,21 @@
this.noAnswerList = this.getNoAnswerList()
this.haveAnswerList = this.gethaveAnswerList()
// console.log('this.answerIdsList', this.answerIdsList);
this.testPaper = res.examPaper
var planEndTimeDate = new Date(res.planEndTime)
this.endTime = planEndTimeDate.getTime(); // 结束的时间戳
console.log('this.endTime',this.endTime);
this.testPaper = res.examPaper
// var planEndTimeDate = new Date(res.planEndTime)
// this.endTime = planEndTimeDate.getTime();
this.endTime = res.planEndTime
var severNowTime = await this.getServerTime()
this.severNowTime = severNowTime
console.log('this.endTime',this.endTime);
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('时间存储成功');
}
})
// this.setPaperEndTime({time:this.endTime})
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('时间存储成功');
}
})
}
// console.log('本地存储的结束时间', this.$store.state.paperEndTime);
console.log('this.endTime',this.timeDif.hour, this.timeDif.minutes, this.timeDif.second);
}
this.curQuestion = {
...this.questionList[this.curIndex1]
}

View File

@@ -7,7 +7,7 @@
<view style="padding: 20rpx; background-color: #fff; border-bottom: 1px solid #eee;">当前课程{{courseTitle}}</view>
<view class="containerBg">
<view class="learnBox box">
<view class="newBox">
<view class="newBox" v-if="courseList.length > 0">
<view class="item flexbox" v-for="(item, index) in courseList" :key="index" @click="onPageJump('/pages/miniClass/classInfo',item.id)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer" v-if="item.icon != ''" >
@@ -37,7 +37,9 @@
</view>
</view>
</view>
<view class="" v-else>
<u-divider text="当前课程下暂无可加入的小班"></u-divider>
</view>
</view>
<view>
<!-- <u-back-top scroll-top="100"></u-back-top> -->
@@ -229,7 +231,7 @@
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"courseId": Number(this.courseId),
"state": '', //小班状态0待开班1已开班2完成
"state": '0', //小班状态0待开班1已开班2完成
"type": '' // 班类型 0小班 1联合班 2精英班
},
header: { //默认 无 说明:请求头

View File

@@ -430,7 +430,9 @@
url: "common/classExam/generateExamPaper",
method: "POST",
data: {
"classId": this.classId
// "classId":
"type":"1",//考试类型 1小班 2自考
"relationId": this.classId, //小班id、课程id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
@@ -454,23 +456,23 @@
this.examId = res.id
this.paperCreateTime = 1
// this.endTime = this.hourUp(res.startTime,2) // 结束的时间戳
var planEndTimeDate = new Date(res.planEndTime)
this.endTime = planEndTimeDate.getTime();
// var planEndTimeDate = new Date(res.planEndTime)
// this.endTime = planEndTimeDate.getTime();
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('时间存储成功');
}
})
// uni.setStorage({
// key:'paperEndTime',
// data:{
// time: this.endTime,
// examId: this.examId,
// },
// success: function () {
// console.log('时间存储成功');
// }
// })
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