|
|
|
@ -12,59 +12,43 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="section_2"> |
|
|
|
<view class="ul"> |
|
|
|
<view class="li" @click="openViewClassInfo({id:1})"> |
|
|
|
<scroll-view |
|
|
|
class="ul" |
|
|
|
scroll-y="true" |
|
|
|
:lower-threshold="lowerThreshold" |
|
|
|
@scrolltolower="loadMoreData" |
|
|
|
style="height: 80vh;" |
|
|
|
> |
|
|
|
<view |
|
|
|
class="li" |
|
|
|
v-for="(v,k) in tableList" |
|
|
|
:key="k" |
|
|
|
@click="openViewClassInfo(v)" |
|
|
|
> |
|
|
|
<view class="left"> |
|
|
|
<!-- <image class="pic" src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image>--> |
|
|
|
<!-- <image class="pic" src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image>--> |
|
|
|
</view> |
|
|
|
<view class="right"> |
|
|
|
<view class="box_1"> |
|
|
|
<view class="name"> |
|
|
|
少年班 |
|
|
|
{{v.name}} |
|
|
|
</view> |
|
|
|
<view class="btn_box"> |
|
|
|
<view>2人即将到期</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="box_2"> |
|
|
|
<view class="user_list"> |
|
|
|
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
|
|
|
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
|
|
|
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
|
|
|
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
|
|
|
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
|
|
|
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
|
|
|
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
|
|
|
</view> |
|
|
|
<view class="num">34</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="li" @click="openViewClassInfo({id:3})"> |
|
|
|
<view class="left"> |
|
|
|
<!-- <image class="pic" src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image>--> |
|
|
|
</view> |
|
|
|
<view class="right"> |
|
|
|
<view class="box_1"> |
|
|
|
<view class="name"> |
|
|
|
少年班 |
|
|
|
</view> |
|
|
|
<view class="btn_box"> |
|
|
|
<!-- <view>2人即将到期</view>--> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="box_2"> |
|
|
|
<view class="user_list"> |
|
|
|
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
|
|
|
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
|
|
|
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
|
|
|
</view> |
|
|
|
<view class="num">34</view> |
|
|
|
<view class="user_list" v-for="(v2,k2) in v.students_list" :key="k2"> |
|
|
|
<image |
|
|
|
:src="$util.img(v2.header)"></image> |
|
|
|
</view> |
|
|
|
<view class="num">{{v.students_count}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 底部导航--> |
|
|
|
@ -73,7 +57,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
// import user from '@/api/user.js'; |
|
|
|
import memberApi from '@/api/member.js'; |
|
|
|
import AQTabber from "@/components/AQ/AQTabber.vue" |
|
|
|
|
|
|
|
|
|
|
|
@ -83,12 +67,86 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
formData:{}, |
|
|
|
loading:false,//加载状态 |
|
|
|
lowerThreshold: 100,//距离底部多远触发 |
|
|
|
isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载 |
|
|
|
|
|
|
|
//筛选条件 |
|
|
|
filteredData:{ |
|
|
|
page:1,//当前页码 |
|
|
|
limit:10,//每页返回数据条数 |
|
|
|
total:10,//数据总条数 |
|
|
|
name: '',//班级名称 |
|
|
|
}, |
|
|
|
tableList:[],//聊天数据列表 |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
onLoad(options) {}, |
|
|
|
onShow(){ |
|
|
|
this.init()//初始化 |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//初始化 |
|
|
|
async init(){ |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
|
|
|
|
//加载更多(下一页) |
|
|
|
loadMoreData() { |
|
|
|
//判断是否加载 |
|
|
|
if (!this.isReachedBottom) { |
|
|
|
this.isReachedBottom = true;//设置为不可请求状态 |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}, |
|
|
|
//重置为第一页 |
|
|
|
async resetFilteredData() { |
|
|
|
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 |
|
|
|
|
|
|
|
this.filteredData.page = 1//当前页码 |
|
|
|
this.filteredData.limit = 10//每页返回数据条数 |
|
|
|
this.filteredData.total = 10//数据总条数 |
|
|
|
}, |
|
|
|
//获取列表 |
|
|
|
async getList(){ |
|
|
|
this.loading = true |
|
|
|
|
|
|
|
let data = {...this.filteredData} |
|
|
|
|
|
|
|
console.log(111,(this.filteredData.page * this.filteredData.limit) ,(this.filteredData.total)) |
|
|
|
|
|
|
|
//判断是否还有数据 |
|
|
|
if(this.filteredData.page * this.filteredData.limit > this.filteredData.total){ |
|
|
|
this.loading = false |
|
|
|
uni.showToast({ |
|
|
|
title: '暂无更多', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if(data.page == 1){ |
|
|
|
this.tableList = [] |
|
|
|
} |
|
|
|
|
|
|
|
let res = await memberApi.jlClassList(data) |
|
|
|
this.loading = false |
|
|
|
this.isReachedBottom = false; |
|
|
|
if (res.code != 1){ |
|
|
|
uni.showToast({ |
|
|
|
title: res.msg, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.tableList = this.tableList.concat(res.data.data); // 使用 concat 方法 将新数据追加到数组中 |
|
|
|
|
|
|
|
console.log('列表',this.tableList) |
|
|
|
this.filteredData.total = res.data.total |
|
|
|
this.filteredData.page++ |
|
|
|
}, |
|
|
|
|
|
|
|
//打开班级详情页 |
|
|
|
openViewClassInfo(item){ |
|
|
|
uni.navigateTo({ |
|
|
|
@ -157,8 +215,9 @@ export default { |
|
|
|
.ul{ |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
gap: 24rpx; |
|
|
|
//gap: 24rpx; |
|
|
|
.li{ |
|
|
|
margin-bottom: 24rpx; |
|
|
|
background: #404045; |
|
|
|
padding: 50rpx 36rpx 46rpx; |
|
|
|
border-radius: 16rpx; |
|
|
|
|