This commit is contained in:
@fawn-nine
2024-08-09 17:10:39 +08:00
parent c753ab18a3
commit 7c7c96f630
13 changed files with 1674 additions and 314 deletions

View File

@@ -605,6 +605,13 @@
"navigationBarTitleText" : "用户的班级列表"
}
},
{
"path" : "pages/miniClass/MonitorClassList",
"style" :
{
"navigationBarTitleText" : "管理员的班级列表"
}
},
{
"path" : "pages/miniClass/memberSet",
"style" :
@@ -660,6 +667,13 @@
{
"navigationBarTitleText" : "班内学员"
}
},
{
"path" : "pages/miniClass/xindeList",
"style" :
{
"navigationBarTitleText" : "管理员心得列表"
}
}
],
"globalStyle": {

View File

@@ -473,7 +473,7 @@
var item = {
// 主任之外的人显示班级管理
name: "班级管理",
url: "/pages/miniClass/miniClassMan?type=mine",
url: "/pages/miniClass/MonitorClassList?type=mine",
type: "pageJump",
}

View File

@@ -0,0 +1,676 @@
<template>
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="我的班级管理员页面">
</z-nav-bar>
<!-- <view class="tabsBox" :class="[fixed ? 'fixed' : '' ]">
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="fatherClick" :current="curTagId"
:activeStyle="activeStyle" :scrollable="scrollable" :list="tabList"
itemStyle="padding-left: 15px; background-color:#fff; padding-right: 15px; height: 50px;"></u-tabs>
</view> -->
<view class="containerBg">
<view class="subCate flex" v-if="subList1.length> 0">
<text :class="['item',subTabId == item.id ? 'active' : '']" v-for="(item, index) in subList1"
@click="curseClick(item)" :key="index">{{item.title}}</text>
</view>
<view class="" v-show="subTabId == 0">
<view class="" v-if="preClassList.length > 0">
<!-- 待开班 -->
<uni-section class="mb-10 nobg" title="待开班" type="line"></uni-section>
<view class="888">
<view class="newBox" v-if="preClassList.length > 0">
<view class="item flexbox" v-for="(item, index) in preClassList" :key="index"
@click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer" v-if="item.icon != ''">
<image :src="item.icon" mode="aspectFit"></image>
</view>
<view class="imgcontainer defaultImg" v-else>
<image src="@/static/my_04.png" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="">
<text v-show="item.classModel.type == 0">普通班</text>
<text v-show="item.classModel.type == 1">联合班</text>
<text v-show="item.classModel.type == 2">精英班</text>
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
{{item.title}}
</text>
</view>
<view class="jianjie">
目标学员人数{{item.number}}
</view>
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="btn_box">
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<text class="seeInfo">进入班级</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="" v-if="learningClassList.length > 0">
<uni-section class="mb-10 nobg" title="学习中" type="line"></uni-section>
<view class="learnBox box">
<view class="newBox" v-if="learningClassList.length > 0">
<view class="item flexbox" v-for="(item, index) in learningClassList" :key="index"
@click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer" v-if="item.icon != ''">
<image :src="item.icon" mode="aspectFit"></image>
</view>
<view class="imgcontainer defaultImg" v-else>
<image src="@/static/my_04.png" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="">
<text v-show="item.classModel.type == 0">普通班</text>
<text v-show="item.classModel.type == 1">联合班</text>
<text v-show="item.classModel.type == 2">精英班</text>
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
{{item.title}}
</text>
</view>
<view class="jianjie">
目标学员人数{{item.number}}
</view>
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="btn_box">
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<text class="seeInfo">进入班级</text>
</view>
</view>
</view>
</view>
</view>
</view>
<u-divider v-if="preClassList.length == 0 && learningClassList.length == 0" text="暂无数据"></u-divider>
</view>
<!-- 过期班级 -->
<view class="" v-show="subTabId == 2">
<view class="learnBox box">
<view class="newBox" v-if="classList.length > 0">
<view class="item flexbox" v-for="(item, index) in classList" :key="index"
@click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer" v-if="item.icon != ''">
<image :src="item.icon" mode="aspectFit"></image>
</view>
<view class="imgcontainer defaultImg" v-else>
<image src="@/static/my_04.png" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="">
<text v-show="item.classModel.type == 0">普通班</text>
<text v-show="item.classModel.type == 1">联合班</text>
<text v-show="item.classModel.type == 2">精英班</text>
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
{{item.title}}
</text>
</view>
<view class="jianjie">
目标学员人数{{item.number}}
</view>
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="btn_box">
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<text class="seeInfo">进入班级</text>
</view>
</view>
</view>
</view>
<u-divider v-else text="暂无数据"></u-divider>
</view>
<view>
<!-- <u-back-top scroll-top="100"></u-back-top> -->
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle='bgiStyle'
:iconStyle="iconStyle"></u-back-top>
</view>
</view>
</view>
<z-navigation></z-navigation>
</view>
</template>
<script>
import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
var clear;
import {
mapState
} from 'vuex';
export default {
data() {
return {
playData: {},
addType: undefined, // 小班类型
range: [{
value: '0',
text: "普通小班",
name: "普通小班"
},
{
value: '1',
text: "联合班",
name: "普通小班"
},
{
value: '2',
text: "精英班",
name: "普通小班"
},
],
tagId: null,
pid: null,
fixed: false,
pupShow: false,
fatherTabId: null,
subTabId: null, //
bgiStyle: {
background: '#fff'
},
iconStyle: {
fontSize: '40rpx',
fontWeight: 'bold',
color: '#258feb',
},
scrollTop: 0,
activeStyle: {
color: '#333',
fontWeight: 'bold',
transform: 'scale(1.2)',
// backgroundColor: '#258feb'
},
subList1: [{
title: '进行中',
id: '0'
}, {
title: '已结班',
id: '2'
}],
subList: [{
title: '待开班',
id: '0'
}, {
title: '已开班',
id: '1'
}, {
title: '已结班',
id: '2'
}],
scrollable: false,
pageTitle: '',
tabList: [{
name: '普通小班',
id: '0'
}, {
name: '联合班',
id: '1'
}, {
name: '精英班',
id: '2'
}],
curTagId: 0,
classList: [], // 已结班
preClassList: [], // 待开班
learningClassList: [], // 在学习的班级
status: 3, // 0 不显示, 1 加载中2 加载全部完成3 暂无数据
page: 1,
flag: true, // 函数是否执行完
};
},
//第一次加载
onLoad(e) {
// 隐藏原生的tabbar
uni.hideTabBar();
// this.tagId = e.id
this.curTagId = this.range[0].value
this.subTabId = this.subList[0].id
this.pageTitle = e.title
this.pid = e.pid
console.log(e, '传入分类id')
// this.getData()
// this.getCateList(this.tagId)
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
if (this.scrollTop > 500) {
this.fixed = true
} else {
this.fixed = false
}
// console.log(this.scrollTop,'this.scrollTop')
},
onPullDownRefresh() {
console.log('下拉刷新')
// this.status = 3
// this.page = 1
this.classList = []
this.getData()
uni.stopPullDownRefresh()
},
onReachBottom() {
// if (this.status != 2 && this.flag) {
// this.page++
// this.getData(this.subTabId)
// }
console.log('触底加载', this.page)
},
computed: {
...mapState(['userInfo'])
},
//页面显示
onShow() {
// 隐藏原生的tabbar
// uni.hideTabBar();
this.getLearingClassList()
},
components: {
musicPlay
},
//方法
methods: {
// 加入班级
enterClass() {
},
selectChange(e) {
console.log("e:", e);
},
closePup() {
this.pupShow = false
},
surl(imageurl) {
return `url(${imageurl})`
},
// 待开班
getPreClassList() {
uni.showLoading({
title: "加载中"
})
$http.request({
url: "common/class/MyClassList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"state": '0', //小班状态0待开班1已开班2完成
"type": '' // 班类型 0小班 1联合班 2精英班
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.result.length > 0) {
this.preClassList = res.result
} else {
this.preClassList = []
}
}
uni.hideLoading()
this.getData()
}).catch(e => {
uni.hideLoading()
this.getData()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: `获取数据失败`,
icon: 'error'
})
});
},
// 学习中
getLearingClassList() {
uni.showLoading({
title: "加载中"
})
$http.request({
url: "common/class/MyClassList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"state": '1', //小班状态0待开班1已开班2完成
"type": '' // 班类型 0小班 1联合班 2精英班
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.result.length > 0) {
this.learningClassList = res.result
} else {
this.learningClassList = []
}
}
this.getPreClassList()
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
this.getPreClassList()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: `获取数据失败`,
icon: 'error'
})
});
},
goCreateClass() {
console.log('this.addType', this.addType);
if (this.addType != undefined) {
uni.navigateTo({
url: `/pages/miniClass/addClass?type=${this.addType}&name=add`
})
} else {
uni.showToast({
title: '请选择班级的类型',
icon: 'none'
})
return
}
},
fatherClick(e) {
console.log('点击', e)
this.page = 1
// var item = e
this.curTagId = e.id
this.subTabId = this.subList[0].id
this.getData(this.subTabId);
},
curseClick(item) {
this.subTabId = item.id
// this.classList = []
// this.page = 1
// this.getData(this.subTabId);
},
getData(id) {
if (!this.flag) {
console.log('正在执行,未完成')
return
}
this.status = 1
this.flag = false
uni.showLoading({
title: '正在加载'
})
$http.request({
url: "common/class/MyClassList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"state": '2', //小班状态0待开班1已开班2完成
"type": '' // 班类型 0小班 1联合班 2精英班
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.result.length > 0) {
this.classList = res.result
} else {
this.classList = []
}
this.flag = true
}
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
this.flag = true
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: `获取数据失败`,
icon: 'error'
})
});
},
// 跳转
onPageJump(url, id, have) {
// console.log('进来了',url,id);
uni.navigateTo({
url: `${url}?id=${id}&have=${have}`
});
},
shuomingPage(url, id, pid) {
uni.navigateTo({
url: `${url}?id=${id}&pid=${pid}`
});
}
},
};
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
/deep/.uni-select__selector {
top: unset;
bottom: calc(100% + 12px);
}
/deep/.uni-select {
border: none;
}
/deep/.uni-select__input-text {
font-size: 14px;
color: #7f7f7f //修改为你的字体颜色
}
/deep/.uni-select__input-placeholder {
font-size: 14px;
color: #7f7f7f //修改为你的字体颜色
}
/deep/.uni-popper__arrow {
top: unset;
bottom: -6px;
transform: rotate(180deg);
}
/deep/.uni-popper__arrow::after {
top: 0
}
.nobg {
background-color: transparent !important;
}
.box6 {
.btnBox {
justify-content: center;
}
}
.containerBg {
// background-color: $containerColor;
background-color: #f6f6f8;
padding: 0 20rpx;
}
.curseSet {
margin-right: 20rpx;
font-size: 28rpx;
display: flex;
align-items: center;
}
.fixed {
position: fixed;
z-index: 1;
width: 100%;
background-color: #fff;
}
.newBox {
.item {
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 20rpx;
@include ptop_bottm(10px);
@include pleft_right(10px);
@include mshadow(10px, 1) .imgcontainer {
display: block;
width: 110rpx;
margin-right: 20rpx;
// background-size: cover;
// background-position: center;
height: 200rpx;
flex-grow: 1;
// @include ptop_bottm(10px);
overflow: hidden;
// @include pleft_right(10px);
image {
width: 100%;
height: 200rpx;
}
}
.btn_box {
text-align: right;
text {
border-radius: 20rpx;
padding: 3px 5px;
@include theme("btn_bg");
font-size: 28rpx;
color: #fff;
}
.seeInfo {
background-color: #fff;
background-image: none;
border: 1px solid #666;
color: #333;
margin-left: 20rpx;
}
}
.buyItems {
width: 60%;
}
.jianjie {
line-height: 30rpx;
height: 60rpx;
overflow: hidden;
overflow: hidden !important;
margin-top: 10rpx;
font-size: 24rpx;
@include bov();
color: #9c9c9c;
}
.txt555 {
font-size: 30rpx;
color: #000;
@include bov()
}
}
}
.subCate {
padding-top: 10px;
padding-bottom: 10px;
display: flex;
.item {
border: 1px solid #bfcad9;
display: inline-block;
text-align: center;
font-size: 26rpx;
background-color: #fff;
border-radius: 4px;
width: 100%;
color: #333;
margin-right: 16rpx;
padding: 14rpx 30rpx;
}
.item:last-child() {
margin-right: 0;
}
.item.active {
border-color: $themeColor;
background-color: $themeColor;
color: #fff;
}
}
.tabList {
text-align: center;
}
.flexbox {
display: flex;
}
.imgcontainer {
background-color: $imgBg;
}
.box {
// background-color: #fff;
min-height: calc(100vh - 270rpx);
}
.learnBox {
// background-color: #fff;
margin-top: 10px;
.learn {
flex-wrap: wrap;
justify-content: space-between;
margin-top: 20rpx;
.item {
width: 48%;
margin-bottom: 16px;
overflow: hidden;
image {
width: 100%;
height: 200rpx;
}
.txt555 {
display: block;
text-align: center;
height: 40rpx;
width: 100%;
line-height: 40rpx;
@include bov(1);
margin-top: 10rpx;
font-size: 24rpx;
}
}
}
}
</style>

View File

@@ -5,6 +5,22 @@
<public-module ></public-module>
<!-- <view class="title">{{pageName+pageType}}</view> -->
<uni-forms :modelValue="form" :rules="rules" ref="form">
<view class="input_box" v-if="!form.id && form.type != 2">
<uni-forms-item label="" name="type" label-width="0">
<text class="input_tit"><i>*</i>类型:</text>
<view class="in" style="flex: 1; border: none;">
<!-- {{modelLIst}} -->
<uni-data-select placeholder="请选择类型"
class="addType"
v-model="form.type"
:localdata="range"
placement="top"
></uni-data-select>
</view>
</uni-forms-item>
</view>
<view class="input_box">
<uni-forms-item label="" name="title" label-width="0">
<text class="input_tit"><i>*</i>标题:</text>
@@ -72,10 +88,22 @@
img: '', //图片
type: undefined, // 反馈类型
},
range:[
{ value: '0', text: "班内作业",name:"班内作业"},
{ value: '1', text: "班内医案" ,name:"班内医案"},
],
telError: false,
relationError: false,
relationErrorPattern:false,
rules: {
type: {
rules: [{
required: true,
errorMessage: '请选择类型',
}
]
},
title: {
rules: [{
required: true,
@@ -105,6 +133,11 @@
this.pageType = e.type
this.form.classId = e.classId
this.form.type = e.type
if(e.type){
this.form.type = e.type
}else{
this.form.type = '0'
}
if(e.id){
// this.form.renwuId = e.renwuId
this.form.id = e.id
@@ -120,6 +153,8 @@
this.pageType = '医案'
}else if( e.type == 2){
this.pageType = '心得'
}else{
this.pageType = '作业'
}
console.log('收到的值', e);
},
@@ -219,11 +254,6 @@
},
onSubmit() {
this.$refs.form.validate().then(res => {
// var _show = '1'
// if(this.form.type == 2){
// this.form.display == true ? _show = '1' : _show = '0'
// }
if (this.fileList1.length > 0) {
let _list = this.fileList1
_list = _list.map(item => item.url)
@@ -254,9 +284,10 @@
icon:'success'
})
setTimeout(()=>{
uni.$emit('refreshData');
uni.navigateBack({
delta: 1
});
})
},1000)
}).catch(e => {
// console.log('表单错误信息:', err);

View File

@@ -100,7 +100,7 @@
<text>快来添加一条记录吧~</text>
</view>
<view class="btn">
<text @click="onPageJump('/pages/miniClass/addHomeWork',thisClass.id,2)">写心得</text>
<text @click="addXinde('/pages/miniClass/addHomeWork',undefined,2)">写心得</text>
</view>
</view>
</view>
@@ -131,8 +131,12 @@
<text>发布者{{item.createUser.nickname != null && item.createUser.nickname != '' ? item.createUser.nickname : '匿名用户'}}</text>
<text style="" class="date">日期{{item.createTime}}</text>
</view>
<text class="btn" v-show="tijiaoTitleId == 2 && myExperience == 1" @click.stop="editMyXinde(item)" >修改</text>
<view class="">
<view class="score" v-if="item.scoreSuccess == 1">
分数{{item.score}}
</view>
</view>
<text class="btn" v-show="tijiaoTitleId == 2 && myExperience == 1 && item.scoreSuccess == 0" @click.stop="editMyXinde(item)" >修改</text>
</view>
<view class="leve3" v-show="item.reply && tijiaoTitleId != 2">
<text>已提交答案</text>
@@ -181,7 +185,7 @@
<text v-else>暂未设置</text>
</view>
<view class="item"><text class="adminName">学习委员</text>
<view class="personbox" v-if="admins.learner.id">
<view class="personbox" v-if="admins.learner.user != null && 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>
@@ -190,8 +194,10 @@
<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">
<template v-if="item.user != null">
<text>{{item.user.nickname != null && item.user.nickname != '' ? item.user.nickname : '匿名用户'}}</text>
<text>({{item.user.tel}}) </text>
</template>
</view>
</template>
<text v-else>暂未设置</text>
@@ -199,8 +205,10 @@
<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">
<template v-if="item.user != null">
<text>{{item.user.nickname != null && item.user.nickname != '' ? item.user.nickname : '匿名用户'}}</text>
<text>({{item.user.tel}}) </text>
</template>
</view>
</template>
<text v-else>暂未设置</text>
@@ -330,6 +338,12 @@
uni.hideTabBar();
this.classId = e.id
this.getUserInfo()
uni.$on('refreshData',() => {
console.log('开始刷新列表数据');
this.pPage = 0
this.taskList = []
this.getList()
})
},
onReachBottom() {
if (this.status != 2 && this.status != 3) {
@@ -402,7 +416,7 @@
},
// 点击作业或者医案,进入详细介绍
clickTask(item){
var options = JSON.stringify(item)
var options = JSON.stringify(item)
if(this.tijiaoTitleId == 2){
// 进入的是心得
uni.navigateTo({
@@ -414,7 +428,7 @@
// console.log('options',options);
uni.navigateTo({
url:`/pages/miniClass/taskDetail?id=${item.id}`
url:`/pages/miniClass/taskDetail?id=${item.id}&`
})
},
delClass() {
@@ -542,6 +556,12 @@
});
}
},
// 添加心得
addXinde(url, id, modeType) {
uni.navigateTo({
url: `${url}?classId=${this.thisClass.id}&type=${modeType}`
});
},
// 跳转
onPageJump(url, id, modeType) {
uni.navigateTo({
@@ -836,7 +856,7 @@
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.score{color: #55aaff; font-size: 30rpx !important; font-weight: bold;}
.flexbox {
display: flex;
}
@@ -938,12 +958,12 @@
.newBox {
.classmateImg {
width: 60rpx !important;
height: 60rpx !important;
width: 40rpx !important;
height: 40rpx !important;
image {
width: 60rpx !important;
height: 60rpx;
width: 40rpx !important;
height: 40rpx;
}
}
@@ -964,10 +984,11 @@
.leve2{
color: #666;
line-height: 56rpx;
@include bov(3)
@include bov(3); padding-bottom: 6rpx;
border-bottom: 1px dotted #eee !important;
}
.leve3{
color: $themeColor; text-align: center; padding-top: 10rpx;
.tips{
width: 100%; justify-content: space-between;font-size: 26rpx; color: #999;
@@ -1057,14 +1078,14 @@
}
.classmateImg {
width: 80rpx;
margin-right: 40rpx;
height: 80rpx;
width: 40rpx;
margin-right: 20rpx;
height: 40rpx;
border-radius: 100rpx;
image {
width: 80rpx;
height: 80rpx;
width: 40rpx;
height: 40rpx;
}
}

View File

@@ -18,67 +18,66 @@
<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 class="pingfenBox" >
<!-- 功能按钮 -->
<view class="optionsBtn">
<view class="flex_box">
<view class="item setBanewei" v-if="thisClass.state != '2'" v-show="roleCode.includes('66') || roleCode.includes('1') || roleCode.includes('2')"
@click="goSetAdmin('/pages/miniClass/memberSet')">
<text>设置班委</text>
</view>
<!-- 主任班长副班长修改班级 没开班的时候可以 -->
<view class="item editClass" v-show="isDirector && thisClass.state == '0' ||
roleCode.includes('2') && thisClass.state == '0' ||
roleCode.includes('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.includes('1') ||
thisClass.state == '0' && roleCode.includes('2')">
<text>开班</text>
</view>
<view class="item overClass" @click="changeClassStatu('2')" v-if="thisClass.state == '1' && isMonitor ||
thisClass.state == '1' && roleCode.includes('1') ||
thisClass.state == '1' && roleCode.includes('2')">
<text>结班</text>
</view>
<view class="item delClass" v-if="isDirector" @click="delClass()">
<text>删除班级</text>
</view>
</view>
</view>
</view>
<!-- 作业批改 -->
<view class="pingfenBox" v-if="isDirector || isMonitor">
<!-- 作业批改 -->
<view class="flex_box">
<view class="item" @click="goAddHomeWork">
<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">
<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">
<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">
<view class="img">
<image src="../../static/icon/biaoxianfen.png" mode="widthFix"></image>
</view>
<text>表现</text>
</view>
</view>
</view>
<view class="otherItems flex_box">
@@ -93,9 +92,10 @@
<view @click="onPageJump('/pages/miniClass/studentsInClass', thisClass.id, roleCode)">
<text class="ciyao">学员人数</text>
<view class="mainTxt flex_box">
<text class="">{{students.length}}/{{thisClass.number}}人 </text>
<uni-icons type="eye" size="20" color="#333"></uni-icons></view>
<text class="">{{students.length}}/{{thisClass.number}}人 </text>
<uni-icons type="eye" size="20" color="#333"></uni-icons>
</view>
</view>
<view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text></view>
</view>
@@ -172,7 +172,7 @@
<h3>班内管理人员</h3>
<view class="item">
<text class="adminName">班长:</text>
<view class="personbox" v-if="admins.monitor.id">
<view class="personbox" v-if="admins.monitor.user != null && 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>
@@ -180,14 +180,14 @@
</view>
<view class="item">
<text class="adminName">副班长:</text>
<view class="personbox" v-if="admins.dmonitor.id">
<view class="personbox" v-if="admins.dmonitor.user != null && 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">
<view class="personbox" v-if="admins.learner.user != null && 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>
@@ -196,8 +196,10 @@
<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>
<template v-if="item.user != null">
<text>{{item.user.nickname != null && item.user.nickname != '' ? item.user.nickname : '匿名用户'}}</text>
<text>({{item.user.tel}}) </text>
</template>
</view>
</template>
<text v-else>暂未设置</text>
@@ -205,18 +207,20 @@
<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>
<template v-if="item.user != null">
<text>{{item.user.nickname != null && item.user.nickname != '' ? item.user.nickname : '匿名用户'}}</text>
<text>({{item.user.tel}}) </text>
</template>
</view>
</template>
<text v-else>暂未设置</text>
</view>
</view>
</u-popup>
<view class="fabBox" >
<!-- <view class="fabBox">
<uni-fab ref="fab" :pattern="pattern" :content="fabContent" :horizontal="horizontal" :vertical="vertical"
:direction="direction" @trigger="fabTrigger" @fabClick="fabClick" />
</view>
</view> -->
</view>
</template>
@@ -315,19 +319,32 @@
tijiaoTitleId: '0',
taskList: [], // 任务列表
taskHaveMore: false, // 是否还有更多
roleCode: undefined,
roleCode: [], // 角色数组
interval:null,
}
},
onLoad(e) {
uni.hideTabBar();
this.classId = e.id
this.getUserInfo()
this.interval = setInterval(() => {
if(this.thisClass.id){
uni.showLoading({
title:'加载中'
})
this.getUserInfo()
clearInterval(this.interval)
console.log('定时清了吗');
}
},500)
},
onPullDownRefresh() {
this.getClassInfo()
uni.stopPullDownRefresh()
},
beforeDestroy() {
clearInterval(this.interval)
},
onBackPress() {
if (this.$refs.fab.isShow) {
this.$refs.fab.close()
@@ -337,37 +354,44 @@
},
onShow() {
this.getClassInfo()
},
computed: {
...mapState(["userInfo"]),
getRoleName() {
console.log('执行一次');
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;
}
// var _code = ''
this.roleCode.forEach(item => {
switch (item) {
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(){
getClassStatus() {
var _roleName = ''
switch (this.thisClass.state) {
case '0':
@@ -384,8 +408,22 @@
}
},
methods: {
goAddHomeWork(){
uni.navigateTo({
url: `/pages/miniClass/addHomeWork?classId=${this.thisClass.id}`
})
},
goXindeList(url){
uni.navigateTo({
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",
@@ -397,8 +435,20 @@
},
})
.then((res) => {
console.log('res获取身份信息', 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'
@@ -407,7 +457,7 @@
},
goPingfen(url, classId, type) {
uni.navigateTo({
url: `${url}?classId=${classId}&type=${type}`
url: `${url}?classId=${classId}&type=${type}&roleCode=${this.roleCode}`
})
},
// 点击作业或者医案,进入详细介绍
@@ -493,8 +543,10 @@
this.isMonitor = res.isMonitor
this.isDirector = res.isDirector
if (this.isDirector) {
this.roleCode = '66'
} else if (this.isMonitor) {
this.roleCode.push('66')
}
if (this.isMonitor) {
console.log('确定具体的职位是什么');
this.getRealRole()
} else {
@@ -507,9 +559,14 @@
});
}
},
goSetAdmin(url){
uni.navigateTo({
url: `${url}?id=${this.thisClass.id}&roleCode=${this.roleCode}`
});
},
// 跳转
onPageJump(url, id, modeType) {
console.log('type',modeType);
console.log('type', modeType);
uni.navigateTo({
url: `${url}?id=${id}&type=${modeType}`
});
@@ -735,11 +792,11 @@
if (item.role == '3') {
this.admins.learner = item
}
if (item.role == '4') {
if (item.role == '4' && item.user != null) {
// console.log('this.admins.counter',this.admins.counter);
this.admins.scorer.push(item)
}
if (item.role == '5') {
if (item.role == '5' && item.user != null) {
// console.log('this.admins.counter',this.admins.counter);
this.admins.counter.push(item)
}
@@ -751,7 +808,6 @@
this.courses = res.result.courses
this.students = res.result.students
this.refresh = true
}
uni.hideLoading()
}).catch(e => {
@@ -776,7 +832,8 @@
}
.welComeText {
// padding: 6rpx 4rpx;
padding:20rpx 0;
color: #e58d44;
}
@@ -798,19 +855,66 @@
color: #fff;
font-weight: normal;
}
.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;}
.optionsBtn {
margin-bottom: 30rpx;
border-bottom: 1px solid #eee; padding-bottom: 30rpx;
margin-top: 20rpx;
.flex_box {
justify-content: space-between;
}
.item {
margin-right: 20rpx;
width: 100%;
text-align: center;
color: #fff;
padding: 20rpx 0;
border-radius: 6rpx;
text{padding-top: 0 !important;}
}
.item:last-child{
margin-right: 0 !important;
}
.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%);
}
.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;

View File

@@ -5,9 +5,10 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<uni-forms :modelValue="form" :rules="rules" ref="form">
<uni-forms :modelValue="form" :rules="rules" ref="form" v-if="roleCode.length > 0">
<view class="input_box " style="">
<uni-forms-item label="" name="monitor" label-width="0">
<uni-forms-item label="" name="monitor" label-width="0"
v-show="roleCode.includes('66')">
<view class="">
<text class="input_tit"><i>*</i>班长</text>
</view>
@@ -26,9 +27,11 @@
</view>
</view>
</uni-forms-item>
<uni-forms-item label="" name="dmonitor" label-width="0">
<uni-forms-item label="" name="dmonitor" label-width="0" v-show="roleCode.includes('1') || roleCode.includes('66')">
<view class="">
<text class="input_tit"><i>*</i>副班长</text>
<text class="input_tit">
<!-- <i>*</i> -->
副班长</text>
</view>
<view class="addBtnBox">
<view class="item" v-if="memeberRefsh">
@@ -45,9 +48,11 @@
</view>
</view>
</uni-forms-item>
<uni-forms-item label="" name="learner" label-width="0">
<uni-forms-item label="" name="learner" label-width="0" >
<view class="">
<text class="input_tit"><i>*</i>学习委员</text>
<text class="input_tit">
<!-- <i>*</i> -->
学习委员</text>
</view>
<view class="addBtnBox">
<view class="item" v-if="memeberRefsh">
@@ -64,9 +69,11 @@
</view>
</view>
</uni-forms-item>
<uni-forms-item label="" name="scorer" label-width="0">
<uni-forms-item label="" name="scorer" label-width="0" >
<view class="">
<text class="input_tit"><i>*</i>评分员</text>
<text class="input_tit">
<!-- <i>*</i> -->
评分员</text>
</view>
<view class="addBtnBox">
<!-- {{setDefaultAddItem}} -->
@@ -84,9 +91,11 @@
</view>
</view>
</uni-forms-item>
<uni-forms-item label="" name="counter" label-width="0">
<uni-forms-item label="" name="counter" label-width="0" >
<view class="">
<text class="input_tit"><i>*</i>记分员</text>
<text class="input_tit">
<!-- <i>*</i> -->
记分员</text>
</view>
<view class="addBtnBox">
<view class="item" v-if="memeberRefsh">
@@ -171,35 +180,29 @@
}
]
},
dmonitor: {
rules: [{
required: true,
errorMessage: '请设置副班长人员',
}
}
// ,
// dmonitor: {
// rules: [{
// required: true,
// errorMessage: '请设置副班长人员',
// }
]
},
learner: {
rules: [{
required: true,
errorMessage: '请设置学习委员人员',
}
]
},
// ]
// }
},
pageType: '',
modelLIst: [
// { value: 0, text: "请选择" },
],
roleCode:''
};
},
//第一次加载
onLoad(e) {
console.log('收到的值', e);
// this.getUserModel()
this.roleCode = e.roleCode
if (e.id) {
this.form.classId = e.id
this.getClassInfo()
@@ -435,20 +438,6 @@
addPic(e) {
console.log("添加图片");
let that = this;
// for (var i = 0; i < e.file.length; i++) {
// console.log(i,e.file[i].url)
// uni.uploadFile({
// url: this.$baseUrl + "oss/fileoss", //仅为示例,非真实的接口地址
// filePath: tempFilePaths[0],
// name: 'file',
// formData: {
// 'user': 'test'
// },
// success: (uploadFileRes) => {
// console.log(uploadFileRes.data);
// }
// });
// return
uni.uploadFile({
url: this.$baseUrl + "oss/fileoss",
filePath: e.file.url,
@@ -456,12 +445,10 @@
name: "file",
formData: {},
success: (res) => {
// console.log("that.uploadPicLIst", res);
that.fileList1.push({
url: JSON.parse(res.data).url,
});
// console.log(that.fileList1, "that.uploadPicLIst");
},
fail: (error) => {
console.log("上传失败", error);
@@ -473,58 +460,72 @@
this.fileList1.splice(event.index, 1)
},
onSubmit() {
this.$refs.form.validate().then(res => {
console.log('form',this.form);
if(!this.form.monitor){
uni.showToast({
title: '请添加班长人选',
icon: 'none'
})
return
}
// if(!this.form.dmonitor){
// uni.showToast({
// title: '请添加副班长人选',
// icon: 'none'
// })
// return
// }
// this.$refs.form.validate().then(res => {
var newScorer = [...this.form.scorer]
var newCounter = [...this.form.counter]
console.log('this.form.scorer',this.form.scorer);
if(!this.form.scorer[0] && !this.form.scorer[1]){
uni.showToast({
title:'请至少设置一名评分员',
icon:'none'
})
return
newScorer = [0,0]
}else{
if(this.form.scorer[0].id == this.form.scorer[1].id){
console.log('newScorer',newScorer);
this.form.scorer.forEach((item, index) => {
console.log('item',item);
if(!item || item == null){
console.log('进来了');
newScorer[index] = {
id:0
}
}
})
// console.log('删除后的newScorer',newScorer);
if(newScorer[0].id == newScorer[1].id){
uni.showToast({
title:'两名评分员不能是同一人',
icon:'none'
})
return
}
this.form.scorer.forEach((item, index) => {
if(!item){
newScorer.splice(index, 1)
}
})
newScorer = newScorer.map(item => {
return item.id
})
console.log('删除后的newScorer',newScorer);
// console.log('删除后的newScorer',newScorer);
}
if(!this.form.counter[0] && !this.form.counter[1]){
uni.showToast({
title:'请至少设置一名记分员',
icon:'none'
})
return
newCounter = [0,0]
}else{
if(this.form.counter[0].id == this.form.counter[1].id){
this.form.counter.forEach((item, index) => {
if(!item || item == null){
newCounter[index] = {id:0}
// newCounter.splice(index, 1)
}
})
if(newCounter[0].id == newCounter[1].id){
uni.showToast({
title:'两名记分员不能是同一人',
icon:'none'
})
return
}
this.form.counter.forEach((item, index) => {
if(!item){
newCounter.splice(index, 1)
}
})
newCounter = newCounter.map(item => {
return item.id
})
console.log('删除后的newCounter',newCounter);
// console.log('删除后的newCounter',newCounter);
}
var _url = 'common/class/setUserRole'
@@ -535,8 +536,8 @@
data: {
"classId": this.form.classId,
"monitor": this.form.monitor.id+'', //班长
"dmonitor": this.form.dmonitor.id+'', //2班长
"learner": this.form.learner.id+'', //学习委员
"dmonitor": this.form.dmonitor ? this.form.dmonitor.id+'' : '0', //2班长
"learner": this.form.learner ? this.form.learner.id+'' : '0', //学习委员
"scorer": newScorer.join(','), //评分员
"counter": newCounter.join(',') //记分员
},
@@ -550,12 +551,10 @@
icon: 'success'
});
setTimeout(() => {
// this.fileList1 = []
// this.$nextTick(() => {
uni.navigateBack({
delta: 1
});
}, 300)
}, 1000)
}).catch(e => {
// console.log('表单错误信息:', err);
uni.showToast({
@@ -563,13 +562,13 @@
icon: 'error'
})
});
}).catch(err => {
console.log('表单错误信息:', err);
uni.showToast({
title: '页面有未填写的内容哦',
icon: 'none'
})
})
// }).catch(err => {
// console.log('表单错误信息:', err);
// uni.showToast({
// title: '页面有未填写的内容哦',
// icon: 'none'
// })
// })
}
},
//页面隐藏

View File

@@ -2,7 +2,7 @@
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="主任教学">
<z-nav-bar title="班级教学">
<!-- <view class="curseSet" slot="right" @click="shuomingPage('/pages/course/courseSet',tagId,pid)"> -->
<!-- <uni-icons type="info" size="24"></uni-icons> 课程说明</view> -->
</z-nav-bar>

View File

@@ -1,7 +1,7 @@
<template>
<view>
<public-module></public-module>
<z-nav-bar title="医案详情"></z-nav-bar>
<z-nav-bar title="详情"></z-nav-bar>
<!-- <view class="" style="background-color: #f4f7ff; min-height: calc(100vh - 200rpx);"> -->
<view class="mainContent" v-if="thisTask.id">
<view class="" style="height:40rpx;">
@@ -57,7 +57,7 @@
<text v-else>匿名用户</text>
</view>
</view>
<view class="editBtn" v-if="listDisplay == '1'">
<view class="editBtn" v-if="listDisplay == '1' && item.scoreSuccess == 0">
<text @click="editOrAdd(item)">修改</text>
</view>
</view>
@@ -70,9 +70,15 @@
<view class="">
{{item.content}}
</view>
<view class="date">
{{item.createTime}}
<view class="">
<view class="score" v-show="listDisplay == '1' && item.scoreSuccess == 1">
分数{{item.score}}
</view>
<view class="date">
{{item.createTime}}
</view>
</view>
</view>
</view>
</view>
@@ -476,7 +482,7 @@
.noanser{ padding: 20rpx;
text-align: center;
// border-bottom: 1px solid #eee;
.btn{display: inline-block; border-radius: 20rpx ; padding: 10rpx 20rpx; background-color: $themeColor; color: #fff;}
.btn{display: inline-block; border-radius: 20rpx ; margin-top: 20rpx; padding: 10rpx 20rpx; background-color: $themeColor; color: #fff;}
}
.in {
border: 1rpx solid #eeeeee;
@@ -570,14 +576,17 @@
margin-bottom: 20rpx;
// .userName{}
}
.leve2{
.date{color: #999; text-align: right; font-size: 26rpx;}
.leve2{ overflow: hidden;
.score{
float: left;
}
.date{color: #999; float: right; text-align: right; font-size: 26rpx;}
}
}
}
.score{color: #55aaff; font-size: 30rpx !important; font-weight: bold;}
.taskContent {
font-size: 30rpx;
font-size: 30rpx; line-height: 50rpx;
margin-top: 20rpx;
}
@@ -587,7 +596,7 @@
.item {
width: 20%;
margin-right: 10rpx; border: 1px solid #eee;
padding: 0 !important;
image {
width: 100%;
}

View File

@@ -1,7 +1,7 @@
<template>
<view>
<public-module></public-module>
<z-nav-bar title="医案详情"></z-nav-bar>
<z-nav-bar :title="pageType+'详情'"></z-nav-bar>
<!-- <view class="" style="background-color: #f4f7ff; min-height: calc(100vh - 200rpx);"> -->
<view class="mainContent" v-if="thisTask.id">
<view class="" style="height:40rpx;">
@@ -20,6 +20,9 @@
<view class="taskContent" v-html="thisTask.content">
</view>
<view class="editBtn" @click="goEdit" v-if="zuoyeList.length == 0">
<text>修改</text>
</view>
</view>
<!-- 提交记录 -->
<view>
@@ -51,9 +54,16 @@
<view class="">
{{item.content}}
</view>
<view class="date">
{{item.createTime}}
<view class="">
<view class="score" v-if="item.scoreSuccess == 1">
分数{{item.score}}
</view>
<view class="score noscore" v-else>未评分</view>
<view class="date">
{{item.createTime}}
</view>
</view>
</view>
</view>
</view>
@@ -73,7 +83,7 @@
</view>
<view class="图片">
<view class="imgBox flex_box" v-if="fileList1.length > 0">
<view class="itemImg" v-for="(item, index) in fileList1" :key="index">
<view class="item" v-for="(item, index) in fileList1" :key="index">
<image @click="previewImage(item.url)" :src="item.url" mode="widthFix"></image>
</view>
</view>
@@ -86,14 +96,22 @@
学员信息{{curReplay.createUser.nickname != null && curReplay.createUser.nickname != '' ? curReplay.createUser.nickname : '匿名用户'}}
/ {{curReplay.createUser.tel}}
</view>
<view class="" style="background-color: beige; padding: 10rpx 10rpx; margin-top: 20rpx;">
<uni-forms :modelValue="form" :rules="rules" ref="form">
<uni-forms-item label="分数" name="score" >
<uni-easyinput type="number" v-model="form.score" placeholder="请输入分数" />
</uni-forms-item>
</uni-forms>
<view class="score" v-show="curReplay.scoreSuccess == 1">
分数{{curReplay.score}}
</view>
<view class="btn_box"><button @click="onSubmit"> </button></view>
<view class="score noscore" v-show="curReplay.scoreSuccess == 0">
未评分
</view>
<template v-if="roleCode.includes('4') || roleCode.includes('5')">
<view class="" style="background-color: beige; padding: 10rpx 10rpx; margin-top: 20rpx;">
<uni-forms :modelValue="form" :rules="rules" ref="form">
<uni-forms-item label="分数" name="score" >
<uni-easyinput type="number" v-model="form.score" placeholder="请输入分数:0-100分" />
</uni-forms-item>
</uni-forms>
</view>
<view class="btn_box"><button @click="onSubmit"> </button></view>
</template>
</view>
</view>
</u-popup>
@@ -122,19 +140,15 @@
pPage: 0,
form: {
score: undefined, //分数
taskId: undefined,
id: undefined,
display: "1", //0不展示1展示
content: "",
img: ""
},
ispreviewImage :false,
curReplay: {},
rules: {
content: {
score: {
rules: [{
required: true,
errorMessage: '请输入回答内容',
errorMessage: '请输入分数',
}
]
@@ -142,19 +156,28 @@
},
listDisplay: '1', // 提交记录展示类型 0 全部 1 自己的
roleCode:'',
pageType:''
}
},
onLoad(e) {
uni.hideTabBar();
// this.thisTask = JSON.parse(e.options)
console.log('e', e)
this.roleCode = e.roleCode
if (e.id) {
this.thisTask.id = e.id
this.getTaskInfo()
this.getReplayList()
}
if(e.type == 0){
// this.form.renwuId = e.renwuId
this.pageType = '作业'
}else if(e.type == 1){
this.pageType = '医案'
}else if( e.type == 2){
this.pageType = '心得'
}
// console.log('this.FileList', this.FileList)
// this.TaskId = e.id
this.getUserInfo()
@@ -173,10 +196,11 @@
this.form.taskId = this.thisTask.id
console.log('this.ispreviewImage',this.ispreviewImage);
if(this.ispreviewImage){
this.showEditBlank = true
this.ispreviewImage = false
}
this.FileList11 = []
this.getTaskInfo()
},
computed: {
...mapState(["userInfo"]),
@@ -224,28 +248,28 @@
closePup() {
this.showEditBlank = false
this.form = {
taskId: undefined,
score: undefined,
id: undefined,
display: "1", //0不展示1展示
content: "",
img: ""
}
this.curReplay = {}
this.fileList1 = []
setTimeout(()=>{
this.pPage = 0
this.zuoyeList = []
this.getReplayList()
},1000)
},
deletePic(event) {
this.fileList1.splice(event.index, 1)
},
editOrAdd(item) {
console.log('item', item);
if (item) {
this.curReplay = item
this.form = item
this.form = {...item}
if(this.form.scoreSuccess == 0){
this.form.score = undefined
}
this.fileList1 = [...item.fileList]
console.log('fileList4545', item.fileList);
} else {
console.log('form', this.form);
}
this.showEditBlank = true
},
radioChange1(e) {
@@ -331,6 +355,11 @@
})
},
goEdit(){
uni.navigateTo({
url:`/pages/miniClass/addHomeWork?id=${this.thisTask.id}&type=${this.thisTask.type}`
})
},
getUserInfo() {
// 获取个人信息
if (this.userInfo.id != undefined) {
@@ -352,23 +381,27 @@
},
onSubmit() {
this.$refs.form.validate().then(res => {
if (this.fileList1.length > 0) {
let _list = this.fileList1
_list = _list.map(item => item.url)
// console.log('this.fileList1',_list);
this.form.img = _list.join(',')
if(this.form.score > 100){
uni.showToast({
title:'分数不能大于100',
icon:'none'
})
return
}
var _url = ""
this.form.id ? _url =
'common/class/editClassTaskReply' : _url = 'common/class/addClassTaskReply'
if(this.form.score < 0){
uni.showToast({
title:'分数不能小于0分',
icon:'none'
})
return
}
var _url = "common/class/editScore"
var data = {
"taskId": this.form.id ? undefined : this.form.taskId,
"id": this.form.id,
"display": this.form.display, //0不展示1展示
"content": this.form.content,
"img": this.form.img
"score": this.form.score,
"replyId": this.form.id
}
console.log('data', data);
console.log('data后台提交数据', data);
$http.request({
url: _url,
method: "POST",
@@ -384,12 +417,6 @@
})
this.FileList = []
this.closePup()
setTimeout(() => {
this.pPage = 0
this.zuoyeList = []
this.getTaskInfo()
this.getReplayList()
}, 200)
}).catch(e => {
uni.showToast({
title: '操作失败',
@@ -479,7 +506,10 @@
padding: 8rpx;
margin-top: 10rpx;
}
.editBtn{text-align: center; margin-top: 20rpx;
text{
padding: 4rpx; display: inline-block; width:40%; text-align: center; color: $themeColor; border: 1px solid $themeColor; border-radius: 6rpx;
}}
.zuoyeListBox {
margin-top: 40rpx;
background-color: #fff;
@@ -592,7 +622,10 @@
margin-bottom: 20rpx;
}
.leve2 {}
.leve2 { overflow: hidden;
.score{float: left;}
.date{float: right;}
}
}
}
@@ -606,15 +639,16 @@
text-align: right;
font-size: 26rpx;
}
.score{color: #55aaff; font-size: 30rpx !important; font-weight: bold;;}
.noscore{color: #ffaa7f;}
.imgBox {
flex-wrap: wrap;
.itemImg {
.item {
width: 20%;
margin-right: 10rpx;
border: 1px solid #eee;
padding: 0 !important;
image {
width: 100%;
}

View File

@@ -52,6 +52,7 @@
<u-divider v-show="status == 3" text="暂无数据"></u-divider>
<u-divider v-show="status == 1" text="加载中..."></u-divider>
</view>
<z-navigation></z-navigation>
</view>
</template>
@@ -67,13 +68,15 @@
status: 88,
loadFlag: false,
pageName: '',
taskList: []
taskList: [],
roleCode:'',
}
},
onLoad(e) {
// console.log('taskLIst1',taskLIst1);
console.log('e',e);
this.classId = e.classId
this.pageType = e.type
this.roleCode = e.roleCode
if (e.type == '0') {
this.pageName = '作业列表'
} else if (this.pageName = '医案列表') {
@@ -81,7 +84,7 @@
} else {
this.pageName = '心得列表'
}
this.getList()
// this.getList()
},
onPullDownRefresh() {
this.pPage = 0
@@ -95,6 +98,9 @@
}
},
onShow() {
this.pPage = 0
this.taskList = []
this.getList()
// this.getList()
},
onBackPress() {
@@ -109,7 +115,7 @@
clickTask(item){
// console.log('options',options);
uni.navigateTo({
url:`/pages/miniClass/taskDetailForMan?id=${item.id}`
url:`/pages/miniClass/taskDetailForMan?id=${item.id}&roleCode=${this.roleCode}&type=${this.pageType}`
})
},
getList() {
@@ -209,7 +215,7 @@
box-shadow: none !important;
// border-bottom: 1px solid #eee;
border-radius: 20rpx;
padding: 20rpx;
padding: 20rpx ;
margin-bottom: 20rpx;
.leve1 {
align-items: center;
@@ -222,7 +228,7 @@
.leve2 { justify-content: space-between;
color: #666; font-size: 24rpx;
.item{text-align: center;}
.item{text-align: center; padding-top: 0; padding-bottom: 0; margin-bottom: 0;}
}
.leve3 {

View File

@@ -0,0 +1,466 @@
<template>
<view style="min-height: calc(100vh - 120rpx); background-color: #ebf2f5;">
<z-nav-bar :title="pageName"></z-nav-bar>
<view class="pad20">
<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>
</view>
<view class="leve2">
{{item.content}}
</view>
<view class="leve3">
<view class="score" v-if="item.scoreSuccess == 1">
分数{{item.score}}
</view>
<view class="score noscore" v-else>未评分</view>
<view class="date">
{{item.createTime}}
</view>
</view>
</view>
</view>
</view>
</view>
<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>
<u-popup key="1" :show="showEditBlank" :round="10" @close="closePup" ref="">
<view class="" style="padding: 40rpx; max-height: 80vh; overflow-y:scroll">
<view class="anserBox">
<h3>心得详情</h3>
<view class="" style="border-bottom: 1px solid #eee; padding-bottom: 20rpx; margin-bottom: 20rpx;">
<view class="anserContent" v-html="curReplay.content">
</view>
<view class="图片">
<view class="imgBox flex_box" v-if="fileList1.length > 0">
<view class="item" v-for="(item, index) in fileList1" :key="index">
<image @click="previewImage(item.url)" :src="item.url" mode="widthFix"></image>
</view>
</view>
</view>
</view>
<view class="date">
日期{{curReplay.createTime}}
</view>
<view class="" v-if="curReplay.createUser" style="color: #999;padding: 10rpx 0;">
学员信息{{curReplay.createUser.nickname != null && curReplay.createUser.nickname != '' ? curReplay.createUser.nickname : '匿名用户'}}
/ {{curReplay.createUser.tel}}
</view>
<view class="score" v-show="curReplay.scoreSuccess == 1">
分数{{curReplay.score}}
</view>
<view class="score noscore" v-show="curReplay.scoreSuccess == 0">
未评分
</view>
<!-- v-if="roleCode.includes('4') || roleCode.includes('5')" -->
<template>
<view class="" style="background-color: beige; padding: 10rpx 10rpx; margin-top: 20rpx;">
<uni-forms :modelValue="form" :rules="rules" ref="form">
<uni-forms-item label="分数" name="score" >
<uni-easyinput type="number" v-model="form.score" placeholder="请输入分数:0-100分" />
</uni-forms-item>
</uni-forms>
</view>
<view class="btn_box"><button @click="onSubmit"> </button></view>
</template>
</view>
</view>
</u-popup>
<z-navigation></z-navigation>
</view>
</template>
<script>
import $http from '@/config/requestConfig.js';
// const taskLIst1 = require('@/data/taskList.json')
export default {
data() {
return {
classId: undefined,
pageType: undefined,
pPage: 0,
status: 88,
loadFlag: false,
pageName: '',
taskList: [],
fileList1:[],
rules: {
score: {
rules: [{
required: true,
errorMessage: '请输入分数',
}
]
},
},
roleCode:'',
showEditBlank:false,
curReplay:{},
form: {
score: undefined, //分数
id: undefined,
},
ispreviewImage :false,
}
},
onLoad(e) {
console.log('e',e);
this.classId = e.classId
this.pageType = e.type
this.roleCode = e.roleCode
this.pageName = '心得列表'
this.getList()
},
onPullDownRefresh() {
this.pPage = 0
this.taskList = []
this.getList()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.status != 2 && this.status != 3) {
this.getList()
}
},
onShow() {
// this.getList()
if(this.ispreviewImage){
this.showEditBlank = true
this.ispreviewImage = false
}
},
onBackPress() {
},
methods: {
onSubmit() {
this.$refs.form.validate().then(res => {
if(this.form.score > 100){
uni.showToast({
title:'分数不能大于100',
icon:'none'
})
return
}
if(this.form.score < 0){
uni.showToast({
title:'分数不能小于0分',
icon:'none'
})
return
}
var _url = "common/class/editTaskScore"
var data = {
"score": this.form.score,
"taskId": this.form.id
}
console.log('data后台提交数据', data);
$http.request({
url: _url,
method: "POST",
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
uni.showToast({
title: '操作成功!',
icon: 'success'
})
this.FileList = []
this.closePup()
}).catch(e => {
uni.showToast({
title: '操作失败',
icon: 'error'
})
});
}).catch(err => {
console.log('表单错误信息:', err);
uni.showToast({
title: '页面有未填写的内容哦',
icon: 'none'
})
})
},
previewImage(url) {
console.log(url);
this.ispreviewImage = true
this.showEditBlank = false
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ["很抱歉,暂不支持保存图片到本地"],
success: function(res) {
// console.log(res,'+++++')
},
},
});
},
closePup() {
this.showEditBlank = false
this.form = {
score: undefined,
id: undefined,
}
this.curReplay = {}
this.fileList1 = []
setTimeout(()=>{
this.pPage = 0
this.taskList = []
this.getList()
},1000)
},
clickTask(item){
console.log('item',item);
this.curReplay = item
this.form = {...item}
if(this.form.scoreSuccess == 0){
this.form.score = undefined
}
if(item.img != ''){
var _list = item.img.split(',')
_list.forEach( item => {
this.fileList1.push({url:item})
})
}
// this.fileList1 = [...item.fileList]
this.showEditBlank = true
// console.log('options',options);
// uni.navigateTo({
// url:`/pages/miniClass/taskDetailForMan?id=${item.id}&roleCode=${this.roleCode}&type=${this.pageType}`
// })
},
getList() {
this.status = 1;
if (this.loadFlag) {
console.log("有未完成的进程");
return;
}
uni.showLoading({
title: '加载中'
})
this.loadFlag = true;
this.pPage++;
$http.request({
url: "common/class/getClassTaskList",
method: "POST",
data: {
"limit": 10,
"page": this.pPage,
"classId": this.classId,
"type": this.pageType + '', //类型 0班内任务1医案2心得
"title": ""
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.page.records.length > 0) {
console.log('数据获取成功', res.page.records);
var lis = res.page.records
this.taskList = this.taskList.concat(lis)
// this.taskList = taskLIst1.page.records // 测试数据
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, '数据报错')
uni.hideLoading()
this.loadFlag = false;
uni.showToast({
title: e.msg,
icon: 'error'
})
});
},
}
}
</script>
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.example-body {
padding: 10px;
}
.pad20 {
padding: 20rpx;
}
.scroll-view {
/* #ifndef APP-NVUE */
width: 100%;
height: 100%;
/* #endif */
flex: 1
}
.anserBox {
border: 4rpx dotted #2bb447;
margin-top: 30rpx;
padding: 20rpx;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
padding-top: 0;
.imgBox {
flex-wrap: wrap;
.item {
width: 20%;
margin-right: 10rpx;
border: 1px solid #eee;
padding: 0 !important;
image {
width: 100%;
}
}
}
.anserContent{line-height: 50rpx; padding: 20rpx 0; display: block;}
h3 {
line-height: 80rpx;
width: 50%;
margin: 0 auto;
text-align: center;
color: #fff;
background-color: #2bb447;
border-radius: 0 0 20rpx 20rpx;
}
}
.btn_box {
margin-top: 70rpx;
padding-bottom: 20rpx;
button {
font-size: 32rpx;
@include theme('btn_bg') color: #fff;
height: 80rpx;
line-height: 80rpx;
border-radius: 50rpx;
}
}
::v-deep .uni-forms-item{margin-bottom: 0 !important;}
.date {font-size: 26rpx; color: #999;}
.score{color: #55aaff; font-size: 30rpx !important; font-weight: bold;;}
.noscore{color: #ffaa7f;}
.submitRecode {
// padding: 20rpx;
.newBox {
.classmateImg {
width: 60rpx !important;
height: 60rpx !important;
image {
width: 60rpx !important;
height: 60rpx;
}
}
.item {
background-color: #fff;
border-radius: 20rpx;
box-shadow: none !important;
// border-bottom: 1px solid #eee;
border-radius: 20rpx;
padding: 20rpx ;
margin-bottom: 20rpx;
.leve1 {
align-items: center;
border-bottom: 1px dashed #eee;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
// .userName{}
}
.leve2 { justify-content: space-between;
color: #666; font-size: 28rpx; line-height: 50rpx;
@include bov(3);
.item{text-align: center; padding-top: 0; padding-bottom: 0; margin-bottom: 0;}
}
.leve3 { overflow: hidden;
color: #999;
text-align: center;
padding-top: 10rpx;
.score{float: left;}
.date{float: right;}
.tips {
width: 100%;
justify-content: space-between;
font-size: 26rpx;
color: #999;
}
.btn {
border: 1px solid $themeColor;
margin-top: 20rpx;
display: inline-block;
width: 50%;
padding: 6rpx 0;
border-radius: 10rpx;
}
}
.leve3.no {
color: #ff9277;
text-align: center;
}
}
}
}
// 处理抽屉内容滚动
.scroll-view-box {
flex: 1;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.info {
padding: 15px;
color: #666;
}
.info-text {
font-size: 14px;
color: #666;
}
.info-content {
padding: 5px 15px;
}
.close {
padding: 10px;
}
</style>

BIN
static/icon/fabu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB