From 15b699a7c79b660378713c51a20032a46607af98 Mon Sep 17 00:00:00 2001 From: Kavehhn174 Date: Sun, 16 Aug 2026 08:42:25 +0330 Subject: [PATCH] feat: add class registration pages for enrollment and class requests. Wire class cards to payment flows with plan terms, user provisioning, and a disabled pay button until the gateway is ready. --- src/api/classesApi.js | 1 + src/api/registrationApi.js | 8 + src/components/ClassCard.vue | 9 +- src/router/index.js | 12 + src/utils/registrationPricing.js | 83 ++++ src/views/ClassRegistrationView.vue | 584 ++++++++++++++++++++++++++++ src/views/LandingView.vue | 2 +- 7 files changed, 697 insertions(+), 2 deletions(-) create mode 100644 src/api/registrationApi.js create mode 100644 src/utils/registrationPricing.js create mode 100644 src/views/ClassRegistrationView.vue diff --git a/src/api/classesApi.js b/src/api/classesApi.js index 8784988..908b1f2 100644 --- a/src/api/classesApi.js +++ b/src/api/classesApi.js @@ -2,5 +2,6 @@ import axiosInstance from './axiosInstance' export const classesApi = { getAll: (params = {}) => axiosInstance.get('/classes/user/get-all', { params }), + getOne: (id) => axiosInstance.get(`/classes/user/get-one/${id}`), getMyClasses: (params = {}) => axiosInstance.get('/classes/user/my-classes', { params }) } diff --git a/src/api/registrationApi.js b/src/api/registrationApi.js new file mode 100644 index 0000000..5e56cc4 --- /dev/null +++ b/src/api/registrationApi.js @@ -0,0 +1,8 @@ +import axiosInstance from './axiosInstance' + +export const registrationApi = { + getClass: (id) => axiosInstance.get(`/classes/user/get-one/${id}`), + getPricing: (params) => axiosInstance.get('/pending-students/public/pricing', { params }), + ensureUser: (data) => axiosInstance.post('/pending-students/public/ensure-user', data), + completeAfterPayment: (data) => axiosInstance.post('/pending-students/public/complete', data) +} diff --git a/src/components/ClassCard.vue b/src/components/ClassCard.vue index 89f7904..30b3d55 100644 --- a/src/components/ClassCard.vue +++ b/src/components/ClassCard.vue @@ -49,13 +49,14 @@ - {{ ctaLabel }} + {{ ctaLabel }} + + diff --git a/src/views/LandingView.vue b/src/views/LandingView.vue index 62d6527..ee79760 100644 --- a/src/views/LandingView.vue +++ b/src/views/LandingView.vue @@ -68,7 +68,7 @@

در حال برگزاری

کلاس‌های فعال

-

کلاس‌هایی که هم‌اکنون در حال برگزاری هستند و هنوز امکان پیوستن دارند.

+

کلاس‌های در حال برگزاری — برای تشکیل کلاس جدید همان دوره، درخواست دهید و بیعانه پرداخت کنید.