list.vue
5.38 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<template>
<view>
<z-paging ref="paging" v-model="infoList" @query="getQuery" emptyViewImg="/static/nodata.png">
<view :slot="top">
<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>
<view class="indexboxre">
<view class="userlist mt30">
<view class="item" v-for="n in infoList" :key="n.memId">
<view @click="godetail(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" style="top: 10rpx;" @click="handleInfo(n)">
<text class="text-success" v-if="n.valiStr=='正常'">{{n.valiStr}}</text>
<text class="text-warning" v-if="n.valiStr=='已过期'">{{n.valiStr}}</text>
<text class="text-primary" v-if="n.valiStr=='即将过期'">{{n.valiStr}}</text>
</view>
<view class="status" style="bottom: 20rpx;" @click="handleInfo(n)">
<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>
</z-paging>
</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({
pageNum: 1,
pageSize: 8,
fromList: 1,
dType: 4,
status: 2
})
const navs = ref(['道馆', '二级协会', '一级协会'])
// const navs = ref(['道馆', '三级协会', '二级协会', '一级协会'])
const list = ref([])
const paging = ref(null)
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 = ['道馆', '三级协会', '二级协会']
navs.value = ['道馆', '二级协会']
} else if (deptType.value == 4) {
// navs.value = ['道馆', '三级协会']
navs.value = ['道馆']
}
getList()
getGroupInfo()
})
function getList() {
uni.showLoading({
title: '加载中'
})
console.log(current.value, currentTabName.value, query.value.dType)
query.value.pageNum = 1
infoList.value = []
if (paging.value) {
paging.value.clear()
}
api.getGroupVipList(query.value).then(res => {
// infoList.value = res.rows
paging.value.complete(res.rows);
total.value = res.total
uni.hideLoading()
})
}
function getQuery(pageNum, pageSize) {
query.value.pageNum = pageNum
query.value.pageSize = pageSize
api.getGroupVipList(query.value).then(res => {
// infoList.value = res.rows
paging.value.complete(res.rows);
total.value = res.total
uni.hideLoading()
})
}
function getGroupInfo() {
uni.showLoading({
title: '加载中'
})
api.getMemberCountInfo({
dType: query.value.dType,
fromList: 1
}).then(res => {
forms.value = res
uni.hideLoading()
})
}
function onClickItem(e) {
uni.showLoading({
title: '加载中'
})
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 godetail(n) {
uni.navigateTo({
url: `/group/groupInfo?memId=${n.memId}&isR=true`
})
}
function handleInfo(n) {
if (n.allMemberCount == 0) {
return
}
uni.navigateTo({
url: `/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>