Browse Source
- 在 market.js 中新增 signClient 方法获取已签客户列表 - 在 my/index.vue 中添加已签客户数量显示和列表页面跳转 - 新增 signed_client_list.vue 页面实现已签客户列表展示 - 在 pages.json 中添加已签客户列表页面配置项master
4 changed files with 317 additions and 2 deletions
@ -0,0 +1,269 @@ |
|||||
|
<!--已签客户-列表--> |
||||
|
<template> |
||||
|
<view class="main_box"> |
||||
|
<!--自定义导航栏--> |
||||
|
<!-- <view class="navbar_section">--> |
||||
|
<!-- <view class="title">班级详情</view>--> |
||||
|
<!-- </view>--> |
||||
|
|
||||
|
<view class="main_section"> |
||||
|
<!-- 班级成员列表--> |
||||
|
<scroll-view |
||||
|
class="section_4" |
||||
|
scroll-y="true" |
||||
|
:lower-threshold="lowerThreshold" |
||||
|
@scrolltolower="loadMoreData" |
||||
|
style="height: 83vh;" |
||||
|
> |
||||
|
<view class="ul"> |
||||
|
<view class="li" |
||||
|
v-for="(v,k) in tableList" |
||||
|
:key="k" |
||||
|
@click="openViewStudentInfo(v)"> |
||||
|
<view class="left"> |
||||
|
<view class="box_1"> |
||||
|
<image class="pic" |
||||
|
v-if="v.header" :src="$util.img(v.header)"></image> |
||||
|
<image v-else class="pic" src="@/static/images/index/myk.png"></image> |
||||
|
<!-- <view class="tag_box">--> |
||||
|
<!-- 即将到期--> |
||||
|
<!-- </view>--> |
||||
|
</view> |
||||
|
<view class="box_2"> |
||||
|
<view class="name">{{v.name}}</view> |
||||
|
<view class="date">课程截止时间:{{v.end_time}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="right"> |
||||
|
<view class="item"> |
||||
|
<view>{{v.have_study_time}}</view> |
||||
|
<view>已上课时</view> |
||||
|
</view> |
||||
|
<view class="item"> |
||||
|
<view>{{v.end_study_time ? v.end_study_time:0}}</view> |
||||
|
<view>剩余课时</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 底部导航--> |
||||
|
<!-- <AQTabber/>--> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import marketApi from '@/api/market.js'; |
||||
|
import AQTabber from "@/components/AQ/AQTabber.vue" |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
AQTabber, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
loading:false,//加载状态 |
||||
|
lowerThreshold: 100,//距离底部多远触发 |
||||
|
isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载 |
||||
|
|
||||
|
//筛选条件 |
||||
|
filteredData:{ |
||||
|
page:1,//当前页码 |
||||
|
limit:10,//每页返回数据条数 |
||||
|
total:10,//数据总条数 |
||||
|
name: '',//班级名称 |
||||
|
}, |
||||
|
tableList:[],//聊天数据列表 |
||||
|
} |
||||
|
}, |
||||
|
onLoad() { |
||||
|
}, |
||||
|
onShow() { |
||||
|
this.init(); |
||||
|
}, |
||||
|
methods: { |
||||
|
//初始化 |
||||
|
async init(){ |
||||
|
await 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} |
||||
|
|
||||
|
//判断是否还有数据 |
||||
|
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 marketApi.signClient(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++ |
||||
|
}, |
||||
|
|
||||
|
//打开学员详情页 |
||||
|
openViewStudentInfo(item){ |
||||
|
let students_id= item.id |
||||
|
uni.navigateTo({ |
||||
|
url: `/pages/coach/student/info?students_id=${students_id}` |
||||
|
}) |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="less" scoped> |
||||
|
|
||||
|
.main_box{ |
||||
|
background: #292929 ; |
||||
|
} |
||||
|
|
||||
|
//自定义导航栏 |
||||
|
.navbar_section{ |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
background: #292929; |
||||
|
.title{ |
||||
|
padding: 20rpx 0; |
||||
|
font-size: 30rpx; |
||||
|
color: #fff; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.main_section{ |
||||
|
min-height: 95vh; |
||||
|
background: #292929 100%; |
||||
|
padding: 0 24rpx; |
||||
|
padding-top: 40rpx; |
||||
|
padding-bottom: 150rpx; |
||||
|
font-size: 24rpx; |
||||
|
color: #FFFFFF; |
||||
|
//班级成员列表 |
||||
|
.section_4{ |
||||
|
.ul{ |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
gap: 10rpx; |
||||
|
.li{ |
||||
|
padding: 20rpx 0; |
||||
|
padding-bottom: 40rpx; |
||||
|
border-bottom: 2px solid #D7D7D7; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
.left{ |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
gap: 30rpx; |
||||
|
.box_1{ |
||||
|
padding-left: 20rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
position: relative; |
||||
|
.pic{ |
||||
|
width: 84rpx; |
||||
|
height: 84rpx; |
||||
|
border-radius: 50%; |
||||
|
} |
||||
|
.tag_box{ |
||||
|
position: absolute; |
||||
|
bottom: -30rpx; |
||||
|
width: 120rpx; |
||||
|
height: 38rpx; |
||||
|
background-color: #F59A23; |
||||
|
border-radius: 4rpx; |
||||
|
line-height: 35rpx; |
||||
|
text-align: center; |
||||
|
font-size: 20rpx; |
||||
|
} |
||||
|
} |
||||
|
.box_2{ |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
gap: 20rpx; |
||||
|
.name{ |
||||
|
font-size: 28rpx; |
||||
|
} |
||||
|
.date{ |
||||
|
font-size: 24rpx; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.right{ |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
gap: 14rpx; |
||||
|
.item{ |
||||
|
border: 1px solid #00E5BB; |
||||
|
border-radius: 10rpx; |
||||
|
width: 102rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
view{ |
||||
|
text-align: center; |
||||
|
height: 50rpx; |
||||
|
line-height: 50rpx; |
||||
|
} |
||||
|
view:nth-child(1){ |
||||
|
font-size: 32rpx; |
||||
|
background-color: #fff; |
||||
|
color: #00e5bb; |
||||
|
} |
||||
|
view:nth-child(2){ |
||||
|
font-size: 20rpx; |
||||
|
background-color: #00e5bb; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
</style> |
||||
Loading…
Reference in new issue