hookehuyr

fix 义工报名修改逻辑修改

<!--
* @Date: 2022-09-27 17:13:05
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-27 18:41:46
* @LastEditTime: 2022-10-28 13:42:48
* @FilePath: /swx/src/pages/joinVolunteer/index.vue
* @Description: 义工报名
-->
......@@ -141,6 +141,20 @@ const onSubmit = async () => {
gender: user_sex.value,
post: post_status.value
}
if (getCurrentPageParam().type === 'edit') {
params.i = getCurrentPageParam().reg_id;
const { code } = await editRegAPI(params);
if (code) {
Taro.showToast({
title: '修改成功',
icon: 'success',
duration: 3000,
success: function () {
Taro.navigateBack()
}
});
}
} else {
const { code } = await addRegAPI(params);
if (code) {
Taro.showToast({
......@@ -153,6 +167,7 @@ const onSubmit = async () => {
});
}
}
}
}
</script>
......@@ -161,7 +176,7 @@ const onSubmit = async () => {
import "./index.less";
import { activityInfoAPI } from '@/api/Host/index';
import { getCurrentPageParam } from "@/utils/weapp";
import { addRegAPI } from '@/api/Reg/index';
import { addRegAPI, editRegAPI } from '@/api/Reg/index';
import Toast from '@/components/vant-weapp/toast/toast';
export default {
......