diff --git a/src/api/api-models.ts b/src/api/api-models.ts index e5710f5..d5df165 100644 --- a/src/api/api-models.ts +++ b/src/api/api-models.ts @@ -650,6 +650,14 @@ export enum GoodsTypes { Physical, Virtual } + +// 添加密钥选择模式枚举 +export enum KeySelectionMode { + None, + Random, // 随机选择 + Sequential // 顺序选择 +} + export interface PointGoodsSetting { guardFree?: { year: number; month: number } allowGuardLevel?: GuardLevel @@ -670,16 +678,22 @@ export interface ResponsePointGoodModel { maxBuyCount?: number collectUrl?: string embedCollectUrl?: boolean + isPinned: boolean canFreeBuy: boolean allowGuardLevel: GuardLevel setting: PointGoodsSetting + + // 添加虚拟礼物多Key支持 + virtualKeys?: string[] + keySelectionMode?: KeySelectionMode + currentKeyIndex?: number } export interface ImageUploadModel { existImages: string[] newImagesBase64: string[] } -export interface PointGoodsModel { +export interface UploadPointGoodsModel { id?: number name: string count?: number @@ -694,8 +708,14 @@ export interface PointGoodsModel { content?: string isAllowRebuy: boolean maxBuyCount?: number + isPinned: boolean setting: PointGoodsSetting + + // 添加虚拟礼物多Key支持 + virtualKeys?: string[] + keySelectionMode?: KeySelectionMode + currentKeyIndex?: number } export interface AddressInfo { id?: string diff --git a/src/components.d.ts b/src/components.d.ts index e9ad635..5901f37 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -20,28 +20,19 @@ declare module 'vue' { MonacoEditorComponent: typeof import('./components/MonacoEditorComponent.vue')['default'] NAlert: typeof import('naive-ui')['NAlert'] NAvatar: typeof import('naive-ui')['NAvatar'] - NBadge: typeof import('naive-ui')['NBadge'] NButton: typeof import('naive-ui')['NButton'] NCard: typeof import('naive-ui')['NCard'] - NCollapse: typeof import('naive-ui')['NCollapse'] - NDataTable: typeof import('naive-ui')['NDataTable'] - NDivider: typeof import('naive-ui')['NDivider'] NEmpty: typeof import('naive-ui')['NEmpty'] NFlex: typeof import('naive-ui')['NFlex'] NFormItemGi: typeof import('naive-ui')['NFormItemGi'] NGridItem: typeof import('naive-ui')['NGridItem'] NIcon: typeof import('naive-ui')['NIcon'] NImage: typeof import('naive-ui')['NImage'] - NInput: typeof import('naive-ui')['NInput'] NPopconfirm: typeof import('naive-ui')['NPopconfirm'] NScrollbar: typeof import('naive-ui')['NScrollbar'] NSpace: typeof import('naive-ui')['NSpace'] - NSpin: typeof import('naive-ui')['NSpin'] - NTabPane: typeof import('naive-ui')['NTabPane'] - NTabs: typeof import('naive-ui')['NTabs'] NTag: typeof import('naive-ui')['NTag'] NText: typeof import('naive-ui')['NText'] - NTooltip: typeof import('naive-ui')['NTooltip'] PointGoodsItem: typeof import('./components/manage/PointGoodsItem.vue')['default'] PointHistoryCard: typeof import('./components/manage/PointHistoryCard.vue')['default'] PointOrderCard: typeof import('./components/manage/PointOrderCard.vue')['default'] diff --git a/src/components/manage/PointGoodsItem.vue b/src/components/manage/PointGoodsItem.vue index b4bcb64..63ca90c 100644 --- a/src/components/manage/PointGoodsItem.vue +++ b/src/components/manage/PointGoodsItem.vue @@ -2,7 +2,7 @@ import { GoodsTypes, ResponsePointGoodModel } from '@/api/api-models'; import { FILE_BASE_URL, IMGUR_URL } from '@/data/constants'; import { NAlert, NCard, NEllipsis, NEmpty, NFlex, NIcon, NImage, NTag, NText } from 'naive-ui'; - import { VehicleShip20Filled } from '@vicons/fluent'; + import { VehicleShip20Filled, Pin16Filled } from '@vicons/fluent'; const props = defineProps<{ goods: ResponsePointGoodModel | undefined; @@ -22,77 +22,143 @@ v-else embedded :style="props.contentStyle" + size="small" class="goods-card" + :class="{ 'pinned-card': goods.isPinned }" > - + + + + + + + + + + + 🪙 {{ goods.price > 0 ? goods.price : '免费' }} + + + + + + + + {{ goods.type == GoodsTypes.Physical ? '实物' : '虚拟' }} + + + + 已售完 + + + + + {{ goods.allowGuardLevel === 1 ? '总督' : goods.allowGuardLevel === 2 ? '提督' : '舰长' }}专属 + + + - - - - - - 库存: - - - {{ goods.count }} - - + + + + + - 无 - - - ∞ - + + {{ goods.name }} + + + + + + 库存: + + + {{ goods.count }} + + + 无 + + + ∞ + + - - - - - - 已售完 - - - - - {{ goods.type == GoodsTypes.Physical ? '实物' : '虚拟' }} - - - - - {{ goods.name }} - - - - - - + + + - - - - - - - - 仅限舰长 - - - - - {{ tag }} - - + + + + + {{ tag }} + + + @@ -137,10 +197,118 @@ diff --git a/src/views/manage/point/PointManage.vue b/src/views/manage/point/PointManage.vue index eea560e..52842ff 100644 --- a/src/views/manage/point/PointManage.vue +++ b/src/views/manage/point/PointManage.vue @@ -1,7 +1,7 @@