hookehuyr

✨ feat(活动报名信息): 显示报名信息API联调

1 <!-- 1 <!--
2 * @Date: 2022-09-26 16:10:35 2 * @Date: 2022-09-26 16:10:35
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-10-20 11:54:56 4 + * @LastEditTime: 2022-10-20 16:22:36
5 * @FilePath: /swx/src/components/activity-bar.vue 5 * @FilePath: /swx/src/components/activity-bar.vue
6 * @Description: 活动详情页底部导航栏 6 * @Description: 活动详情页底部导航栏
7 --> 7 -->
...@@ -51,7 +51,8 @@ const props = defineProps({ ...@@ -51,7 +51,8 @@ const props = defineProps({
51 // volunteer=义工,可报名义工,如果活动允许内部人员参加,则也可报名活动。 51 // volunteer=义工,可报名义工,如果活动允许内部人员参加,则也可报名活动。
52 // volunteer_only=只能报名义工 52 // volunteer_only=只能报名义工
53 // creator=创建人,可管理活动 53 // creator=创建人,可管理活动
54 - userType: String 54 + userType: String,
55 + regId: String
55 }) 56 })
56 57
57 const goTo = (type) => { 58 const goTo = (type) => {
...@@ -65,15 +66,15 @@ const goTo = (type) => { ...@@ -65,15 +66,15 @@ const goTo = (type) => {
65 }) 66 })
66 } else if (type === 'volunteer') { // 义工报名 67 } else if (type === 'volunteer') { // 义工报名
67 Taro.navigateTo({ 68 Taro.navigateTo({
68 - url: '../joinVolunteer/index' 69 + url: '../joinVolunteer/index?id=' + getCurrentPageParam().id
69 }) 70 })
70 } else if (type === 'info') { // 报名信息 71 } else if (type === 'info') { // 报名信息
71 Taro.navigateTo({ 72 Taro.navigateTo({
72 - url: '../joinInfo/index' 73 + url: '../joinInfo/index?reg_id=' + props.regId
73 }) 74 })
74 } else if (type === 'list') { // 报名列表 75 } else if (type === 'list') { // 报名列表
75 Taro.navigateTo({ 76 Taro.navigateTo({
76 - url: '../joinList/index' 77 + url: '../joinList/index?id='
77 }) 78 })
78 } else if (type === 'edit') { // 修改活动 79 } else if (type === 'edit') { // 修改活动
79 const id = getCurrentPageParam().id; 80 const id = getCurrentPageParam().id;
......
1 <!-- 1 <!--
2 * @Date: 2022-09-26 14:36:57 2 * @Date: 2022-09-26 14:36:57
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-10-19 17:59:18 4 + * @LastEditTime: 2022-10-20 16:13:03
5 * @FilePath: /swx/src/pages/activityDetail/index.vue 5 * @FilePath: /swx/src/pages/activityDetail/index.vue
6 * @Description: 活动详情页 6 * @Description: 活动详情页
7 --> 7 -->
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
106 </view> 106 </view>
107 </view> 107 </view>
108 <view style="height: 6rem;"></view> 108 <view style="height: 6rem;"></view>
109 - <activity-bar :user-type="userType" /> 109 + <activity-bar :user-type="userType" :reg-id="reg_id" />
110 110
111 <van-action-sheet 111 <van-action-sheet
112 :z-index="10" 112 :z-index="10"
......
1 <!-- 1 <!--
2 * @Date: 2022-09-27 17:13:05 2 * @Date: 2022-09-27 17:13:05
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-09-28 18:30:16 4 + * @LastEditTime: 2022-10-20 16:56:34
5 * @FilePath: /swx/src/pages/joinInfo/index.vue 5 * @FilePath: /swx/src/pages/joinInfo/index.vue
6 * @Description: 活动报名 6 * @Description: 活动报名
7 --> 7 -->
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
27 <view class="at-input"> 27 <view class="at-input">
28 <view class="at-input__container"> 28 <view class="at-input__container">
29 <label class="h5-label at-input__title at-input__title">年龄段</label> 29 <label class="h5-label at-input__title at-input__title">年龄段</label>
30 - <input class="h5-input at-input__input" placeholder-class="placeholder" :value="age_range" placeholder="" :disabled="true"/> 30 + <input class="h5-input at-input__input" placeholder-class="placeholder" :value="age_group" placeholder="" :disabled="true"/>
31 </view> 31 </view>
32 </view> 32 </view>
33 <view class="at-input"> 33 <view class="at-input">
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
36 <input class="h5-input at-input__input" placeholder-class="placeholder" :value="user_sex" placeholder="" :disabled="true"/> 36 <input class="h5-input at-input__input" placeholder-class="placeholder" :value="user_sex" placeholder="" :disabled="true"/>
37 </view> 37 </view>
38 </view> 38 </view>
39 - <view v-for="(item, index) in arr" :key="index"> 39 + <view v-for="(item, index) in extend" :key="index">
40 <view class="at-input"> 40 <view class="at-input">
41 <view class="at-input__container"> 41 <view class="at-input__container">
42 <label class="h5-label at-input__title at-input__title">{{ item.title }}</label> 42 <label class="h5-label at-input__title at-input__title">{{ item.title }}</label>
...@@ -58,22 +58,34 @@ ...@@ -58,22 +58,34 @@
58 58
59 <script setup> 59 <script setup>
60 import { ref, onMounted } from "vue"; 60 import { ref, onMounted } from "vue";
61 -
62 import "taro-ui-vue3/dist/style/components/input.scss"; 61 import "taro-ui-vue3/dist/style/components/input.scss";
63 -
64 import Taro from '@tarojs/taro' 62 import Taro from '@tarojs/taro'
63 +import { myInfoAPI } from '@/api/Reg/index';
64 +import { getCurrentPageParam } from "@/utils/weapp";
65 +
66 +const username = ref('');
67 +const phone = ref('');
68 +const age_group = ref('');
69 +const user_sex = ref('');
70 +const extend = ref([]);
65 71
66 -const username = ref('刘阳河'); 72 +onMounted(async () => {
67 -const phone = ref('18687888990'); 73 + const { code, data } = await myInfoAPI({ i: getCurrentPageParam().reg_id });
68 -const age_range = ref('30-40岁'); 74 + if (code) {
69 -const user_sex = ref('男士'); 75 + username.value = data.name;
70 -const arr = ref([]); 76 + phone.value = data.phone;
71 -onMounted(() => { 77 + age_group.value = data.age_group;
72 - arr.value = [{ 78 + user_sex.value = data.gender === 'man' ? '男士' : '女士';
73 - title: '推荐人' , 79 + // 额外信息
74 - key: 'recommender', 80 + if (data.extend) {
75 - value: '净莲', 81 + for (const key in data.extend) {
76 - }] 82 + extend.value.push({
83 + title: key,
84 + value: data.extend[key],
85 + });
86 + }
87 + }
88 + }
77 }) 89 })
78 90
79 const cancelJoin = (val) => { 91 const cancelJoin = (val) => {
......