index.vue
3.37 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
<!--
* @Date: 2022-09-27 17:13:05
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-27 18:37:45
* @FilePath: /swx/src/pages/joinVolunteerInfo/index.vue
* @Description: 义工报名
-->
<template>
<view class="join-activity-page">
<view class="activity-title">
<view class="box">
<text class="bg-gradient" style="font-size: 1.25rem;">义工报名信息</text>
</view>
</view>
<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="post" placeholder="" :disabled="true"/>
</view>
</view>
<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="username" placeholder="" :disabled="true"/>
</view>
</view>
<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="phone" placeholder="" :disabled="true"/>
</view>
</view>
<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="user_sex" placeholder="" :disabled="true"/>
</view>
</view>
</view>
<view class="confirm-wrapper-page">
<view class="box">
<view @tap="cancelJoin" class="button">取消报名</view>
</view>
<view class="box">
<view @tap="editJoin" class="button">确认报名</view>
</view>
</view>
<van-dialog id="van-dialog" />
</template>
<script setup>
import { ref, onMounted } from "vue";
import "taro-ui-vue3/dist/style/components/input.scss";
import Taro from '@tarojs/taro'
import { myInfoAPI, cancelRegAPI } from '@/api/Reg/index';
import { getCurrentPageParam } from "@/utils/weapp";
import Dialog from '@/components/vant-weapp/dialog/dialog';
const cancelJoin = (val) => {
Dialog.confirm({
title: '温馨提示',
message: '是否确认取消报名?',
confirmButtonColor: '#199a74'
})
.then(async () => {
// on confirm
const { code, data } = await cancelRegAPI({ i: getCurrentPageParam().reg_id });
if (code) {
Taro.showToast({
title: '取消成功',
icon: 'success',
duration: 2000
});
Taro.navigateBack()
}
})
.catch(() => {
// on cancel
});
}
const editJoin = (val) => {
Taro.navigateTo({
url: '../joinVolunteer/index?type=edit®_id=' + getCurrentPageParam().reg_id + '&id=' + getCurrentPageParam().id
})
}
</script>
<script>
import "./index.less";
export default {
name: "demoPage",
data () {
return {
username: '',
phone: '',
user_sex: '',
post: '',
}
},
async onShow () {
const { code, data } = await myInfoAPI({ i: getCurrentPageParam().reg_id });
if (code) {
this.username = data.name;
this.phone = data.phone;
this.post = data.post;
this.user_sex = data.gender === 'man' ? '男士' : '女士';
}
}
};
</script>