This commit is contained in:
@fawn-nine
2024-08-06 17:17:31 +08:00
parent 4426b044bd
commit 3ae89fd86b
8 changed files with 2607 additions and 239 deletions

View File

@@ -1,46 +1,12 @@
<template>
<view>
<public-module></public-module>
<z-nav-bar title="班级详情"></z-nav-bar>
<!-- <view class="" style="background-color: #f4f7ff; min-height: calc(100vh - 200rpx);"> -->
<z-nav-bar title="班级详情"></z-nav-bar>
<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>
<h3>{{thisClass.title}}</h3>
<text class="tuichu" v-if="!isMonitor && !isDirector && isHave" @click="outClass()">退出班级</text>
</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>
<view class="otherItems flex_box">
<view><text class="ciyao">创建日期</text><text
class="mainTxt">{{thisClass.createTime.substring(0,10)}}</text>
@@ -60,7 +26,6 @@
<rich-text class="banjiJianjie" :nodes="formatRichText(thisClass.content)"></rich-text>
<!-- <view class="banjiJianjie" v-html="thisClass.content"></view> -->
<view class="mainBox">
<view class="">
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="tabClick" :current="curTagIndex"
@@ -94,10 +59,7 @@
<!-- 班内同学 -->
<view class="classMateBox" v-show="students.length> 0 && tabId == '2'">
<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="['item','flexbox']" 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"
@@ -107,18 +69,7 @@
<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>
<text class="userType" v-if="item.vip == '2' ">医学VIP用户</text>
<text class="userType" v-if="item.vip == '3' ">国学VIP用户</text>
</text>
</view>
</view>
@@ -135,37 +86,59 @@
</view>
<!-- 班内任务 --><!-- 医案 --> <!-- 心得 -->
<view class="">
<view class="" v-if="tijiaoTitleId == 2" >
<view class="noanser">
<view class="">
<text>快来添加一条记录吧~</text>
</view>
<view class="btn">
<text @click="onPageJump('/pages/miniClass/addHomeWork',thisClass.id,2)">写心得</text>
</view>
</view>
</view>
<view class="" v-if="tijiaoTitleId == 2" style="margin: 20rpx 0;">
<radio-group @change="radioChange1" class="flex_box">
<view class="" style="margin-right:20rpx ;">
<radio value="0" checked="true" />全部同学的</label>
</view>
<view class="">
<radio value="1" />只看我自己的</label>
</view>
</radio-group>
</view>
<!-- <uni-section class="mb-10 nobg" title="任务列表" type="line"></uni-section> -->
<view v-if="taskList.length > 0">
<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>
</view>
<view class="leve2">
{{item.content}}
</view>
<view class="leve3" @click.stop="editMyXinde(item)" v-show="tijiaoTitleId == 2 && myExperience == 1">
修改
</view>
<view class="leve3" v-show="item.reply && tijiaoTitleId != 2">
<text>已提交答案</text>
</view>
<view class="leve3 no" v-show="!item.reply && tijiaoTitleId != 2">
<text>未提交答案</text>
</view>
</view>
</view>
</view>
<view class="showMore" v-show="true">
<!-- <view class="showMore" v-show="taskHaveMore"> -->
<text @click="showmoreTask">查看全部 >></text>
</view>
</view>
</view>
<view class="" v-else>
<u-divider text="暂无数据"></u-divider>
</view>
<!-- <uni-section class="mb-10 nobg" title="提交的任务" type="line"></uni-section> -->
<u-divider v-show="status == 2" text="已加载全部"></u-divider>
<u-divider v-show="status == 3" text="暂无数据"></u-divider>
<u-divider v-show="status == 1" text="加载中..."></u-divider>
<!-- <view class="" v-else>
<u-divider text="暂无数据"></u-divider>
</view> -->
</view>
@@ -174,69 +147,9 @@
</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>
<!-- 管理弹出 -->
<u-popup key="1" :show="showMan" :round="10" @close="closeManager">
</view>
<view class="guanli">
<h3>班内管理人员</h3>
<view class="item">
<text class="adminName">班长</text>
<view class="personbox" v-if="admins.monitor.id">
<text>{{admins.monitor.user.nickname != null && admins.monitor.user.nickname != '' ? admins.monitor.user.nickname : '匿名用户'}}</text>
<text v-if="admins.monitor.id">({{admins.monitor.user.tel}})</text>
</view>
<text v-else>暂未设置</text>
</view>
<view class="item">
<text class="adminName">副班长</text>
<view class="personbox" v-if="admins.dmonitor.id">
<text>{{admins.dmonitor.user.nickname != null && admins.dmonitor.user.nickname != '' ? admins.dmonitor.user.nickname : '匿名用户'}}</text>
<text>({{admins.dmonitor.user.tel}})</text>
</view>
<text v-else>暂未设置</text>
</view>
<view class="item"><text class="adminName">学习委员</text>
<view class="personbox" v-if="admins.learner.id">
<text>{{admins.learner.user.nickname != null && admins.learner.user.nickname != '' ? admins.learner.user.nickname : '匿名用户'}}</text>
<text>({{admins.learner.user.tel}})</text>
</view>
<text v-else>暂未设置</text>
</view>
<view class="item arryItem"><text class="adminName">记分员</text>
<template v-if="admins.counter.length > 0">
<view class="arryItemSub" v-for="(item,index) in admins.counter" :key="index">
<text>{{item.user.nickname != null && item.user.nickname != '' ? item.user.nickname : '匿名用户'}}</text>
<text>({{item.user.tel}}) </text>
</view>
</template>
<text v-else>暂未设置</text>
</view>
<view class="item arryItem"><text class="adminName">评分员</text>
<template v-if="admins.scorer.length > 0">
<view class="arryItemSub" v-for="(item,index) in admins.scorer" :key="index">
<text>{{item.user.nickname != null && item.user.nickname != '' ? item.user.nickname : '匿名用户'}}</text>
<text>({{item.user.tel}}) </text>
</view>
</template>
<text v-else>暂未设置</text>
</view>
</view>
</u-popup>
<view class="fabBox" v-if="isDirector || isMonitor">
<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>
<z-navigation ></z-navigation>
</view>
</template>
@@ -251,6 +164,8 @@
horizontal: 'right',
vertical: 'bottom',
direction: 'vertical',
status:88,
loadFlag:false,
pattern: {
color: '#7A7E83',
backgroundColor: '#fff',
@@ -277,6 +192,7 @@
tabId: '0',
curTagIndex: 0,
scrollable: false,
pPage:0,
tabList: [{
name: '班内课程',
id: '0'
@@ -319,7 +235,7 @@
isHave: false,
showMan: false,
tijiaoTitleList: [{
name: '班内任务',
name: '班内作业',
id: '0'
},
{
@@ -334,6 +250,7 @@
tijiaoTitleId: '0',
taskList:[], // 任务列表
taskHaveMore:false, // 是否还有更多
myExperience:'0',
}
},
onLoad(e) {
@@ -341,6 +258,11 @@
this.classId = e.id
this.getUserInfo()
},
onReachBottom() {
if (this.status != 2 && this.status != 3) {
this.getList()
}
},
onPullDownRefresh() {
this.getClassInfo()
uni.stopPullDownRefresh()
@@ -354,19 +276,48 @@
},
onShow() {
this.getClassInfo()
this.pPage = 0
this.taskList = []
this.getList()
},
computed: {
...mapState(["userInfo"]),
},
methods: {
editMyXinde(item){
var options = JSON.stringify(item)
uni.navigateTo({
url:`/pages/miniClass/addHomeWork?options=${options}&type=2`
})
},
radioChange1(e){
this.myExperience = e.detail.value
console.log('点了',this.myExperience);
this.pPage = 0
this.taskList = []
this.getList()
},
goPingfen(url,classId,type){
uni.navigateTo({
url:`${url}?classId=${classId}&type=${type}`
})
},
// 点击作业或者医案,进入详细介绍
clickTask(){
clickTask(item){
var options = JSON.stringify(item)
if(this.tijiaoTitleId == 2){
// 进入的是心得
uni.navigateTo({
url:`/pages/miniClass/xindeDetail?options=${options}`
})
return
}
console.log('this.tijiaoTitleId',this.tijiaoTitleId);
// console.log('options',options);
uni.navigateTo({
url:`/pages/miniClass/taskDetail?options=${options}`
})
},
delClass() {
var that = this
@@ -405,18 +356,27 @@
}
})
},
titleClick(item, textIndex) {
this.tijiaoTitleId = textIndex
console.log('e班内提交子按钮');
getList(){
this.status = 1;
if (this.loadFlag) {
console.log("有未完成的进程");
return;
}
uni.showLoading({
title:'加载中'
})
this.loadFlag = true;
this.pPage++;
$http.request({
url: "common/class/getClassTaskList",
url: "common/class/getClassTaskListStudent",
method: "POST",
data: {
"limit": 20,
"page": 1,
"classId": this.thisClass.id,
"type": textIndex+'', //类型 0班内任务1医案2心得
"title": ""
"limit": 100,
"page": 1,
"classId": this.thisClass.id,
"type": this.tijiaoTitleId+'', //类型 0班内任务1医案2心得
"myExperience": this.myExperience, //0全部心得1我的心得
"title": ""
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
@@ -424,21 +384,46 @@
})
.then(res => {
if (res.code == 0) {
if(res.page.records.length > 0){
console.log('数据获取成功',res.page.records);
this.taskList = res.page.records
if(res.page.pages > 1){
this.taskHaveMore = true
}
if (res.page.pages > this.pPage) {
this.status = 0;
} else {
this.status = 2;
}
}else{
this.status = 3; // 暂无数据
}
this.loadFlag = false;
console.log('res', res);
uni.hideLoading()
}
}).catch(e => {
console.log(e, '数据报错')
// this.status = 3
uni.hideLoading()
this.loadFlag = false;
uni.showToast({
title: e.msg,
icon: 'error'
})
});
},
titleClick(item, textIndex) {
console.log('进来了吗');
if(this.tijiaoTitleId == textIndex){
return
}
this.tijiaoTitleId = textIndex
console.log('e班内提交子按钮');
this.pPage = 0
this.taskList = []
this.myExperience = 0
this.getList()
},
getUserInfo() {
// 获取个人信息
if (this.userInfo.id != undefined) {
@@ -464,7 +449,8 @@
console.log('e', e);
this.tabId = e.id
if(e.id == 3){
this.titleClick(undefined,0)
console.log('心得');
this.getList()
}
},
@@ -772,6 +758,11 @@
color: #fff;
font-weight: normal;
}
.noanser{ padding: 20rpx;
background-color: rgba(255, 255, 255, .6);
text-align: center; border-bottom: 1px solid #eee;
.btn{display: inline-block; border-radius: 20rpx ; padding: 10rpx 20rpx; background-color: $themeColor; color: #fff;}
}
.taskEdit{color: $themeColor; display: inline-block; padding-left: 20rpx;}
.pingfenBox {
border: 2px dotted #bed4ee;
@@ -865,8 +856,10 @@
}
.leve2{
color: #999;
@include bov()
@include bov()
}
.leve3{color: $themeColor; text-align: center; padding-top: 10rpx;}
.leve3.no{color: #ff9277; text-align: center;}
}
}
}