hookehuyr

新增我参加的活动页面

1 +/*
2 + * @Date: 2022-09-29 09:45:17
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-10-08 10:31:49
5 + * @FilePath: /swx/src/pages/myActivityList/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 + <activity-card v-for="(item, index) in activity_list" :key="index" :data="item" style="margin-bottom: 1rem;"></activity-card>
48 + </view>
49 + </view>
50 + <view style="height: 2rem;"></view>
51 + </view>
52 +
53 + <!-- 切换状态弹出框 -->
54 + <van-popup :show="show_status_popup" position="bottom" custom-style="height: 40%;" :lock-scroll="true">
55 + <van-picker :show-toolbar="true" title="" confirm-button-text="确定" :columns="status_type_columns"
56 + toolbar-class="picker-toolbar" @confirm="onStatusTypeConfirm" @cancel="onStatusTypeCancel" @change="onStatusTypeChange" />
57 + </van-popup>
58 +</template>
59 +
60 +<script setup>
61 +import { ref } from "vue";
62 +import icon_join from '@/images/icon/baoming@2x.png'
63 +import icon_job from '@/images/icon/yigong@2x.png'
64 +import icon_sign from '@/images/icon/qiandao@2x.png'
65 +import icon_sel2 from '@/images/icon/sel02@2x.png'
66 +import icon_tel from '@/images/icon/tel@2x.png'
67 +import Taro from '@tarojs/taro'
68 +import activityCard from '@/components/activity-card.vue'
69 +
70 +const activity_list = ref([{
71 + title: '智慧没有烦恼',
72 + address: '上海市杨浦区军工路100号A座05室',
73 +}, {
74 + title: '万人共乘浪漫热气球',
75 + address: '',
76 +}, {
77 + title: '八段锦',
78 + address: '',
79 +}, {
80 + title: '智慧没有烦恼',
81 + address: '上海市杨浦区军工路100号A座05室',
82 +}, {
83 + title: '万人共乘浪漫热气球',
84 + address: '',
85 +}, {
86 + title: '八段锦',
87 + address: '',
88 +}]);
89 +
90 +const show_status_popup = ref(false);
91 +const status_type = ref('');
92 +const status_type_columns = ref(['已报名', '未出席', '已签到']);
93 +const onStatusTypeChange = (event) => {
94 + const { picker, value, index } = event.detail;
95 +}
96 +const onStatusTypeConfirm = (event) => {
97 + const { picker, value, index } = event.detail;
98 + show_status_popup.value = false;
99 + status_type.value = value;
100 + console.warn('查询新数据');
101 +}
102 +const onStatusTypeCancel = (event) => {
103 + show_status_popup.value = false;
104 +}
105 +
106 +const activated = ref(1);
107 +const toggleColum = (type) => {
108 + if (type === 'activity') {
109 + activity_list.value = [];
110 + activated.value = 1
111 + } else {
112 + activity_list.value = [];
113 + activated.value = 2
114 + }
115 +}
116 +
117 +const goToUserInfo = () => {
118 + Taro.navigateTo({
119 + url: '../userInfo/index'
120 + })
121 +}
122 +</script>
123 +
124 +<script>
125 +import "./index.less";
126 +
127 +export default {
128 + name: "joinListPage",
129 +};
130 +</script>