Browse Source

feat(market): 添加已签客户列表功能

- 在 market.js 中新增 signClient 方法获取已签客户列表
- 在 my/index.vue 中添加已签客户数量显示和列表页面跳转
- 新增 signed_client_list.vue 页面实现已签客户列表展示
- 在 pages.json 中添加已签客户列表页面配置项
master
liutong 12 months ago
parent
commit
6d404ae2ff
  1. 9
      api/market.js
  2. 9
      pages.json
  3. 32
      pages/market/my/index.vue
  4. 269
      pages/market/my/signed_client_list.vue

9
api/market.js

@ -117,6 +117,15 @@ export default {
}, },
//已签客户列表
signClient(data = {}) {
let url = '/member/sign_client'
return http.get(url, data).then(res => {
return res;
})
},

9
pages.json

@ -436,6 +436,15 @@
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
} }
}, },
{
"path": "pages/market/my/signed_client_list",
"style": {
"navigationBarTitleText": "已签客户",
"navigationStyle": "default",
"navigationBarBackgroundColor": "#292929",
"navigationBarTextStyle": "white"
}
},
{ {
"path": "pages/market/my/info", "path": "pages/market/my/info",
"style": { "style": {

32
pages/market/my/index.vue

@ -63,8 +63,8 @@
<view class="main_section"> <view class="main_section">
<view class="section_box"> <view class="section_box">
<view class="item"> <view class="item">
<view>已签客户</view> <view @click="openViewSignedClientList()">已签客户</view>
<view>23</view> <view>{{signedClientListCount}}</view>
</view> </view>
<view class="item" @click="openViewFirmInfo()"> <view class="item" @click="openViewFirmInfo()">
@ -119,6 +119,8 @@ export default {
userInfo:{},// userInfo:{},//
//APi //APi
uploadUrl: `${Api_url}/file/image`, uploadUrl: `${Api_url}/file/image`,
signedClientListCount:0,//
} }
}, },
onLoad() { onLoad() {
@ -131,6 +133,24 @@ export default {
// //
async init(){ async init(){
await this.getUserInfo()// await this.getUserInfo()//
await this.getSignedClientListCount()//
},
//
async getSignedClientListCount(){
let data = {
page:1,
limit:1,
}
let res = await marketApi.signClient(data);
if (res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.signedClientListCount = res.data.total
}, },
// //
@ -183,6 +203,14 @@ export default {
}) })
}, },
//-
openViewSignedClientList(){
uni.navigateTo({
url: '/pages/market/my/signed_client_list'
})
},
// //
openViewFirmInfo(){ openViewFirmInfo(){
uni.navigateTo({ uni.navigateTo({

269
pages/market/my/signed_client_list.vue

@ -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…
Cancel
Save