This commit is contained in:
@fawn-nine
2024-09-26 15:43:57 +08:00
parent 86a1f754c2
commit b2221666e1
13 changed files with 132 additions and 73 deletions

View File

@@ -99,6 +99,7 @@
<script>
import $http from '@/config/requestConfig.js';
import permission from "@/js_sdk/wa-permission/permission.js"
import debounce from "@/common/debounce.js";
import {
mapState,
mapMutations
@@ -368,6 +369,7 @@
this.fileList2.splice(event.index, 1)
},
async onSubmit() {
debounce(async () => {
this.$refs.form.validate().then(async res => {
let data = await this.getHtml();
var _data = data.html.replace(/<.*?>/g, "")
@@ -448,6 +450,7 @@
icon: 'none'
})
})
},300)
}
},
//页面隐藏

View File

@@ -6,7 +6,7 @@
<!-- <text class="" @click="showSubmit">提交证件资料</text> -->
<!-- <view class="stickyyy" offset-top="60" v-if="buyCourseMsg != ''">
<text>{{buyCourseMsg}} 课程未购买</text>
</view> -->
</view> -->
<view :class="['classStatus',
thisClass.state == '0' ? 'daikai' :'',
thisClass.state == '1' ? 'xuexizhong' :'',
@@ -19,7 +19,7 @@
<view class="className">
<h3>{{thisClass.title}}</h3>
<text class="tuichu" v-if="thisClass.state == 0 && isHave" @click="outClass()">退出班级</text>
<text class="tuichu" v-if="thisClass.state == '0' && isHave" @click="outClass()">退出班级</text>
</view>
<view class="otherItems flex_box">
<view v-if="thisClass.state == '0'">
@@ -184,7 +184,7 @@
</view>
<!-- 课程列表 -->
<view class="" v-if="tabId == '0'">
<uni-section class="mb-10 nobg nopad" title="班内课程" type="line"></uni-section>
<!-- <uni-section class="mb-10 nobg nopad" title="班内课程" type="line"></uni-section> -->
<view class="newBox" v-show="courses.length > 0 ">
<view class="item flexbox" v-for="(item, index) in courses" :key="index"
@click="onPageJump('/pages/course/courseDetail',item.id)">
@@ -221,6 +221,10 @@
<!-- 班内同学 -->
<template v-if="tabId == '2'">
<template v-if="students.length> 0">
<view class="" style=" overflow: hidden; margin:20rpx 0">
<text style="font-size: 26rpx; color: #666;"> {{students.length}} 名学员</text>
<!-- <uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title=""></uni-section> -->
</view>
<view class="classMateBox" v-if="(thisClass.state == '0' || thisClass.state == '1')">
<view class="newBox flexbox">
<view :class="['item']" v-for="(item, index) in students" :key="index">
@@ -244,7 +248,7 @@
</view>
<sutdent-score-list :students="students" :classModel="classModel" :tabId="tabId"
:thisClass="thisClass" @chooseStudent="chooseStudent"
v-if="(thisClass.state == '3' || thisClass.state == '2')"></sutdent-score-list>
v-if="(thisClass.state == '3' || thisClass.state == '2') && students.length > 0"></sutdent-score-list>
</template>
<view class="" v-else>
<u-divider text="暂无学员加入"></u-divider>
@@ -759,12 +763,13 @@
}
}
},
onPullDownRefresh() {
async onPullDownRefresh() {
// this.curTagIndex = 0
console.log('this.tabId------', this.tabId);
this.getClassInfo()
this.getScore()
var ll = await this.getPaperList()
// this.pPage = 0
// this.taskList = []
// this.getList()
@@ -1034,6 +1039,7 @@
},
})
.then(async (res) => {
console.log('课程购买情况',res);
if (res.code == 0) {
if (res.msg != '') {
msg = res.msg
@@ -1107,7 +1113,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]
@@ -1753,8 +1759,7 @@
})
.then(async res => {
if (res.code == 0) {
this.isHave = true
// this.isHave = true
uni.showToast({
title: `加入成功!`,
icon: 'success'
@@ -1763,13 +1768,18 @@
this.getClassInfo()
this.buyCourseMsg = await this.checkUserCourse()
}, 200)
}else{
uni.showToast({
title: res.errMsg,
icon: 'none'
})
}
}).catch(e => {
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: `加入失败`,
icon: 'error'
title: e.errMsg,
icon: 'none'
})
});
},
@@ -1870,7 +1880,7 @@
})
.then(res => {
if (res.code == 0) {
that.isHave = true
// that.isHave = true
uni.showToast({
title: `退出成功!`,
icon: 'success'
@@ -2009,7 +2019,17 @@
<style lang="scss" scoped>
@import "@/style/mixin.scss";
::v-deep .xueyuanTitle {
.uni-section-header {
float: left;
}
.uni-section-content {
float: right;
margin-top: 20rpx;
font-size: 26rpx;
}
}
.score {
color: #55aaff;
font-size: 30rpx !important;

View File

@@ -142,12 +142,14 @@
<!-- 学员列表 -->
<view class="" v-if="tabId == '2'">
<template v-if="students.length> 0 ">
<view class="" style=" overflow: hidden; margin: 20rpx 0;">
<text style="font-size: 26rpx; color: #666;"> {{students.length}} 名学员</text>
<!-- <uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title="">
{{students.length}} 名学员</uni-section> -->
</view>
<template v-if="(thisClass.state == '0' || thisClass.state == '1')">
<view class="classMateBox">
<view class="" style=" overflow: hidden;">
<uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title="">
{{students.length}} 名学员</uni-section>
</view>
<view class=" tips">
<view class="flex_box">
<view class="item flex_box">
@@ -389,6 +391,7 @@
<script>
import sutdentScoreList from "./components/sutdent_score_list.vue";
import debounce from "@/common/debounce.js";
import {
ref,
onMounted
@@ -869,10 +872,11 @@
return list
},
// 改变班级状态
changeClassStatu(statusCode) {
changeClassStatu(statusCode) {
debounce(async () => {
let that = this
that.opClass(statusCode)
},300)
},
// 考试周和结班状态下,学员的信息
async getStudentScoreList() {
@@ -919,6 +923,9 @@
},
// 班级操作
opClass(statusCode) {
uni.showLoading({
title:'正在处理'
})
$http.request({
url: "common/class/updateClassState",
method: "POST",
@@ -931,6 +938,7 @@
},
})
.then(res => {
uni.hideLoading()
if (res.code == 0) {
// that.isHave = true
uni.showToast({
@@ -951,11 +959,12 @@
})
}
}).catch(e => {
uni.hideLoading()
console.log(e, '数据报错')
uni.showToast({
title: res.errMsg,
icon: 'none',
duration: 300
duration: 3000
})
});
},

View File

@@ -32,14 +32,16 @@
itemStyle="padding-left:10rpx; background-color:#fff; padding-right: 10rpx; height: 50px; font-size:26rpx"></u-tabs>
</view>
<!-- 学员列表 -->
<view class="" v-if="tabId == '2'">
<view class="" v-if="tabId == '2'">
<template v-if="students.length> 0 ">
<view class="" style=" overflow: hidden; margin: 20rpx 0;">
<text style="font-size: 26rpx; color: #666;"> {{students.length}} 名学员</text>
<!-- <uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title="">
{{students.length}} 名学员</uni-section> -->
</view>
<template v-if="(thisClass.state == '0' || thisClass.state == '1')">
<view class="classMateBox">
<view class="" style=" overflow: hidden;">
<uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title="">
{{students.length}} 名学员</uni-section>
</view>
<view class=" tips">
<view class="flex_box">
<view class="item flex_box">

View File

@@ -1,10 +1,10 @@
<template>
<view class="">
<view class="" >
<view class="classMateBox" v-show="students.length> 0 ">
<view class="classMateBox" v-if="students.length> 0 ">
<view class="" style=" overflow: hidden;">
<uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" >
{{students.length}} 名学员</uni-section>
<!-- <uni-section v-if="students.length> 0 " class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" >
{{students.length}} 名学员</uni-section> -->
</view>
<!-- <view class=" tips">
<view v-if="thisClass.state == '2'" class=" zhiliang flex_box flex_between align-items_box" style="margin-top: 20rpx;">

View File

@@ -115,6 +115,7 @@
<script>
import $http from '@/config/requestConfig.js';
import debounce from "@/common/debounce.js";
import {
mapState,mapMutations
} from "vuex";
@@ -300,6 +301,7 @@
},
// 获取交卷数据
sumitAnswer() {
debounce(async () => {
let that = this
that.wantSubmit = true
// this.noAnswerList = await this.getNoAnswerList()
@@ -319,10 +321,13 @@
}else{
that.sumbitPaper()
}
},300)
},
// q请求提交试卷
sumbitPaper(ids) {
uni.showLoading({
title:'正在交卷'
})
let that = this
$http.request({
url: "common/classExam/submitExamPaper",
@@ -335,7 +340,7 @@
},
})
.then(res => {
// uni.hideLoading()
uni.hideLoading()
if (res.code == 0) {
console.log('交卷结果',res);
uni.showToast({
@@ -392,6 +397,7 @@
this.haveAnswerList = this.gethaveAnswerList()
},
showNextQuestion() {
debounce(async () => {
// 下一题
this.curIndex1++
// this.curQuestion.answerIds = []
@@ -402,8 +408,10 @@
// console.log('+++++++++++++++', this.testPaper, );
this.noAnswerList = this.getNoAnswerList()
this.haveAnswerList = this.gethaveAnswerList()
},300)
},
clickOption(item, index) {
// debounce(async () => {
console.log('item', item, index, this.curIndex1);
if (this.curQuestion.type == 0) {
this.questionList[this.curIndex1].answerIds = [item.id]
@@ -431,6 +439,7 @@
console.log('this.testPaper.',this.noAnswerList,this.haveAnswerList);
this.saveQuestAnswer(this.examId,this.curIndex1+1,this.curQuestion.answerIds.join(','))
console.log('noAnswerList', this.noAnswerList)
// },300)
},
setDesc() {
const letterArr = []

View File

@@ -10,8 +10,8 @@
<view class="item " v-for="(item, index) in taskList" @click="clickReply(item)">
<view class="leve1 flex_box">
<view class="pp" style="flex: 1;" v-html="item.content"></view>
<text v-if="item.scoreSuccess == '0'" class="red light"></text>
<text v-else class="score" style="padding-left: 10rpx;">{{item.score}}</text>
<text v-if="item.scoreSuccess == 0 && classState != '2'" class="red light"></text>
<text v-if="item.scoreSuccess > 0" class="score" style="padding-left: 10rpx;">{{item.score}}</text>
<!-- <text v-if="" class="blue light"></text> -->
</view>
<view :class="['leve2']">
@@ -46,12 +46,18 @@
</view>
</view>
</scroll-view>
<!-- <view class="date">
日期{{curReplay.createTime}}
</view> -->
<view class="score" v-show="curReplay.scoreSuccess >= 1">
分数{{curReplay.score}}
</view>
<view class="score noscore" v-show="curReplay.scoreSuccess == 0">
<view class="score noscore" v-if="curReplay.scoreSuccess == 0 && (classState == '1' || classState == '3')">
未开始评分
</view>
<view class="" style="color: #999; font-size: 26rpx; margin-top: 20rpx;" v-if="curReplay.scoreSuccess == 0 && (classState == '0' || classState == '2')">
不可评分
</view>
<template v-if="(roleCode.includes('4') || roleCode.includes('5')) && curReplay.scoreSuccess < 1 && (classState == '3' || classState == '1')">
<view class="" style=" padding: 10rpx 10rpx; margin-top: 20rpx;">
<view class="scoreBox flex_box">

View File

@@ -133,6 +133,7 @@
<script>
import $http from '@/config/requestConfig.js';
import debounce from "@/common/debounce.js";
import {
mapState,mapMutations
} from "vuex";
@@ -207,17 +208,19 @@
})
},
onHandleClickBuy(){ // 确定开始考试
this.protocolShow = false
if (this.testPaper.length <= 0) {
this.pagetitle = '获取试卷'
this.getTestPage()
}else{
uni.showToast({
title:'页面发生错误,请退出后重新进入页面或联系客服人员',
icon:'none',
duration:3000
})
}
debounce(async () => {
this.protocolShow = false
if (this.testPaper.length <= 0) {
this.pagetitle = '获取试卷'
this.getTestPage()
}else{
uni.showToast({
title:'页面发生错误,请退出后重新进入页面或联系客服人员',
icon:'none',
duration:3000
})
}
},300)
},
// 获取服务器时间
async getServerTime() {
@@ -327,6 +330,7 @@
},
// 获取交卷数据
sumitAnswer() {
debounce(async () => {
let that = this
// this.noAnswerList = await this.getNoAnswerList()
if(this.noAnswerList.length > 0){
@@ -345,10 +349,13 @@
}else{
that.sumbitPaper()
}
},300)
},
// q请求提交试卷
sumbitPaper(ids) {
uni.showLoading({
title:'正在交卷'
})
let that = this
$http.request({
url: "common/classExam/submitExamPaper",
@@ -416,6 +423,7 @@
this.haveAnswerList = this.gethaveAnswerList()
},
showNextQuestion() {
debounce(async () => {
// 下一题
this.curIndex1++
// this.curQuestion.answerIds = []
@@ -426,8 +434,10 @@
// console.log('+++++++++++++++', this.testPaper, );
this.noAnswerList = this.getNoAnswerList()
this.haveAnswerList = this.gethaveAnswerList()
},300)
},
clickOption(item, index) {
// debounce(async () => {
console.log('item', item, index, this.curIndex1);
if (this.curQuestion.type == 0) {
this.testPaper[this.curIndex1].answerIds = [item.id]
@@ -454,6 +464,7 @@
console.log('this.testPaper.',this.testPaper.id);
this.saveQuestAnswer(this.examId,this.curIndex1+1,this.curQuestion.answerIds.join(','))
console.log('noAnswerList', this.noAnswerList)
// },300)
},
setDesc() {
const letterArr = []
@@ -549,6 +560,9 @@
icon: 'none',
duration: 3000
})
setTimeout(()=>{
this.goToClass()
},1000)
});
},
giveZero() {