From 07866f48d079c32f342a445b9ce923c3a246de4e Mon Sep 17 00:00:00 2001 From: que01 Date: Sun, 20 Sep 2026 17:16:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E6=9E=84=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E9=A1=B9=E7=AE=A1=E7=90=86=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/features/services/ServicesPage.tsx | 112 +++++++++++------- 1 file changed, 70 insertions(+), 42 deletions(-) diff --git a/apps/admin/src/features/services/ServicesPage.tsx b/apps/admin/src/features/services/ServicesPage.tsx index 29d7a8a..0af0ca7 100644 --- a/apps/admin/src/features/services/ServicesPage.tsx +++ b/apps/admin/src/features/services/ServicesPage.tsx @@ -8,6 +8,7 @@ import { Space, Table, Tag, + Typography, message, Divider, } from "antd"; @@ -15,6 +16,8 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import type { Offering, PublicService } from "@personal-brand/api-client"; import { useState } from "react"; import { createApiClient } from "../../lib/api.js"; +import { AdminPageHeader } from "../../components/AdminPageHeader.js"; +import { MutationError, QueryState } from "../../components/QueryState.js"; export function ServicesPage() { const client = createApiClient(); @@ -90,58 +93,46 @@ export function ServicesPage() { ); }; return ( - begin()}> - 新增服务 - - } + { + void query.refetch(); + void offerings.refetch(); + }} > - {value} }, - { title: "价格展示", dataIndex: "priceText" }, - { - title: "状态", - dataIndex: "isEnabled", - render: (value) => (value ? "已上架" : "已下架"), - }, - { - title: "操作", - render: (_: unknown, item: PublicService) => ( - - - - - ), - }, - ]} - /> - 通用业务提供项 - beginOffering()}> - 新增提供项 + 新增业务提供项 } - > + /> + 小程序优先展示}>
{value} }, + { + title: "业务类型", + dataIndex: "kind", + render: (value) => ( + + {( + { + service: "服务", + product: "定制产品", + package: "套餐", + subscription: "订阅", + } as Record + )[value] ?? value} + + ), + }, { title: "价格", dataIndex: "priceText" }, { title: "状态", @@ -158,6 +149,43 @@ export function ServicesPage() { }, ]} /> + {offerings.data?.length === 0 && ( + + 还没有公开业务提供项。创建后,小程序服务页会优先读取这些内容。 + + )} + 兼容旧版服务 +
(value ? "已公开" : "已下架"), + }, + { + title: "操作", + render: (_: unknown, item: PublicService) => ( + + + + + ), + }, + ]} + /> + + + - + ); }