diff --git a/src/api/products.ts b/src/api/products.ts index e0f492e..56db761 100644 --- a/src/api/products.ts +++ b/src/api/products.ts @@ -6,6 +6,10 @@ import type { PWallet, Wallet } from '@/models/wallet' export const getProducts = async (): Promise => { return await useAxios.get(`/customer/product/list`, { timeout: 15000 }) } +export const getTvProducts = async (): Promise => { + const response = await useAxios.get(`/customer/tv/products`, { timeout: 15000 }) + return Array.isArray(response) ? (response as Product[]) : [] +} export const getProductById = async ( id:number|null): Promise => { return await useAxios.get(`/customer/product/list/${id}`, { timeout: 15000 }) } diff --git a/src/app/setupRouter.ts b/src/app/setupRouter.ts index 96b597d..c04c457 100644 --- a/src/app/setupRouter.ts +++ b/src/app/setupRouter.ts @@ -34,7 +34,7 @@ export function setupRouterGuards() { } function goToLogin(to: RouteLocationNormalized, next: NavigationGuardNext) { - if (to.name === 'buyProduct' || to.name === 'productDetail' || to.name === 'about' || to.name === 'cart') { + if (to.name === 'buyProduct' || to.name === 'productDetail' || to.name === 'about' || to.name === 'cart' || to.name === 'tv') { return next() } if (to.name !== 'login') { @@ -112,7 +112,7 @@ export function setupRouterGuards() { return next() } } else { - if (['login', '404', 'buyProduct', 'productDetail', 'about', 'cart'].includes(to.name as string)) { + if (['login', '404', 'buyProduct', 'productDetail', 'about', 'cart', 'tv'].includes(to.name as string)) { return next() } goToLogin(to, next) @@ -126,7 +126,7 @@ export function setupRouterGuards() { return next() } - if (['login', '404', 'buyProduct', 'productDetail', 'about', 'cart'].includes(to.name as string)) { + if (['login', '404', 'buyProduct', 'productDetail', 'about', 'cart', 'tv'].includes(to.name as string)) { return next() } return next({ name: 'login' }) diff --git a/src/models/products.ts b/src/models/products.ts index 06db4d0..244426a 100644 --- a/src/models/products.ts +++ b/src/models/products.ts @@ -11,6 +11,7 @@ export interface Product { active: boolean show: boolean show_in_assets?: boolean + show_on_tv?: boolean open_sell: boolean open_buy: boolean group_type:string diff --git a/src/router/index.ts b/src/router/index.ts index 5bd1044..199ab16 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -168,6 +168,12 @@ const router = createRouter({ }, ] }, + { + path: '/tv', + name: 'tv', + meta: { hideMenu: true }, + component: () => import('@/views/base/tv/index.vue') + }, { path: '/:pathMatch(.*)*', name: 'notFound', diff --git a/src/views/base/tv/index.vue b/src/views/base/tv/index.vue new file mode 100644 index 0000000..c7f7aa8 --- /dev/null +++ b/src/views/base/tv/index.vue @@ -0,0 +1,184 @@ + + + + +