hookehuyr

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

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