This commit is contained in:
@fawn-nine
2024-09-23 13:34:21 +08:00
parent 6ad01b5a89
commit 1a2df86df2
6 changed files with 260 additions and 124 deletions

View File

@@ -697,12 +697,12 @@
console.log('this.classId', this.classId);
this.getUserRole()
this.getUserInfo()
uni.$on('refreshData', () => {
console.log('开始刷新列表数据');
this.pPage = 0
this.taskList = []
this.getList()
})
// uni.$on('refreshData', () => {
// console.log('开始刷新列表数据');
// this.pPage = 0
// this.taskList = []
// this.getList()
// })
// uni.$on('refreshUserAnswerList',() => {
// console.log('开始刷新用户提交列表');
@@ -713,8 +713,10 @@
},
onReachBottom() {
if (this.status != 2 && this.status != 3) {
this.getList()
if(this.tijiaoTitleId != 3){
if (this.status != 2 && this.status != 3) {
this.getList()
}
}
},
onPullDownRefresh() {
@@ -723,9 +725,9 @@
console.log('this.tabId------', this.tabId);
this.getClassInfo()
this.getScore()
this.pPage = 0
this.taskList = []
this.getList()
// this.pPage = 0
// this.taskList = []
// this.getList()
uni.stopPullDownRefresh()
},
async onShow() {
@@ -859,7 +861,7 @@
}
// return _list
if (_list.length > 0) {
console.log('是否进入了这里666666666666');
console.log('是否进入了这里666666666666',this.tijiaoTitleIndex);
this.tijiaoTitleList = _list
this.titleClick(this.tijiaoTitleList[this.tijiaoTitleIndex], this.tijiaoTitleIndex)
// this.tijiaoTitleId = this.tijiaoTitleList[0].id
@@ -889,6 +891,7 @@
methods: {
// 获得思考题列表及答案
async getQuestionsList() {
console.log('是否进入了思考题请求????????????');
var list = []
await $http.request({
url: "common/class/getThinkQuestionListStudent",
@@ -1113,7 +1116,7 @@
},
})
.then(res => {
console.log('考试周班状态下,学员的信息', this.classId, res, );
// console.log('考试周班状态下,学员的信息', this.classId, res, );
// this.userMsg = res.user
// list = studentList
if (res.code == 0) {
@@ -1157,7 +1160,7 @@
return
}
uni.navigateTo({
url: `/pages/miniClass/test?classId=${this.thisClass.id}`
url: `/pages/miniClass/test?classId=${this.thisClass.id}&testDuration=${this.classModel.examTime}`
})
},
changeZheDie(item, index) {
@@ -1276,7 +1279,7 @@
.then(async (res) => {
if (res.code == 0) {
this.performanceScore = res.result
console.log('平时成绩e-------', this.performanceScore);
// console.log('平时成绩e-------', this.performanceScore);
if (this.performanceScore.userScore < 60 && this.thisClass.state == '2') {
this.getNewCLassInfo()
} else {
@@ -1486,7 +1489,7 @@
},
getList() {
console.log('进入函数了吗');
console.log('进入函数了吗--------------------------------------');
this.status = 1;
if (this.loadFlag) {
console.log("有未完成的进程");
@@ -1505,7 +1508,9 @@
"myExperience": this.tijiaoTitleId != 2 ? "0" : "1", //0全部心得1我的心得 this.myExperience
"title": ""
}
console.log('data任务/心得', data);
console.log('data任务/心得', this.pPage ,data);
// let that = this
const pp = this.pPage
$http.request({
url: "common/class/getClassTaskListStudent",
method: "POST",
@@ -1516,27 +1521,30 @@
})
.then(res => {
if (res.code == 0) {
// that.pPage = 3
if (res.page.records.length > 0) {
console.log('数据获取成功', res.page.records);
var lis = res.page.records
lis.forEach(item => {
item.zhedie = false
})
this.taskList = this.taskList.concat(lis)
if (res.page.pages > 1) {
this.taskHaveMore = true
}
if (res.page.pages > this.pPage) {
this.taskList = this.taskList.concat(lis)
if (res.page.pages > pp) {
this.status = 0;
} else {
this.status = 2;
}
console.log('res.page.pages > this.pPage',res.page.pages,pp,this.status);
} else {
this.status = 3; // 暂无数据
}
this.loadFlag = false;
console.log('res', res);
uni.hideLoading()
setTimeout(()=>{
this.loadFlag = false;
},400)
} else {
console.log('数据获取失败.......', res);
}
@@ -1551,10 +1559,18 @@
});
},
async titleClick(item, textIndex) {
console.log('进来了吗', item);
if(this.loadFlag){
uni.showToast({
title:'操作太快了,休息一下吧',
icon:'none',
})
return
}
if (item.id == '3') {
this.tijiaoTitleId = item.id
this.tijiaoTitleIndex = textIndex
this.questionsList = await this.getQuestionsList()
if (this.questionsList.length > 0) {
this.curCourseId = this.questionsList[this.curCourseIndex].courseEntity.id
@@ -1562,11 +1578,8 @@
return item.courseEntity
})
}
}
// if (this.tijiaoTitleId == item.id) {
// console.log(5555555555555555, this.tijiaoTitleId,item.id);
// return
// }
return
}
this.tijiaoTitleId = item.id
this.tijiaoTitleIndex = textIndex
console.log('e班内提交子按钮', this.tijiaoTitleId);

View File

@@ -491,12 +491,25 @@
this.severNowTime = severNowTime
console.log('this.endTime',this.endTime);
this.secondTimeDif = this.endTime - severNowTime // 时间差 毫秒
let that = this
if(this.secondTimeDif > 0){
// 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.showModal({
title:'提示',
content:'您的时间已经结束,即将返回班级',
confirmText:'好的',
showCancel:fals,
success: (res) => {
if(res.confirm){
that.goToClass()
}
}
})
}
this.curQuestion = {
...this.questionList[this.curIndex1]

View File

@@ -1,7 +1,7 @@
<template style="">
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
<public-module></public-module>
<z-nav-bar title="正在考试" backState="2000">
<z-nav-bar :title="pagetitle" backState="2000">
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
@click="showPopup = true">考试说明</text>
</z-nav-bar>
@@ -107,6 +107,27 @@
</view>
</view>
</u-popup>
<u-popup :show="protocolShow" mode="center" round="6" :key="3">
<view class="popup_box">
<view class="title">温馨提示</view>
<view class="content">
<view class="center">
用户您好本次考试时间为 <text style="color: red; font-weight: bold; font-size: 30rpx;">{{testDuration}}</text> 分钟<br />
<view style="color: red; font-weight: bold"> : </view>
<view>
<text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br />
请在倒计时结束前完成答题倒计时结束后将自动交卷</text>
</view>
</view>
<view class="bottom">
<view class="button_box">
<u-button size="small" text="稍后再考" @click="cancelClick"></u-button>
<u-button text="开始考试" color="#258feb" size="small" @click="onHandleClickBuy"></u-button>
</view>
</view>
</view>
</view>
</u-popup>
</view>
</template>
@@ -118,6 +139,8 @@
export default {
data() {
return {
testDuration:undefined, // 考试时长
protocolShow:false,
showPopup: false,
code: 0, // 英文code
classId: undefined,
@@ -142,17 +165,16 @@
haveAnswerList:[],
exameResult:{},
showQuestIndex:false,
secondTimeDif:undefined
secondTimeDif:undefined,
pagetitle:'', // 页面标题
}
},
async onLoad(e) {
console.log('收到得值');
this.classId = e.classId
// this.examId = e.id
if (this.testPaper.length <= 0) {
this.getTestPage()
}
// this.questIndexList = await this.getNowList('add')
this.testDuration = e.testDuration
this.protocolShow = true
this.pagetitle = '准备考试'
},
onHide() {
if (!this.isOvertime) {}
@@ -178,6 +200,25 @@
},
methods: {
...mapMutations(['setPaperEndTime']),
cancelClick(){
this.protocolShow = false
uni.navigateTo({
url: `/pages/miniClass/classInfo?id=${this.classId}`
})
},
onHandleClickBuy(){ // 确定开始考试
this.protocolShow = false
if (this.testPaper.length <= 0) {
this.pagetitle = '获取试卷'
this.getTestPage()
}else{
uni.showToast({
title:'页面发生错误,请退出后重新进入页面或联系客服人员',
icon:'none',
duration:3000
})
}
},
// 获取服务器时间
async getServerTime() {
var time = 0
@@ -461,37 +502,26 @@
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('时间存储成功');
// }
// })
let that = this
if(this.secondTimeDif > 0){
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('时间存储成功');
}
uni.showModal({
title:'提示',
content:'您的时间已经结束,即将返回班级',
confirmText:'好的',
showCancel:fals,
success: (res) => {
if(res.confirm){
that.goToClass()
}
}
})
}
console.log('本地存储的结束时间', this.$store.state.paperEndTime);
}
this.curQuestion = {
...this.testPaper[this.curIndex1]
}
@@ -501,9 +531,7 @@
icon: 'success'
})
console.log(res, '试卷', this.curQuestion)
// setTimeout(() => {
// this.getClassInfo()
// }, 500)
this.pagetitle = '正在考试'
} else {
uni.showToast({
title: res.errMsg,
@@ -570,7 +598,66 @@
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.popup_box {
padding-bottom: 20rpx;
width: 85vw;
overflow: hidden;
position: relative;
height: auto;
.title {
font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
font-weight: normal;
font-size: 46rpx;
color: $themeColor;
background-color: #f5f5f5;
// line-height: 46rpx;
padding: 20rpx;
// border-leradius: 6px;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.content {
font-size: 26rpx;
letter-spacing: 0.15rpx;
padding: 20rpx;
color: #3f3f3f;
.top {
margin: 30rpx 0;
}
.center {
line-height: 40rpx;
// padding:0 10rpx;
}
.bottom {
width: 100%;
margin-top: 60rpx;
font-size: 24rpx;
line-height: 26rpx;
color: #b0b0b0;
}
}
.button_box {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
.u-button {
margin-left: 40rpx;
}
.u-button:nth-child(1) {
margin-left: 0;
}
}
}
.questIndx { overflow: hidden;
margin-top: 20rpx;
margin-bottom: 20rpx;