暂存
This commit is contained in:
@@ -18,12 +18,11 @@
|
||||
<h3 style="margin-top: 20rpx; font-size: 28rpx;">班级名称:{{thisClass.title}}</h3>
|
||||
<view class="welComeText">
|
||||
<text>【 班内职务:{{getRoleName}} 】</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="pingfenBox" >
|
||||
<!-- 功能按钮 -->
|
||||
<view class="optionsBtn" v-if="(roleCode.includes('66') || roleCode.includes('1') || roleCode.includes('2')) && thisClass.state != '2'">
|
||||
<view class="optionsBtn" v-if="(roleCode.includes('主任') || roleCode.includes('副主任') || roleCode.includes('1') || roleCode.includes('2')) && thisClass.state != '2'">
|
||||
<view class="flex_box">
|
||||
<view class="item setBanewei" v-if="thisClass.state != '2'"
|
||||
@click="goSetAdmin('/pages/miniClass/memberSet')">
|
||||
@@ -35,51 +34,20 @@
|
||||
<text>修改班级</text>
|
||||
</view>
|
||||
<!-- 主任、班长副班长可以开班或者结班 -->
|
||||
<view class="item openClass" @click="changeClassStatu('1')" v-if="thisClass.state == '0'">
|
||||
<view class="item openClass" @click="changeClassStatu('1')" v-if="thisClass.state == '0' && (roleCode.includes('1') || roleCode.includes('2'))">
|
||||
<text>开班</text>
|
||||
</view>
|
||||
<view class="item overClass" @click="changeClassStatu('2')" v-if="thisClass.state == '1' ">
|
||||
<view class="item overClass" @click="changeClassStatu('2')" v-if="thisClass.state == '1' && (roleCode.includes('1') || roleCode.includes('2'))">
|
||||
<text>结班</text>
|
||||
</view>
|
||||
<view class="item delClass" v-if="thisClass.state == '0'" @click="delClass()">
|
||||
<view class="item delClass" v-if="thisClass.state == '0' && (roleCode.includes('主任') || roleCode.includes('副主任'))" @click="delClass()">
|
||||
<text>删除班级</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 作业批改 -->
|
||||
<view class="flex_box">
|
||||
<view class="item" @click="goAddHomeWork" v-if="thisClass.state == '1' && roleCode.includes('2') || thisClass.state == '1' && roleCode.includes('1')">
|
||||
<view class="img">
|
||||
<image src="../../static/icon/fabu.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<text>发布</text>
|
||||
</view>
|
||||
<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" @click="goPingfen('/pages/miniClass/taskList',thisClass.id, '1')">
|
||||
<view class="img">
|
||||
<image src="../../static/icon/pigai1.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<text>医案</text>
|
||||
</view>
|
||||
<view class="item" @click="goXindeList('/pages/miniClass/xindeList')">
|
||||
<view class="img">
|
||||
<image src="../../static/icon/pigai3.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<text>心得</text>
|
||||
</view>
|
||||
<view class="item" @click="goSikaoList('/pages/miniClass/sikaoQuestionList', thisClass.id)">
|
||||
<view class="img">
|
||||
<image src="../../static/icon/sikaoti.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<text>思考题</text>
|
||||
</view>
|
||||
</view>
|
||||
<class-infoWork-blank :thisClass="thisClass" :roleCode="roleCode"></class-infoWork-blank>
|
||||
</view>
|
||||
<view class="otherItems flex_box">
|
||||
<view><text class="ciyao">创建日期</text><text
|
||||
@@ -126,12 +94,27 @@
|
||||
<view class="" v-show="courses.length == 0">
|
||||
<u-divider text="暂无课程"></u-divider>
|
||||
</view>
|
||||
<uni-section class="mb-10 nobg" title="教学目标/班级简介" type="line"></uni-section>
|
||||
<!-- 作业列表 -->
|
||||
<template v-if="homeWorkList.length > 0 && thisClass.state == 0">
|
||||
<uni-section class="mb-10 nobg" title="班内作业" type="line"></uni-section>
|
||||
<view class="newBox" v-show="homeWorkList.length > 0">
|
||||
<view class="item flexbox" v-for="(item, index) in homeWorkList" :key="index"
|
||||
@click="clickTask(item)">
|
||||
<view class="buyItems">
|
||||
<view class="txt555">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="jianjie" v-html="item.content"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- <uni-section class="mb-10 nobg" title="教学目标/班级简介" type="line"></uni-section>
|
||||
<rich-text class="banjiJianjie" :nodes="formatRichText(thisClass.content)"></rich-text>
|
||||
<view class="qrcode" v-if="thisClass.qrcode != ''">
|
||||
<uni-section class="mb-10 nobg" title="群二维码" type="line"></uni-section>
|
||||
<image :src="thisClass.qrcode" mode="widthFix" @click="previewImage(thisClass.qrcode)"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -194,6 +177,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import classInfoWorkBlank from "@/components/classInfoWorkBlank.vue";
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
mapState
|
||||
@@ -290,11 +274,13 @@
|
||||
taskHaveMore: false, // 是否还有更多
|
||||
roleCode: [], // 角色数组
|
||||
interval:null,
|
||||
homeWorkList:[]
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
uni.hideTabBar();
|
||||
this.classId = e.id
|
||||
|
||||
this.interval = setInterval(() => {
|
||||
if(this.thisClass.id){
|
||||
uni.showLoading({
|
||||
@@ -314,29 +300,29 @@
|
||||
beforeDestroy() {
|
||||
clearInterval(this.interval)
|
||||
},
|
||||
// onBackPress() {
|
||||
// if (this.$refs.fab.isShow) {
|
||||
// this.$refs.fab.close()
|
||||
// return true
|
||||
// }
|
||||
// return false
|
||||
// },
|
||||
onShow() {
|
||||
this.getClassInfo()
|
||||
|
||||
|
||||
onShow() {
|
||||
this.getClassInfo()
|
||||
// this.roleCode = await this.getRealRole()
|
||||
},
|
||||
components: {
|
||||
// musicPlay
|
||||
classInfoWorkBlank,
|
||||
},
|
||||
computed: {
|
||||
...mapState(["userInfo"]),
|
||||
|
||||
getRoleName() {
|
||||
|
||||
getRoleName() {
|
||||
console.log('执行一次');
|
||||
var _roleName = ''
|
||||
// var _code = ''
|
||||
this.roleCode.forEach(item => {
|
||||
switch (item) {
|
||||
case '66':
|
||||
_roleName += '主任';
|
||||
case '主任':
|
||||
_roleName += ' 主任';
|
||||
break;
|
||||
case '副主任':
|
||||
_roleName += ' 副主任';
|
||||
break;
|
||||
case '0':
|
||||
_roleName += ' 学员';
|
||||
@@ -359,7 +345,7 @@
|
||||
}
|
||||
})
|
||||
return _roleName
|
||||
},
|
||||
},
|
||||
getClassStatus() {
|
||||
var _roleName = ''
|
||||
switch (this.thisClass.state) {
|
||||
@@ -377,10 +363,14 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goAddHomeWork(){
|
||||
|
||||
clickTask(item){
|
||||
uni.navigateTo({
|
||||
url:`/pages/miniClass/taskDetailForMan?id=${item.id}&roleCode=${this.roleCode}&type=0&classState=${this.thisClass.state}`
|
||||
})
|
||||
},
|
||||
goAddHomeWork(type){
|
||||
uni.navigateTo({
|
||||
url: `/pages/miniClass/addHomeWork?classId=${this.thisClass.id}`
|
||||
url: `/pages/miniClass/addHomeWork?classId=${this.thisClass.id}&type=${type}`
|
||||
})
|
||||
|
||||
},
|
||||
@@ -389,41 +379,33 @@
|
||||
url:`${url}?classId=${this.thisClass.id}&type=2&roleCode=${this.roleCode}`
|
||||
})
|
||||
},
|
||||
// 获取真实的身份信息
|
||||
getRealRole() {
|
||||
console.log('this.thisClass.id', this.thisClass.id);
|
||||
|
||||
$http.request({
|
||||
url: "common/class/getUserRole",
|
||||
method: "POST",
|
||||
data: {
|
||||
"classId": this.thisClass.id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
uni.hideLoading()
|
||||
// console.log('res获取身份信息', res);
|
||||
var _list = []
|
||||
if (res.result.length > 0) {
|
||||
_list = res.result
|
||||
_list = _list.map(item => {
|
||||
return item.role
|
||||
})
|
||||
console.log('——list', _list)
|
||||
}
|
||||
this.roleCode = this.roleCode.concat(_list)
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
this.roleCode = []
|
||||
uni.showToast({
|
||||
title: '获取身份信息失败',
|
||||
icon: 'error'
|
||||
})
|
||||
});
|
||||
},
|
||||
// 获取真实的身份信息
|
||||
getRealRole() {
|
||||
console.log('this.thisClass.id', this.thisClass.id);
|
||||
|
||||
$http.request({
|
||||
url: "common/class/getUserRole",
|
||||
method: "POST",
|
||||
data: {
|
||||
"classId": this.thisClass.id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
uni.hideLoading()
|
||||
console.log('res获取身份信息',this.thisClass.id, res);
|
||||
this.roleCode = res.result
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
this.roleCode = []
|
||||
uni.showToast({
|
||||
title: '获取身份信息失败',
|
||||
icon: 'error'
|
||||
})
|
||||
});
|
||||
},
|
||||
goPingfen(url, classId, type) {
|
||||
uni.navigateTo({
|
||||
url: `${url}?classId=${classId}&type=${type}&roleCode=${this.roleCode}`
|
||||
@@ -433,12 +415,15 @@
|
||||
uni.navigateTo({
|
||||
url:`${url}?classId=${id}&roleCode=${this.roleCode}`
|
||||
})
|
||||
},
|
||||
// 点击作业或者医案,进入详细介绍
|
||||
clickTask() {
|
||||
|
||||
},
|
||||
},
|
||||
delClass() {
|
||||
if(this.students.length > 0){
|
||||
uni.showToast({
|
||||
title: '已经有学员加入,不可删除班级',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
var that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
@@ -528,16 +513,9 @@
|
||||
uni.hideLoading()
|
||||
this.userMes = res.result;
|
||||
this.isMonitor = res.isMonitor
|
||||
this.isDirector = res.isDirector
|
||||
if (this.isDirector) {
|
||||
this.roleCode.push('66')
|
||||
}
|
||||
if (this.isMonitor) {
|
||||
console.log('确定具体的职位是什么');
|
||||
this.isDirector = res.isDirector
|
||||
this.getRealRole()
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
@@ -632,18 +610,68 @@
|
||||
})
|
||||
}, 200)
|
||||
},
|
||||
// 获取固定作业的数量
|
||||
async getHomeWorkLength(){
|
||||
var list = []
|
||||
await $http.request({
|
||||
url: "common/class/getClassTaskList",
|
||||
method: "POST",
|
||||
data: {
|
||||
"limit": 100,
|
||||
"page": 1,
|
||||
"classId": this.thisClass.id,
|
||||
"type": "0", //类型 0班内任务1医案2心得
|
||||
"title": ""
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then((res) => {
|
||||
// console.log('班内作业的输俩个',res);
|
||||
if(res.code == 0){
|
||||
list = res.page.records
|
||||
}
|
||||
}).catch(e => {
|
||||
list = []
|
||||
console.log('e',e);
|
||||
})
|
||||
return list
|
||||
},
|
||||
// 改变班级状态
|
||||
changeClassStatu(statusCode) {
|
||||
changeClassStatu(statusCode) {
|
||||
// var mm = 0
|
||||
// mm = await this.getHomeWorkLength()
|
||||
let that = this
|
||||
if (statusCode == '1') {
|
||||
console.log('this.admins',this.admins);
|
||||
if (this.admins.list.length == 0) {
|
||||
if(this.homeWorkList.length == 0){
|
||||
uni.showToast({
|
||||
title: '请先完成管理人员的设置',
|
||||
icon: 'none'
|
||||
title: '开班前请发布班内作业,开班后将不可添加和更改',
|
||||
icon: 'none',
|
||||
duration:3000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.students.length < this.thisClass.number) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content:'班内成员还没有招满,确定开班操作吗?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
that.opClass(statusCode)
|
||||
}else{
|
||||
return
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
}else{
|
||||
that.opClass(statusCode)
|
||||
}
|
||||
|
||||
},
|
||||
// 班级操作
|
||||
opClass(statusCode){
|
||||
$http.request({
|
||||
url: "common/class/editClass",
|
||||
method: "POST",
|
||||
@@ -671,12 +699,7 @@
|
||||
}, 500)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
// uni.showToast({
|
||||
// title: e.msg,
|
||||
// icon: 'error'
|
||||
// })
|
||||
console.log(e, '数据报错')
|
||||
});
|
||||
},
|
||||
taskEdit(item) {
|
||||
@@ -745,7 +768,7 @@
|
||||
url: `/pages/miniClass/classCaskList?id=${this.thisClass.id}&type=${this.tijiaoTitleId}`
|
||||
})
|
||||
},
|
||||
getClassInfo() {
|
||||
async getClassInfo() {
|
||||
uni.showLoading({
|
||||
title: '正在加载'
|
||||
})
|
||||
@@ -759,7 +782,7 @@
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
.then(async res => {
|
||||
console.log('res--------',this.classId,res,);
|
||||
this.refresh = false
|
||||
if (res.code == 0) {
|
||||
@@ -797,8 +820,12 @@
|
||||
this.classModel = res.result.classModel
|
||||
this.courses = res.result.courses
|
||||
this.students = res.result.students
|
||||
this.refresh = true
|
||||
}
|
||||
this.refresh = true
|
||||
if(this.thisClass.state == 0){
|
||||
this.homeWorkList = await this.getHomeWorkLength()
|
||||
}
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
@@ -848,7 +875,8 @@
|
||||
|
||||
.optionsBtn {
|
||||
margin-bottom: 30rpx;
|
||||
border-bottom: 1px solid #eee; padding-bottom: 30rpx;
|
||||
// border-bottom: 1px solid #eee;
|
||||
padding-bottom: 10rpx;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.flex_box {
|
||||
@@ -939,16 +967,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin: 0 auto;
|
||||
// .img {
|
||||
// width: 100rpx;
|
||||
// height: 100rpx;
|
||||
// margin: 0 auto;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
// image {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
.qrcode{width:100%;
|
||||
@@ -1130,7 +1158,7 @@
|
||||
|
||||
// background-color: #f4f7ff;
|
||||
}
|
||||
|
||||
u-divider{font-size: 24rpx;}
|
||||
.newBox {
|
||||
|
||||
.item {
|
||||
@@ -1140,7 +1168,8 @@
|
||||
@include ptop_bottm(10px);
|
||||
@include pleft_right(10px);
|
||||
|
||||
@include mshadow(10px, 1) .imgcontainer {
|
||||
// @include mshadow(10px, 1)
|
||||
.imgcontainer {
|
||||
display: block;
|
||||
width: 80rpx;
|
||||
margin-right: 20rpx;
|
||||
|
||||
Reference in New Issue
Block a user