From 6160c89c6865b43552f76e3f0c00cd70c16ad975 Mon Sep 17 00:00:00 2001 From: Megghy Date: Wed, 30 Apr 2025 04:39:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=99=9A=E6=8B=9F=E7=A4=BC=E7=89=A9=E5=A4=9AKey=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=92=8C=E6=8E=92=E5=BA=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在商品模型中添加密钥选择模式和虚拟密钥列表 - 更新商品展示组件,支持置顶标记和价格徽章 - 优化商品管理视图,添加排序功能和清空筛选条件的功能 - 改进礼物添加表单,增加输入验证和错误提示 --- src/api/api-models.ts | 22 +- src/components.d.ts | 9 - src/components/manage/PointGoodsItem.vue | 336 ++++++++++++++++------ src/views/manage/point/PointManage.vue | 342 +++++++++++++++-------- src/views/manage/point/PointSettings.vue | 259 ++++++++++++----- src/views/pointViews/PointGoodsView.vue | 222 ++++++++++++--- 6 files changed, 858 insertions(+), 332 deletions(-) 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 }" > - -