hookehuyr

✨ feat: 新增报名列表页面

...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 * @Author: hookehuyr hookehuyr@gmail.com 2 * @Author: hookehuyr hookehuyr@gmail.com
3 * @Date: 2022-05-27 15:57:59 3 * @Date: 2022-05-27 15:57:59
4 * @LastEditors: hookehuyr hookehuyr@gmail.com 4 * @LastEditors: hookehuyr hookehuyr@gmail.com
5 - * @LastEditTime: 2022-09-28 16:56:40 5 + * @LastEditTime: 2022-09-29 09:46:03
6 * @FilePath: /swx/src/app.config.js 6 * @FilePath: /swx/src/app.config.js
7 * @Description: 7 * @Description:
8 */ 8 */
...@@ -29,6 +29,7 @@ export default { ...@@ -29,6 +29,7 @@ export default {
29 'pages/joinSuccess/index', 29 'pages/joinSuccess/index',
30 'pages/joinVolunteer/index', 30 'pages/joinVolunteer/index',
31 'pages/joinInfo/index', 31 'pages/joinInfo/index',
32 + 'pages/joinList/index',
32 ], 33 ],
33 subpackages: [ // 配置在tabBar中的页面不能分包写到subpackages中去 34 subpackages: [ // 配置在tabBar中的页面不能分包写到subpackages中去
34 { 35 {
......
1 +/*
2 + * @Date: 2022-09-29 09:45:17
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-09-29 09:45:33
5 + * @FilePath: /swx/src/pages/joinList/index.config.js
6 + * @Description: 文件描述
7 + */
8 +export default {
9 + navigationBarTitleText: '报名列表',
10 + usingComponents: {
11 + },
12 +}
1 +.join-list-page {
2 + .join-list-header {
3 + background-color: #FFFFFF;
4 + .header-info {
5 + display: flex;
6 + text-align: center;
7 + padding-bottom: 1rem;
8 + margin-top: 0.5rem;
9 + .activity {
10 + flex: 1;
11 + height: 50rpx;
12 + line-height: 50rpx;
13 + }
14 + .job {
15 + flex: 1;
16 + border-right: 1px solid #F5F5F5;
17 + border-left: 1px solid #F5F5F5;
18 + height: 100rpx;
19 + line-height: 50rpx;
20 + }
21 + .sign {
22 + flex: 1;
23 + height: 50rpx;
24 + line-height: 50rpx;
25 + }
26 + }
27 + }
28 + .activity-title {
29 + background-color: #FFFFFF;
30 + .box {
31 + padding: 1rem 1rem 0.5rem 1rem;
32 + }
33 + }
34 + .bg-gradient {
35 + background: linear-gradient(#B3DDC9, #B3DDC9) no-repeat;
36 + /*调整下划线的宽度占百分之百 高度是3px */
37 + background-size: 100% 1vw;
38 + /* 调整下划线的起始位置 左侧是0 上边是1.15em */
39 + background-position: 0 1.1rem;
40 + }
41 + .inactivate {
42 + font-size: 1rem;
43 + color: #999999;
44 + }
45 + .list-item {
46 + background-color: white;
47 + padding: 0.75rem;
48 + border-radius: 0.65rem;
49 + position: relative;
50 + margin-bottom: 1rem;
51 + .avatar {
52 + width: 100%;
53 + height: 5rem;
54 + background-size: cover;
55 + background-repeat: no-repeat;
56 + background-position: center;
57 + border-radius: 0.5rem;
58 + }
59 + .content {
60 + padding: 0.5rem 1rem;
61 + .title {
62 + font-size: 1.25rem;
63 + }
64 + .phone {
65 + color: #199A74;
66 + margin-top: 0.5rem;
67 + }
68 + }
69 + }
70 +}
1 +<template>
2 + <view class="join-list-page">
3 + <view class="join-list-header">
4 + <view class="activity-title">
5 + <view class="box">
6 + <text class="bg-gradient" style="font-size: 1.15rem;">报名统计</text>
7 + </view>
8 + </view>
9 + <view class="header-info">
10 + <view class="activity">
11 + <view><text style="font-size: 1.25rem;">5</text>人</view>
12 + <view>
13 + <van-icon :name="icon_join" size="1.5rem" color="" style="vertical-align: sub;" />
14 + <text style="font-size: 0.9rem; color: #999999;">活动报名</text>
15 + </view>
16 + </view>
17 + <view class="job">
18 + <text style="font-size: 1.25rem;">2</text>人
19 + <view>
20 + <van-icon :name="icon_job" size="1.25rem" color="" style="vertical-align: sub;" />
21 + <text style="font-size: 0.9rem; color: #999999;">岗位报名</text>
22 + </view>
23 + </view>
24 + <view class="sign">
25 + <view><text style="font-size: 1.25rem;">3</text>人</view>
26 + <view>
27 + <van-icon :name="icon_sign" size="1.25rem" color="" style="vertical-align: sub;" />
28 + <text style="font-size: 0.9rem; color: #999999;">用户签到</text>
29 + </view>
30 + </view>
31 + </view>
32 + </view>
33 + <view class="list-wrapper" style="margin: 1rem;">
34 + <view style="background-color: white; border-radius: 0.65rem; padding: 1rem;overflow: auto; margin-bottom: 1px;">
35 + <view style="display: inline-block; margin-right: 1rem; line-height: 60rpx;">
36 + <view @tap="toggleColum('activity')" :class="[activated === 1 ? 'bg-gradient' : 'inactivate']" style="font-size: 1rem;">活动报名</view>
37 + </view>
38 + <view style="display: inline-block; line-height: 60rpx;">
39 + <view @tap="toggleColum('join')" :class="[activated === 2 ? 'bg-gradient' : 'inactivate']">岗位报名</view>
40 + </view>
41 + <view @tap="show_status_popup=true" style="float: right; color: #666666; font-size: 0.9rem; border: 1px solid #DBDBDB; border-radius: 1rem; padding: 0.3rem 1rem 0.3rem 1rem;">
42 + &nbsp;{{ status_type === '' ? '全部' : status_type }}&nbsp;&nbsp;
43 + <van-icon :name="icon_sel2" size="0.8rem" color="" style="vertical-align: middle;" />
44 + </view>
45 + </view>
46 + <view>
47 + <view v-for="(item, index) in activityList" :key="index" class="list-item">
48 + <van-row>
49 + <van-col span="6">
50 + <view class="avatar" :style="{ backgroundImage: `url(${item.avatar})` }"></view>
51 + </van-col>
52 + <van-col span="14">
53 + <view class="content">
54 + <view class="title">{{ item.name }}</view>
55 + <view class="phone" @tap="onPhoneClick(item.phone)">
56 + <van-icon :name="icon_tel" color="" size="1.25rem" style="vertical-align: sub;" />
57 + {{ item.phone }}
58 + </view>
59 + </view>
60 + </van-col>
61 + <van-col span="4">
62 + <van-tag v-if="item.status === '1'" :round="true" color="#D7F3FF" text-color="#0091FD" size="large">已报名</van-tag>
63 + <van-tag v-if="item.status === '2'" :round="true" color="#D7FFD7" text-color="#019200" size="large">已签到</van-tag>
64 + <van-tag v-if="item.status === '3'" :round="true" color="#FFF5E4" text-color="#FF7300" size="large">未出席</van-tag>
65 + </van-col>
66 + </van-row>
67 + </view>
68 + </view>
69 + </view>
70 + <view style="height: 2rem;"></view>
71 + </view>
72 +
73 + <!-- 切换状态弹出框 -->
74 + <van-popup :show="show_status_popup" position="bottom" custom-style="height: 40%;" :lock-scroll="true">
75 + <van-picker :show-toolbar="true" title="" confirm-button-text="确定" :columns="status_type_columns"
76 + toolbar-class="picker-toolbar" @confirm="onStatusTypeConfirm" @cancel="onStatusTypeCancel" @change="onStatusTypeChange" />
77 + </van-popup>
78 +</template>
79 +
80 +<script setup>
81 +import { ref } from "vue";
82 +import icon_join from '@/images/icon/baoming@2x.png'
83 +import icon_job from '@/images/icon/yigong@2x.png'
84 +import icon_sign from '@/images/icon/qiandao@2x.png'
85 +import icon_sel2 from '@/images/icon/sel02@2x.png'
86 +import icon_tel from '@/images/icon/tel@2x.png'
87 +import Taro from '@tarojs/taro'
88 +
89 +const activityList = ref([{
90 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
91 + name: '净妙',
92 + phone: '18789800786',
93 + status: '1',
94 +}, {
95 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
96 + name: '人在路途',
97 + phone: '18789800786',
98 + status: '2',
99 +}, {
100 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
101 + name: '寒潭秋月心如洗',
102 + phone: '18789800786',
103 + status: '3',
104 +}, {
105 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
106 + name: '净妙',
107 + phone: '18789800786',
108 + status: '1',
109 +}, {
110 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
111 + name: '人在路途',
112 + phone: '18789800786',
113 + status: '2',
114 +}, {
115 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
116 + name: '寒潭秋月心如洗',
117 + phone: '18789800786',
118 + status: '3',
119 +}])
120 +
121 +const onPhoneClick = (number) => {
122 + Taro.makePhoneCall({
123 + phoneNumber: number
124 + })
125 +}
126 +
127 +const show_status_popup = ref(false);
128 +const status_type = ref('');
129 +const status_type_columns = ref(['已报名', '未出席', '已签到']);
130 +const onStatusTypeChange = (event) => {
131 + const { picker, value, index } = event.detail;
132 +}
133 +const onStatusTypeConfirm = (event) => {
134 + const { picker, value, index } = event.detail;
135 + show_status_popup.value = false;
136 + status_type.value = value;
137 + console.warn('查询新数据');
138 +}
139 +const onStatusTypeCancel = (event) => {
140 + show_status_popup.value = false;
141 +}
142 +
143 +const activated = ref(1);
144 +const toggleColum = (type) => {
145 + if (type === 'activity') {
146 + activityList.value = [{
147 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
148 + name: '净妙',
149 + phone: '18789800786',
150 + status: '1',
151 + }, {
152 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
153 + name: '人在路途',
154 + phone: '18789800786',
155 + status: '2',
156 + }, {
157 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
158 + name: '寒潭秋月心如洗',
159 + phone: '18789800786',
160 + status: '3',
161 + }, {
162 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
163 + name: '净妙',
164 + phone: '18789800786',
165 + status: '1',
166 + }, {
167 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
168 + name: '人在路途',
169 + phone: '18789800786',
170 + status: '2',
171 + }, {
172 + avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
173 + name: '寒潭秋月心如洗',
174 + phone: '18789800786',
175 + status: '3',
176 + }];
177 + activated.value = 1
178 + } else {
179 + activityList.value = [];
180 + activated.value = 2
181 + }
182 +}
183 +</script>
184 +
185 +<script>
186 +import "./index.less";
187 +
188 +export default {
189 + name: "joinListPage",
190 +};
191 +</script>