暂存
This commit is contained in:
14
pages.json
14
pages.json
@@ -674,6 +674,20 @@
|
|||||||
{
|
{
|
||||||
"navigationBarTitleText" : "管理员心得列表"
|
"navigationBarTitleText" : "管理员心得列表"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/miniClass/sikaoQuestionList",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "思考题列表"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/miniClass/DirectorModalList",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "主任模型列表"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view :class="['noanser', isInClass ? '' : 'lock']" v-else>
|
<view :class="['noanser', isInClass ? '' : 'lock']" v-else>
|
||||||
<view class="lockView flex_box">
|
<view class="lockView flex_box">
|
||||||
<view class="">
|
<view class="">
|
||||||
@@ -87,11 +88,11 @@
|
|||||||
<text>加入小班学习后,即可发表您的见解, 更有相关领域的前辈为您解惑,帮助您更系统地学习本课程</text>
|
<text>加入小班学习后,即可发表您的见解, 更有相关领域的前辈为您解惑,帮助您更系统地学习本课程</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="btnBox">
|
<view class="btnBox">
|
||||||
<button size="mini" @click="goClassLIst()">去加入小班</button>
|
<button size="mini" @click="goClassLIst('/pages/miniClass/courseClassList')">去加入小班</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="welc">
|
||||||
<text>欢迎留下你的见解</text>
|
<text>欢迎留下你的见解</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn">
|
<view class="btn">
|
||||||
@@ -167,6 +168,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isInClass:false, // 是否加入了班级
|
||||||
showEditBlank: false,
|
showEditBlank: false,
|
||||||
answerForm: {
|
answerForm: {
|
||||||
relationId: undefined,
|
relationId: undefined,
|
||||||
@@ -243,7 +245,7 @@
|
|||||||
|
|
||||||
show: false,
|
show: false,
|
||||||
playData: {},
|
playData: {},
|
||||||
isInClass:false, // 是否加入了班级
|
|
||||||
taiHuClassInfo: {},
|
taiHuClassInfo: {},
|
||||||
searchValue: "",
|
searchValue: "",
|
||||||
ordersTabs: [{
|
ordersTabs: [{
|
||||||
@@ -525,9 +527,9 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
goClassLIst(url, id,title){
|
goClassLIst(url){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `${url}?courseId=${this.options.id}&courseTitle=${this.options.navTitle}`,
|
url: `${url}?courseId=${this.options.courseId}&courseTitle=${this.options.navTitle}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
readOnlyChange() {
|
readOnlyChange() {
|
||||||
@@ -788,7 +790,7 @@
|
|||||||
url: '/common/class/getClassByCourseIdNoUser',
|
url: '/common/class/getClassByCourseIdNoUser',
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: {
|
data: {
|
||||||
"courseId": this.options.id,
|
"courseId": this.options.courseId,
|
||||||
"state": "", //小班状态0待开班1已开班2完成
|
"state": "", //小班状态0待开班1已开班2完成
|
||||||
"type": "" // 班类型 0小班 1联合班 2精英班
|
"type": "" // 班类型 0小班 1联合班 2精英班
|
||||||
},
|
},
|
||||||
@@ -797,13 +799,16 @@
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
console.log('获取班级列表',res.result.length,this.options.courseId);
|
||||||
if(res.code == 0){
|
if(res.code == 0){
|
||||||
if(res.result.length > 0){
|
if(res.result.length > 0){
|
||||||
this.isInClass = false
|
this.isInClass = false
|
||||||
}else{
|
}else{
|
||||||
this.isInClass = true
|
this.isInClass = true
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log('获取班级列表++++++',this.isInClass);
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.log('获取班级列表失败',e);
|
console.log('获取班级列表失败',e);
|
||||||
});
|
});
|
||||||
@@ -1021,7 +1026,8 @@
|
|||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
background-color: rgba(255, 255, 255, .6);
|
background-color: rgba(255, 255, 255, .6);
|
||||||
text-align: center;
|
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;}
|
.lockView{display: none;}
|
||||||
.btn {
|
.btn {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -676,7 +676,7 @@
|
|||||||
v.isAudition == 1 && this.userMsg.vip == 0 && this.librayList[this.curIndex].isBuy == 0 ?
|
v.isAudition == 1 && this.userMsg.vip == 0 && this.librayList[this.curIndex].isBuy == 0 ?
|
||||||
noRecored = true : ''
|
noRecored = true : ''
|
||||||
uni.navigateTo({
|
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 {
|
} else {
|
||||||
this.$commonJS.showToast("请先购买课程");
|
this.$commonJS.showToast("请先购买课程");
|
||||||
|
|||||||
@@ -252,6 +252,7 @@
|
|||||||
style: "color:#fff;font-size:28rpx"
|
style: "color:#fff;font-size:28rpx"
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
roleObj:{},
|
||||||
infoShow: false, // 显示电子书相关
|
infoShow: false, // 显示电子书相关
|
||||||
showEbook: false, // 显示电子书相关
|
showEbook: false, // 显示电子书相关
|
||||||
userMes: {},
|
userMes: {},
|
||||||
@@ -323,6 +324,7 @@
|
|||||||
onShow() {
|
onShow() {
|
||||||
// console.log(this.userInfo, "11111111111111");
|
// console.log(this.userInfo, "11111111111111");
|
||||||
this.getData();
|
this.getData();
|
||||||
|
this.getUserRole()
|
||||||
// 隐藏原生的tabbar
|
// 隐藏原生的tabbar
|
||||||
// uni.hideTabBar();
|
// uni.hideTabBar();
|
||||||
},
|
},
|
||||||
@@ -424,80 +426,91 @@
|
|||||||
url: url,
|
url: url,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 获取用户的角色信息
|
||||||
|
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 == '主任教学'
|
||||||
|
})
|
||||||
|
if (zhurenIndex > -1) {
|
||||||
|
this.pageList.splice(zhurenIndex, 1)
|
||||||
|
}
|
||||||
|
var banzhangIndex = this.pageList.findIndex(item => {
|
||||||
|
return item.name == '班级管理'
|
||||||
|
})
|
||||||
|
if (banzhangIndex > -1) {
|
||||||
|
this.pageList.splice(banzhangIndex, 1)
|
||||||
|
}
|
||||||
|
var yonghuIndex = this.pageList.findIndex(item => {
|
||||||
|
return item.name == '我的班级'
|
||||||
|
})
|
||||||
|
if (yonghuIndex > -1) {
|
||||||
|
this.pageList.splice(yonghuIndex, 1)
|
||||||
|
}
|
||||||
|
if (this.roleObj.isDirector) {
|
||||||
|
var n = this.pageList.find(item => {
|
||||||
|
return item.name == '主任教学'
|
||||||
|
})
|
||||||
|
console.log('主任找到了么', n);
|
||||||
|
if (!n) {
|
||||||
|
// this.directorShow = true : this.directorShow = false
|
||||||
|
var item = {
|
||||||
|
// { // 主任之外的人显示班级管理
|
||||||
|
name: "主任教学",
|
||||||
|
url: "/pages/miniClass/DirectorModalList?type=mine",
|
||||||
|
type: "pageJump",
|
||||||
|
// },
|
||||||
|
}
|
||||||
|
this.pageList.splice(3, 0, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 是班长
|
||||||
|
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",
|
||||||
|
|
||||||
|
}
|
||||||
|
this.pageList.splice(3, 0, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 是学员
|
||||||
|
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",
|
||||||
|
|
||||||
|
}
|
||||||
|
this.pageList.splice(3, 0, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch(e => {
|
||||||
|
console.log('获取角色信息失败');
|
||||||
|
})
|
||||||
|
},
|
||||||
getData() {
|
getData() {
|
||||||
// 获取个人信息
|
// 获取个人信息
|
||||||
if (this.userInfo.id != undefined) {
|
if (this.userInfo.id != undefined) {
|
||||||
this.$http.post("common/user/getUserInfo").then((res) => {
|
this.$http.post("common/user/getUserInfo").then((res) => {
|
||||||
this.userMes = res.result;
|
this.userMes = res.result;
|
||||||
var zhurenIndex = this.pageList.findIndex(item => {
|
|
||||||
return item.name == '主任教学'
|
|
||||||
})
|
|
||||||
if (zhurenIndex > -1) {
|
|
||||||
this.pageList.splice(zhurenIndex, 1)
|
|
||||||
}
|
|
||||||
var banzhangIndex = this.pageList.findIndex(item => {
|
|
||||||
return item.name == '班级管理'
|
|
||||||
})
|
|
||||||
if (banzhangIndex > -1) {
|
|
||||||
this.pageList.splice(banzhangIndex, 1)
|
|
||||||
}
|
|
||||||
var yonghuIndex = this.pageList.findIndex(item => {
|
|
||||||
return item.name == '我的班级'
|
|
||||||
})
|
|
||||||
if (yonghuIndex > -1) {
|
|
||||||
this.pageList.splice(yonghuIndex, 1)
|
|
||||||
}
|
|
||||||
if (res.isDirector) {
|
|
||||||
var n = this.pageList.find(item => {
|
|
||||||
return item.name == '主任教学'
|
|
||||||
})
|
|
||||||
console.log('主任找到了么', n);
|
|
||||||
if (!n) {
|
|
||||||
// this.directorShow = true : this.directorShow = false
|
|
||||||
var item = {
|
|
||||||
// { // 主任之外的人显示班级管理
|
|
||||||
name: "主任教学",
|
|
||||||
url: "/pages/miniClass/miniClassMan?type=mine",
|
|
||||||
type: "pageJump",
|
|
||||||
// },
|
|
||||||
}
|
|
||||||
this.pageList.splice(3, 0, item);
|
|
||||||
}
|
|
||||||
} else{
|
|
||||||
if (res.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",
|
|
||||||
|
|
||||||
}
|
|
||||||
this.pageList.splice(3, 0, item);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(!res.isMonitor && !res.isDirector){
|
|
||||||
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",
|
|
||||||
|
|
||||||
}
|
|
||||||
this.pageList.splice(3, 0, item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
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="888">
|
||||||
<view class="newBox" v-if="preClassList.length > 0">
|
<view class="newBox" v-if="preClassList.length > 0">
|
||||||
<view class="item flexbox" v-for="(item, index) in preClassList" :key="index"
|
<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" :style="{backgroundImage:surl(item.image)}"> -->
|
||||||
<view class="imgcontainer" v-if="item.icon != ''">
|
<view class="imgcontainer" v-if="item.icon != ''">
|
||||||
<image :src="item.icon" mode="aspectFit"></image>
|
<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 == 0">【普通班】</text>
|
||||||
<text v-show="item.classModel.type == 1">【联合班】</text>
|
<text v-show="item.classModel.type == 1">【联合班】</text>
|
||||||
<text v-show="item.classModel.type == 2">【精英班】</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}}
|
{{item.title}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
<view class="learnBox box">
|
<view class="learnBox box">
|
||||||
<view class="newBox" v-if="learningClassList.length > 0">
|
<view class="newBox" v-if="learningClassList.length > 0">
|
||||||
<view class="item flexbox" v-for="(item, index) in learningClassList" :key="index"
|
<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" :style="{backgroundImage:surl(item.image)}"> -->
|
||||||
<view class="imgcontainer" v-if="item.icon != ''">
|
<view class="imgcontainer" v-if="item.icon != ''">
|
||||||
<image :src="item.icon" mode="aspectFit"></image>
|
<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 == 0">【普通班】</text>
|
||||||
<text v-show="item.classModel.type == 1">【联合班】</text>
|
<text v-show="item.classModel.type == 1">【联合班】</text>
|
||||||
<text v-show="item.classModel.type == 2">【精英班】</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}}
|
{{item.title}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
<view class="learnBox box">
|
<view class="learnBox box">
|
||||||
<view class="newBox" v-if="classList.length > 0">
|
<view class="newBox" v-if="classList.length > 0">
|
||||||
<view class="item flexbox" v-for="(item, index) in classList" :key="index"
|
<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" :style="{backgroundImage:surl(item.image)}"> -->
|
||||||
<view class="imgcontainer" v-if="item.icon != ''">
|
<view class="imgcontainer" v-if="item.icon != ''">
|
||||||
<image :src="item.icon" mode="aspectFit"></image>
|
<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 == 0">【普通班】</text>
|
||||||
<text v-show="item.classModel.type == 1">【联合班】</text>
|
<text v-show="item.classModel.type == 1">【联合班】</text>
|
||||||
<text v-show="item.classModel.type == 2">【精英班】</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}}
|
{{item.title}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -256,8 +256,8 @@
|
|||||||
console.log('下拉刷新')
|
console.log('下拉刷新')
|
||||||
// this.status = 3
|
// this.status = 3
|
||||||
// this.page = 1
|
// this.page = 1
|
||||||
this.classList = []
|
// this.classList = []
|
||||||
this.getData()
|
// this.getData()
|
||||||
uni.stopPullDownRefresh()
|
uni.stopPullDownRefresh()
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
@@ -271,10 +271,13 @@
|
|||||||
...mapState(['userInfo'])
|
...mapState(['userInfo'])
|
||||||
},
|
},
|
||||||
//页面显示
|
//页面显示
|
||||||
onShow() {
|
async onShow() {
|
||||||
// 隐藏原生的tabbar
|
// 隐藏原生的tabbar
|
||||||
// uni.hideTabBar();
|
// 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: {
|
components: {
|
||||||
musicPlay
|
musicPlay
|
||||||
@@ -303,6 +306,7 @@
|
|||||||
url: "common/class/MyClassList",
|
url: "common/class/MyClassList",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data: {
|
data: {
|
||||||
|
"role": "1",
|
||||||
"state": '0', //小班状态0待开班1已开班2完成
|
"state": '0', //小班状态0待开班1已开班2完成
|
||||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||||
},
|
},
|
||||||
@@ -341,6 +345,7 @@
|
|||||||
url: "common/class/MyClassList",
|
url: "common/class/MyClassList",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data: {
|
data: {
|
||||||
|
"role": "1",
|
||||||
"state": '1', //小班状态0待开班1已开班2完成
|
"state": '1', //小班状态0待开班1已开班2完成
|
||||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||||
},
|
},
|
||||||
@@ -399,22 +404,23 @@
|
|||||||
// this.page = 1
|
// this.page = 1
|
||||||
// this.getData(this.subTabId);
|
// this.getData(this.subTabId);
|
||||||
},
|
},
|
||||||
getData(id) {
|
async getData(role,state) {
|
||||||
if (!this.flag) {
|
// if (!this.flag) {
|
||||||
console.log('正在执行,未完成')
|
// console.log('正在执行,未完成')
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
var _list = []
|
||||||
this.status = 1
|
this.status = 1
|
||||||
this.flag = false
|
// this.flag = false
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在加载'
|
title: '正在加载'
|
||||||
})
|
})
|
||||||
$http.request({
|
await $http.request({
|
||||||
url: "common/class/MyClassList",
|
url: "common/class/MyClassList",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data: {
|
data: {
|
||||||
"state": '2', //小班状态0待开班1已开班2完成
|
"role": role,
|
||||||
|
"state": state, //小班状态0待开班1已开班2完成
|
||||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||||
},
|
},
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
@@ -424,17 +430,19 @@
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.result.length > 0) {
|
if (res.result.length > 0) {
|
||||||
this.classList = res.result
|
// this.classList = res.result
|
||||||
|
_list = res.result
|
||||||
} else {
|
} else {
|
||||||
this.classList = []
|
// this.classList = []
|
||||||
|
_list = []
|
||||||
}
|
}
|
||||||
this.flag = true
|
// this.flag = true
|
||||||
}
|
}
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
|
_list = []
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
this.flag = true
|
// this.flag = true
|
||||||
console.log(e, '数据报错')
|
console.log(e, '数据报错')
|
||||||
// this.status = 3
|
// this.status = 3
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -442,15 +450,49 @@
|
|||||||
icon: 'error'
|
icon: 'error'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
return _list
|
||||||
},
|
},
|
||||||
// 跳转
|
// 跳转
|
||||||
onPageJump(url, id, have) {
|
async onPageJump(url, id, have) {
|
||||||
// console.log('进来了',url,id);
|
var isStudent = await this.getRealRole(id)
|
||||||
uni.navigateTo({
|
console.log('isStudent',isStudent);
|
||||||
url: `${url}?id=${id}&have=${have}`
|
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) {
|
shuomingPage(url, id, pid) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `${url}?id=${id}&pid=${pid}`
|
url: `${url}?id=${id}&pid=${pid}`
|
||||||
|
|||||||
@@ -145,7 +145,7 @@
|
|||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
console.log('收到的值', e);
|
console.log('收到的值', e);
|
||||||
// this.pageType = e.type
|
// this.pageType = e.type
|
||||||
// this.form.type = e.type
|
this.form.type = e.type
|
||||||
// this.modeType = e.type
|
// this.modeType = e.type
|
||||||
|
|
||||||
if(e.id){
|
if(e.id){
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<view class="pingfenBox" >
|
<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="flex_box">
|
||||||
<view class="item setBanewei" v-if="thisClass.state != '2'"
|
<view class="item setBanewei" v-if="thisClass.state != '2'"
|
||||||
@click="goSetAdmin('/pages/miniClass/memberSet')">
|
@click="goSetAdmin('/pages/miniClass/memberSet')">
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<text>心得</text>
|
<text>心得</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="item" @click="goXindeList('/pages/miniClass/xindeList')">
|
<view class="item" @click="goSikaoList('/pages/miniClass/sikaoQuestionList', thisClass.id)">
|
||||||
<view class="img">
|
<view class="img">
|
||||||
<image src="../../static/icon/sikaoti.png" mode="widthFix"></image>
|
<image src="../../static/icon/sikaoti.png" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -429,6 +429,11 @@
|
|||||||
url: `${url}?classId=${classId}&type=${type}&roleCode=${this.roleCode}`
|
url: `${url}?classId=${classId}&type=${type}&roleCode=${this.roleCode}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
goSikaoList(url,id){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:`${url}?classId=${id}&roleCode=${this.roleCode}`
|
||||||
|
})
|
||||||
|
},
|
||||||
// 点击作业或者医案,进入详细介绍
|
// 点击作业或者医案,进入详细介绍
|
||||||
clickTask() {
|
clickTask() {
|
||||||
|
|
||||||
|
|||||||
@@ -209,23 +209,10 @@
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.classEntityList.length > 0) {
|
if (res.classEntityList.length > 0) {
|
||||||
this.courseList = res.classEntityList
|
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{
|
}else{
|
||||||
this.courseList = []
|
this.courseList = []
|
||||||
}
|
}
|
||||||
// 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()
|
||||||
@@ -241,13 +228,45 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 跳转
|
// 跳转
|
||||||
onPageJump(url,id) {
|
async onPageJump(url,id) {
|
||||||
// console.log('进来了',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({
|
uni.navigateTo({
|
||||||
url: `${url}?id=${id}`
|
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){
|
shuomingPage(url,id,pid){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `${url}?id=${id}&pid=${pid}`
|
url: `${url}?id=${id}&pid=${pid}`
|
||||||
|
|||||||
@@ -2,69 +2,151 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- 公共组件-每个页面必须引入 -->
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
<public-module></public-module>
|
<public-module></public-module>
|
||||||
<z-nav-bar title="班级教学">
|
<z-nav-bar title="主任班级管理"></z-nav-bar>
|
||||||
<!-- <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="classNewBtn" >
|
||||||
<view class="box88 flex_box">
|
<view class="box88 flex_box">
|
||||||
<view class="" style="width: 60%; text-align: center;">
|
<view class="" style="width: 60%; text-align: center;">
|
||||||
<button type="primary" @click="goAddClasss">新开一个班级</button>
|
<button type="primary" @click="goAddClasss">新开一个班级</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="modelName">
|
||||||
<view class="tabsBox" :class="[fixed ? 'fixed' : '' ]">
|
当前模型名称:{{modelTitle}}
|
||||||
|
</view>
|
||||||
|
<!-- <view class="tabsBox" :class="[fixed ? 'fixed' : '' ]">
|
||||||
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="fatherClick" :current="curTagId"
|
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="fatherClick" :current="curTagId"
|
||||||
:activeStyle="activeStyle" :scrollable="scrollable" :list="tabList"
|
:activeStyle="activeStyle" :scrollable="scrollable" :list="tabList"
|
||||||
itemStyle="padding-left: 15px; background-color:#fff; padding-right: 15px; height: 50px;"></u-tabs>
|
itemStyle="padding-left: 15px; background-color:#fff; padding-right: 15px; height: 50px;"></u-tabs>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="containerBg">
|
<view class="containerBg">
|
||||||
<view class="subCate flex" v-if="subList.length> 0">
|
<view class="subCate flex" v-if="subList1.length> 0">
|
||||||
<text :class="['item',subTabId == item.id ? 'active' : '']" v-for="(item, index) in subList"
|
<text :class="['item',subTabId == item.id ? 'active' : '']" v-for="(item, index) in subList1"
|
||||||
@click="curseClick(item)" :key="index">{{item.title}}</text>
|
@click="curseClick(item)" :key="index">{{item.title}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="learnBox box">
|
<view class="" v-show="subTabId == 0">
|
||||||
<view class="newBox" v-if="classList.length > 0">
|
<view class="" v-if="preClassList.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)}"> -->
|
<uni-section class="mb-10 nobg" title="待开班" type="line"></uni-section>
|
||||||
<view class="imgcontainer" v-if="item.icon != ''">
|
<view class="888">
|
||||||
<image :src="item.icon" mode="aspectFit"></image>
|
<view class="newBox" v-if="preClassList.length > 0">
|
||||||
</view>
|
<view class="item flexbox" v-for="(item, index) in preClassList" :key="index"
|
||||||
<view class="imgcontainer defaultImg" v-else>
|
@click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||||
<image src="@/static/my_04.png" mode="aspectFit"></image>
|
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||||
</view>
|
<view class="imgcontainer" v-if="item.icon != ''">
|
||||||
<view class="buyItems">
|
<image :src="item.icon" mode="aspectFit"></image>
|
||||||
<view class="txt555" >
|
</view>
|
||||||
{{item.title}}
|
<view class="imgcontainer defaultImg" v-else>
|
||||||
</view>
|
<image src="@/static/my_04.png" mode="aspectFit"></image>
|
||||||
<view class="jianjie">
|
</view>
|
||||||
目标学员人数:{{item.number}} 人
|
<view class="buyItems">
|
||||||
</view>
|
<view class="">
|
||||||
<!-- <view class="jianjie" v-html="item.content">
|
<!-- <text v-show="item.classModel.type == 0">【普通班】</text>
|
||||||
</view> -->
|
<text v-show="item.classModel.type == 1">【联合班】</text>
|
||||||
<view class="btn_box" >
|
<text v-show="item.classModel.type == 2">【精英班】</text> -->
|
||||||
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
|
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||||
<text class="seeInfo" >进入班级</text>
|
{{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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-divider v-else text="暂无数据"></u-divider>
|
<view class="" v-if="learningClassList.length > 0">
|
||||||
<!-- <u-divider v-show="status == 2" text="已加载全部"></u-divider> -->
|
<uni-section class="mb-10 nobg" title="学习中" type="line"></uni-section>
|
||||||
<!-- <u-divider v-show="status == 3" text="暂无数据"></u-divider> -->
|
<view class="learnBox box">
|
||||||
<!-- <u-divider v-show="status == 1" text="加载中..."></u-divider> -->
|
<view class="newBox" v-if="learningClassList.length > 0">
|
||||||
</view>
|
<view class="item flexbox" v-for="(item, index) in learningClassList" :key="index"
|
||||||
<view>
|
@click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||||
<!-- <u-back-top scroll-top="100"></u-back-top> -->
|
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||||
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle='bgiStyle'
|
<view class="imgcontainer" v-if="item.icon != ''">
|
||||||
:iconStyle="iconStyle"></u-back-top>
|
<image :src="item.icon" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<z-navigation></z-navigation>
|
<view class="imgcontainer defaultImg" v-else>
|
||||||
|
<image src="@/static/my_04.png" mode="aspectFit"></image>
|
||||||
|
</view>
|
||||||
|
<view class="buyItems">
|
||||||
|
<view class="">
|
||||||
|
<!-- <text v-show="item.classModel.type == 0">【普通班】</text>
|
||||||
|
<text v-show="item.classModel.type == 1">【联合班】</text>
|
||||||
|
<text v-show="item.classModel.type == 2">【精英班】</text> -->
|
||||||
|
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||||
|
{{item.title}}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="jianjie">
|
||||||
|
目标学员人数:{{item.number}} 人
|
||||||
|
</view>
|
||||||
|
<!-- <view class="jianjie" v-html="item.content">
|
||||||
|
</view> -->
|
||||||
|
<view class="btn_box">
|
||||||
|
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
|
||||||
|
<text class="seeInfo">进入班级</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-divider v-if="preClassList.length == 0 && learningClassList.length == 0" text="暂无数据"></u-divider>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 过期班级 -->
|
||||||
|
<view class="" v-show="subTabId == 2">
|
||||||
|
<view class="learnBox box">
|
||||||
|
<view class="newBox" v-if="classList.length > 0">
|
||||||
|
<view class="item flexbox" v-for="(item, index) in classList" :key="index"
|
||||||
|
@click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||||
|
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||||
|
<view class="imgcontainer" v-if="item.icon != ''">
|
||||||
|
<image :src="item.icon" mode="aspectFit"></image>
|
||||||
|
</view>
|
||||||
|
<view class="imgcontainer defaultImg" v-else>
|
||||||
|
<image src="@/static/my_04.png" mode="aspectFit"></image>
|
||||||
|
</view>
|
||||||
|
<view class="buyItems">
|
||||||
|
<view class="">
|
||||||
|
<!-- <text v-show="item.classModel.type == 0">【普通班】</text>
|
||||||
|
<text v-show="item.classModel.type == 1">【联合班】</text>
|
||||||
|
<text v-show="item.classModel.type == 2">【精英班】</text> -->
|
||||||
|
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||||
|
{{item.title}}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="jianjie">
|
||||||
|
目标学员人数:{{item.number}} 人
|
||||||
|
</view>
|
||||||
|
<!-- <view class="jianjie" v-html="item.content">
|
||||||
|
</view> -->
|
||||||
|
<view class="btn_box">
|
||||||
|
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
|
||||||
|
<text class="seeInfo">进入班级</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-divider v-else text="暂无数据"></u-divider>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<!-- <u-back-top scroll-top="100"></u-back-top> -->
|
||||||
|
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle='bgiStyle'
|
||||||
|
:iconStyle="iconStyle"></u-back-top>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- <music-play :playData="playData"></music-play> -->
|
|
||||||
</view>
|
</view>
|
||||||
|
<z-navigation></z-navigation>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -79,12 +161,27 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
playData: {},
|
playData: {},
|
||||||
addType:undefined, // 小班类型
|
addType: undefined, // 小班类型
|
||||||
|
range: [{
|
||||||
|
value: '0',
|
||||||
|
text: "普通小班",
|
||||||
|
name: "普通小班"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '1',
|
||||||
|
text: "联合班",
|
||||||
|
name: "普通小班"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '2',
|
||||||
|
text: "精英班",
|
||||||
|
name: "普通小班"
|
||||||
|
},
|
||||||
|
],
|
||||||
tagId: null,
|
tagId: null,
|
||||||
pid:null,
|
pid: null,
|
||||||
fixed: false,
|
fixed: false,
|
||||||
pupShow:false,
|
pupShow: false,
|
||||||
fatherTabId: null,
|
fatherTabId: null,
|
||||||
subTabId: null, //
|
subTabId: null, //
|
||||||
bgiStyle: {
|
bgiStyle: {
|
||||||
@@ -103,33 +200,61 @@
|
|||||||
// backgroundColor: '#258feb'
|
// 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,
|
scrollable: false,
|
||||||
pageTitle: '',
|
pageTitle: '',
|
||||||
tabList: [
|
tabList: [{
|
||||||
{name:'普通小班', id:'0'},{name:'联合班', id:'1'},{name:'精英班',id:'2'}],
|
name: '普通小班',
|
||||||
|
id: '0'
|
||||||
|
}, {
|
||||||
|
name: '联合班',
|
||||||
|
id: '1'
|
||||||
|
}, {
|
||||||
|
name: '精英班',
|
||||||
|
id: '2'
|
||||||
|
}],
|
||||||
curTagId: 0,
|
curTagId: 0,
|
||||||
classList: [],
|
classList: [], // 已结班
|
||||||
|
preClassList: [], // 待开班
|
||||||
|
learningClassList: [], // 在学习的班级
|
||||||
status: 3, // 0 不显示, 1 加载中,2 加载全部完成,3 暂无数据
|
status: 3, // 0 不显示, 1 加载中,2 加载全部完成,3 暂无数据
|
||||||
page: 1,
|
page: 1,
|
||||||
flag: true, // 函数是否执行完
|
flag: true, // 函数是否执行完
|
||||||
userMes: undefined,
|
modelId:undefined,
|
||||||
isMonitor :undefined,
|
modelType:undefined,
|
||||||
isDirector :undefined,
|
modelTitle:undefined,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
//第一次加载
|
//第一次加载
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
// 隐藏原生的tabbar
|
// 隐藏原生的tabbar
|
||||||
uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
|
this.modelId = e.id
|
||||||
|
this.modelType = e.type
|
||||||
|
this.modelTitle = e.title
|
||||||
// this.tagId = e.id
|
// this.tagId = e.id
|
||||||
|
// this.curTagId = this.range[0].value
|
||||||
this.subTabId = this.subList[0].id
|
this.subTabId = this.subList[0].id
|
||||||
this.pageTitle = e.title
|
// this.pageTitle = e.title
|
||||||
this.pid = e.pid
|
// this.pid = e.pid
|
||||||
console.log(e, '传入分类id')
|
console.log(e, '传入分类id')
|
||||||
this.getUserInfo()
|
// this.getData()
|
||||||
|
|
||||||
// this.getCateList(this.tagId)
|
// this.getCateList(this.tagId)
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
@@ -145,8 +270,8 @@
|
|||||||
console.log('下拉刷新')
|
console.log('下拉刷新')
|
||||||
// this.status = 3
|
// this.status = 3
|
||||||
// this.page = 1
|
// this.page = 1
|
||||||
this.classList = []
|
// this.classList = []
|
||||||
this.getData()
|
// this.getData()
|
||||||
uni.stopPullDownRefresh()
|
uni.stopPullDownRefresh()
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
@@ -160,11 +285,13 @@
|
|||||||
...mapState(['userInfo'])
|
...mapState(['userInfo'])
|
||||||
},
|
},
|
||||||
//页面显示
|
//页面显示
|
||||||
onShow() {
|
async onShow() {
|
||||||
// this.addType = undefined
|
|
||||||
this.getData()
|
|
||||||
// 隐藏原生的tabbar
|
// 隐藏原生的tabbar
|
||||||
// uni.hideTabBar();
|
// uni.hideTabBar();
|
||||||
|
this.classList = await this.getData('2')
|
||||||
|
this.learningClassList = await this.getData('1')
|
||||||
|
this.preClassList = await this.getData('0')
|
||||||
|
// this.getLearingClassList()
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
musicPlay
|
musicPlay
|
||||||
@@ -173,38 +300,33 @@
|
|||||||
methods: {
|
methods: {
|
||||||
goAddClasss(){
|
goAddClasss(){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/miniClass/addClass'
|
url:`/pages/miniClass/addClass?type=${this.modelType}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getUserInfo() {
|
selectChange(e) {
|
||||||
// 获取个人信息
|
|
||||||
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);
|
console.log("e:", e);
|
||||||
},
|
},
|
||||||
closePup(){
|
closePup() {
|
||||||
this.pupShow = false
|
this.pupShow = false
|
||||||
},
|
},
|
||||||
surl(imageurl) {
|
surl(imageurl) {
|
||||||
return `url(${imageurl})`
|
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) {
|
fatherClick(e) {
|
||||||
console.log('点击', e)
|
console.log('点击', e)
|
||||||
this.page = 1
|
this.page = 1
|
||||||
@@ -215,27 +337,28 @@
|
|||||||
},
|
},
|
||||||
curseClick(item) {
|
curseClick(item) {
|
||||||
this.subTabId = item.id
|
this.subTabId = item.id
|
||||||
this.classList = []
|
// this.classList = []
|
||||||
this.page = 1
|
// this.page = 1
|
||||||
this.getData(this.subTabId);
|
// this.getData(this.subTabId);
|
||||||
},
|
},
|
||||||
getData(id) {
|
async getData(state) {
|
||||||
// if (!this.flag) {
|
// if (!this.flag) {
|
||||||
// console.log('正在执行,未完成')
|
// console.log('正在执行,未完成')
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
var _list = []
|
||||||
this.status = 1
|
this.status = 1
|
||||||
this.flag = false
|
// this.flag = false
|
||||||
// uni.showLoading({
|
uni.showLoading({
|
||||||
// title:'正在加载'
|
title: '正在加载'
|
||||||
// })
|
})
|
||||||
$http.request({
|
await $http.request({
|
||||||
url: "common/class/getClassByDirectorid",
|
url: "common/class/getClassByDirectorid",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data: {
|
data: {
|
||||||
"state": this.subTabId, //小班状态0待开班1已开班2完成
|
"modelId": this.modelId,
|
||||||
"type": this.curTagId // 班类型 0小班 1联合班 2精英班
|
"state": state, //小班状态0待开班1已开班2完成
|
||||||
|
"type": "" // 班类型 0小班 1联合班 2精英班
|
||||||
},
|
},
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@@ -244,47 +367,70 @@
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.classEntityList.length > 0) {
|
if (res.classEntityList.length > 0) {
|
||||||
this.classList = res.classEntityList
|
// this.classList = res.result
|
||||||
// var list = res.classEntityList
|
_list = res.classEntityList
|
||||||
// this.classList = this.classList.concat(list)
|
} else {
|
||||||
// if (res.courses.pages > this.page) {
|
// this.classList = []
|
||||||
// this.status = 0
|
_list = []
|
||||||
// } else {
|
|
||||||
// this.status = 2
|
|
||||||
// }
|
|
||||||
}else{
|
|
||||||
this.classList = []
|
|
||||||
}
|
}
|
||||||
// else if (this.page > 1) {
|
// this.flag = true
|
||||||
// this.status = 2 // 加载完成
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
// this.status = 3 // 暂无数据
|
|
||||||
// }
|
|
||||||
// console.log('status', this.status)
|
|
||||||
this.flag = true
|
|
||||||
}
|
}
|
||||||
// uni.hideLoading()
|
uni.hideLoading()
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
// uni.hideLoading()
|
_list = []
|
||||||
this.flag = true
|
uni.hideLoading()
|
||||||
|
// this.flag = true
|
||||||
console.log(e, '数据报错')
|
console.log(e, '数据报错')
|
||||||
// this.status = 3
|
// this.status = 3
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:`获取数据失败`,
|
title: `获取数据失败`,
|
||||||
icon:'error'
|
icon: 'error'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
return _list
|
||||||
},
|
},
|
||||||
// 跳转
|
// 跳转
|
||||||
onPageJump(url,id) {
|
async onPageJump(url, id, have) {
|
||||||
// console.log('进来了',url,id);
|
var isStudent = await this.getRealRole(id)
|
||||||
uni.navigateTo({
|
console.log('isStudent',isStudent);
|
||||||
url: `${url}?id=${id}`
|
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
|
||||||
|
|
||||||
shuomingPage(url,id,pid){
|
}else{
|
||||||
|
_isStudent = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return _isStudent
|
||||||
|
},
|
||||||
|
shuomingPage(url, id, pid) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `${url}?id=${id}&pid=${pid}`
|
url: `${url}?id=${id}&pid=${pid}`
|
||||||
});
|
});
|
||||||
@@ -294,31 +440,67 @@
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/style/mixin.scss';
|
@import '@/style/mixin.scss';
|
||||||
/deep/.uni-select__selector{
|
|
||||||
top:unset;
|
/deep/.uni-select__selector {
|
||||||
bottom:calc(100% + 12px) ;
|
top: unset;
|
||||||
|
bottom: calc(100% + 12px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.uni-select {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.uni-select__input-text {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #7f7f7f //修改为你的字体颜色
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.uni-select__input-placeholder {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #7f7f7f //修改为你的字体颜色
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.uni-popper__arrow {
|
||||||
|
top: unset;
|
||||||
|
bottom: -6px;
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.uni-popper__arrow::after {
|
||||||
|
top: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.nobg {
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box6 {
|
||||||
|
.btnBox {
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
/deep/.uni-select{
|
}
|
||||||
border: none;
|
|
||||||
}
|
.containerBg {
|
||||||
/deep/.uni-select__input-text{
|
// background-color: $containerColor;
|
||||||
font-size:14px;
|
background-color: #f6f6f8;
|
||||||
color:#7f7f7f //修改为你的字体颜色
|
padding: 0 20rpx;
|
||||||
}
|
|
||||||
/deep/.uni-select__input-placeholder{
|
}
|
||||||
font-size:14px;
|
|
||||||
color:#7f7f7f //修改为你的字体颜色
|
.curseSet {
|
||||||
}
|
margin-right: 20rpx;
|
||||||
/deep/.uni-popper__arrow{
|
font-size: 28rpx;
|
||||||
top:unset;
|
display: flex;
|
||||||
bottom: -6px;
|
align-items: center;
|
||||||
transform: rotate(180deg);
|
}
|
||||||
}
|
|
||||||
/deep/.uni-popper__arrow::after{
|
.fixed {
|
||||||
top:0
|
position: fixed;
|
||||||
}
|
z-index: 1;
|
||||||
.addType{width: 100%; margin-top: 40rpx;margin-bottom: 40rpx; border: 1px solid #eee;}
|
width: 100%;
|
||||||
.classNewBtn{text-align: center; height:200rpx; padding: 30rpx;
|
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%);
|
background-image: linear-gradient(-60deg, #fdf0ed 0%, #bfe3f0 40%, #e4eefa 60%, #bfe3f0 80%, #fdf0ed 100%);
|
||||||
|
|
||||||
border-radius: 0 0 40rpx 40rpx;
|
border-radius: 0 0 40rpx 40rpx;
|
||||||
@@ -327,21 +509,6 @@
|
|||||||
button{border-radius: 40rpx;}
|
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 {
|
.newBox {
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
@@ -368,21 +535,36 @@
|
|||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.btn_box{ text-align: right;
|
|
||||||
text{
|
.btn_box {
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
text {
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
padding: 3px 5px; @include theme("btn_bg");
|
padding: 3px 5px;
|
||||||
font-size: 28rpx; color: #fff;
|
@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 {
|
.buyItems {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jianjie {
|
.jianjie {
|
||||||
line-height: 30rpx; height: 60rpx; overflow: hidden;
|
line-height: 30rpx;
|
||||||
overflow: hidden!important;
|
height: 60rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow: hidden !important;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
@include bov();
|
@include bov();
|
||||||
@@ -398,16 +580,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.subCate {
|
.subCate {
|
||||||
padding-top:10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
border: 1px solid #bfcad9;
|
border: 1px solid #bfcad9;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 4px; width: 100%;
|
border-radius: 4px;
|
||||||
|
width: 100%;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-right: 16rpx;
|
margin-right: 16rpx;
|
||||||
padding: 14rpx 30rpx;
|
padding: 14rpx 30rpx;
|
||||||
@@ -431,7 +615,7 @@
|
|||||||
.flexbox {
|
.flexbox {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
.modelName{padding: 10rpx 5rpx;}
|
||||||
.imgcontainer {
|
.imgcontainer {
|
||||||
background-color: $imgBg;
|
background-color: $imgBg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,10 +271,13 @@
|
|||||||
...mapState(['userInfo'])
|
...mapState(['userInfo'])
|
||||||
},
|
},
|
||||||
//页面显示
|
//页面显示
|
||||||
onShow() {
|
async onShow() {
|
||||||
// 隐藏原生的tabbar
|
// 隐藏原生的tabbar
|
||||||
// uni.hideTabBar();
|
// 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: {
|
components: {
|
||||||
musicPlay
|
musicPlay
|
||||||
@@ -294,83 +297,7 @@
|
|||||||
surl(imageurl) {
|
surl(imageurl) {
|
||||||
return `url(${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() {
|
goCreateClass() {
|
||||||
console.log('this.addType', this.addType);
|
console.log('this.addType', this.addType);
|
||||||
if (this.addType != undefined) {
|
if (this.addType != undefined) {
|
||||||
@@ -399,22 +326,25 @@ this.getData()
|
|||||||
// this.page = 1
|
// this.page = 1
|
||||||
// this.getData(this.subTabId);
|
// 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.status = 1
|
||||||
this.flag = false
|
// this.flag = false
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在加载'
|
title: '正在加载'
|
||||||
})
|
})
|
||||||
$http.request({
|
await $http.request({
|
||||||
|
|
||||||
url: "common/class/MyClassList",
|
url: "common/class/MyClassList",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data: {
|
data: {
|
||||||
"state": '2', //小班状态0待开班1已开班2完成
|
"role": role,
|
||||||
|
"state": state, //小班状态0待开班1已开班2完成
|
||||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||||
},
|
},
|
||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
@@ -424,17 +354,18 @@ this.getData()
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.result.length > 0) {
|
if (res.result.length > 0) {
|
||||||
this.classList = res.result
|
// this.classList = res.result
|
||||||
|
_list = res.result
|
||||||
} else {
|
} else {
|
||||||
this.classList = []
|
// this.classList = []
|
||||||
|
_list = []
|
||||||
}
|
}
|
||||||
this.flag = true
|
// this.flag = true
|
||||||
}
|
}
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
this.flag = true
|
// this.flag = true
|
||||||
console.log(e, '数据报错')
|
console.log(e, '数据报错')
|
||||||
// this.status = 3
|
// this.status = 3
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -442,6 +373,7 @@ this.getData()
|
|||||||
icon: 'error'
|
icon: 'error'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
return _list
|
||||||
},
|
},
|
||||||
// 跳转
|
// 跳转
|
||||||
onPageJump(url, id, have) {
|
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