This commit is contained in:
@@ -144,16 +144,6 @@
|
||||
{{ errorMessage }}
|
||||
</v-alert>
|
||||
|
||||
<!-- Success Alert -->
|
||||
<v-alert
|
||||
v-if="successMessage"
|
||||
type="success"
|
||||
variant="tonal"
|
||||
class="mb-4"
|
||||
>
|
||||
<v-alert-title>Registration Successful!</v-alert-title>
|
||||
{{ successMessage }}
|
||||
</v-alert>
|
||||
|
||||
<v-btn
|
||||
type="submit"
|
||||
@@ -224,6 +214,14 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
|
||||
<!-- Registration Success Dialog -->
|
||||
<RegistrationSuccessDialog
|
||||
v-model="showSuccessDialog"
|
||||
:member-data="registrationResult"
|
||||
:payment-info="registrationConfig"
|
||||
@go-to-login="goToLogin"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -232,8 +230,7 @@ import type { RegistrationFormData, RecaptchaConfig, RegistrationConfig } from '
|
||||
|
||||
// Page metadata
|
||||
definePageMeta({
|
||||
layout: false,
|
||||
middleware: 'guest'
|
||||
layout: false
|
||||
});
|
||||
|
||||
// Head configuration
|
||||
@@ -271,6 +268,10 @@ const recaptchaToken = ref('');
|
||||
const successMessage = ref('');
|
||||
const errorMessage = ref('');
|
||||
|
||||
// Success dialog state
|
||||
const showSuccessDialog = ref(false);
|
||||
const registrationResult = ref<{ memberId: string; email: string } | null>(null);
|
||||
|
||||
// Configs
|
||||
const recaptchaConfig = ref<RecaptchaConfig>({ siteKey: '', secretKey: '' });
|
||||
const registrationConfig = ref<RegistrationConfig>({
|
||||
@@ -357,7 +358,15 @@ async function submitRegistration() {
|
||||
}) as any;
|
||||
|
||||
if (response?.success) {
|
||||
successMessage.value = response.message || 'Registration successful!';
|
||||
// Set registration result data for dialog
|
||||
registrationResult.value = {
|
||||
memberId: response.data?.memberId || 'N/A',
|
||||
email: form.value.email
|
||||
};
|
||||
|
||||
// Show success dialog instead of just alert
|
||||
showSuccessDialog.value = true;
|
||||
|
||||
// Reset form by resetting individual refs
|
||||
firstName.value = '';
|
||||
lastName.value = '';
|
||||
@@ -383,6 +392,11 @@ async function submitRegistration() {
|
||||
}
|
||||
}
|
||||
|
||||
// Navigation methods
|
||||
const goToLogin = () => {
|
||||
navigateTo('/login');
|
||||
};
|
||||
|
||||
// Load configurations on mount
|
||||
onMounted(async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user