This commit is contained in:
@fawn-nine
2024-08-07 16:43:49 +08:00
parent ebd8dff627
commit 784e771fb8
12 changed files with 1310 additions and 402 deletions

View File

@@ -2,16 +2,85 @@
<view>
<public-module></public-module>
<z-nav-bar title="班级详情"></z-nav-bar>
<!-- <view class="" style="background-color: #f4f7ff; min-height: calc(100vh - 200rpx);"> -->
<view class="mainContent" v-if="thisClass.id">
<view class="className">
<h3>{{thisClass.title}}</h3>
<text class="kaiban" v-if="thisClass.state == '0' && isMonitor || thisClass.state == '0' && isDirector"
@click="changeClassStatu('1')">开班</text>
<text class="jieban" v-if="thisClass.state == '1' && isMonitor || thisClass.state == '1' && isDirector"
@click="changeClassStatu('2')">结班</text>
<!-- <view class="" style="height: 40rpx;">
</view> -->
<view :class="['classStatus',
this.thisClass.state == 0 ? 'daikai' :'',
this.thisClass.state == 1 ? 'xuexizhong' :'',
this.thisClass.state == 2 ? 'yijieban' :''
]">
{{getClassStatus}}
</view>
<view class="welComeText">
<text> 班内职务{{getRoleName}} </text>
</view>
<!-- 功能按钮 -->
<view class="optionsBtn">
<view class="flex_box">
<view class="item setBanewei" v-if="isDirector" @click="onPageJump('/pages/miniClass/memberSet',thisClass.id)">
<text>设置班委</text>
</view>
<!-- 主任班长副班长修改班级 没开班的时候可以 -->
<view class="item editClass"
v-show="isDirector && thisClass.state == '0' ||
roleCode == 2 && thisClass.state == '0' ||
roleCode == 1 && thisClass.state == '0'
"
@click="onPageJump('/pages/miniClass/addClass',thisClass.id, classModel.type)">
<text>修改班级</text>
</view>
<!-- 主任、班长副班长可以开班或者结班 -->
<view class="item openClass" @click="changeClassStatu('1')"
v-if="thisClass.state == '0' && isMonitor ||
thisClass.state == '0' && roleCode == 1 ||
thisClass.state == '0' && roleCode == 2">
<text >开班</text>
</view>
<view class="item overClass" @click="changeClassStatu('2')"
v-if="thisClass.state == '1' && isMonitor ||
thisClass.state == '1' && roleCode == 1 ||
thisClass.state == '1' && roleCode == 2">
<text >结班</text>
</view>
<view class="item delClass" v-if="isDirector" @click="delClass()">
<text>删除班级</text>
</view>
</view>
</view>
<!-- 作业批改 -->
<view class="pingfenBox" v-if="isDirector || isMonitor">
<view class="flex_box">
<view class="item" @click="goPingfen('/pages/miniClass/taskList',thisClass.id, '0')">
<view class="img">
<image src="../../static/icon/pigai2.png" mode="widthFix"></image>
</view>
<text>作业</text>
</view>
<view class="item">
<view class="img">
<image src="../../static/icon/pigai1.png" mode="widthFix"></image>
</view>
<text>医案</text>
</view>
<view class="item">
<view class="img">
<image src="../../static/icon/pigai3.png" mode="widthFix"></image>
</view>
<text>心得</text>
</view>
<view class="item">
<view class="img">
<image src="../../static/icon/biaoxianfen.png" mode="widthFix"></image>
</view>
<text>表现</text>
</view>
</view>
</view>
<view class="otherItems flex_box">
<view><text class="ciyao">创建日期</text><text
class="mainTxt">{{thisClass.createTime.substring(0,10)}}</text>
@@ -21,44 +90,13 @@
<text class="mainTxt" v-if="classModel.type == '1'">联合班</text>
<text class="mainTxt" v-if="classModel.type == '2'">精英班</text>
</view>
<view><text class="ciyao">班级人数</text><text class="mainTxt">{{thisClass.number}}</text></view>
<view><text class="ciyao">人数</text><text
class="mainTxt">{{students.length}}/{{thisClass.number}}人</text></view>
<view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text></view>
</view>
<!-- 作业批改 -->
<view class="pingfenBox" v-if="isDirector || isMonitor">
<view class="flex_box">
<view class="item" @click="goPingfen('/pages/miniClass/giveScore',thisClass.id, '0')">
<view class="img">
<image src="../../static/icon/pigai2.png" mode="widthFix"></image>
</view>
<text>作业评分</text>
</view>
<view class="item">
<view class="img">
<image src="../../static/icon/pigai1.png" mode="widthFix"></image>
</view>
<text>医案评分</text>
</view>
<view class="item">
<view class="img">
<image src="../../static/icon/pigai3.png" mode="widthFix"></image>
</view>
<text>心得评分</text>
</view>
<view class="item">
<view class="img">
<image src="../../static/icon/biaoxianfen.png" mode="widthFix"></image>
</view>
<text>表现评分</text>
</view>
</view>
</view>
<view class="" v-if="thisClass.content != ''">
<text class="adminName">教学目标/班级简介</text>
</view>
<rich-text class="banjiJianjie" :nodes="formatRichText(thisClass.content)"></rich-text>
<!-- <view class="banjiJianjie" v-html="thisClass.content"></view> -->
<view class="mainBox">
<view class="mainBox">
<!-- 课程列表 -->
<uni-section class="mb-10 nobg" title="班内课程" type="line"></uni-section>
<view class="newBox" v-show="courses.length > 0">
@@ -79,7 +117,9 @@
</view>
<view class="" v-show="courses.length == 0">
<u-divider text="暂无课程"></u-divider>
</view>
</view>
<uni-section class="mb-10 nobg" title="教学目标/班级简介" type="line"></uni-section>
<rich-text class="banjiJianjie" :nodes="formatRichText(thisClass.content)"></rich-text>
<!-- 班内问答 -->
<!-- <view class="" v-if=" tabId == '1'">
班内问答
@@ -88,33 +128,38 @@
<uni-section class="mb-10 nobg" title="班内学员" type="line"></uni-section>
<view class="classMateBox" v-show="students.length> 0">
<view class="newBox">
<view :class="['item','flexbox',
item.vip == '1' ? 'superVip' : '',
item.vip == '2' ? 'wumenVip' : '',
item.vip == '3' ? 'zmVip' : '']" v-for="(item, index) in students" :key="index">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="classmateImg">
<image v-if="item.avatar != null && item.avatar != ''" :src="item.avatar"
mode="aspectFit"></image>
<image v-else src="/static/icon/morenAvavter.png" mode="aspectFit"></image>
</view>
<view class="textItems flex_box">
<text class="txt555" v-if="item.nickname != null && item.nickname != ''">
{{item.nickname}}
<template v-if="isDirector || isMonitor">
<text>{{item.tel}}</text> <text @click="outClass(item.id)"
class="outBtn">踢出班级</text>
</template>
</text>
<text class="txt555" v-else>
匿名用户
</text>
<text class="userType" v-if="item.vip == '1'">超级VIP用户</text>
<view :class="['item',
item.student.vip == '1' ? 'superVip' : '',
item.student.vip == '2' ? 'wumenVip' : '',
item.student.vip == '3' ? 'zmVip' : '']" v-for="(item, index) in students" :key="index">
<view class="flexbox">
<view class="classmateImg">
<image v-if="item.student.avatar != null && item.student.avatar != ''"
:src="item.student.avatar" mode="aspectFit"></image>
<image v-else src="/static/icon/morenAvavter.png" mode="aspectFit"></image>
</view>
<view class="textItems flex_box">
<text class="txt555"
v-if="item.student.nickname != null && item.student.nickname != ''">
{{item.student.nickname}}
<template v-if="isDirector || isMonitor">
<text>{{item.student.tel}}</text> <text @click="outClass(item.student.id)"
class="outBtn">踢出班级</text>
</template>
</text>
<text class="txt555" v-else>
匿名用户
</text>
<!-- <text class="userType" v-if="item.vip == '1'">超级VIP用户</text>
<text class="userType" v-if="item.vip == '2' ">医学VIP用户</text>
<text class="userType" v-if="item.vip == '3' ">国学VIP用户</text>
<text class="userType" v-if="item.vip == '3' ">国学VIP用户</text> -->
</view>
</view>
<view class="courseBuyOrNo" v-if="item.buyState !='会员 ' ">
<view class="">
<text>{{ item.buyState }}</text>
</view>
</view>
</view>
</view>
</view>
@@ -127,22 +172,16 @@
<text :class="tijiaoTitleId == item.id ? 'active' :''" @click="titleClick(item,index)"
v-for="(item, index) in tijiaoTitleList" :key="index">{{item.name}}</text>
</view>
<!-- 班内任务 --><!-- 医案 --> <!-- 心得 -->
<!-- 班内任务 --><!-- 医案 --> <!-- 心得 -->
<view class="">
<view v-if="taskList.length > 0">
<view class="submitRecode">
<view class="newBox">
<view class="item " v-for="(item, index) in taskList" @click="clickTask(item)">
<view class="leve1 flex_box">
<text>{{item.title}}</text><text v-if="isDirector || isMonitor" class="taskEdit" @click="taskEdit(item)">修改</text>
<!-- <view class="classmateImg">
<image v-if="item.avatar != null && item.avatar != ''" :src="item.avatar" mode="aspectFit"></image>
<image src="/static/icon/morenAvavter.png" mode="aspectFit"></image>
</view> -->
<!-- <view class="userName flex_box">
<text>匿名用户</text>
</view> -->
<text>{{item.title}}</text><text v-if="isDirector || isMonitor"
class="taskEdit" @click="taskEdit(item)">修改</text>
</view>
<view class="leve2">
{{item.content}}
@@ -150,8 +189,8 @@
</view>
</view>
</view>
<view class="showMore" v-show="true">
<!-- <view class="showMore" v-show="taskHaveMore"> -->
<view class="showMore" v-show="true">
<!-- <view class="showMore" v-show="taskHaveMore"> -->
<text @click="showmoreTask">查看全部 >></text>
</view>
</view>
@@ -159,24 +198,12 @@
<u-divider text="暂无数据"></u-divider>
</view>
<!-- <uni-section class="mb-10 nobg" title="提交的任务" type="line"></uni-section> -->
</view>
</view>
</view>
</view>
<view class="bottomBox" v-if="!isHave && !isDirector && !isMonitor && students.length < thisClass.number">
<button type="primary" @click="addClass">一键加入班级</button>
</view>
<view class="bottomBox manBtnBox flex_box" v-if="isDirector || isMonitor">
<text class="set" @click="onPageJump('/pages/miniClass/memberSet',thisClass.id)">管理人员设置</text>
<template v-show="isDirector && thisClass.state == '0'">
<text class="edit"
@click="onPageJump('/pages/miniClass/addClass',thisClass.id, classModel.type)">修改班级</text>
<text class="del" @click="delClass()">删除班级</text>
</template>
</view>
</view>
<!-- 管理弹出 -->
<u-popup key="1" :show="showMan" :round="10" @close="closeManager">
<view class="guanli">
@@ -228,8 +255,6 @@
<uni-fab ref="fab" :pattern="pattern" :content="fabContent" :horizontal="horizontal" :vertical="vertical"
:direction="direction" @trigger="fabTrigger" @fabClick="fabClick" />
</view>
<z-navigation v-if="!isDirector && !isMonitor"></z-navigation>
</view>
</template>
@@ -281,7 +306,7 @@
{
name: '班内学员',
id: '2'
},
},
// {
// name: '班内提交',
// id: '3'
@@ -295,7 +320,7 @@
scorer: [],
counter: []
},
},
activeStyle: {
color: '#333',
fontWeight: 'bold',
@@ -326,8 +351,10 @@
},
],
tijiaoTitleId: '0',
taskList:[], // 任务列表
taskHaveMore:false, // 是否还有更多
taskList: [], // 任务列表
taskHaveMore: false, // 是否还有更多
roleCode: undefined,
}
},
onLoad(e) {
@@ -351,16 +378,79 @@
},
computed: {
...mapState(["userInfo"]),
getRoleName() {
var _roleName = ''
switch (this.roleCode) {
case '66':
_roleName = '主任';
break;
case '0':
_roleName = '学员';
break;
case '1':
_roleName = '班长';
break;
case '2':
_roleName = '副班长';
break;
case '3':
_roleName = '学习委员';
break;
case '4':
_roleName = '评分员';
break;
case '5':
_roleName = '记分员';
break;
}
return _roleName
},
getClassStatus(){
var _roleName = ''
switch (this.thisClass.state) {
case '0':
_roleName = '待开班';
break;
case '1':
_roleName = '学习中';
break;
case '2':
_roleName = '已结班';
break;
}
return _roleName
}
},
methods: {
goPingfen(url,classId,type){
// 获取真实的身份信息
getRealRole() {
$http.request({
url: "common/class/getUserRole",
method: "POST",
data: {
"classId": this.thisClass.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then((res) => {
console.log('res获取身份信息', res);
}).catch(e => {
uni.showToast({
title: '获取身份信息失败',
icon: 'error'
})
});
},
goPingfen(url, classId, type) {
uni.navigateTo({
url:`${url}?classId=${classId}&type=${type}`
url: `${url}?classId=${classId}&type=${type}`
})
},
// 点击作业或者医案,进入详细介绍
clickTask(){
clickTask() {
},
delClass() {
var that = this
@@ -409,8 +499,8 @@
"limit": 20,
"page": 1,
"classId": this.thisClass.id,
"type": textIndex+'', //类型 0班内任务1医案2心得
"title": ""
"type": textIndex + '', //类型 0班内任务1医案2心得
"title": ""
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
@@ -418,11 +508,11 @@
})
.then(res => {
if (res.code == 0) {
console.log('数据获取成功',res.page.records);
this.taskList = res.page.records
if(res.page.pages > 1){
this.taskHaveMore = true
}
console.log('数据获取成功', res.page.records);
this.taskList = res.page.records
if (res.page.pages > 1) {
this.taskHaveMore = true
}
}
}).catch(e => {
console.log(e, '数据报错')
@@ -440,6 +530,13 @@
this.userMes = res.result;
this.isMonitor = res.isMonitor
this.isDirector = res.isDirector
if (this.isDirector) {
this.roleCode = '66'
} else if (this.isMonitor) {
this.getRealRole()
} else {
}
}).catch(e => {
uni.showToast({
title: '获取用户信息失败',
@@ -457,10 +554,10 @@
tabClick(e) {
console.log('e', e);
this.tabId = e.id
if(e.id == 3){
this.titleClick(undefined,0)
if (e.id == 3) {
this.titleClick(undefined, 0)
}
},
formatRichText(html) {
if (html == '') {
@@ -495,38 +592,7 @@
);
return newContent;
},
// 加入班级
addClass() {
$http.request({
url: "common/class/joinClass",
method: "POST",
data: {
"classId": this.classId,
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
this.isHave = true
uni.showToast({
title: `加入成功!`,
icon: 'success'
})
setTimeout(() => {
this.getClassInfo()
}, 200)
}
}).catch(e => {
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: `加入失败`,
icon: 'error'
})
});
},
// 显示班级成员
seeManager() {
this.showMan = true
@@ -556,7 +622,7 @@
uni.navigateTo({
url: `${_url}?id=${this.thisClass.id}&type=${_type}`
})
}, 200)
}, 200)
},
// 改变班级状态
changeClassStatu(statusCode) {
@@ -604,7 +670,7 @@
})
});
},
taskEdit(item){
taskEdit(item) {
console.log('taskEdit'.item);
},
// 退出班级 // 踢出班级
@@ -665,9 +731,9 @@
}
});
},
showmoreTask(){
showmoreTask() {
uni.navigateTo({
url:`/pages/miniClass/classCaskList?id=${this.thisClass.id}&type=${this.tijiaoTitleId}`
url: `/pages/miniClass/classCaskList?id=${this.thisClass.id}&type=${this.tijiaoTitleId}`
})
},
getClassInfo() {
@@ -746,7 +812,10 @@
display: flex;
}
.fabBox {}
.welComeText {
// padding: 6rpx 4rpx;
color: #e58d44;
}
::v-deep .uni-fab__content--other-platform,
::v-deep .uni-fab--rightBottom {
@@ -766,7 +835,33 @@
color: #fff;
font-weight: normal;
}
.taskEdit{color: $themeColor; display: inline-block; padding-left: 20rpx;}
.optionsBtn{ margin: 20rpx 0;
.flex_box{justify-content: space-between;}
.item{margin-right: 20rpx; width: 100%; text-align: center; color: #fff; padding: 20rpx 0; border-radius: 6rpx;}
.delClass{background-color: #ffa4a6;}
.openClass{background-color: #67c23a;}
.overClass{background-color: #258feb;}
.editClass{background-color: #258feb;}
.setBanewei{background-color: #e7b772;}
}
.classStatus{padding: 10rpx; color: #fff; text-align: right;}
.daikai{background-image: linear-gradient(-90deg, #258feb 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100% );}
.xuexizhong{background-image: linear-gradient(-90deg, #55aa00 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100% );}
.yijieban{background-image: linear-gradient(-90deg, #999 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100% );}
.courseBuyOrNo {
font-size: 28rpx;
border-top: 1px solid #eee;
padding-top: 10rpx;
margin-top: 10rpx;
}
.taskEdit {
color: $themeColor;
display: inline-block;
padding-left: 20rpx;
}
.pingfenBox {
border: 2px dotted #bed4ee;
padding: 20rpx;
@@ -825,13 +920,20 @@
}
}
.showMore{ width: 100%;
text-align: center; margin: 20rpx 0;
text{color: $themeColor;}
.showMore {
width: 100%;
text-align: center;
margin: 20rpx 0;
text {
color: $themeColor;
}
.submitRecode {
}
.submitRecode {
// padding: 20rpx;
.newBox {
.classmateImg {
width: 60rpx !important;
@@ -857,7 +959,8 @@
margin-bottom: 20rpx;
// .userName{}
}
.leve2{
.leve2 {
color: #999;
@include bov()
}
@@ -869,7 +972,8 @@
background-color: transparent !important;
}
.bottomBox { border-top: 1px solid #eee;
.bottomBox {
border-top: 1px solid #eee;
position: fixed;
padding: 20rpx 0;
text-align: center;
@@ -889,7 +993,7 @@
.mainContent {
color: #333;
padding: 0 20rpx;
padding-bottom:120rpx;
padding-bottom: 120rpx;
background-image: linear-gradient(30deg, #d4eaf0 0%, #d4eaf0 50%, #fdf0ed 100%);
min-height: 100vh;
}
@@ -1044,10 +1148,11 @@
margin-bottom: 10rpx;
}
}
.tijiaoTitle {
justify-content: space-between;
margin-bottom: 20rpx;
text {
display: block;
width: 30%;
@@ -1127,17 +1232,5 @@
top: 20rpx;
z-index: 1;
}
text.kaiban {
background-color: #67c23a;
}
text.jieban {
background-color: $themeColor
}
text.tuichu {
background-color: #f4a2a6;
}
}
</style>