-
-
+
+
-
-
+
+
+
+
-
+
diff --git a/front/src/index.d.ts b/front/src/index.d.ts
index bee66c6..aa839d9 100644
--- a/front/src/index.d.ts
+++ b/front/src/index.d.ts
@@ -76,4 +76,19 @@ interface EnvVars {
clear_color?: string,
env_displacementmap?: string,
env_normalmap?: string
+}
+
+interface PageItem {
+ id: number;
+ images: Image[];
+ name: string;
+ slug: string;
+ is_front: boolean;
+ scene_3d: number;
+}
+interface Image {
+ id: number;
+ file: string;
+ alt: string;
+ title: string;
}
\ No newline at end of file
diff --git a/front/src/main.ts b/front/src/main.ts
index 4fb1f14..39f09c7 100644
--- a/front/src/main.ts
+++ b/front/src/main.ts
@@ -9,7 +9,7 @@ import Promo from './components/Promo/index.vue'
import PromoMain from './components/Promo/main.vue'
const routes = [
- { path: '/', component: Promo, name: 'index' },
+ { path: '/', component: Promo, name: 'home_no' },
{ path: '/:item', component: Promo, name: 'home' },
{ path: '/:item/:target', component: PromoMain, name: 'scene' },
]
diff --git a/front/src/stores/item.ts b/front/src/stores/item.ts
new file mode 100644
index 0000000..168c0ab
--- /dev/null
+++ b/front/src/stores/item.ts
@@ -0,0 +1,21 @@
+import { defineStore } from 'pinia'
+import { SERVER_URL } from '../constants'
+export const useItem = defineStore('item', {
+ state: () => {
+ return {
+
+ } as PageItem
+ },
+ actions: {
+ async load(params: any) {
+ const res = await fetch(`${SERVER_URL}/api/item/${params.item ? (params.item + '/') : '?is_front=true'}`)
+ const pageArray = await res.json()
+ const page = Array.isArray(pageArray) ? pageArray[0] : pageArray
+ // this.$state = Object.assign(this.$state, page)
+ for (const key in page) {
+ this[key] = page[key]
+ }
+ return page
+ }
+ }
+})