주소 로직 변경, 생년월일 추가

This commit is contained in:
yoon 2025-01-24 10:01:43 +09:00
parent 0ee5425663
commit 55ca1308fe

View File

@ -124,12 +124,12 @@
<ArrInput <ArrInput
title="주소" title="주소"
name="arr" name="address"
:isEssential="true" :isEssential="true"
:is-alert="arrAlert" :is-alert="addressAlert"
@update:data="handleAddressUpdate" @update:data="handleAddressUpdate"
@update:alert="arrAlert = $event" @update:alert="addressAlert = $event"
:value="arr" :value="address"
/> />
<UserFormInput <UserFormInput
@ -177,7 +177,8 @@
const pwhintRes = ref(''); const pwhintRes = ref('');
const name = ref(''); const name = ref('');
const birth = ref(''); const birth = ref('');
const arr = ref(''); // const address = ref('');
const detailAddress = ref('');
const postcode = ref(''); // const postcode = ref(''); //
const phone = ref(''); const phone = ref('');
const colorList = ref([]); const colorList = ref([]);
@ -194,7 +195,7 @@
const pwhintResAlert = ref(false); const pwhintResAlert = ref(false);
const nameAlert = ref(false); const nameAlert = ref(false);
const birthAlert = ref(false); const birthAlert = ref(false);
const arrAlert = ref(false); const addressAlert = ref(false);
const phoneAlert = ref(false); const phoneAlert = ref(false);
const toastStore = useToastStore(); const toastStore = useToastStore();
@ -252,27 +253,20 @@
}; };
const Colors = async () => { const Colors = async () => {
try { const response = await $api.get('/user/color');
const response = await $api.get('/user/color'); colorList.value = response.data.data.map(item => ({
colorList.value = response.data.data.map(item => ({ label: item.CMNCODNAM,
label: item.CMNCODNAM, value: item.CMNCODVAL
value: item.CMNCODVAL }));
}));
} catch (error) {
console.error('Error colors:', error);
}
}; };
const Mbtis = async () => { const Mbtis = async () => {
try { const response = await $api.get('/user/mbti');
const response = await $api.get('/user/mbti'); mbtiList.value = response.data.data.map(item => ({
mbtiList.value = response.data.data.map(item => ({ label: item.CMNCODNAM,
label: item.CMNCODNAM, value: item.CMNCODVAL
value: item.CMNCODVAL }));
}));
} catch (error) {
console.error('Error MBTIs:', error);
}
}; };
onMounted(() => { onMounted(() => {
@ -282,7 +276,8 @@
// //
const handleAddressUpdate = (addressData) => { const handleAddressUpdate = (addressData) => {
arr.value = addressData.fullAddress; // address.value = addressData.address;
detailAddress.value = addressData.detailAddress;
postcode.value = addressData.postcode; // postcode.value = addressData.postcode; //
}; };
@ -306,7 +301,7 @@
pwhintResAlert.value = pwhintRes.value.trim() === ''; pwhintResAlert.value = pwhintRes.value.trim() === '';
nameAlert.value = name.value.trim() === ''; nameAlert.value = name.value.trim() === '';
birthAlert.value = birth.value.trim() === ''; birthAlert.value = birth.value.trim() === '';
arrAlert.value = arr.value.trim() === ''; addressAlert.value = address.value.trim() === '';
phoneAlert.value = phone.value.trim() === ''; phoneAlert.value = phone.value.trim() === '';
// //
@ -319,7 +314,7 @@
} }
if (profilAlert.value || idAlert.value || idErrorAlert.value || passwordAlert.value || passwordcheckAlert.value || if (profilAlert.value || idAlert.value || idErrorAlert.value || passwordAlert.value || passwordcheckAlert.value ||
passwordcheckErrorAlert.value || pwhintResAlert.value || nameAlert.value || birthAlert.value || arrAlert.value || phoneAlert.value) { passwordcheckErrorAlert.value || pwhintResAlert.value || nameAlert.value || birthAlert.value || addressAlert.value || phoneAlert.value) {
return; return;
} }
@ -329,15 +324,14 @@
formData.append('memberPwh', pwhintList[pwhint.value]); formData.append('memberPwh', pwhintList[pwhint.value]);
formData.append('memberPwr', pwhintRes.value); formData.append('memberPwr', pwhintRes.value);
formData.append('memberNam', name.value); formData.append('memberNam', name.value);
formData.append('memberArr', arr.value); // formData.append('memberArr', address.value);
formData.append('memberZip', postcode.value); // formData.append('memberDtl', detailAddress.value);
formData.append('memberZip', postcode.value);
formData.append('memberBth', birth.value);
formData.append('memberTel', phone.value); formData.append('memberTel', phone.value);
formData.append('memberCol', color.value); formData.append('memberCol', color.value);
formData.append('memberMbt', mbti.value); formData.append('memberMbt', mbti.value);
formData.append('memberPrf', profile.value);
if (profile.value) {
formData.append('profile', profile.value);
}
const response = await $api.post('/user/join', formData, { isFormData : true }); const response = await $api.post('/user/join', formData, { isFormData : true });