diff --git a/components/addCerInfo.vue b/components/addCerInfo.vue index 8e4c78d..25b844e 100644 --- a/components/addCerInfo.vue +++ b/components/addCerInfo.vue @@ -12,7 +12,7 @@ - 请上传 diff --git a/pages.json b/pages.json index acb3a3f..6f581f5 100644 --- a/pages.json +++ b/pages.json @@ -733,6 +733,13 @@ { "navigationBarTitleText" : "查看答案页面" } + }, + { + "path" : "pages/certificate/certificate", + "style" : + { + "navigationBarTitleText" : "我的证书" + } } ], "globalStyle": { diff --git a/pages/certificate/certificate.vue b/pages/certificate/certificate.vue new file mode 100644 index 0000000..96bb93d --- /dev/null +++ b/pages/certificate/certificate.vue @@ -0,0 +1,152 @@ + + + \ No newline at end of file diff --git a/pages/mine/aboutUs/index.vue b/pages/mine/aboutUs/index.vue index e1fadda..223c754 100644 --- a/pages/mine/aboutUs/index.vue +++ b/pages/mine/aboutUs/index.vue @@ -78,14 +78,14 @@ view{ font-size: 28rpx; } - .prof{padding: 20rpx; color: #666; font-size: 24rpx; line-height: 40rpx; text-indent: 2em;} + .prof{padding: 20rpx; color: #666; font-size: 28rpx; line-height: 40rpx; text-indent: 2em;} .telInfo{background-color:#fff; .nav_list{padding: 30upx 0 30upx 20upx; border-top: 1px solid #e5e5e5; border-top: 1px solid #e5e5e5; justify-content: space-between; color: #666; .view1{width:300rpx;} } } .APPinfo{background-color:#fff; padding: 40rpx 0; margin-top: 20rpx; text-align: center; - p{font-size: 28rpx;} + p{font-size: 32rpx;} } .flexbox{display: flex; justify-content: center;} diff --git a/pages/mine/mine/index.vue b/pages/mine/mine/index.vue index 155479b..cd6c3ee 100644 --- a/pages/mine/mine/index.vue +++ b/pages/mine/mine/index.vue @@ -162,7 +162,7 @@ @@ -270,6 +270,11 @@ type: "switchTab", // type: "pageJump", }, + { + name: "我的证书", + url: "/pages/certificate/certificate", + type: "pageJump", + }, // { // name: "购物车", // url: "../peanut/shopping", diff --git a/pages/mine/userInfo/persData.vue b/pages/mine/userInfo/persData.vue index 3609fdc..2f309d4 100644 --- a/pages/mine/userInfo/persData.vue +++ b/pages/mine/userInfo/persData.vue @@ -416,7 +416,7 @@ export default { type: "sex", }, { - title: "真实姓名", + title: "真实姓名/证书姓名", indexValue: "name", type: "name", }, diff --git a/pages/miniClass/classInfo.vue b/pages/miniClass/classInfo.vue index 26417b8..8962692 100644 --- a/pages/miniClass/classInfo.vue +++ b/pages/miniClass/classInfo.vue @@ -2,8 +2,8 @@ - - 提交证件资料 + 再考一次 + - + 总成绩: {{performanceScore.userScore}} - + ({{performanceScore.examScore}}分考试分 ,{{performanceScore.usualScore}}分平时表现分) @@ -70,12 +70,16 @@ B 证 {{certificate && certificate.id ? '查看证书' : '生成证书'}} - - - 加入新班级重修 - + @@ -127,7 +131,7 @@ + v-if="thisClass.state != '0' && tijiaoTitleList.length > 0"> 表现分 - -

信息展示

+ + +

信息确认

+ 请确认以下证书信息,证书一经生成后不可更改 +
- {{submitInfo.name}}-{{submitInfo.photo}} + + + 证书姓名: + + {{submitInfo.name && submitInfo.name != '' && submitInfo.name != null ? submitInfo.name : '未设置'}} + + + {{submitInfo.name && submitInfo.name != '' && submitInfo.name != null ? '去修改' : '去设置'}} + + + + + 证书照片: + + 未上传 + {{submitInfo.photo && submitInfo.photo != '' && submitInfo.photo != null ? '去修改' : '去上传'}} + + +
@@ -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 ;} + } \ No newline at end of file diff --git a/pages/miniClass/components/sutdent_score_list.vue b/pages/miniClass/components/sutdent_score_list.vue index 9540bc8..ab6ea85 100644 --- a/pages/miniClass/components/sutdent_score_list.vue +++ b/pages/miniClass/components/sutdent_score_list.vue @@ -35,13 +35,13 @@
- {{item.user.nickname}} - + 匿名用户 @@ -66,20 +66,9 @@ 未考试 -
- +
- - +
@@ -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 { diff --git a/pages/miniClass/continueTest.vue b/pages/miniClass/continueTest.vue index 3f367c0..2ef0e51 100644 --- a/pages/miniClass/continueTest.vue +++ b/pages/miniClass/continueTest.vue @@ -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] } diff --git a/pages/miniClass/courseClassList.vue b/pages/miniClass/courseClassList.vue index 5842991..f9566f9 100644 --- a/pages/miniClass/courseClassList.vue +++ b/pages/miniClass/courseClassList.vue @@ -7,7 +7,7 @@ 当前课程:{{courseTitle}} - + @@ -37,7 +37,9 @@ - + + + @@ -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: { //默认 无 说明:请求头 diff --git a/pages/miniClass/test.vue b/pages/miniClass/test.vue index ea9931c..1e4cad3 100644 --- a/pages/miniClass/test.vue +++ b/pages/miniClass/test.vue @@ -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 diff --git a/pages/peanut/home.vue b/pages/peanut/home.vue index a911fbc..2add862 100644 --- a/pages/peanut/home.vue +++ b/pages/peanut/home.vue @@ -385,20 +385,22 @@ // var paperData={} var paperEndTime = 0 var severNowTime = -1 + severNowTime = await this.getServerTime() // paperData = await this.getlocaltestInfo('paperEndTime') var historyPaper = await this.getingPaper() if(historyPaper && historyPaper != null){ - var planEndTimeDate = new Date(historyPaper.planEndTime) - paperEndTime = planEndTimeDate.getTime(); // 结束的时间戳 + // var planEndTimeDate = new Date(historyPaper.planEndTime) + // paperEndTime = planEndTimeDate.getTime(); // 结束的时间戳 + paperEndTime = historyPaper.planEndTime this.examId = historyPaper.id - this.classId = historyPaper.classId + this.classId = historyPaper.relationId }else{ this.classId = undefined this.examId = undefined paperEndTime = 0 } console.log('this.examId////////////', paperEndTime); - severNowTime = await this.getServerTime() + // severNowTime = await this.getServerTime() // console.log('//////////////', paperEndTime, severNowTime); if (severNowTime > -1 && paperEndTime - severNowTime > 0) { var secondTimeDif = paperEndTime - severNowTime @@ -494,24 +496,7 @@ }); return obj - }, - // 获取本地试卷信息 - // getlocaltestInfo(keystr){ - // return new Promise((resolve, reject) => { - // uni.getStorage({ - // key: keystr, - // success: function(res) { - // if (res.error) { - // reject(res.data) - // } else { - // resolve(res.data) - // console.log('/////getlocaltestInfo/////', res.data); - // } - - // } - // }); - // }) - // }, + }, // 获取服务器时间 async getServerTime() { var time = 0 @@ -524,6 +509,7 @@ }, }) .then(async (res) => { + console.log('获取服务器时间'); if (res.code == 0) { time = res.serverTime } else { diff --git a/static/icon/Az.png b/static/icon/Az.png index 8409685..77f049b 100644 Binary files a/static/icon/Az.png and b/static/icon/Az.png differ diff --git a/static/icon/Bz.png b/static/icon/Bz.png index d9ff9f2..3105ff8 100644 Binary files a/static/icon/Bz.png and b/static/icon/Bz.png differ diff --git a/static/icon/lz.png b/static/icon/lz.png new file mode 100644 index 0000000..571051f Binary files /dev/null and b/static/icon/lz.png differ