diff --git a/src/api/giftCard.ts b/src/api/giftCard.ts new file mode 100644 index 0000000..cd4a607 --- /dev/null +++ b/src/api/giftCard.ts @@ -0,0 +1,5 @@ +import useAxios from "@/utils/useAxios"; + + +//customer +export const registerCodeGiftCard = async (code: string) => await useAxios.post(`/customer/giftcard/use`, {code:code}) diff --git a/src/main.ts b/src/main.ts index 02539e2..696dcfc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,6 +15,7 @@ import VueLazyLoad from 'vue3-lazyload' import { getMe } from '@/api/me' import type { NavigationGuardNext, RouteLocationNormalized } from 'vue-router' import { useAuthStore } from '@/store/useAuthStore' +import {getConfigApp} from "@/utils/config"; const app = createApp(App) @@ -85,6 +86,8 @@ router.beforeEach(async (to, from, next) => { if (timeoutId) { clearTimeout(timeoutId) } + if (to.name=='giftCard' && getConfigApp('name')!='garoosi') + return next({ name: from.name }) // Start a new timeout to reset fingerprint after 5 seconds of inactivity if (from.name !== 'login' || from.name !== undefined) { timeoutId = setTimeout(async () => { diff --git a/src/router/index.ts b/src/router/index.ts index 2294a17..fd2361b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -98,6 +98,11 @@ const router = createRouter({ name: 'earnMoney', component: () => import('@/views/base/earnMoney/index.vue') }, + { + path: 'giftCard', + name: 'giftCard', + component: () => import('@/views/base/giftCard/index.vue') + }, { path: 'fund', name: 'fund', diff --git a/src/views/base/giftCard/index.vue b/src/views/base/giftCard/index.vue new file mode 100644 index 0000000..75a5e7f --- /dev/null +++ b/src/views/base/giftCard/index.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/src/views/base/index.vue b/src/views/base/index.vue index d7f5b71..6e5e106 100644 --- a/src/views/base/index.vue +++ b/src/views/base/index.vue @@ -50,6 +50,13 @@
قوانین و مقررات
+ +
+ +
ثبت کارت هدیه
+
+