This commit is contained in:
@fawn-nine
2024-08-22 16:56:55 +08:00
parent d549954559
commit a1c8108fa3
13 changed files with 940 additions and 386 deletions

View File

@@ -1,18 +1,6 @@
<template>
<view>
<view class="">
<view class="flex_box">
<view class="item1 fabuhomework" @click="goAddHomeWork('0')" v-if="thisClass.state == '0' && roleCode.includes('2') || thisClass.state == '0' && roleCode.includes('1')">
<!-- <view class="img">
<image src="@/static/icon/fabu.png" mode="widthFix"></image>
</view> -->
<text>发布作业</text>
</view>
<view class="item1 fabuhomework" @click="goAddHomeWork('1')" v-if="thisClass.state == '1' && ( roleCode.includes('2') || roleCode.includes('1'))">
<text>发布医案</text>
</view>
</view>
<view v-if="thisClass.state != 0" class="flex_box">
<view class="item" @click="goPingfen('/pages/miniClass/taskList',thisClass.id, '0')">

View File

@@ -6,8 +6,8 @@ if (process.env.NODE_ENV === 'development') {
// socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/";
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式
baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
baseUrl = "https://api.nuttyreading.com/"; // 线上正式
// baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
// baseUrl = "http://59.110.212.44:9200/pb/";
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
// baseUrl = "http://192.168.110.110:9200/pb/";

View File

@@ -560,7 +560,8 @@
"path" : "pages/miniClass/miniClassMan",
"style" :
{
"navigationBarTitleText" : "主任教学"
"navigationBarTitleText" : "主任教学",
"enablePullDownRefresh": false
}
},
{

View File

@@ -1436,7 +1436,7 @@
}
img {
width: 20px;
max-width: 260rpx;
}
.u-upload__button {

View File

@@ -21,21 +21,19 @@
<view class="newBox" v-if="classList.length > 0">
<view class="item flexbox" v-for="(item, index) in classList" :key="index" @click="onPageJump('/pages/miniClass/miniClassMan',item)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="" v-if="item.icon != ''">
<view class="flexbox" v-if="item.icon != ''" style="align-items: center; border: 1px solid #ddd; margin-right: 10rpx; border-radius: 10rpx;">
<text v-show="item.type == 0">普通班</text>
<text v-show="item.type == 1">联合班</text>
<text v-show="item.type == 2">精英班</text>
<!-- <view class="jianjie">
教学时长{{item.days}}
</view> -->
</view>
<view class="buyItems">
<view class="txt555" >
{{item.title}}
</view>
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="jianjie">
教学时长{{item.days}}
</view>
<view class="btn_box" >
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<!-- <text class="seeInfo" >进入班级</text> -->

View File

@@ -56,7 +56,7 @@
</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="learnBox">
<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)">
@@ -97,7 +97,7 @@
<!-- 过期班级 -->
<view class="" v-show="subTabId == 2">
<view class="learnBox box">
<view class="learnBox">
<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)">

View File

@@ -201,7 +201,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">
<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>
@@ -209,14 +209,15 @@
</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 class="personbox" v-if="admins.dmonitor.user != null">
<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.user != null && admins.learner.id">
<view class="personbox" v-if="admins.learner.user != null">
<text>{{admins.learner.user.nickname != null && admins.learner.user.nickname != '' ? admins.learner.user.nickname : '匿名用户'}}</text>
<text>({{admins.learner.user.tel}})</text>
</view>

View File

@@ -1,7 +1,10 @@
<template>
<view>
<public-module></public-module>
<z-nav-bar title="班级详情"></z-nav-bar>
<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 class="" style="background-color: #f4f7ff; min-height: calc(100vh - 200rpx);"> -->
<view class="mainContent" v-if="thisClass.id">
@@ -9,112 +12,177 @@
</view> -->
<view :class="['classStatus',
this.thisClass.state == 0 ? 'daikai' :'',
this.thisClass.state == 1 ? 'xuexizhong' :'',
this.thisClass.state == 2 ? 'yijieban' :''
thisClass.state == '0' ? 'daikai' :'',
thisClass.state == '1' ? 'xuexizhong' :'',
thisClass.state == '2' ? 'yijieban' :''
]">
{{getClassStatus}}
</view>
<h3 style="margin-top: 20rpx; font-size: 28rpx;">班级名称{{thisClass.title}}</h3>
<view class="welComeText">
<text> 班内职务{{getRoleName}} </text>
<view class="flex_box">
<view class="">
<h3 style="margin-top: 20rpx; font-size: 28rpx;">班级名称{{thisClass.title}}</h3>
<view class="welComeText">
<text> 班内职务{{getRoleName}} </text>
</view>
</view>
</view>
<view class="pingfenBox" >
<!-- 功能按钮 -->
<view class="optionsBtn" v-if="(roleCode.includes('主任') || roleCode.includes('副主任') || roleCode.includes('1') || roleCode.includes('2')) && thisClass.state != '2'">
<view class="flex_box">
<!-- 待开班按钮 -->
<!-- 已开班按钮 -->
<view class="optionsBtn" v-if="thisClass.state != '2'">
<view class="flex_box" v-show="thisClass.state == '0' ">
<view class="item editClass"
@click="onPageJump('/pages/miniClass/addClass',thisClass.id, classModel.type)">
<text>修改班级</text>
</view>
<!-- <view class="item delClass" v-if="thisClass.state == '0' && (roleCode.includes('主任') || roleCode.includes('副主任'))" @click="delClass()"> -->
<view class="item delClass" >
<text>删除班级</text>
</view>
</view>
<view class="stepBox" v-if="thisClass.state == '0' && (roleCode.includes('1') || roleCode.includes('2'))">
<h3 class="PM_font threeStepTitle">3步操作快速开班</h3>
<view class="flex_box item">
<i class="PM_font stepItem">1.</i>
<view class="textBox">
<text class="PM_font">设置班委</text><br/>
<span>开班之前需要完成副班长学委评分员的任命</span>
</view>
<view class="btn">
<view class="item setBanewei" v-if="admins.list.length < 6"
@click="goSetAdmin('/pages/miniClass/memberSet')">
<text>去设置</text>
</view>
</view>
</view>
<view class="flex_box item">
<i class="PM_font stepItem">2.</i>
<view class="textBox">
<text class="PM_font">发布作业</text><br/>
<span>根据教学时长,至少发布{{thisClass.homeWorkNumber}}条作业</span>
</view>
<view class="btn">
<view class="item fabuhomework" v-if="homeWorkList.length < thisClass.homeWorkNumber"
@click="goAddHomeWork('0')">
<text>去设置</text>
</view>
</view>
</view>
<view class="flex_box item">
<i class="PM_font stepItem">3.</i>
<view class="textBox">
<text class="PM_font">招收学员</text><br/>
<span>班级内学员人满后可开班</span>
</view>
<view class="btn">
<view class="item openClass" @click="opClass('1')" v-if="thisClass.number == students.length">
<text >去开班</text>
</view>
<view class="item openClass disableBtn" v-else>
<text >去开班</text>
</view>
</view>
</view>
</view>
<view class="flex_box" v-if="thisClass.state == '1'">
<view class="item fabuhomework" @click="goAddHomeWork('1')" v-if="thisClass.state == '1' && ( roleCode.includes('2') || roleCode.includes('1'))">
<text>发布医案</text>
</view>
<view class="item setBanewei" v-if="thisClass.state != '2'"
@click="goSetAdmin('/pages/miniClass/memberSet')">
<text>设置班委</text>
</view>
<!-- 主任班长副班长修改班级 没开班的时候可以 -->
<view class="item editClass" v-show="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' && (roleCode.includes('1') || roleCode.includes('2'))">
<text>开班</text>
</view>
<view class="item overClass" @click="changeClassStatu('2')" v-if="thisClass.state == '1' && (roleCode.includes('1') || roleCode.includes('2'))">
<view class="item overClass" @click="opClass('2')" v-if="thisClass.state == '1' && (roleCode.includes('1') || roleCode.includes('2'))">
<text>结班</text>
</view>
<view class="item delClass" v-if="thisClass.state == '0' && (roleCode.includes('主任') || roleCode.includes('副主任'))" @click="delClass()">
<text>删除班级</text>
</view>
</view>
</view>
<view class="line1" v-if="thisClass.state == '1'">
</view>
<!-- 作业批改 -->
<class-infoWork-blank :thisClass="thisClass" :roleCode="roleCode"></class-infoWork-blank>
<class-infoWork-blank v-if="thisClass.state != '0'" :thisClass="thisClass" :roleCode="roleCode"></class-infoWork-blank>
</view>
<view class="otherItems flex_box">
<view><text class="ciyao">创建日期</text><text
class="mainTxt">{{thisClass.createTime.substring(0,10)}}</text>
</view>
<view><text class="ciyao">班级类型</text>
<text class="mainTxt" v-if="classModel.type == '0'">普通小班</text>
<text class="mainTxt" v-if="classModel.type == '1'">联合班</text>
<text class="mainTxt" v-if="classModel.type == '2'">精英班</text>
</view>
<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>
</view>
<view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text></view>
</view>
<!-- <view class="banjiJianjie" v-html="thisClass.content"></view> -->
<view class="mainBox">
<!-- 课程列表 -->
<uni-section class="mb-10 nobg" title="班内课程" type="line"></uni-section>
<view class="newBox" v-show="courses.length > 0">
<view class="item flexbox" v-for="(item, index) in courses" :key="index"
@click="onPageJump('/pages/course/courseDetail',item.id)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="txt555">
{{item.title}}
</view>
<view class="jianjie" v-html="item.content"></view>
</view>
<view class="">
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="tabClick" :current="curTagIndex"
:activeStyle="activeStyle" :scrollable="scrollable" :list="tabList"
itemStyle="padding-left:10rpx; background-color:#fff; padding-right: 10rpx; height: 50px; font-size:26rpx"></u-tabs>
</view>
<!-- 学员列表 -->
<view class="" v-if="tabId == '2'">
</view>
<view class="" v-if="classModel.days > 0" style="text-align: center; color: #999; font-size: 28rpx;">
教学时长{{classModel.days}}
</view>
<view class="classMateBox" v-show="students.length> 0 ">
<uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title=""> {{students.length}} 名学员</uni-section>
<view class="newBox" >
<view
:class="['item','flexbox',
item.student.vip == '1' ? 'superVip' : '',
item.student.vip == '2' ? 'wumenVip' : '',
item.student.vip == '3' ? 'zmVip' : '',
thisStudent.student && thisStudent.student.id == item.student.id ? 'cur' : ''
]" v-for="(item, index) in students" :key="index" @click="clickStudent(item)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<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 >
<text >{{item.student.tel}}</text>
</template>
</text>
<text class="txt555" v-else>
匿名用户
</text>
<text @click.stop="outClass(item.student.id)" class="outBtn">踢出班级</text>
<!-- <text class="userType" v-if="item.student.vip == '1'">超级VIP用户</text>
<text class="userType" v-if="item.student.vip == '2' ">医学VIP用户</text>
<text class="userType" v-if="item.student.vip == '3' ">国学VIP用户</text> -->
</view>
</view>
</view>
</view>
<view class="" v-show="courses.length == 0">
<u-divider text="暂无课程"></u-divider>
<view class="" v-show="students.length == 0">
<u-divider text="暂无学员加入"></u-divider>
</view>
<!-- 作业列表 -->
<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 class="" v-if="tabId == '0'">
<view class="otherItems flex_box">
<view class="itt"><text class="ciyao">创建日期</text><text
class="mainTxt">{{thisClass.createTime.substring(0,10)}}</text>
</view>
<view class="itt"><text class="ciyao">班级类型</text>
<text class="mainTxt" v-if="classModel.type == '0'">普通小班</text>
<text class="mainTxt" v-if="classModel.type == '1'">联合班</text>
<text class="mainTxt" v-if="classModel.type == '2'">精英班</text>
</view>
<!-- <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>
</view> -->
<!-- <view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text></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="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>
</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>
@@ -169,6 +237,24 @@
</view>
</view>
</u-popup>
<u-popup key="2" v-if="showStudentBlank" :show="showStudentBlank" :round="10" @close="closePup" ref="">
<view class="upopBox" style="">
<h3 style="margin-bottom: 20rpx;">{{thisStudent.student.nickname != null && thisStudent.student.nickname != '' ? thisStudent.student.nickname : "匿名用户"}}</h3>
<view class="item">
<text><b>身份信息</b></text>
<text v-if="thisStudent.student.vip == '0'">普通用户</text>
<text v-if="thisStudent.student.vip == '1'">超级VIP</text>
<text v-if="thisStudent.student.vip == '2'">医学VIP</text>
<text v-if="thisStudent.student.vip == '3'">国学VIP</text>
</view>
<view class="item">
<text><b>电话</b>{{thisStudent.student.tel}}</text>
</view>
<view class="item">
<b>课程购买情况</b><br/>{{thisStudent.buyState}}
</view>
</view>
</u-popup>
<!-- <view class="fabBox">
<uni-fab ref="fab" :pattern="pattern" :content="fabContent" :horizontal="horizontal" :vertical="vertical"
:direction="direction" @trigger="fabTrigger" @fabClick="fabClick" />
@@ -211,21 +297,24 @@
thisClass: {},
students: [],
tabId: '0',
tabId: '2',
curTagIndex: 0,
scrollable: false,
tabList: [{
name: '班内课程',
id: '0'
},
// {
// name: '班内讨论',
// id: '1'
// },
tabList: [
{
name: '班内学员',
id: '2'
},
{
name: '班级情况',
id: '0'
},
// {
// name: '班内讨论',
// id: '1'
// },
// {
// name: '班内提交',
// id: '3'
@@ -274,7 +363,9 @@
taskHaveMore: false, // 是否还有更多
roleCode: [], // 角色数组
interval:null,
homeWorkList:[]
homeWorkList:[],
thisStudent:{},
showStudentBlank:false,
}
},
onLoad(e) {
@@ -363,6 +454,9 @@
}
},
methods: {
closePup(){
this.showStudentBlank = false
},
clickTask(item){
uni.navigateTo({
url:`/pages/miniClass/taskDetailForMan?id=${item.id}&roleCode=${this.roleCode}&type=0&classState=${this.thisClass.state}`
@@ -506,6 +600,11 @@
})
});
},
clickStudent(item){
console.log('item',item);
this.thisStudent = item
this.showStudentBlank = true
},
getUserInfo() {
// 获取个人信息
if (this.userInfo.id != undefined) {
@@ -673,15 +772,11 @@
// 班级操作
opClass(statusCode){
$http.request({
url: "common/class/editClass",
url: "common/class/updateClassState",
method: "POST",
data: {
"id": this.thisClass.id,
"title": this.thisClass.title,
"qrcode": this.thisClass.qrcode,
"state": statusCode, //小班状态0待开班1已开班2完成
"icon": this.thisClass.icon,
"content": this.thisClass.content,
"classId": this.thisClass.id,
"state": statusCode
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
@@ -697,6 +792,12 @@
setTimeout(() => {
this.getClassInfo()
}, 500)
}else{
uni.showToast({
title: `res.msg`,
icon:'none',
duration: 300
})
}
}).catch(e => {
console.log(e, '数据报错')
@@ -739,20 +840,18 @@
if (res.code == 0) {
that.isHave = true
uni.showToast({
title: `退出成功!`,
title: `操作成功!`,
icon: 'success'
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/miniClass/myClassList'
})
this.getClassInfo()
}, 200)
}
}).catch(e => {
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: `退出失败`,
title: `操作失败`,
icon: 'error'
})
});
@@ -788,6 +887,11 @@
if (res.code == 0) {
this.isHave = res.result.isJoin
this.thisClass = res.result.class
this.thisClass.homeWorkNumber = 4
if(res.result.days > 0){
this.thisClass.homeWorkNumber = Math.ceil(res.result.days / 7)
}
this.admins.list = res.result.admins
this.admins.monitor = {}
this.admins.dmonitor = {}
@@ -843,6 +947,9 @@
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.upopBox{padding: 40rpx; max-height: 80vh; overflow-y:scroll; color: #666;
.item{padding: 10rpx 0; border-bottom: 1px solid #eee;}
}
.flexbox {
display: flex;
@@ -853,7 +960,19 @@
padding:20rpx 0;
color: #e58d44;
}
.dakai{
.item {
margin-bottom: 10rpx;
width: 100%;
text-align: center;
color: #fff;
padding: 10rpx 6rpx;
border-radius: 6rpx;
text{padding-top: 0 !important;}
}
.editClass{}
.delClass{}
}
::v-deep .uni-fab__content--other-platform,
::v-deep .uni-fab--rightBottom {
bottom: 100px !important;
@@ -872,9 +991,28 @@
color: #fff;
font-weight: normal;
}
.threeStepTitle{font-weight: normal; margin-top: 30rpx; color: #55aa00; font-size:50rpx; margin-bottom: 20rpx;}
.stepItem{
font-size: 50rpx; color: #666; margin-right: 10rpx;
}
.line1{margin: 20rpx 0; border-bottom: 1px solid #eee;}
.disableBtn{background-color: #9f9f9f !important;}
.stepBox{
.item{ align-items: center;
padding: 10rpx 0;
border-bottom: 1px solid #dddddd;
.textBox{color: #333 !important; text-align: left; margin-right: 10rpx; flex: 1;
text{font-size: 40rpx;color: #333; }
span{color: #999; font-size: 26rpx;}
}
.btn{
text{padding: 0 20rpx;}
}
}
.item:last-child{border: none !important;}
}
.optionsBtn {
margin-bottom: 30rpx;
margin-bottom: 10rpx;
// border-bottom: 1px solid #eee;
padding-bottom: 10rpx;
margin-top: 20rpx;
@@ -895,25 +1033,7 @@
.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 {
@@ -933,7 +1053,27 @@
.yijieban {
background-image: linear-gradient(-90deg, #999 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100%);
}
.delClass {
background-color: #ffa4a6;
}
.openClass {
background-color: #67c23a;
}
.overClass {
background-color: #258feb;
}
.editClass {
background-color: #258feb;
}
.fabuhomework{
background-color: #97a1ff;
}
.setBanewei {
background-color: #e7b772;
}
.courseBuyOrNo {
font-size: 28rpx;
border-top: 1px solid #eee;
@@ -1062,7 +1202,10 @@
.nobg {
background-color: transparent !important;
}
::v-deep .xueyuanTitle{
.uni-section-header{float: left;}
.uni-section-content{float: right; margin-top: 20rpx; font-size: 26rpx;}
}
.bottomBox {
border-top: 1px solid #eee;
position: fixed;
@@ -1092,16 +1235,31 @@
.classMateBox {
.zmVip {
background-image: linear-gradient(-60deg, #53966a 0%, #e1feef 50%, #e1feef 100%);
.outBtn {
color: #fff !important;
border: 1px solid #fff !important;
}
}
.wumenVip {
background-image: linear-gradient(-60deg, #578df0 0%, #f1f4fd 50%, #f1f4fd 100%);
.outBtn {
color: #fff !important;
border: 1px solid #fff !important;
}
}
.superVip {
background-image: linear-gradient(-60deg, #965af0 0%, #fdf0ed 50%, #fdf0ed 100%);
.outBtn {
color: #fff !important;
border: 1px solid #fff !important;
}
}
.newBox {
flex-wrap: wrap;
}
.item {
width: 100%;
position: relative;
@@ -1109,14 +1267,14 @@
.textItems {
width: 100%;
align-items: center;
justify-content: space-between;
.outBtn {
padding: 6rpx 10rpx;
display: inline-block;
border-radius: 10rpx;
color: $themeColor;
border: 1px solid $themeColor;
font-size: 26rpx;
font-size: 26rpx; margin-left: 10rpx;
}
.txt555 {
@@ -1132,18 +1290,20 @@
color: #fff;
}
}
}
.item.cur{border: 2px solid #55aa00;}
}
.classmateImg {
width: 80rpx;
margin-right: 40rpx;
height: 80rpx;
width: 60rpx;
margin-right: 20rpx;
height: 60rpx;
border-radius: 100rpx;
image {
width: 80rpx;
height: 80rpx;
width: 60rpx;
height: 60rpx;
}
}
@@ -1228,9 +1388,9 @@ u-divider{font-size: 24rpx;}
text-align: center;
// background-color: rgba(255, 255, 255, .5);
border-radius: 20rpx;
justify-content: space-between;
justify-content: start;
margin: 20rpx 0;
.itt{margin: 0 20rpx;}
text {
display: block;
font-size: 28rpx;

View File

@@ -20,62 +20,89 @@
<text> 班内职务{{getRoleName}} </text>
</view>
<view class="pingfenBox" >
<!-- 作业批改 -->
<class-infoWork-blank :thisClass="thisClass" :roleCode="roleCode"></class-infoWork-blank>
</view>
<view class="otherItems flex_box">
<view><text class="ciyao">创建日期</text><text
class="mainTxt">{{thisClass.createTime.substring(0,10)}}</text>
<view class="pingfenBox">
<view class="waitOpen" v-if="thisClass.state == '0'">
<text>等待开班</text>
</view>
<view><text class="ciyao">班级类型</text>
<text class="mainTxt" v-if="classModel.type == '0'">普通小班</text>
<text class="mainTxt" v-if="classModel.type == '1'">联合班</text>
<text class="mainTxt" v-if="classModel.type == '2'">精英班</text>
</view>
<!-- <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>
</view> -->
<view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text></view>
<class-infoWork-blank v-else :thisClass="thisClass" :roleCode="roleCode"></class-infoWork-blank>
</view>
<!-- <view class="banjiJianjie" v-html="thisClass.content"></view> -->
<view class="mainBox">
<!-- 课程列表 -->
<uni-section class="mb-10 nobg" title="班内课程" type="line"></uni-section>
<view class="newBox" v-show="courses.length > 0">
<view class="item flexbox" v-for="(item, index) in courses" :key="index"
@click="onPageJump('/pages/course/courseDetail',item.id)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="txt555">
{{item.title}}
</view>
<view class="jianjie" v-html="item.content"></view>
</view>
<view class="">
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="tabClick" :current="curTagIndex"
:activeStyle="activeStyle" :scrollable="scrollable" :list="tabList"
itemStyle="padding-left:10rpx; background-color:#fff; padding-right: 10rpx; height: 50px; font-size:26rpx"></u-tabs>
</view>
<!-- 学员列表 -->
<view class="" v-if="tabId == '2'">
<view class="classMateBox" v-show="students.length> 0 ">
<uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title="">
{{students.length}} 名学员</uni-section>
<view class="newBox">
<view :class="['item','flexbox',
item.student.vip == '1' ? 'superVip' : '',
item.student.vip == '2' ? 'wumenVip' : '',
item.student.vip == '3' ? 'zmVip' : '',
thisStudent.student && thisStudent.student.id == item.student.id ? 'cur' : ''
]" v-for="(item, index) in students" :key="index" @click="clickStudent(item)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<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>
<text>{{item.student.tel}}</text>
</template>
</text>
<text class="txt555" v-else>
匿名用户
</text>
<text @click.stop="outClass(item.student.id)" class="outBtn">踢出班级</text>
<!-- <text class="userType" v-if="item.student.vip == '1'">超级VIP用户</text>
<text class="userType" v-if="item.student.vip == '2' ">医学VIP用户</text>
<text class="userType" v-if="item.student.vip == '3' ">国学VIP用户</text> -->
</view>
</view>
</view>
</view>
<view class="" v-if="classModel.days > 0" style="text-align: center; color: #999; font-size: 28rpx;">
教学时长{{classModel.days}}
<view class="" v-show="students.length == 0">
<u-divider text="暂无学员加入"></u-divider>
</view>
</view>
<view class="" v-show="courses.length == 0">
<u-divider text="暂无课程"></u-divider>
<view class="" v-if="tabId == '0'">
<view class="otherItems flex_box">
<view><text class="ciyao">创建日期</text><text
class="mainTxt">{{thisClass.createTime.substring(0,10)}}</text>
</view>
<view><text class="ciyao">班级类型</text>
<text class="mainTxt" v-if="classModel.type == '0'">普通小班</text>
<text class="mainTxt" v-if="classModel.type == '1'">联合班</text>
<text class="mainTxt" v-if="classModel.type == '2'">精英班</text>
</view>
<!-- <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>
</view> -->
<!-- <view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text></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="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>
<!-- <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>
@@ -130,6 +157,26 @@
</view>
</view>
</u-popup>
<u-popup key="2" v-if="showStudentBlank" :show="showStudentBlank" :round="10" @close="closePup" ref="">
<view class="upopBox" style="">
<h3 style="margin-bottom: 20rpx;">
{{thisStudent.student.nickname != null && thisStudent.student.nickname != '' ? thisStudent.student.nickname : "匿名用户"}}
</h3>
<view class="item">
<text><b>身份信息</b></text>
<text v-if="thisStudent.student.vip == '0'">普通用户</text>
<text v-if="thisStudent.student.vip == '1'">超级VIP</text>
<text v-if="thisStudent.student.vip == '2'">医学VIP</text>
<text v-if="thisStudent.student.vip == '3'">国学VIP</text>
</view>
<view class="item">
<text><b>电话</b>{{thisStudent.student.tel}}</text>
</view>
<view class="item">
<b>课程购买情况</b><br />{{thisStudent.buyState}}
</view>
</view>
</u-popup>
<!-- <view class="fabBox">
<uni-fab ref="fab" :pattern="pattern" :content="fabContent" :horizontal="horizontal" :vertical="vertical"
:direction="direction" @trigger="fabTrigger" @fabClick="fabClick" />
@@ -172,21 +219,23 @@
thisClass: {},
students: [],
tabId: '0',
tabId: '2',
curTagIndex: 0,
scrollable: false,
tabList: [{
name: '班内课程',
name: '班内学员',
id: '2'
},
{
name: '班级情况',
id: '0'
},
// {
// name: '班内讨论',
// id: '1'
// },
{
name: '班内学员',
id: '2'
},
// {
// name: '班内提交',
// id: '3'
@@ -234,7 +283,10 @@
taskList: [], // 任务列表
taskHaveMore: false, // 是否还有更多
roleCode: [], // 角色数组
interval:null,
interval: null,
homeWorkList: [],
thisStudent: {},
showStudentBlank: false,
}
},
onLoad(e) {
@@ -242,15 +294,15 @@
this.classId = e.id
this.interval = setInterval(() => {
if(this.thisClass.id){
if (this.thisClass.id) {
uni.showLoading({
title:'加载中'
title: '加载中'
})
this.getUserInfo()
clearInterval(this.interval)
console.log('定时清了吗');
}
},500)
this.getUserInfo()
clearInterval(this.interval)
console.log('定时清了吗');
}
}, 500)
},
onPullDownRefresh() {
@@ -260,14 +312,8 @@
beforeDestroy() {
clearInterval(this.interval)
},
// onBackPress() {
// if (this.$refs.fab.isShow) {
// this.$refs.fab.close()
// return true
// }
// return false
// },
async onShow() {
onShow() {
this.getClassInfo()
// this.roleCode = await this.getRealRole()
},
@@ -285,10 +331,10 @@
this.roleCode.forEach(item => {
switch (item) {
case '主任':
_roleName += '主任';
_roleName += ' 主任';
break;
case '副主任':
_roleName += '副主任';
_roleName += ' 副主任';
break;
case '0':
_roleName += ' 学员';
@@ -329,68 +375,70 @@
}
},
methods: {
goAddHomeWork(type){
uni.navigateTo({
url: `/pages/miniClass/addHomeWork?classId=${this.thisClass.id}&type=${type}`
})
closePup() {
this.showStudentBlank = false
},
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}&type=${type}`
})
},
goXindeList(url){
goXindeList(url) {
uni.navigateTo({
url:`${url}?classId=${this.thisClass.id}&type=2&roleCode=${this.roleCode}`
url: `${url}?classId=${this.thisClass.id}&type=2&roleCode=${this.roleCode}`
})
},
// 获取真实的身份信息
getRealRole() {
console.log('this.thisClass.id', this.thisClass.id);
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);
// var _list = []
// if (res.result.length > 0) {
// _list = res.result
// _list = _list.map(item => {
// return item.role
// })
// console.log('——list', res.result)
// }
this.roleCode = res.result
}).catch(e => {
uni.hideLoading()
this.roleCode = []
uni.showToast({
title: '获取身份信息失败',
icon: 'error'
})
});
},
$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}`
})
},
goSikaoList(url,id){
goSikaoList(url, id) {
uni.navigateTo({
url:`${url}?classId=${id}&roleCode=${this.roleCode}`
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: '提示',
@@ -473,6 +521,11 @@
})
});
},
clickStudent(item) {
console.log('item', item);
this.thisStudent = item
this.showStudentBlank = true
},
getUserInfo() {
// 获取个人信息
if (this.userInfo.id != undefined) {
@@ -481,15 +534,8 @@
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.getRealRole()
// } else {
this.getRealRole()
// }
}).catch(e => {
uni.hideLoading()
uni.showToast({
@@ -499,7 +545,7 @@
});
}
},
goSetAdmin(url){
goSetAdmin(url) {
uni.navigateTo({
url: `${url}?id=${this.thisClass.id}&roleCode=${this.roleCode}`
});
@@ -584,18 +630,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) {
// 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) {
console.log('this.admins', this.admins);
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",
@@ -624,11 +720,6 @@
}
}).catch(e => {
console.log(e, '数据报错')
// this.status = 3
// uni.showToast({
// title: e.msg,
// icon: 'error'
// })
});
},
taskEdit(item) {
@@ -668,20 +759,18 @@
if (res.code == 0) {
that.isHave = true
uni.showToast({
title: `退出成功!`,
title: `操作成功!`,
icon: 'success'
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/miniClass/myClassList'
})
this.getClassInfo()
}, 200)
}
}).catch(e => {
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: `退出失败`,
title: `操作失败`,
icon: 'error'
})
});
@@ -697,7 +786,7 @@
url: `/pages/miniClass/classCaskList?id=${this.thisClass.id}&type=${this.tijiaoTitleId}`
})
},
getClassInfo() {
async getClassInfo() {
uni.showLoading({
title: '正在加载'
})
@@ -711,8 +800,8 @@
'Content-Type': 'application/json'
},
})
.then(res => {
console.log('res--------',this.classId,res,);
.then(async res => {
console.log('res--------', this.classId, res, );
this.refresh = false
if (res.code == 0) {
this.isHave = res.result.isJoin
@@ -750,7 +839,11 @@
this.courses = res.result.courses
this.students = res.result.students
this.refresh = true
if (this.thisClass.state == 0) {
this.homeWorkList = await this.getHomeWorkLength()
}
}
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
@@ -769,13 +862,25 @@
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.upopBox {
padding: 40rpx;
max-height: 80vh;
overflow-y: scroll;
color: #666;
.item {
padding: 10rpx 0;
border-bottom: 1px solid #eee;
}
}
.flexbox {
display: flex;
}
.welComeText {
font-size: 28rpx;
padding:20rpx 0;
font-size: 28rpx;
padding: 20rpx 0;
color: #e58d44;
}
@@ -815,11 +920,16 @@
color: #fff;
padding: 20rpx 0;
border-radius: 6rpx;
text{padding-top: 0 !important;}
text {
padding-top: 0 !important;
}
}
.item:last-child{
.item:last-child {
margin-right: 0 !important;
}
.delClass {
background-color: #ffa4a6;
}
@@ -904,12 +1014,16 @@
// }
}
.qrcode{width:100%;
image{
width: 200rpx;height: 200rpx;
.qrcode {
width: 100%;
image {
width: 200rpx;
height: 200rpx;
}
}
.manBtnBox {
justify-content: center;
@@ -947,6 +1061,13 @@
}
}
.waitOpen {
height: 100rpx;
justify-content: center;
display: flex;
align-items: center;
}
.submitRecode {
// padding: 20rpx;
@@ -988,6 +1109,18 @@
background-color: transparent !important;
}
::v-deep .xueyuanTitle {
.uni-section-header {
float: left;
}
.uni-section-content {
float: right;
margin-top: 20rpx;
font-size: 26rpx;
}
}
.bottomBox {
border-top: 1px solid #eee;
position: fixed;
@@ -1017,14 +1150,33 @@
.classMateBox {
.zmVip {
background-image: linear-gradient(-60deg, #53966a 0%, #e1feef 50%, #e1feef 100%);
.outBtn {
color: #fff !important;
border: 1px solid #fff !important;
}
}
.wumenVip {
background-image: linear-gradient(-60deg, #578df0 0%, #f1f4fd 50%, #f1f4fd 100%);
.outBtn {
color: #fff !important;
border: 1px solid #fff !important;
}
}
.superVip {
background-image: linear-gradient(-60deg, #965af0 0%, #fdf0ed 50%, #fdf0ed 100%);
.outBtn {
color: #fff !important;
border: 1px solid #fff !important;
}
}
.newBox {
flex-wrap: wrap;
}
.item {
@@ -1034,6 +1186,7 @@
.textItems {
width: 100%;
align-items: center;
justify-content: space-between;
.outBtn {
padding: 6rpx 10rpx;
@@ -1042,6 +1195,7 @@
color: $themeColor;
border: 1px solid $themeColor;
font-size: 26rpx;
margin-left: 10rpx;
}
.txt555 {
@@ -1057,18 +1211,23 @@
color: #fff;
}
}
}
.item.cur {
border: 2px solid #55aa00;
}
}
.classmateImg {
width: 80rpx;
margin-right: 40rpx;
height: 80rpx;
width: 60rpx;
margin-right: 20rpx;
height: 60rpx;
border-radius: 100rpx;
image {
width: 80rpx;
height: 80rpx;
width: 60rpx;
height: 60rpx;
}
}
@@ -1084,6 +1243,10 @@
// background-color: #f4f7ff;
}
u-divider {
font-size: 24rpx;
}
.newBox {
.item {

View File

@@ -160,10 +160,9 @@
</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>
</view>
<view class="addBtnBox">
@@ -195,13 +194,10 @@
>删除</text>
</view>
</view>
<!-- <text class="delBtn" v-if="item" @click.stop="delMemeber('counter',index)">删除</text>
<text class="addText" v-else>添加人员</text> -->
</view>
</view>
</view>
</uni-forms-item>
</uni-forms-item> -->
</view>
</uni-forms>
<view class="btn_box"><button @click="onSubmit"> </button></view>

View File

@@ -3,17 +3,9 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="教研室班级管理"></z-nav-bar>
<!-- 主任和副主任可以创建班级 -->
<view class="classNewBtn" >
<view class="box88 flex_box">
<view class="" style="width: 60%; text-align: center;">
<button type="primary" @click="goAddClasss">新开一个班级</button>
</view>
<view class="modelName">
当前教研室名称{{modelTitle}}
</view>
</view>
<view class="modelName">
当前教研室名称{{modelTitle}}
</view>
<!-- <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"
@@ -63,9 +55,17 @@
</view>
</view>
</view>
<!-- 主任和副主任可以创建班级 -->
<view class="classNewBtn" v-else>
<view class="box88 flex_box">
<view class="" style="width: 60%; text-align: center;">
<button type="primary" @click="goAddClasss">创建班级</button>
</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="learnBox">
<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)">
@@ -101,12 +101,12 @@
</view>
</view>
<u-divider v-if="preClassList.length == 0 && learningClassList.length == 0" text="暂无数据"></u-divider>
<!-- <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="learnBox">
<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)">
@@ -494,6 +494,7 @@
.containerBg {
// background-color: $containerColor;
min-height: calc(100vh - 500rpx);
background-color: #f6f6f8;
padding: 0 20rpx;

View File

@@ -1,23 +1,269 @@
<template>
<view>
这是思考题列表
<view style="min-height: calc(100vh - 120rpx); background-color: #ebf2f5;">
<z-nav-bar title="思考题提交列表"></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 flex_box">
<view class="item flex_box" style="align-items: center;">
<view class="">
<uni-icons type="spinner-cycle" size="18" color="#ff878d"></uni-icons>
</view>
<view class="">
未评分 <b>{{item.otherInfo.setNoGiveScoreNumber}}</b>
</view>
</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>
<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: [],
roleCode:'',
}
},
onLoad(e) {
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 = '医案列表') {
} else {
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.pPage = 0
this.taskList = []
this.getList()
// this.getList()
},
onBackPress() {
if (this.showRight || this.showLeft) {
this.$refs.showLeft.close()
this.$refs.showRight.close()
return true
}
},
methods: {
// 点击作业或者医案,进入作业提交情况
clickTask(item){
// 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>
<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
}
.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: center;
color: #999; font-size: 24rpx;
b{font-size: 34rpx; padding: 0 4rpx; font-weight: normal; color: #333; color: red;}
.item{text-align: center; padding-top: 0; padding-bottom: 0; margin-bottom: 0;}
}
.leve3 {
color: $themeColor;
text-align: center;
padding-top: 10rpx;
.tips {
width: 100%;
justify-content: space-between;
font-size: 26rpx;
color: #999;
}
.date {}
.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>

View File

@@ -11,7 +11,7 @@
<text>{{item.title}}</text>
</view>
<view class="leve2 flex_box">
<view class="item">
<!-- <view class="item">
<view class="">
<uni-icons type="checkmarkempty" size="18" color="#55aa7f"></uni-icons>
</view>
@@ -34,8 +34,8 @@
<view class="">
已评分 <b>{{item.otherInfo.setGiveScoreNumber}}</b>
</view>
</view>
<view class="item">
</view> -->
<view class="item flex_box" style="align-items: center;">
<view class="">
<uni-icons type="spinner-cycle" size="18" color="#ff878d"></uni-icons>
</view>
@@ -225,9 +225,9 @@
// .userName{}
}
.leve2 { justify-content: space-between;
.leve2 { justify-content: center;
color: #999; font-size: 24rpx;
b{font-size: 34rpx; padding: 0 4rpx; font-weight: normal; color: #333;}
b{font-size: 34rpx; padding: 0 4rpx; font-weight: normal; color: #333; color: red;}
.item{text-align: center; padding-top: 0; padding-bottom: 0; margin-bottom: 0;}
}