diff --git a/Build_God_Admin_Frontend/Frontend/src/api/shop.ts b/Build_God_Admin_Frontend/Frontend/src/api/shop.ts new file mode 100644 index 0000000..7ccb06b --- /dev/null +++ b/Build_God_Admin_Frontend/Frontend/src/api/shop.ts @@ -0,0 +1,27 @@ +import http from "../api/index"; + +export interface ShopItem { + id: number; + itemType: number; + itemId: number; + price: number; + dailyLimit: number; + isActive: boolean; + sortOrder: number; +} + +export const GetShopItemList = (): Promise => { + return http.get('/shop/admin/all'); +}; + +export const CreateShopItem = (data: ShopItem): Promise => { + return http.post('/shop/admin', data); +}; + +export const UpdateShopItem = (data: ShopItem): Promise => { + return http.put(`/shop/admin/${data.id}`, data); +}; + +export const DeleteShopItem = (id: number): Promise => { + return http.delete(`/shop/admin/${id}`); +}; diff --git a/Build_God_Admin_Frontend/Frontend/src/components/Sidebar.vue b/Build_God_Admin_Frontend/Frontend/src/components/Sidebar.vue index a67ef10..af9e346 100644 --- a/Build_God_Admin_Frontend/Frontend/src/components/Sidebar.vue +++ b/Build_God_Admin_Frontend/Frontend/src/components/Sidebar.vue @@ -55,6 +55,11 @@ const menuItems = [ icon: ICONS.monster, label: '怪兽管理', path: '/admin/monsters' + }, + { + icon: ICONS.shop, + label: '商店管理', + path: '/admin/shops' } ] diff --git a/Build_God_Admin_Frontend/Frontend/src/constants/theme.ts b/Build_God_Admin_Frontend/Frontend/src/constants/theme.ts index 3af7360..c613044 100644 --- a/Build_God_Admin_Frontend/Frontend/src/constants/theme.ts +++ b/Build_God_Admin_Frontend/Frontend/src/constants/theme.ts @@ -8,6 +8,7 @@ export const ICONS = { mission: '📜', scrap: '📜', monster: '👹', + shop: '💰', reward: { pill: '💊', diff --git a/Build_God_Admin_Frontend/Frontend/src/router/index.ts b/Build_God_Admin_Frontend/Frontend/src/router/index.ts index 11d5563..97cd581 100644 --- a/Build_God_Admin_Frontend/Frontend/src/router/index.ts +++ b/Build_God_Admin_Frontend/Frontend/src/router/index.ts @@ -80,6 +80,12 @@ const routes: RouteRecordRaw[] = [ name: 'settings', component: () => import('../views/admin/SettingsView.vue'), meta: { title: '系统设置' } + }, + { + path: 'shops', + name: 'shops', + component: () => import('../views/admin/ShopView.vue'), + meta: { title: '商店管理' } } ] }, diff --git a/Build_God_Admin_Frontend/Frontend/src/views/admin/ShopView.vue b/Build_God_Admin_Frontend/Frontend/src/views/admin/ShopView.vue new file mode 100644 index 0000000..6c11010 --- /dev/null +++ b/Build_God_Admin_Frontend/Frontend/src/views/admin/ShopView.vue @@ -0,0 +1,334 @@ + + + + +