컬러, 휴대전화

This commit is contained in:
yoon 2025-04-04 16:32:53 +09:00
parent f18aa4dc16
commit 17e86f49d0
2 changed files with 15 additions and 4 deletions

View File

@ -31,7 +31,7 @@
:src="`/img/mbti/${selected.toLowerCase()}.png`"
alt="MBTI image"/>
</div>
<div v-if="isAlert" class="invalid-feedback">{{ title }} 확인해주세요.</div>
<div class="invalid-feedback" :class="isAlert ? 'd-block' : ''">{{ title }} 확인해주세요.</div>
</div>
</template>

View File

@ -95,6 +95,7 @@
:is-color="true"
:data="colorList"
@update:data="handleColorUpdate"
:is-alert="colorAlert"
class="w-50"
/>
</div>
@ -143,13 +144,12 @@
name="phone"
:isEssential="true"
:is-alert="phoneAlert"
@update:data="phone = $event"
@update:alert="phoneAlert = $event"
@blur="checkPhoneDuplicate"
:maxlength="11"
:value="phone"
@keypress="onlyNumber"
@input="inputEvent"
/>
<span v-if="phoneError" class="invalid-feedback d-block">{{ phoneError }}</span>
@ -205,6 +205,7 @@
const passwordcheckErrorAlert = ref(false); //
const pwhintResAlert = ref(false);
const nameAlert = ref(false);
const colorAlert = ref(false);
const birthAlert = ref(false);
const addressAlert = ref(false);
const phoneAlert = ref(false);
@ -326,6 +327,12 @@
}
};
const inputEvent = (e) => {
const newValue = e.target.value.replace(/\D/g, ''); //
e.target.value = newValue; //
phone.value = newValue; // Vue
};
watch(id, (newValue) => {
if (newValue && newValue.length >= 4) {
idError.value = '';
@ -359,7 +366,6 @@
}
});
//
const handleSubmit = async () => {
await checkColorDuplicate();
@ -373,6 +379,10 @@
addressAlert.value = address.value.trim() === '';
phoneAlert.value = phone.value.trim() === '';
if (!colorList.value || colorList.value.length === 0) {
colorAlert.value = true;
}
//
if (id.value && id.value.length < 4) {
idErrorAlert.value = true;
@ -402,6 +412,7 @@
profilAlert.value = false;
}
if (
profilAlert.value ||
idAlert.value ||