This commit is contained in:
@fawn-nine
2024-08-19 14:34:32 +08:00
parent 28067d851d
commit 6d8629ff4f
9 changed files with 251 additions and 57 deletions

View File

@@ -2,7 +2,7 @@
<view> <view>
<!-- 公共组件-每个页面必须引入 --> <!-- 公共组件-每个页面必须引入 -->
<public-module></public-module> <public-module></public-module>
<z-nav-bar title="我的班级管理员页面"> <z-nav-bar title="我的班级管理">
</z-nav-bar> </z-nav-bar>
<!-- <view class="tabsBox" :class="[fixed ? 'fixed' : '' ]"> <!-- <view class="tabsBox" :class="[fixed ? 'fixed' : '' ]">
@@ -319,11 +319,11 @@
this.preClassList = [] this.preClassList = []
} }
} }
uni.hideLoading() // uni.hideLoading()
this.getData() this.getData()
}).catch(e => { }).catch(e => {
uni.hideLoading() // uni.hideLoading()
this.getData() // this.getData()
console.log(e, '数据报错') console.log(e, '数据报错')
// this.status = 3 // this.status = 3
uni.showToast({ uni.showToast({

View File

@@ -267,6 +267,8 @@
_list = _list.map(item => item.url) _list = _list.map(item => item.url)
// console.log('this.fileList1',_list); // console.log('this.fileList1',_list);
this.form.img = _list.join(',') this.form.img = _list.join(',')
}else{
this.form.img = ''
} }
var _url = "" var _url = ""
this.form.id ? _url = "common/class/editClassTask" : _url = "common/class/addClassTask" this.form.id ? _url = "common/class/editClassTask" : _url = "common/class/addClassTask"

View File

@@ -15,6 +15,7 @@
]"> ]">
{{getClassStatus}} {{getClassStatus}}
</view> </view>
<h3 style="margin-top: 20rpx; font-size: 28rpx;">班级名称{{thisClass.title}}</h3>
<view class="welComeText"> <view class="welComeText">
<text> 班内职务{{getRoleName}} </text> <text> 班内职务{{getRoleName}} </text>
</view> </view>
@@ -129,7 +130,7 @@
<rich-text class="banjiJianjie" :nodes="formatRichText(thisClass.content)"></rich-text> <rich-text class="banjiJianjie" :nodes="formatRichText(thisClass.content)"></rich-text>
<view class="qrcode" v-if="thisClass.qrcode != ''"> <view class="qrcode" v-if="thisClass.qrcode != ''">
<uni-section class="mb-10 nobg" title="群二维码" type="line"></uni-section> <uni-section class="mb-10 nobg" title="群二维码" type="line"></uni-section>
<image :src="thisClass.qrcode" mode="widthFix"></image> <image :src="thisClass.qrcode" mode="widthFix" @click="previewImage(thisClass.qrcode)"></image>
</view> </view>
</view> </view>
</view> </view>
@@ -313,13 +314,13 @@
beforeDestroy() { beforeDestroy() {
clearInterval(this.interval) clearInterval(this.interval)
}, },
onBackPress() { // onBackPress() {
if (this.$refs.fab.isShow) { // if (this.$refs.fab.isShow) {
this.$refs.fab.close() // this.$refs.fab.close()
return true // return true
} // }
return false // return false
}, // },
onShow() { onShow() {
this.getClassInfo() this.getClassInfo()
@@ -469,6 +470,18 @@
} }
}) })
}, },
previewImage(url) {
console.log(url);
uni.previewImage({
urls: [url],
// longPressActions: {
// itemList: ["很抱歉,暂不支持保存图片到本地"],
// success: function(res) {
// // console.log(res,'+++++')
// },
// },
});
},
titleClick(item, textIndex) { titleClick(item, textIndex) {
this.tijiaoTitleId = textIndex this.tijiaoTitleId = textIndex
console.log('e班内提交子按钮'); console.log('e班内提交子按钮');
@@ -507,6 +520,7 @@
// 获取个人信息 // 获取个人信息
if (this.userInfo.id != undefined) { if (this.userInfo.id != undefined) {
this.$http.post("common/user/getUserInfo").then((res) => { this.$http.post("common/user/getUserInfo").then((res) => {
uni.hideLoading()
this.userMes = res.result; this.userMes = res.result;
this.isMonitor = res.isMonitor this.isMonitor = res.isMonitor
this.isDirector = res.isDirector this.isDirector = res.isDirector
@@ -520,6 +534,7 @@
} }
}).catch(e => { }).catch(e => {
uni.hideLoading()
uni.showToast({ uni.showToast({
title: '获取用户信息失败', title: '获取用户信息失败',
icon: 'none' icon: 'none'
@@ -615,7 +630,7 @@
// 改变班级状态 // 改变班级状态
changeClassStatu(statusCode) { changeClassStatu(statusCode) {
if (statusCode == '1') { if (statusCode == '1') {
// console.log('this.admins',this.admins); console.log('this.admins',this.admins);
if (this.admins.list.length == 0) { if (this.admins.list.length == 0) {
uni.showToast({ uni.showToast({
title: '请先完成管理人员的设置', title: '请先完成管理人员的设置',
@@ -630,6 +645,7 @@
data: { data: {
"id": this.thisClass.id, "id": this.thisClass.id,
"title": this.thisClass.title, "title": this.thisClass.title,
"qrcode": this.thisClass.qrcode,
"state": statusCode, //小班状态0待开班1已开班2完成 "state": statusCode, //小班状态0待开班1已开班2完成
"icon": this.thisClass.icon, "icon": this.thisClass.icon,
"content": this.thisClass.content, "content": this.thisClass.content,
@@ -652,10 +668,10 @@
}).catch(e => { }).catch(e => {
console.log(e, '数据报错') console.log(e, '数据报错')
// this.status = 3 // this.status = 3
uni.showToast({ // uni.showToast({
title: e.msg, // title: e.msg,
icon: 'error' // icon: 'error'
}) // })
}); });
}, },
taskEdit(item) { taskEdit(item) {
@@ -739,6 +755,7 @@
}, },
}) })
.then(res => { .then(res => {
console.log('res--------',this.classId,res,);
this.refresh = false this.refresh = false
if (res.code == 0) { if (res.code == 0) {
this.isHave = res.result.isJoin this.isHave = res.result.isJoin
@@ -800,7 +817,7 @@
} }
.welComeText { .welComeText {
font-size: 28rpx;
padding:20rpx 0; padding:20rpx 0;
color: #e58d44; color: #e58d44;
} }

View File

@@ -227,9 +227,9 @@
this.status = 1 this.status = 1
this.flag = false this.flag = false
uni.showLoading({ // uni.showLoading({
title:'正在加载' // title:'正在加载'
}) // })
$http.request({ $http.request({
url: "common/class/getClassByDirectorid", url: "common/class/getClassByDirectorid",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档 method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
@@ -264,9 +264,9 @@
// console.log('status', this.status) // console.log('status', this.status)
this.flag = true this.flag = true
} }
uni.hideLoading() // uni.hideLoading()
}).catch(e => { }).catch(e => {
uni.hideLoading() // uni.hideLoading()
this.flag = true this.flag = true
console.log(e, '数据报错') console.log(e, '数据报错')
// this.status = 3 // this.status = 3

View File

@@ -56,8 +56,9 @@
<text v-if="item.createUser.nickname != '' && item.createUser.nickname != null">匿名用户</text> <text v-if="item.createUser.nickname != '' && item.createUser.nickname != null">匿名用户</text>
<text v-else>匿名用户</text> <text v-else>匿名用户</text>
</view> </view>
</view> </view>
<view class="editBtn" v-if="listDisplay == '1' && item.scoreSuccess == 0"> <!-- <view class="editBtn" v-if="listDisplay == '1' && item.scoreSuccess == 0"> -->
<view class="editBtn" v-if="listDisplay == '1' && item.scoreSuccess == 0 && item.scoreInfo == ''">
<text @click="editOrAdd(item)">修改</text> <text @click="editOrAdd(item)">修改</text>
</view> </view>
</view> </view>
@@ -262,18 +263,58 @@
deletePic(event) { deletePic(event) {
this.fileList1.splice(event.index, 1) this.fileList1.splice(event.index, 1)
}, },
getHomeWorkDetail(id){
uni.showLoading({
title:"加载中"
})
$http.request({
url: 'common/class/getClassTaskAndQuesReplyInfo',
method: "POST",
data: {
"replyId":id, //0全部作业1我的作业
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if(res.classTaskAndQuesReply){
console.log('作业详情res',res);
this.form = res.classTaskAndQuesReply
this.fileList1 = []
if(res.classTaskAndQuesReply.img != ''){
var _imgList = res.classTaskAndQuesReply.img.split(',')
_imgList.forEach(item => {
this.fileList1.push({url:item})
})
}
// this.fileList1 = [...res.classTaskAndQuesReply.fileList]
console.log('fileList4545',this.fileList1);
this.showEditBlank = true
}else{
this.form = {}
}
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
uni.showToast({
title: '获取作业详情失败',
icon:'none'
})
})
},
editOrAdd(item){ editOrAdd(item){
console.log('item', item); console.log('item', item);
if(item){ if(item){
this.form = item this.getHomeWorkDetail(item.id)
this.fileList1 = [...item.fileList]
console.log('fileList4545',item.fileList);
} }
else{ else{
console.log('form', this.form); console.log('form', this.form);
this.showEditBlank = true
} }
this.showEditBlank = true
}, },
radioChange1(e){ radioChange1(e){
@@ -376,22 +417,31 @@
}, },
onSubmit() { onSubmit() {
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
if (this.fileList1.length > 0) { if (this.fileList1.length > 0) {
let _list = this.fileList1 let _list = this.fileList1
_list = _list.map(item => item.url) _list = _list.map(item => item.url)
// console.log('this.fileList1',_list); // console.log('this.fileList1',_list);
this.form.img = _list.join(',') this.form.img = _list.join(',')
}else{
this.form.img = ''
} }
var _url = "" var _url = ""
this.form.id ? _url = this.form.id ? _url =
'common/class/editClassTaskReply' : _url = 'common/class/addClassTaskReply' 'common/class/editClassTaskAndQuesReply' : _url = 'common/class/addClassTaskAndQuesReply'
// this.form.id ? _url =
// 'common/class/editClassTaskReply' : _url = 'common/class/addClassTaskReply'
var data = { var data = {
"taskId": this.form.id ? undefined : this.form.taskId, "relationId": this.form.id ? undefined : this.form.taskId,
"id": this.form.id, "id": this.form.id,
"type": this.thisTask.type == '0' || this.thisTask.type == '1' ? '0' : '1', //类型0任务1课后题
"display": this.form.display, //0不展示1展示 "display": this.form.display, //0不展示1展示
"content": this.form.content, "content": this.form.content,
"img": this.form.img "img": this.form.img
} }
console.log('data',data); console.log('data',data);
$http.request({ $http.request({
url: _url, url: _url,

View File

@@ -37,28 +37,28 @@
:src="item.createUser.avatar" mode="aspectFit"></image> :src="item.createUser.avatar" mode="aspectFit"></image>
<image v-else src="/static/icon/morenAvavter.png" mode="aspectFit"></image> <image v-else src="/static/icon/morenAvavter.png" mode="aspectFit"></image>
</view> </view>
<view class="userName flex_box"> <view class="userName flex_box">
<text <text
v-if="item.createUser.nickname != '' && item.createUser.nickname != null">匿名用户</text> v-if="item.createUser.nickname != '' && item.createUser.nickname != null">{{item.createUser.nickname}}</text>
<text v-else>匿名用户</text> <text v-else>匿名用户</text>
</view> </view>
</view> </view>
</view> </view>
<view class="leve2"> <view class="leve2">
<!-- <view class="imgBox flex_box" v-if="item.fileList.length > 0">
<view class="itemImg" v-for="(item, index) in item.fileList" :key="index">
<image @click="previewImage(item.url)" :src="item.url" mode="widthFix"></image>
</view>
</view> -->
<view class=""> <view class="">
{{item.content}} {{item.content}}
</view> </view>
<view class=""> <view class="" style="margin-top: 20rpx;">
<view class="score" v-if="item.scoreSuccess == 1"> <view class="score" v-if="item.scoreSuccess == 1">
分数{{item.score}} 分数{{item.score}}
</view> </view>
<view class="score noscore" v-else>未评分</view> <view class="score noscore" v-else-if="item.scoreInfo != ''">
<text v-show="item.scoreInfos < 2 && item.haveGiveScore">等待另一名评分员评分</text>
<text v-show="item.scoreInfos < 2 && !item.haveGiveScore">请您评分</text>
<button v-show="item.scoreInfos >= 2" class="getScore" @click.stop="getRealScore(item.id)" >生成成绩</button>
</view>
<view class="score noscore" v-else>未开始评分</view>
<view class="date"> <view class="date">
{{item.createTime}} {{item.createTime}}
</view> </view>
@@ -92,7 +92,7 @@
<view class="date"> <view class="date">
日期{{curReplay.createTime}} 日期{{curReplay.createTime}}
</view> </view>
<view class="" v-if="curReplay.createUser" style="color: #999;padding: 10rpx 0;"> <view class="" v-if="curReplay.createUser" style="color: #999;padding: 10rpx 0; font-size: 26rpx;">
学员信息{{curReplay.createUser.nickname != null && curReplay.createUser.nickname != '' ? curReplay.createUser.nickname : '匿名用户'}} 学员信息{{curReplay.createUser.nickname != null && curReplay.createUser.nickname != '' ? curReplay.createUser.nickname : '匿名用户'}}
/ {{curReplay.createUser.tel}} / {{curReplay.createUser.tel}}
</view> </view>
@@ -102,7 +102,7 @@
<view class="score noscore" v-show="curReplay.scoreSuccess == 0"> <view class="score noscore" v-show="curReplay.scoreSuccess == 0">
未评分 未评分
</view> </view>
<template v-if="roleCode.includes('4') || roleCode.includes('5')"> <template v-if="roleCode.includes('4') && curReplay.scoreSuccess != 1 || roleCode.includes('5') && curReplay.scoreSuccess != 1">
<view class="" style="background-color: beige; padding: 10rpx 10rpx; margin-top: 20rpx;"> <view class="" style="background-color: beige; padding: 10rpx 10rpx; margin-top: 20rpx;">
<uni-forms :modelValue="form" :rules="rules" ref="form"> <uni-forms :modelValue="form" :rules="rules" ref="form">
<uni-forms-item label="分数" name="score" > <uni-forms-item label="分数" name="score" >
@@ -110,7 +110,9 @@
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
</view> </view>
<view class="btn_box"><button @click="onSubmit"> </button></view> <view class="btn_box ">
<button class="submit" @click="onSubmit"> </button>
</view>
</template> </template>
</view> </view>
</view> </view>
@@ -189,6 +191,9 @@
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.pPage = 0
this.zuoyeList = []
this.getReplayList()
// this.getTaskInfo() // this.getTaskInfo()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, },
@@ -206,6 +211,47 @@
...mapState(["userInfo"]), ...mapState(["userInfo"]),
}, },
methods: { methods: {
// 生成成绩
getRealScore(id){
uni.showLoading({
title:'正在处理'
})
$http.request({
url: "common/class/generateScore",
method: "POST",
data: {
"replyId": id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
uni.showToast({
title: '成绩已生成',
icon: 'success'
})
}
setTimeout(()=>{
this.closePup()
this.pPage = 0
this.zuoyeList = []
this.getReplayList()
uni.hideLoading()
},500)
}).catch(e => {
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: '成绩生成失败',
icon: 'error'
})
});
},
// 获取医案任务详情 // 获取医案任务详情
getTaskInfo() { getTaskInfo() {
$http.request({ $http.request({
@@ -258,15 +304,67 @@
deletePic(event) { deletePic(event) {
this.fileList1.splice(event.index, 1) this.fileList1.splice(event.index, 1)
}, },
getHomeWorkDetail(id){
uni.showLoading({
title:"加载中"
})
$http.request({
url: 'common/class/getClassTaskAndQuesReplyInfo',
method: "POST",
data: {
"replyId":id, //0全部作业1我的作业
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if(res.classTaskAndQuesReply){
console.log('作业详情res',res);
this.curReplay = res.classTaskAndQuesReply
this.form.id = res.classTaskAndQuesReply.id
this.fileList1 = []
if(res.classTaskAndQuesReply.img != ''){
var _imgList = res.classTaskAndQuesReply.img.split(',')
_imgList.forEach(item => {
this.fileList1.push({url:item})
})
}
if(res.classTaskAndQuesReply.scoreInfo != ''){
this.curReplay.scoreInfo = JSON.parse(res.classTaskAndQuesReply.scoreInfo)
}else{
this.curReplay.scoreInfo = {}
}
if(this.curReplay.scoreInfo != {}){
for (let k in this.curReplay.scoreInfo){
console.log(k)
if(k == this.userInfo.id){
this.form.score = this.curReplay.scoreInfo[k]
this.form.hasGiveScore = true
break
}
// console.log(this.curReplay.scoreInfo[k])
}
}
console.log('this.curReplay.scoreInfo',this.curReplay.scoreInfo);
this.showEditBlank = true
}else{
this.curReplay = {}
this.closePup()
}
uni.hideLoading()
}).catch(e => {
this.showEditBlank = false
uni.hideLoading()
uni.showToast({
title: '获取数据失败',
icon:'none'
})
})
},
editOrAdd(item) { editOrAdd(item) {
console.log('item', item); // console.log('item', item);
this.curReplay = item this.getHomeWorkDetail(item.id)
this.form = {...item}
if(this.form.scoreSuccess == 0){
this.form.score = undefined
}
this.fileList1 = [...item.fileList]
this.showEditBlank = true
}, },
radioChange1(e) { radioChange1(e) {
this.listDisplay = e.detail.value this.listDisplay = e.detail.value
@@ -317,6 +415,8 @@
if (res.page.records.length > 0) { if (res.page.records.length > 0) {
var list = res.page.records var list = res.page.records
list.forEach(item => { list.forEach(item => {
item.scoreInfos = 0
item.haveGiveScore = false
item.fileList = [] item.fileList = []
if (item.img != '') { if (item.img != '') {
var _urs = item.img.split(',') var _urs = item.img.split(',')
@@ -326,7 +426,22 @@
}) })
}) })
} }
console.log('item.scoreInfo',item.scoreInfo);
if(item.scoreInfo != ""){
var i = 0
for(var kk in JSON.parse(item.scoreInfo)){
console.log(kk);
if(kk == this.userInfo.id){
item.haveGiveScore = true
}
i++
}
item.scoreInfos = i
}
console.log('item.scoreInfos',item.scoreInfos, item.haveGiveScore);
}) })
this.zuoyeList = this.zuoyeList.concat(list) this.zuoyeList = this.zuoyeList.concat(list)
console.log('chulihoude ', this.zuoyeList); console.log('chulihoude ', this.zuoyeList);
if (res.page.pages > this.pPage) { if (res.page.pages > this.pPage) {
@@ -479,6 +594,14 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/mixin.scss"; @import "@/style/mixin.scss";
::v-deep .uni-forms-item{margin-bottom: 0 !important;} ::v-deep .uni-forms-item{margin-bottom: 0 !important;}
// .btn_box{ justify-content: space-between;
// button{display: block; width: 46%;}
// }
.getScore{
display: inline-block; font-weight: normal; color: #fff; padding: 4rpx 10rpx; height: 60rpx;
line-height: 50rpx; font-size: 28rpx;
background-color: #ffaa7f !important;
}
.flexbox { .flexbox {
display: flex; display: flex;
} }

View File

@@ -226,8 +226,8 @@
} }
.leve2 { justify-content: space-between; .leve2 { justify-content: space-between;
color: #666; font-size: 24rpx; color: #999; font-size: 24rpx;
b{font-size: 34rpx; padding: 0 4rpx; font-weight: normal;} b{font-size: 34rpx; padding: 0 4rpx; font-weight: normal; color: #333;}
.item{text-align: center; padding-top: 0; padding-bottom: 0; margin-bottom: 0;} .item{text-align: center; padding-top: 0; padding-bottom: 0; margin-bottom: 0;}
} }

View File

@@ -20,7 +20,7 @@
<view class="taskContent" v-html="thisTask.content"> <view class="taskContent" v-html="thisTask.content">
</view> </view>
<view class="date" style="color: #999; text-align: right;"> <view class="date" style="color: #999; text-align: right; font-size: 26rpx;">
提交时间{{thisTask.createTime}} 提交时间{{thisTask.createTime}}
</view> </view>
</view> </view>
@@ -301,6 +301,8 @@
_list = _list.map(item => item.url) _list = _list.map(item => item.url)
// console.log('this.fileList1',_list); // console.log('this.fileList1',_list);
this.form.img = _list.join(',') this.form.img = _list.join(',')
}else{
this.form.img = ''
} }
var _url = "" var _url = ""
this.form.id ? _url = this.form.id ? _url =

View File

@@ -60,7 +60,7 @@
未评分 未评分
</view> </view>
<!-- --> <!-- -->
<template v-if="roleCode.includes('4') || roleCode.includes('5')"> <template v-if="roleCode.includes('4') && curReplay.scoreSuccess != 1 || roleCode.includes('5') && curReplay.scoreSuccess != 1 ">
<view class="" style="background-color: beige; padding: 10rpx 10rpx; margin-top: 20rpx;"> <view class="" style="background-color: beige; padding: 10rpx 10rpx; margin-top: 20rpx;">
<uni-forms :modelValue="form" :rules="rules" ref="form"> <uni-forms :modelValue="form" :rules="rules" ref="form">
<uni-forms-item label="分数" name="score" > <uni-forms-item label="分数" name="score" >