From 3f9e0d761573cb6248c5bd70be731753397eab46 Mon Sep 17 00:00:00 2001 From: HAM!DREZA Date: Mon, 17 Jun 2024 09:09:00 +0330 Subject: [PATCH] update --- components/Card.vue | 2 +- components/ProgressCard.vue | 22 +- .../course-details/Course-information.vue | 2 +- pages/account/[product]/index.vue | 244 +++++++++++++ pages/account/index.vue | 196 ++++++---- pages/account/my-courses.vue | 10 +- pages/account/tickets.vue | 60 ++-- pages/account/wallet.vue | 339 +++++++++++------- server/api/user/payments.js | 19 + utils/jDate.js | 1 + utils/numberFormat.js | 5 + 11 files changed, 666 insertions(+), 234 deletions(-) create mode 100644 pages/account/[product]/index.vue create mode 100644 server/api/user/payments.js create mode 100644 utils/jDate.js create mode 100644 utils/numberFormat.js diff --git a/components/Card.vue b/components/Card.vue index 1bc6bd8..fe63e8c 100644 --- a/components/Card.vue +++ b/components/Card.vue @@ -3,7 +3,7 @@

- {{props.course?.price == 0 ? 'رایگان' : props.course?.price + ',000'}} + {{props.course?.price == 0 ? 'رایگان' : numberFormat(props.course?.price) }} تومان

- 540,000 - تومان + {{ props.item?.price > 0 ? numberFormat(props.item?.price) + 'تومان' : 'رایگان' }} +

- laravel @@ -20,11 +17,11 @@
-

- ترفند های کاربردی پایتون -

+ {{ props.item?.name }} +
- + \ No newline at end of file diff --git a/pages/account/my-courses.vue b/pages/account/my-courses.vue index f4d798b..ae8f6e1 100644 --- a/pages/account/my-courses.vue +++ b/pages/account/my-courses.vue @@ -3,9 +3,11 @@
- - - + +
+ + +
@@ -24,6 +26,8 @@ \ No newline at end of file diff --git a/server/api/user/payments.js b/server/api/user/payments.js new file mode 100644 index 0000000..823a034 --- /dev/null +++ b/server/api/user/payments.js @@ -0,0 +1,19 @@ +export default defineEventHandler(async (event) => { + const { public: { apiBase } } = useRuntimeConfig(); + const token = getCookie(event, 'token'); + try { + const payments = await $fetch(`${apiBase}/user/payments`, { + method: 'GET', + headers: { + 'Accept': 'application/json', + 'Authorization': `Bearer ${token}` + }, + }); +console.log('server', payments); + return payments; + } catch (error) { + + return error; + } + +}) \ No newline at end of file diff --git a/utils/jDate.js b/utils/jDate.js new file mode 100644 index 0000000..b8e533f --- /dev/null +++ b/utils/jDate.js @@ -0,0 +1 @@ +export const jDate = (d) => new Date(d).toLocaleDateString('fa-IR') \ No newline at end of file diff --git a/utils/numberFormat.js b/utils/numberFormat.js new file mode 100644 index 0000000..f490379 --- /dev/null +++ b/utils/numberFormat.js @@ -0,0 +1,5 @@ +// export const numberFormat = (number) => new Intl.NumberFormat('en-IN', { maximumSignificantDigits: 3 }).format(number) + +export const numberFormat = (number) => { + return new Intl.NumberFormat().format(number) +} \ No newline at end of file