暂存
This commit is contained in:
14
pages.json
14
pages.json
@@ -674,6 +674,20 @@
|
||||
{
|
||||
"navigationBarTitleText" : "管理员心得列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/miniClass/sikaoQuestionList",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "思考题列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/miniClass/DirectorModalList",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "主任模型列表"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view :class="['noanser', isInClass ? '' : 'lock']" v-else>
|
||||
<view class="lockView flex_box">
|
||||
<view class="">
|
||||
@@ -87,11 +88,11 @@
|
||||
<text>加入小班学习后,即可发表您的见解, 更有相关领域的前辈为您解惑,帮助您更系统地学习本课程</text>
|
||||
</view>
|
||||
<view class="btnBox">
|
||||
<button size="mini" @click="goClassLIst()">去加入小班</button>
|
||||
<button size="mini" @click="goClassLIst('/pages/miniClass/courseClassList')">去加入小班</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="welc">
|
||||
<text>欢迎留下你的见解</text>
|
||||
</view>
|
||||
<view class="btn">
|
||||
@@ -167,6 +168,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isInClass:false, // 是否加入了班级
|
||||
showEditBlank: false,
|
||||
answerForm: {
|
||||
relationId: undefined,
|
||||
@@ -243,7 +245,7 @@
|
||||
|
||||
show: false,
|
||||
playData: {},
|
||||
isInClass:false, // 是否加入了班级
|
||||
|
||||
taiHuClassInfo: {},
|
||||
searchValue: "",
|
||||
ordersTabs: [{
|
||||
@@ -525,9 +527,9 @@
|
||||
});
|
||||
});
|
||||
},
|
||||
goClassLIst(url, id,title){
|
||||
goClassLIst(url){
|
||||
uni.navigateTo({
|
||||
url: `${url}?courseId=${this.options.id}&courseTitle=${this.options.navTitle}`,
|
||||
url: `${url}?courseId=${this.options.courseId}&courseTitle=${this.options.navTitle}`,
|
||||
});
|
||||
},
|
||||
readOnlyChange() {
|
||||
@@ -788,7 +790,7 @@
|
||||
url: '/common/class/getClassByCourseIdNoUser',
|
||||
method: "POST",
|
||||
data: {
|
||||
"courseId": this.options.id,
|
||||
"courseId": this.options.courseId,
|
||||
"state": "", //小班状态0待开班1已开班2完成
|
||||
"type": "" // 班类型 0小班 1联合班 2精英班
|
||||
},
|
||||
@@ -797,13 +799,16 @@
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
console.log('获取班级列表',res.result.length,this.options.courseId);
|
||||
if(res.code == 0){
|
||||
if(res.result.length > 0){
|
||||
this.isInClass = false
|
||||
}else{
|
||||
this.isInClass = true
|
||||
|
||||
}
|
||||
}
|
||||
console.log('获取班级列表++++++',this.isInClass);
|
||||
}).catch(e => {
|
||||
console.log('获取班级列表失败',e);
|
||||
});
|
||||
@@ -1021,7 +1026,8 @@
|
||||
padding: 20rpx;
|
||||
background-color: rgba(255, 255, 255, .6);
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #eee;
|
||||
// border-bottom: 1px solid #eee;
|
||||
.welc{ display: block; border-top: 1px solid #eee; margin-bottom: 20rpx; padding-top: 20rpx;}
|
||||
.lockView{display: none;}
|
||||
.btn {
|
||||
display: inline-block;
|
||||
|
||||
@@ -676,7 +676,7 @@
|
||||
v.isAudition == 1 && this.userMsg.vip == 0 && this.librayList[this.curIndex].isBuy == 0 ?
|
||||
noRecored = true : ''
|
||||
uni.navigateTo({
|
||||
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
|
||||
url: `${_myurl}?courseId=${this.course.id}&navTitle=${this.pageTitle}&title=${v.title}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
|
||||
});
|
||||
} else {
|
||||
this.$commonJS.showToast("请先购买课程");
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
style: "color:#fff;font-size:28rpx"
|
||||
},
|
||||
],
|
||||
roleObj:{},
|
||||
infoShow: false, // 显示电子书相关
|
||||
showEbook: false, // 显示电子书相关
|
||||
userMes: {},
|
||||
@@ -323,6 +324,7 @@
|
||||
onShow() {
|
||||
// console.log(this.userInfo, "11111111111111");
|
||||
this.getData();
|
||||
this.getUserRole()
|
||||
// 隐藏原生的tabbar
|
||||
// uni.hideTabBar();
|
||||
},
|
||||
@@ -424,11 +426,11 @@
|
||||
url: url,
|
||||
});
|
||||
},
|
||||
getData() {
|
||||
// 获取个人信息
|
||||
if (this.userInfo.id != undefined) {
|
||||
this.$http.post("common/user/getUserInfo").then((res) => {
|
||||
this.userMes = res.result;
|
||||
// 获取用户的角色信息
|
||||
getUserRole(){
|
||||
this.$http.post("common/class/getRoleType").then((res) => {
|
||||
console.log('用户角色信息',res);
|
||||
this.roleObj = res.result
|
||||
var zhurenIndex = this.pageList.findIndex(item => {
|
||||
return item.name == '主任教学'
|
||||
})
|
||||
@@ -447,7 +449,7 @@
|
||||
if (yonghuIndex > -1) {
|
||||
this.pageList.splice(yonghuIndex, 1)
|
||||
}
|
||||
if (res.isDirector) {
|
||||
if (this.roleObj.isDirector) {
|
||||
var n = this.pageList.find(item => {
|
||||
return item.name == '主任教学'
|
||||
})
|
||||
@@ -457,21 +459,22 @@
|
||||
var item = {
|
||||
// { // 主任之外的人显示班级管理
|
||||
name: "主任教学",
|
||||
url: "/pages/miniClass/miniClassMan?type=mine",
|
||||
url: "/pages/miniClass/DirectorModalList?type=mine",
|
||||
type: "pageJump",
|
||||
// },
|
||||
}
|
||||
this.pageList.splice(3, 0, item);
|
||||
}
|
||||
} else{
|
||||
if (res.isMonitor) {
|
||||
}
|
||||
// 是班长
|
||||
if (this.roleObj.isMonitor) {
|
||||
var n = this.pageList.find(item => {
|
||||
return item.name == '班级管理'
|
||||
})
|
||||
console.log('班长n找到了么', n);
|
||||
if (!n) {
|
||||
var item = {
|
||||
// 主任之外的人显示班级管理
|
||||
|
||||
name: "班级管理",
|
||||
url: "/pages/miniClass/MonitorClassList?type=mine",
|
||||
type: "pageJump",
|
||||
@@ -479,15 +482,16 @@
|
||||
}
|
||||
this.pageList.splice(3, 0, item);
|
||||
}
|
||||
} else {
|
||||
if(!res.isMonitor && !res.isDirector){
|
||||
}
|
||||
// 是学员
|
||||
if(this.roleObj.isStudent){
|
||||
var n = this.pageList.find(item => {
|
||||
return item.name == '我的班级'
|
||||
})
|
||||
console.log('我的班级找到了么', n);
|
||||
if (!n) {
|
||||
var item = {
|
||||
// 主任之外的人显示班级管理
|
||||
|
||||
name: "我的班级",
|
||||
url: "/pages/miniClass/myClassList?type=mine",
|
||||
type: "pageJump",
|
||||
@@ -496,8 +500,17 @@
|
||||
this.pageList.splice(3, 0, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}).catch(e => {
|
||||
console.log('获取角色信息失败');
|
||||
})
|
||||
},
|
||||
getData() {
|
||||
// 获取个人信息
|
||||
if (this.userInfo.id != undefined) {
|
||||
this.$http.post("common/user/getUserInfo").then((res) => {
|
||||
this.userMes = res.result;
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
467
pages/miniClass/DirectorModalList.vue
Normal file
467
pages/miniClass/DirectorModalList.vue
Normal file
@@ -0,0 +1,467 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<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="classNewBtn" v-if="isDirector">
|
||||
<view class="box88 flex_box">
|
||||
<view class="" style="width: 60%; text-align: center;">
|
||||
<button type="primary" @click="goAddClasss">新开一个班级</button>
|
||||
</view>
|
||||
</view>
|
||||
</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"
|
||||
itemStyle="padding-left: 15px; background-color:#fff; padding-right: 15px; height: 50px;"></u-tabs>
|
||||
</view> -->
|
||||
<view class="containerBg">
|
||||
<!-- <view class="subCate flex" v-if="subList.length> 0">
|
||||
<text :class="['item',subTabId == item.id ? 'active' : '']" v-for="(item, index) in subList"
|
||||
@click="curseClick(item)" :key="index">{{item.title}}</text>
|
||||
</view> -->
|
||||
<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/miniClassMan',item)">
|
||||
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||
<view class="" v-if="item.icon != ''">
|
||||
<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="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>
|
||||
<!-- <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>
|
||||
<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>
|
||||
<z-navigation></z-navigation>
|
||||
|
||||
<!-- <music-play :playData="playData"></music-play> -->
|
||||
</view>
|
||||
</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, // 小班类型
|
||||
|
||||
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'
|
||||
|
||||
},
|
||||
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: [],
|
||||
status: 3, // 0 不显示, 1 加载中,2 加载全部完成,3 暂无数据
|
||||
page: 1,
|
||||
flag: true, // 函数是否执行完
|
||||
userMes: undefined,
|
||||
isMonitor :undefined,
|
||||
isDirector :undefined,
|
||||
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
// this.tagId = e.id
|
||||
this.subTabId = this.subList[0].id
|
||||
this.pageTitle = e.title
|
||||
this.pid = e.pid
|
||||
console.log(e, '传入分类id')
|
||||
this.getUserInfo()
|
||||
|
||||
// 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() {
|
||||
// this.addType = undefined
|
||||
this.getData()
|
||||
// 隐藏原生的tabbar
|
||||
// uni.hideTabBar();
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
goAddClasss(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/miniClass/addClass'
|
||||
})
|
||||
},
|
||||
getUserInfo() {
|
||||
// 获取个人信息
|
||||
if (this.userInfo.id != undefined) {
|
||||
this.$http.post("common/user/getUserInfo").then((res) => {
|
||||
this.userMes = res.result;
|
||||
this.isMonitor = res.isMonitor
|
||||
this.isDirector = res.isDirector
|
||||
}).catch(e => {
|
||||
uni.showToast({
|
||||
title: '获取用户信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
// 加入班级
|
||||
enterClass(){
|
||||
|
||||
},
|
||||
selectChange(e){
|
||||
console.log("e:", e);
|
||||
},
|
||||
closePup(){
|
||||
this.pupShow = false
|
||||
},
|
||||
surl(imageurl) {
|
||||
return `url(${imageurl})`
|
||||
},
|
||||
|
||||
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/getClassModelByUserid",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"userId": this.userInfo.id,
|
||||
"type": "" // 班类型 0小班 1联合班 2精英班
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
console.log('用户的模型列表');
|
||||
if (res.code == 0) {
|
||||
if (res.classModelList.length > 0) {
|
||||
this.classList = res.classModelList
|
||||
|
||||
}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,val) {
|
||||
// console.log('进来了',url,id);
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${val.id}&title=${val.title}&type=${val.type}`
|
||||
});
|
||||
},
|
||||
|
||||
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
|
||||
}
|
||||
.addType{width: 100%; margin-top: 40rpx;margin-bottom: 40rpx; border: 1px solid #eee;}
|
||||
.classNewBtn{text-align: center; height:200rpx; padding: 30rpx;
|
||||
background-image: linear-gradient(-60deg, #fdf0ed 0%, #bfe3f0 40%, #e4eefa 60%, #bfe3f0 80%, #fdf0ed 100%);
|
||||
|
||||
border-radius: 0 0 40rpx 40rpx;
|
||||
.box88{ border-radius: 40rpx; padding: 30rpx; justify-content: center; align-items: center;
|
||||
// box-shadow: 0 10rpx 8rpx #eee;
|
||||
button{border-radius: 40rpx;}
|
||||
}
|
||||
}
|
||||
.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; top: 120rpx;
|
||||
// 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>
|
||||
@@ -22,7 +22,7 @@
|
||||
<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)">
|
||||
@click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||
<view class="imgcontainer" v-if="item.icon != ''">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
@@ -35,7 +35,7 @@
|
||||
<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)">
|
||||
<text class="txt555" @click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
@@ -58,7 +58,7 @@
|
||||
<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)">
|
||||
@click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||
<view class="imgcontainer" v-if="item.icon != ''">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
@@ -71,7 +71,7 @@
|
||||
<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)">
|
||||
<text class="txt555" @click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
@@ -98,7 +98,7 @@
|
||||
<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)">
|
||||
@click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||
<view class="imgcontainer" v-if="item.icon != ''">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
@@ -111,7 +111,7 @@
|
||||
<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)">
|
||||
<text class="txt555" @click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
@@ -256,8 +256,8 @@
|
||||
console.log('下拉刷新')
|
||||
// this.status = 3
|
||||
// this.page = 1
|
||||
this.classList = []
|
||||
this.getData()
|
||||
// this.classList = []
|
||||
// this.getData()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
@@ -271,10 +271,13 @@
|
||||
...mapState(['userInfo'])
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
async onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
// uni.hideTabBar();
|
||||
this.getLearingClassList()
|
||||
this.classList = await this.getData('1','2')
|
||||
this.learningClassList = await this.getData('1','1')
|
||||
this.preClassList = await this.getData('1','0')
|
||||
// this.getLearingClassList()
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
@@ -303,6 +306,7 @@
|
||||
url: "common/class/MyClassList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"role": "1",
|
||||
"state": '0', //小班状态0待开班1已开班2完成
|
||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||
},
|
||||
@@ -341,6 +345,7 @@
|
||||
url: "common/class/MyClassList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"role": "1",
|
||||
"state": '1', //小班状态0待开班1已开班2完成
|
||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||
},
|
||||
@@ -399,22 +404,23 @@
|
||||
// this.page = 1
|
||||
// this.getData(this.subTabId);
|
||||
},
|
||||
getData(id) {
|
||||
if (!this.flag) {
|
||||
console.log('正在执行,未完成')
|
||||
return
|
||||
}
|
||||
|
||||
async getData(role,state) {
|
||||
// if (!this.flag) {
|
||||
// console.log('正在执行,未完成')
|
||||
// return
|
||||
// }
|
||||
var _list = []
|
||||
this.status = 1
|
||||
this.flag = false
|
||||
// this.flag = false
|
||||
uni.showLoading({
|
||||
title: '正在加载'
|
||||
})
|
||||
$http.request({
|
||||
await $http.request({
|
||||
url: "common/class/MyClassList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"state": '2', //小班状态0待开班1已开班2完成
|
||||
"role": role,
|
||||
"state": state, //小班状态0待开班1已开班2完成
|
||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
@@ -424,17 +430,19 @@
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.result.length > 0) {
|
||||
this.classList = res.result
|
||||
|
||||
// this.classList = res.result
|
||||
_list = res.result
|
||||
} else {
|
||||
this.classList = []
|
||||
// this.classList = []
|
||||
_list = []
|
||||
}
|
||||
this.flag = true
|
||||
// this.flag = true
|
||||
}
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
_list = []
|
||||
uni.hideLoading()
|
||||
this.flag = true
|
||||
// this.flag = true
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
uni.showToast({
|
||||
@@ -442,15 +450,49 @@
|
||||
icon: 'error'
|
||||
})
|
||||
});
|
||||
return _list
|
||||
},
|
||||
// 跳转
|
||||
onPageJump(url, id, have) {
|
||||
// console.log('进来了',url,id);
|
||||
async onPageJump(url, id, have) {
|
||||
var isStudent = await this.getRealRole(id)
|
||||
console.log('isStudent',isStudent);
|
||||
if(isStudent){
|
||||
uni.navigateTo({
|
||||
url:`/pages/miniClass/classInfo?id=${id}`
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}&have=${have}`
|
||||
});
|
||||
}
|
||||
},
|
||||
// 获取真实的身份信息
|
||||
async getRealRole(id) {
|
||||
// console.log('this.thisClass.id', this.thisClass.id);
|
||||
var _isStudent = undefined
|
||||
await $http.request({
|
||||
url: "common/class/getUserRole",
|
||||
method: "POST",
|
||||
data: {
|
||||
"classId": id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
uni.hideLoading()
|
||||
// 如果单纯是学员的身份
|
||||
if(res.result.length == 1 && res.result[0].role == 0){
|
||||
console.log('只是学员身份');
|
||||
_isStudent = true
|
||||
|
||||
}else{
|
||||
_isStudent = false
|
||||
}
|
||||
})
|
||||
return _isStudent
|
||||
},
|
||||
shuomingPage(url, id, pid) {
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}&pid=${pid}`
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
onLoad(e) {
|
||||
console.log('收到的值', e);
|
||||
// this.pageType = e.type
|
||||
// this.form.type = e.type
|
||||
this.form.type = e.type
|
||||
// this.modeType = e.type
|
||||
|
||||
if(e.id){
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<view class="pingfenBox" >
|
||||
<!-- 功能按钮 -->
|
||||
<view class="optionsBtn" v-if="roleCode.includes('66') || roleCode.includes('1') || roleCode.includes('2')">
|
||||
<view class="optionsBtn" v-if="(roleCode.includes('66') || roleCode.includes('1') || roleCode.includes('2')) && thisClass.state != '2'">
|
||||
<view class="flex_box">
|
||||
<view class="item setBanewei" v-if="thisClass.state != '2'"
|
||||
@click="goSetAdmin('/pages/miniClass/memberSet')">
|
||||
@@ -73,7 +73,7 @@
|
||||
</view>
|
||||
<text>心得</text>
|
||||
</view>
|
||||
<view class="item" @click="goXindeList('/pages/miniClass/xindeList')">
|
||||
<view class="item" @click="goSikaoList('/pages/miniClass/sikaoQuestionList', thisClass.id)">
|
||||
<view class="img">
|
||||
<image src="../../static/icon/sikaoti.png" mode="widthFix"></image>
|
||||
</view>
|
||||
@@ -429,6 +429,11 @@
|
||||
url: `${url}?classId=${classId}&type=${type}&roleCode=${this.roleCode}`
|
||||
})
|
||||
},
|
||||
goSikaoList(url,id){
|
||||
uni.navigateTo({
|
||||
url:`${url}?classId=${id}&roleCode=${this.roleCode}`
|
||||
})
|
||||
},
|
||||
// 点击作业或者医案,进入详细介绍
|
||||
clickTask() {
|
||||
|
||||
|
||||
@@ -209,23 +209,10 @@
|
||||
if (res.code == 0) {
|
||||
if (res.classEntityList.length > 0) {
|
||||
this.courseList = res.classEntityList
|
||||
// var list = res.classEntityList
|
||||
// this.courseList = this.courseList.concat(list)
|
||||
// if (res.courses.pages > this.page) {
|
||||
// this.status = 0
|
||||
// } else {
|
||||
// this.status = 2
|
||||
// }
|
||||
|
||||
}else{
|
||||
this.courseList = []
|
||||
}
|
||||
// else if (this.page > 1) {
|
||||
// this.status = 2 // 加载完成
|
||||
|
||||
// } else {
|
||||
// this.status = 3 // 暂无数据
|
||||
// }
|
||||
// console.log('status', this.status)
|
||||
this.flag = true
|
||||
}
|
||||
uni.hideLoading()
|
||||
@@ -241,13 +228,45 @@
|
||||
});
|
||||
},
|
||||
// 跳转
|
||||
onPageJump(url,id) {
|
||||
// console.log('进来了',url,id);
|
||||
async onPageJump(url,id) {
|
||||
var isStudent = await this.getRealRole(id)
|
||||
console.log('isStudent',isStudent);
|
||||
if(isStudent){
|
||||
uni.navigateTo({
|
||||
url:`/pages/miniClass/classInfo?id=${id}`
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}`
|
||||
});
|
||||
});}
|
||||
},
|
||||
// 获取真实的身份信息
|
||||
async getRealRole(id) {
|
||||
// console.log('this.thisClass.id', this.thisClass.id);
|
||||
var _isStudent = undefined
|
||||
await $http.request({
|
||||
url: "common/class/getUserRole",
|
||||
method: "POST",
|
||||
data: {
|
||||
"classId": id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
uni.hideLoading()
|
||||
// 如果单纯是学员的身份
|
||||
if(res.result.length == 1 && res.result[0].role == 0){
|
||||
console.log('只是学员身份');
|
||||
_isStudent = true
|
||||
|
||||
}else{
|
||||
_isStudent = false
|
||||
}
|
||||
})
|
||||
return _isStudent
|
||||
},
|
||||
shuomingPage(url,id,pid){
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}&pid=${pid}`
|
||||
|
||||
@@ -2,32 +2,36 @@
|
||||
<view>
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<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>
|
||||
<z-nav-bar title="主任班级管理"></z-nav-bar>
|
||||
<!-- 主任和副主任可以创建班级 -->
|
||||
<view class="classNewBtn" v-if="isDirector">
|
||||
<view class="classNewBtn" >
|
||||
<view class="box88 flex_box">
|
||||
<view class="" style="width: 60%; text-align: center;">
|
||||
<button type="primary" @click="goAddClasss">新开一个班级</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tabsBox" :class="[fixed ? 'fixed' : '' ]">
|
||||
<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"
|
||||
itemStyle="padding-left: 15px; background-color:#fff; padding-right: 15px; height: 50px;"></u-tabs>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="containerBg">
|
||||
<view class="subCate flex" v-if="subList.length> 0">
|
||||
<text :class="['item',subTabId == item.id ? 'active' : '']" v-for="(item, index) in subList"
|
||||
<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="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="" 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>
|
||||
@@ -36,8 +40,89 @@
|
||||
<image src="@/static/my_04.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="buyItems">
|
||||
<view class="txt555" >
|
||||
<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}} 人
|
||||
@@ -52,19 +137,16 @@
|
||||
</view>
|
||||
</view>
|
||||
<u-divider v-else text="暂无数据"></u-divider>
|
||||
<!-- <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>
|
||||
<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>
|
||||
<z-navigation></z-navigation>
|
||||
|
||||
<!-- <music-play :playData="playData"></music-play> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<z-navigation></z-navigation>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -80,7 +162,22 @@
|
||||
return {
|
||||
playData: {},
|
||||
addType: undefined, // 小班类型
|
||||
|
||||
range: [{
|
||||
value: '0',
|
||||
text: "普通小班",
|
||||
name: "普通小班"
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
text: "联合班",
|
||||
name: "普通小班"
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
text: "精英班",
|
||||
name: "普通小班"
|
||||
},
|
||||
],
|
||||
tagId: null,
|
||||
pid: null,
|
||||
fixed: false,
|
||||
@@ -103,33 +200,61 @@
|
||||
// backgroundColor: '#258feb'
|
||||
|
||||
},
|
||||
subList: [{title:'待开班',id:'0'},{title:'已开班',id:'1'},{title:'已结班',id:'2'}],
|
||||
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'}],
|
||||
tabList: [{
|
||||
name: '普通小班',
|
||||
id: '0'
|
||||
}, {
|
||||
name: '联合班',
|
||||
id: '1'
|
||||
}, {
|
||||
name: '精英班',
|
||||
id: '2'
|
||||
}],
|
||||
curTagId: 0,
|
||||
classList: [],
|
||||
classList: [], // 已结班
|
||||
preClassList: [], // 待开班
|
||||
learningClassList: [], // 在学习的班级
|
||||
status: 3, // 0 不显示, 1 加载中,2 加载全部完成,3 暂无数据
|
||||
page: 1,
|
||||
flag: true, // 函数是否执行完
|
||||
userMes: undefined,
|
||||
isMonitor :undefined,
|
||||
isDirector :undefined,
|
||||
|
||||
modelId:undefined,
|
||||
modelType:undefined,
|
||||
modelTitle:undefined,
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
this.modelId = e.id
|
||||
this.modelType = e.type
|
||||
this.modelTitle = e.title
|
||||
// this.tagId = e.id
|
||||
// this.curTagId = this.range[0].value
|
||||
this.subTabId = this.subList[0].id
|
||||
this.pageTitle = e.title
|
||||
this.pid = e.pid
|
||||
// this.pageTitle = e.title
|
||||
// this.pid = e.pid
|
||||
console.log(e, '传入分类id')
|
||||
this.getUserInfo()
|
||||
|
||||
// this.getData()
|
||||
// this.getCateList(this.tagId)
|
||||
},
|
||||
onPageScroll(e) {
|
||||
@@ -145,8 +270,8 @@
|
||||
console.log('下拉刷新')
|
||||
// this.status = 3
|
||||
// this.page = 1
|
||||
this.classList = []
|
||||
this.getData()
|
||||
// this.classList = []
|
||||
// this.getData()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
@@ -160,11 +285,13 @@
|
||||
...mapState(['userInfo'])
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
// this.addType = undefined
|
||||
this.getData()
|
||||
async onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
// uni.hideTabBar();
|
||||
this.classList = await this.getData('2')
|
||||
this.learningClassList = await this.getData('1')
|
||||
this.preClassList = await this.getData('0')
|
||||
// this.getLearingClassList()
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
@@ -173,27 +300,8 @@
|
||||
methods: {
|
||||
goAddClasss(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/miniClass/addClass'
|
||||
url:`/pages/miniClass/addClass?type=${this.modelType}`
|
||||
})
|
||||
},
|
||||
getUserInfo() {
|
||||
// 获取个人信息
|
||||
if (this.userInfo.id != undefined) {
|
||||
this.$http.post("common/user/getUserInfo").then((res) => {
|
||||
this.userMes = res.result;
|
||||
this.isMonitor = res.isMonitor
|
||||
this.isDirector = res.isDirector
|
||||
}).catch(e => {
|
||||
uni.showToast({
|
||||
title: '获取用户信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
// 加入班级
|
||||
enterClass(){
|
||||
|
||||
},
|
||||
selectChange(e) {
|
||||
console.log("e:", e);
|
||||
@@ -205,6 +313,20 @@
|
||||
return `url(${imageurl})`
|
||||
},
|
||||
|
||||
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
|
||||
@@ -215,27 +337,28 @@
|
||||
},
|
||||
curseClick(item) {
|
||||
this.subTabId = item.id
|
||||
this.classList = []
|
||||
this.page = 1
|
||||
this.getData(this.subTabId);
|
||||
// this.classList = []
|
||||
// this.page = 1
|
||||
// this.getData(this.subTabId);
|
||||
},
|
||||
getData(id) {
|
||||
async getData(state) {
|
||||
// if (!this.flag) {
|
||||
// console.log('正在执行,未完成')
|
||||
// return
|
||||
// }
|
||||
|
||||
var _list = []
|
||||
this.status = 1
|
||||
this.flag = false
|
||||
// uni.showLoading({
|
||||
// title:'正在加载'
|
||||
// })
|
||||
$http.request({
|
||||
// this.flag = false
|
||||
uni.showLoading({
|
||||
title: '正在加载'
|
||||
})
|
||||
await $http.request({
|
||||
url: "common/class/getClassByDirectorid",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"state": this.subTabId, //小班状态0待开班1已开班2完成
|
||||
"type": this.curTagId // 班类型 0小班 1联合班 2精英班
|
||||
"modelId": this.modelId,
|
||||
"state": state, //小班状态0待开班1已开班2完成
|
||||
"type": "" // 班类型 0小班 1联合班 2精英班
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
@@ -244,30 +367,19 @@
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.classEntityList.length > 0) {
|
||||
this.classList = res.classEntityList
|
||||
// var list = res.classEntityList
|
||||
// this.classList = this.classList.concat(list)
|
||||
// if (res.courses.pages > this.page) {
|
||||
// this.status = 0
|
||||
// } else {
|
||||
// this.status = 2
|
||||
// }
|
||||
// this.classList = res.result
|
||||
_list = res.classEntityList
|
||||
} else {
|
||||
this.classList = []
|
||||
// this.classList = []
|
||||
_list = []
|
||||
}
|
||||
// else if (this.page > 1) {
|
||||
// this.status = 2 // 加载完成
|
||||
|
||||
// } else {
|
||||
// this.status = 3 // 暂无数据
|
||||
// }
|
||||
// console.log('status', this.status)
|
||||
this.flag = true
|
||||
// this.flag = true
|
||||
}
|
||||
// uni.hideLoading()
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
// uni.hideLoading()
|
||||
this.flag = true
|
||||
_list = []
|
||||
uni.hideLoading()
|
||||
// this.flag = true
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
uni.showToast({
|
||||
@@ -275,15 +387,49 @@
|
||||
icon: 'error'
|
||||
})
|
||||
});
|
||||
return _list
|
||||
},
|
||||
// 跳转
|
||||
onPageJump(url,id) {
|
||||
// console.log('进来了',url,id);
|
||||
async onPageJump(url, id, have) {
|
||||
var isStudent = await this.getRealRole(id)
|
||||
console.log('isStudent',isStudent);
|
||||
if(isStudent){
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}`
|
||||
url:`/pages/miniClass/classInfo?id=${id}`
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}&have=${have}`
|
||||
});
|
||||
}
|
||||
},
|
||||
// 获取真实的身份信息
|
||||
async getRealRole(id) {
|
||||
// console.log('this.thisClass.id', this.thisClass.id);
|
||||
var _isStudent = undefined
|
||||
await $http.request({
|
||||
url: "common/class/getUserRole",
|
||||
method: "POST",
|
||||
data: {
|
||||
"classId": id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
uni.hideLoading()
|
||||
// 如果单纯是学员的身份
|
||||
if(res.result.length == 1 && res.result[0].role == 0){
|
||||
console.log('只是学员身份');
|
||||
_isStudent = true
|
||||
|
||||
}else{
|
||||
_isStudent = false
|
||||
}
|
||||
})
|
||||
return _isStudent
|
||||
},
|
||||
shuomingPage(url, id, pid) {
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}&pid=${pid}`
|
||||
@@ -294,30 +440,66 @@
|
||||
</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
|
||||
}
|
||||
.addType{width: 100%; margin-top: 40rpx;margin-bottom: 40rpx; border: 1px solid #eee;}
|
||||
|
||||
.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;
|
||||
}
|
||||
.classNewBtn{text-align: center; height:200rpx; padding: 30rpx;
|
||||
background-image: linear-gradient(-60deg, #fdf0ed 0%, #bfe3f0 40%, #e4eefa 60%, #bfe3f0 80%, #fdf0ed 100%);
|
||||
|
||||
@@ -327,21 +509,6 @@
|
||||
button{border-radius: 40rpx;}
|
||||
}
|
||||
}
|
||||
.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; top: 120rpx;
|
||||
// z-index: 1; width: 100%; background-color: #fff;
|
||||
}
|
||||
|
||||
.newBox {
|
||||
|
||||
.item {
|
||||
@@ -368,20 +535,35 @@
|
||||
height: 200rpx;
|
||||
}
|
||||
}
|
||||
.btn_box{ text-align: right;
|
||||
|
||||
.btn_box {
|
||||
text-align: right;
|
||||
|
||||
text {
|
||||
border-radius: 20rpx;
|
||||
padding: 3px 5px; @include theme("btn_bg");
|
||||
font-size: 28rpx; color: #fff;
|
||||
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;}
|
||||
|
||||
.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;
|
||||
line-height: 30rpx;
|
||||
height: 60rpx;
|
||||
overflow: hidden;
|
||||
overflow: hidden !important;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
@@ -401,13 +583,15 @@
|
||||
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%;
|
||||
border-radius: 4px;
|
||||
width: 100%;
|
||||
color: #333;
|
||||
margin-right: 16rpx;
|
||||
padding: 14rpx 30rpx;
|
||||
@@ -431,7 +615,7 @@
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.modelName{padding: 10rpx 5rpx;}
|
||||
.imgcontainer {
|
||||
background-color: $imgBg;
|
||||
}
|
||||
|
||||
@@ -271,10 +271,13 @@
|
||||
...mapState(['userInfo'])
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
async onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
// uni.hideTabBar();
|
||||
this.getLearingClassList()
|
||||
this.classList = await this.getData('0','2')
|
||||
this.learningClassList = await this.getData('0','1')
|
||||
this.preClassList = await this.getData('0','0')
|
||||
// this.getLearingClassList()
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
@@ -294,83 +297,7 @@
|
||||
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) {
|
||||
@@ -399,22 +326,25 @@ this.getData()
|
||||
// this.page = 1
|
||||
// this.getData(this.subTabId);
|
||||
},
|
||||
getData(id) {
|
||||
if (!this.flag) {
|
||||
console.log('正在执行,未完成')
|
||||
return
|
||||
}
|
||||
|
||||
async getData(role,state) {
|
||||
// if (!this.flag) {
|
||||
// console.log('正在执行,未完成')
|
||||
// return
|
||||
// }
|
||||
var _list = []
|
||||
this.status = 1
|
||||
this.flag = false
|
||||
// this.flag = false
|
||||
uni.showLoading({
|
||||
title: '正在加载'
|
||||
})
|
||||
$http.request({
|
||||
await $http.request({
|
||||
|
||||
url: "common/class/MyClassList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"state": '2', //小班状态0待开班1已开班2完成
|
||||
"role": role,
|
||||
"state": state, //小班状态0待开班1已开班2完成
|
||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
@@ -424,17 +354,18 @@ this.getData()
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.result.length > 0) {
|
||||
this.classList = res.result
|
||||
|
||||
// this.classList = res.result
|
||||
_list = res.result
|
||||
} else {
|
||||
this.classList = []
|
||||
// this.classList = []
|
||||
_list = []
|
||||
}
|
||||
this.flag = true
|
||||
// this.flag = true
|
||||
}
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
this.flag = true
|
||||
// this.flag = true
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
uni.showToast({
|
||||
@@ -442,6 +373,7 @@ this.getData()
|
||||
icon: 'error'
|
||||
})
|
||||
});
|
||||
return _list
|
||||
},
|
||||
// 跳转
|
||||
onPageJump(url, id, have) {
|
||||
|
||||
23
pages/miniClass/sikaoQuestionList.vue
Normal file
23
pages/miniClass/sikaoQuestionList.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<view>
|
||||
这是思考题列表
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
roleCode:'',
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user