This commit is contained in:
@fawn-nine
2024-07-30 10:47:38 +08:00
parent 2bb271eee7
commit c8b306343a

View File

@@ -6,6 +6,15 @@
<!-- <view class="curseSet" slot="right" @click="shuomingPage('/pages/course/courseSet',tagId,pid)"> --> <!-- <view class="curseSet" slot="right" @click="shuomingPage('/pages/course/courseSet',tagId,pid)"> -->
<!-- <uni-icons type="info" size="24"></uni-icons> 课程说明</view> --> <!-- <uni-icons type="info" size="24"></uni-icons> 课程说明</view> -->
</z-nav-bar> </z-nav-bar>
<view class="classNewBtn">
<view class="box88 flex_box">
<view class="" style="width: 60%; text-align: center;">
<button type="primary" @click="pupShow = true">新开一个班级</button>
</view>
</view>
</view>
<view class="tabsBox" :class="[fixed ? 'fixed' : '' ]"> <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"
@@ -16,20 +25,7 @@
<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 subList"
@click="curseClick(item)" :key="index">{{item.title}}</text> @click="curseClick(item)" :key="index">{{item.title}}</text>
</view> </view>
<view class="learnBox box"> <view class="learnBox box">
<!-- <view class="learn flexbox shiting">
<view class="item" v-for="(item, index) in courseList" :key="index">
<view class="imgcontainer">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="buyItems flexbox">
<view class="txt555">
{{item.title}}
</view>
</view>
</view>
</view> -->
<view class="newBox"> <view class="newBox">
<view class="item flexbox" v-for="(item, index) in courseList" :key="index" @click="onPageJump('/pages/course/courseDetail',item.id)"> <view class="item flexbox" v-for="(item, index) in courseList" :key="index" @click="onPageJump('/pages/course/courseDetail',item.id)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> --> <!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
@@ -66,6 +62,23 @@
</view> </view>
<public-module></public-module> <public-module></public-module>
<z-navigation></z-navigation> <z-navigation></z-navigation>
<u-popup v-if="pupShow" key="1" :show="pupShow" :round="10" @close="closePup">
<view style="padding: 40rpx;" class="flex_box box6">
<view class="" style="width: 100%; text-align: center;">
<text>请选择您要创建的班级类型</text>
<uni-data-select
class="addType"
v-model="addType"
:localdata="range"
@change="selectChange"
placement="top"
></uni-data-select>
<view class="btnBox flex_box" style="text-align: center; width: 100%;">
<button size="" style="width: 40%;" type="primary" @click="goCreateClass">确定</button>
</view>
</view>
</view>
</u-popup>
<!-- <music-play :playData="playData"></music-play> --> <!-- <music-play :playData="playData"></music-play> -->
</view> </view>
</view> </view>
@@ -82,9 +95,16 @@
data() { data() {
return { return {
playData: {}, playData: {},
addType:undefined, // 小班类型
range:[
{ value: 0, text: "普通小班" },
{ value: 1, text: "联合班" },
{ value: 2, text: "精英班" },
],
tagId: null, tagId: null,
pid:null, pid:null,
fixed: false, fixed: false,
pupShow:false,
fatherTabId: null, fatherTabId: null,
subTabId: null, // subTabId: null, //
bgiStyle: { bgiStyle: {
@@ -164,84 +184,64 @@
}, },
//方法 //方法
methods: { methods: {
selectChange(e){
console.log("e:", e);
},
closePup(){
this.pupShow = false
},
surl(imageurl) { surl(imageurl) {
return `url(${imageurl})` return `url(${imageurl})`
}, },
getCateList(id) { goCreateClass(){
$http.request({ if(this.addType){
url: "medical/home/getChildCourseMedicalTree",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档 }else{
data: { uni.showToast({
"id": id, title:'请选择班级的类型',
}, icon:'none'
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}) })
.then(res => { return
if (res.code == 0) { }
if (res.labels.length > 0) { },
var list = [] getCateList(id) {
res.labels.forEach(item => { this.subTabId = this.subList[0].id
item.name = item.title this.getData(id)
}) // $http.request({
this.tabList = res.labels // url: "medical/home/getChildCourseMedicalTree",
// this.fatherTabId = this.tabList[0].id // method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
// if (this.tabList[0].isLast == 1) { // 终极 // data: {
// this.subList = [] // "id": id,
// this.subTabId = this.tabList[0].id // },
// } else { //非终极 // header: { //默认 无 说明:请求头
// if (this.tabList[0].children.length > 0) { // 'Content-Type': 'application/json'
// this.subList = this.tabList[0].children // },
// this.subTabId = this.subList[0].id // })
// .then(res => {
// } else { // if (res.code == 0) {
// this.subList = [] // if (res.labels.length > 0) {
// this.subTabId = null // var list = []
// } // res.labels.forEach(item => {
// } // item.name = item.title
// if (this.subTabId) { // })
// // console.log(this.subTabId, this.subList[0].title, '初始进入') // this.tabList = res.labels
// this.courseList = [] // }else{
// this.status = 1 // // this.subList = []
// this.getData(this.subTabId) // this.subTabId = id
// } // this.getData(id)
// }
// console.log(this.curTagId, '当前高亮')
}else{ // }
// this.subList = [] // }).catch(e => {
this.subTabId = id // console.log(e, '获取子分类报错')
this.getData(id) // });
}
console.log(this.curTagId, '当前高亮')
}
}).catch(e => {
console.log(e, '获取子分类报错')
});
}, },
fatherClick(e) { fatherClick(e) {
// console.log(e, '点击') // console.log(e, '点击')
this.page = 1 this.page = 1
var item = e var item = e
this.subTabId = this.subList[0].id this.subTabId = this.subList[0].id
// if (item.isLast == 1) { // 终极 this.getData(this.subTabId);
// this.subList = []
// this.subTabId = item.id
// } else {
// if (item.children.length > 0) { // 非终极
// this.subList = item.children
// this.subTabId = item.children[0].id
// } else {
// this.subList = []
// this.subTabId = null
// }
// }
// if (this.subTabId) {
// this.status = 1
// this.courseList = []
this.getData(this.subTabId);
// }
}, },
curseClick(item) { curseClick(item) {
this.subTabId = item.id this.subTabId = item.id
@@ -315,9 +315,42 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/style/mixin.scss'; @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: 300rpx; padding: 30rpx; background-color: $themeColor; margin-bottom: 80rpx;
border-radius: 0 0 40rpx 40rpx;
.box88{background-color: #fff; border-radius: 40rpx; height: 300rpx; justify-content: center; align-items: center; box-shadow: 0 10rpx 8rpx #eee;
button{border-radius: 40rpx;}
}
}
.box6{
.btnBox{justify-content: center;}
}
.containerBg { .containerBg {
background-color: $containerColor; // background-color: $containerColor;
background-color: #f6f6f8;
padding: 0 20rpx; padding: 0 20rpx;
} }