diff --git a/reading-platform-frontend/src/api/collections.ts b/reading-platform-frontend/src/api/collections.ts index 95a9be8..17d62f3 100644 --- a/reading-platform-frontend/src/api/collections.ts +++ b/reading-platform-frontend/src/api/collections.ts @@ -230,6 +230,17 @@ export function formatPrice(price: number | null | undefined): string { return `¥${(price / 100).toFixed(2)}`; } +// 优惠类型映射(与套餐列表、租户选择保持一致) +export const DISCOUNT_TYPE_MAP: Record = { + PERCENTAGE: '折扣', + FIXED: '立减', +}; + +export function getDiscountTypeText(type?: string): string { + if (!type) return '-'; + return DISCOUNT_TYPE_MAP[type] || type; +} + // 格式化日期 export function formatDate(date: string): string { return new Date(date).toLocaleString('zh-CN'); diff --git a/reading-platform-frontend/src/views/admin/collections/CollectionDetailView.vue b/reading-platform-frontend/src/views/admin/collections/CollectionDetailView.vue index 1515906..82bc92d 100644 --- a/reading-platform-frontend/src/views/admin/collections/CollectionDetailView.vue +++ b/reading-platform-frontend/src/views/admin/collections/CollectionDetailView.vue @@ -208,14 +208,7 @@ const getStatusText = (status: string) => { return collectionsApi.getCollectionStatusInfo(status).label; }; -const getDiscountTypeText = (type?: string) => { - if (!type) return '-'; - const typeMap: Record = { - PERCENTAGE: '折扣', - FIXED: '立减', - }; - return typeMap[type] || type; -}; +const getDiscountTypeText = collectionsApi.getDiscountTypeText; // 删除套餐 const handleDelete = async () => { diff --git a/reading-platform-frontend/src/views/admin/collections/CollectionListView.vue b/reading-platform-frontend/src/views/admin/collections/CollectionListView.vue index 88625ac..7767926 100644 --- a/reading-platform-frontend/src/views/admin/collections/CollectionListView.vue +++ b/reading-platform-frontend/src/views/admin/collections/CollectionListView.vue @@ -148,15 +148,7 @@ const columns = [ const getStatusColor = (status: string) => collectionsApi.getCollectionStatusInfo(status).color; const getStatusText = (status: string) => collectionsApi.getCollectionStatusInfo(status).label; const formatPrice = (price: number | null | undefined) => collectionsApi.formatPrice(price); - -const getDiscountTypeText = (type?: string) => { - if (!type) return '-'; - const typeMap: Record = { - PERCENTAGE: '折扣', - FIXED: '立减', - }; - return typeMap[type] || type; -}; +const getDiscountTypeText = collectionsApi.getDiscountTypeText; const parseGradeLevels = (gradeLevels: string | string[]) => { return collectionsApi.parseGradeLevels(gradeLevels); diff --git a/reading-platform-frontend/src/views/admin/courses/CourseReviewView.vue b/reading-platform-frontend/src/views/admin/courses/CourseReviewView.vue index 2009735..b9b9406 100644 --- a/reading-platform-frontend/src/views/admin/courses/CourseReviewView.vue +++ b/reading-platform-frontend/src/views/admin/courses/CourseReviewView.vue @@ -84,7 +84,7 @@ -
+ @@ -119,33 +119,37 @@ - - - - - 教学科学性符合要求 - - - 素材质量达标 - - - 标签分类准确 - - - 版权合规 - - - - + + + + + + + 教学科学性符合要求 + + + 素材质量达标 + + + 标签分类准确 + + + 版权合规 + + + + + - - - - - -
+ + + + +
@@ -159,6 +163,7 @@