list.vue
3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<template>
<view>
<uni-segmented-control class="whitebg" :current="current" :values="navs" @clickItem="onClickItem" styleType="text" activeColor="#AD181F"></uni-segmented-control>
<view class="searchbar">
<uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search"
v-model="query.name" placeholder="搜索团队会员名称" @blur="getList" @clear="getList">
</uni-easyinput>
</view>
<view class="vipData">
<view>共 <text>{{ forms?.total }}</text>人</view>
<view>有效会员 <text>{{ forms?.effective }}</text></view>
<view>过期会员 <text>{{ forms?.expired }}</text></view>
<view>即将过期会员 <text>{{ forms?.soon }}</text></view>
</view>
<view class="indexboxre">
<view class="userlist mt30">
<view class="item" v-for="n in infoList" @click="handleInfo(n)">
<view @click="handleInfo(n)">
<view class="name">{{n.name}}<text v-if="n.memCode"> ({{n.memCode}}) </text></view>
<view class="date">到期时间:{{n.validityDate?.slice(0,10)||'--'}}</view>
</view>
<view class="status">
会员 <text class="text-success">{{n.validityMemberCount}}</text>/{{n.allMemberCount}}
</view>
</view>
</view>
<view class="nodata" v-if="infoList.length==0">
<image mode="aspectFit" src="/static/nodata.png"></image>
<text>暂无数据</text>
</view>
</view>
</view>
</template>
<script setup>
import * as api from '@/common/api.js'
import {
ref,
getCurrentInstance
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
const {
proxy
} = getCurrentInstance()
const app = getApp();
const query = ref({
fromList: 1,
dType: 4,
})
const navs = ref(['道馆','三级协会','二级协会','一级协会'])
const list = ref([])
const forms = ref({})
const infoList = ref([])
const total = ref(0)
const current = ref(0)
const currentTabName = ref('道馆')
const userType = ref('')
const deptType = ref('')
onLoad(() => {
userType.value = app.globalData.userType
deptType.value = app.globalData.deptType
// 部门类型 1:中跆协 2:省 3:直属 4:市 5:区 6: 团体
if(deptType.value==2||deptType.value==3){
navs.value = ['道馆','三级协会','二级协会']
} else if(deptType.value==4){
navs.value = ['道馆','三级协会']
}
getList()
getGroupInfo()
})
function getList() {
console.log(current.value,currentTabName.value,query.value.dType)
api.getGroupVipList(query.value).then(res => {
infoList.value = res.rows
total.value = res.total
})
}
function getGroupInfo(){
api.getMemberCountInfo({dType: query.value.dType, fromList: 1}).then(res=>{
forms.value = res
})
}
function onClickItem(e){
current.value = e.currentIndex
currentTabName.value = navs.value[e.currentIndex]
if(currentTabName.value == '道馆'){
query.value.dType = 4
} else if(currentTabName.value == '三级协会'){
query.value.dType = 3
} else if(currentTabName.value == '二级协会'){
query.value.dType = 2
} else if(currentTabName.value == '一级协会'){
query.value.dType = 1
}
getList()
getGroupInfo()
}
function handleInfo(n) {
uni.navigateTo({
url: `/pages/group/detail?deptId=${n.deptId}`
})
}
</script>
<style scoped lang="scss">
.indexboxre {
padding: 0 30rpx;
.tt {
font-size: 30rpx;
margin: 0 0 30rpx;
color: #4C5359;
}
position: relative;
height: calc(100vh - 300rpx);
}
.searchbar {
display: flex;
align-items: center;
padding: 25rpx;
box-sizing: border-box;
:deep(.uni-easyinput .uni-easyinput__content) {
border-radius: 35rpx;
border: none;
height: 70rpx;
}
:deep(.uni-easyinput__content-input) {
font-size: 26rpx;
}
}
</style>