This commit is contained in:
@fawn-nine
2024-08-27 17:10:44 +08:00
parent 4792202081
commit 48a5c3400e
18 changed files with 735 additions and 102 deletions

View File

@@ -78,6 +78,55 @@
</view>
</view>
</view>
<!-- 可加入的班级列表 -->
<view class="" style="padding:0 5px;" v-if="classList.length > 0">
<view class="learnBox" >
<view class="flexbox flex_between">
<view class="titleBox flexbox">
<image src="../../static/class.png" mode="aspectFit"></image>
<text>班级列表</text>
</view>
<view class="moreBtn" @click="onPageJump('/pages/miniClass/allLearningClassList')">
<text>更多班级</text>
</view>
</view>
<view class="classItemBox uni-margin-wrap">
<view class="uni-margin-wrap">
<swiper class="swiper" circular :indicator-dots="false" :autoplay="true" interval="3000"
duration="500">
<swiper-item v-for="(item, index) in classList" :key="index" >
<view class="classItem flex_box" @click="onPageJump('/pages/miniClass/classInfo',item.id)">
<view class="img" style="overflow: hidden;">
<image v-if="item.icon && item.icon != ''" :src="item.icon" mode="aspectFit"></image>
<image v-else src="@/static/my_04.png" mode="widthFix"></image>
</view>
<view class="textBox flex_box">
<view class="">
<view class="className">{{item.title}}</view>
<view class="fuzhu">目标学员人数{{item.number}}</view>
<view class="fuzhu jianjie" v-html="item.content"></view>
</view>
</view>
</view>
</swiper-item>
<!-- <swiper-item v-for="(item, index) in classList" :key="index">
<view class="classItem flex_box" @click="onPageJump('/pages/miniClass/classInfo',item.id)">
<view class="img" style="overflow: hidden;">
<image v-if="item.icon && item.icon != ''" :src="item.icon" mode="aspectFit"></image>
<image v-else src="@/static/my_04.png" mode="widthFix"></image>
</view>
<view class="txt555">
{{item.title}}
</view>
</view>
</swiper-item> -->
</swiper>
</view>
</view>
</view>
</view>
<!-- 健康超市 -->
<view class="supermarketBox" v-if="tjProList.length > 0">
<view class="hightLightTitleBox " @click="onPageJump('/pages/course/healthMarket',2,'健康超市')">
@@ -289,6 +338,7 @@
sbuMedicalTagsList: [],
newsList: [], // 播报新闻列表
weburl: '',
classList : [],
// webviewStyles: {
// progress: true,
// width: '100%',
@@ -307,13 +357,17 @@
this.page = 1
},
//页面显示
onShow() {
async onShow() {
uni.hideTabBar();
// #ifdef APP-PLUS
plus.screen.unlockOrientation();
plus.screen.lockOrientation("portrait-primary");
// #endif
this.requestAll()
this.classList = await this.getClassNoUser()
if(this.classList.length > 6){
this.classList = this.classList.slice(0,6)
}
},
onTabItemTap() {
@@ -357,6 +411,29 @@
//方法
methods: {
...mapMutations(['setUserInfo']),
// 查询可加入的小班
async getClassNoUser(){
var _list = []
await $http.request({
url: "common/class/getClassNoUser",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async res => {
if (res.code == 0) {
if (res.result.length > 0) {
_list = res.result
}
}
}).catch(e => {
console.log(e, '获取医学班级列表错误')
});
return _list
},
goGoodsDetail(v,isMiaosha) {
console.log(v);
uni.navigateTo({
@@ -1000,7 +1077,9 @@
font-weight: bold;
}
}
.moreBtn{
color: $themeColor; font-size: 26rpx;
}
.learnBox {
background-color: #fff;
margin-top: 10px;
@@ -1505,4 +1584,19 @@
.imgcontainer {
background-color: $imgBg;
}
.classItemBox{margin-top: 20rpx; height: 250rpx;
swiper-item{ padding: 10rpx; width: 90% !important;
.wid90{width: 90% !important;}
.classItem{border: 1px solid #eee; border-radius: 10rpx; padding: 10rpx;}
padding-right:20rpx ; box-sizing:border-box}
}
.classItem{
.className{font-weight: bold; font-size: 32rpx;}
.textBox{margin-left: 20rpx; flex: 1; align-items: center;}
.img{width: 200rpx; height: 200rpx; overflow: hidden;
imgage{
width: 100%; height: 100%;
}}
}
</style>