|
|
@@ -61,15 +61,15 @@ import DynamicForm from '@/components/dynamic/DynamicForm.vue';
|
|
|
import { useAppInit } from '@/common/composeabe/AppInit';
|
|
|
import { UserApi } from '@/api/auth/UserApi';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
-import { back, redirectTo } from '@/components/utils/PageAction';
|
|
|
+import { back } from '@/components/utils/PageAction';
|
|
|
import { closeToast, toast } from '@/components/dialog/CommonRoot';
|
|
|
import { showError } from '@/common/composeabe/ErrorDisplay';
|
|
|
import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
import { getVolunteerForm } from '@/pages/dig/admin/data/volunteer';
|
|
|
-import VillageApi, { VolunteerInfo } from '@/api/inhert/VillageApi';
|
|
|
+import VillageApi, { VillageListItem, VolunteerInfo } from '@/api/inhert/VillageApi';
|
|
|
import type { IDynamicFormOptions, IDynamicFormRef } from '@/components/dynamic';
|
|
|
-import { waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
+import { assertNotNull, waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
|
|
|
/**
|
|
|
* 分享注册页面
|
|
|
@@ -82,13 +82,16 @@ const { querys } = useLoadQuerys({
|
|
|
villageId: 0,
|
|
|
});
|
|
|
const step = ref<'register'|'finished'|'error'>('register');
|
|
|
+const village = ref<VillageListItem>();
|
|
|
|
|
|
onMounted(async () => {
|
|
|
if (!querys.value.villageId) {
|
|
|
step.value = 'error';
|
|
|
return;
|
|
|
}
|
|
|
+ village.value = JSON.parse(uni.getStorageSync('VillageTemp') || '{}'),
|
|
|
await waitTimeOut(1000);
|
|
|
+
|
|
|
registerFormDefine.value = getVolunteerForm({
|
|
|
canSetCatalog: false,
|
|
|
villageId: querys.value.villageId,
|
|
|
@@ -96,6 +99,11 @@ onMounted(async () => {
|
|
|
isNew: ref(true),
|
|
|
formRef: registerFormRef,
|
|
|
});
|
|
|
+
|
|
|
+ assertNotNull(village.value, '村落信息不存在');
|
|
|
+
|
|
|
+ registerFormModel.value.regionId = village.value.region as number;
|
|
|
+ registerFormModel.value.unit = village.value.city! + village.value.district! + village.value?.township!;
|
|
|
});
|
|
|
|
|
|
async function loginWechat() {
|