Showing
1 changed file
with
17 additions
and
2 deletions
| 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-10-27 18:41:46 | 4 | + * @LastEditTime: 2022-10-28 13:42:48 |
| 5 | * @FilePath: /swx/src/pages/joinVolunteer/index.vue | 5 | * @FilePath: /swx/src/pages/joinVolunteer/index.vue |
| 6 | * @Description: 义工报名 | 6 | * @Description: 义工报名 |
| 7 | --> | 7 | --> |
| ... | @@ -141,6 +141,20 @@ const onSubmit = async () => { | ... | @@ -141,6 +141,20 @@ const onSubmit = async () => { |
| 141 | gender: user_sex.value, | 141 | gender: user_sex.value, |
| 142 | post: post_status.value | 142 | post: post_status.value |
| 143 | } | 143 | } |
| 144 | + if (getCurrentPageParam().type === 'edit') { | ||
| 145 | + params.i = getCurrentPageParam().reg_id; | ||
| 146 | + const { code } = await editRegAPI(params); | ||
| 147 | + if (code) { | ||
| 148 | + Taro.showToast({ | ||
| 149 | + title: '修改成功', | ||
| 150 | + icon: 'success', | ||
| 151 | + duration: 3000, | ||
| 152 | + success: function () { | ||
| 153 | + Taro.navigateBack() | ||
| 154 | + } | ||
| 155 | + }); | ||
| 156 | + } | ||
| 157 | + } else { | ||
| 144 | const { code } = await addRegAPI(params); | 158 | const { code } = await addRegAPI(params); |
| 145 | if (code) { | 159 | if (code) { |
| 146 | Taro.showToast({ | 160 | Taro.showToast({ |
| ... | @@ -153,6 +167,7 @@ const onSubmit = async () => { | ... | @@ -153,6 +167,7 @@ const onSubmit = async () => { |
| 153 | }); | 167 | }); |
| 154 | } | 168 | } |
| 155 | } | 169 | } |
| 170 | + } | ||
| 156 | } | 171 | } |
| 157 | 172 | ||
| 158 | </script> | 173 | </script> |
| ... | @@ -161,7 +176,7 @@ const onSubmit = async () => { | ... | @@ -161,7 +176,7 @@ const onSubmit = async () => { |
| 161 | import "./index.less"; | 176 | import "./index.less"; |
| 162 | import { activityInfoAPI } from '@/api/Host/index'; | 177 | import { activityInfoAPI } from '@/api/Host/index'; |
| 163 | import { getCurrentPageParam } from "@/utils/weapp"; | 178 | import { getCurrentPageParam } from "@/utils/weapp"; |
| 164 | -import { addRegAPI } from '@/api/Reg/index'; | 179 | +import { addRegAPI, editRegAPI } from '@/api/Reg/index'; |
| 165 | import Toast from '@/components/vant-weapp/toast/toast'; | 180 | import Toast from '@/components/vant-weapp/toast/toast'; |
| 166 | 181 | ||
| 167 | export default { | 182 | export default { | ... | ... |
-
Please register or login to post a comment