diff --git a/src/features/resources/api.test.ts b/src/features/resources/api.test.ts index f49a43b..d874fbd 100644 --- a/src/features/resources/api.test.ts +++ b/src/features/resources/api.test.ts @@ -86,7 +86,6 @@ test("resource APIs use generated admin paths", async () => { giftId: "rose", giftPointAmount: 1, giftTypeCode: "normal", - heatValue: 1, name: "Rose", presentationJson: "{}", priceVersion: "default", @@ -138,7 +137,6 @@ test("resource APIs use generated admin paths", async () => { giftId: "rose", giftPointAmount: 1, giftTypeCode: "normal", - heatValue: 1, name: "Rose", presentationJson: "{}", priceVersion: "default", diff --git a/src/features/resources/api.ts b/src/features/resources/api.ts index 08f17fe..8ccd369 100644 --- a/src/features/resources/api.ts +++ b/src/features/resources/api.ts @@ -128,7 +128,6 @@ export interface GiftDto { chargeAssetType?: string; coinPrice?: number; giftPointAmount?: number; - heatValue?: number; effectiveFromMs?: number; effectiveToMs?: number; effectTypes?: string[]; @@ -162,7 +161,6 @@ export interface GiftPayload { chargeAssetType: string; coinPrice: number; giftPointAmount: number; - heatValue: number; effectiveAtMs: number; effectiveFromMs: number; effectiveToMs: number; diff --git a/src/features/resources/hooks/useResourcePages.js b/src/features/resources/hooks/useResourcePages.js index ab09ab4..4f3c358 100644 --- a/src/features/resources/hooks/useResourcePages.js +++ b/src/features/resources/hooks/useResourcePages.js @@ -113,7 +113,6 @@ const emptyGiftForm = (gift = {}) => ({ giftId: gift.giftId || "", giftPointAmount: gift.giftPointAmount === 0 || gift.giftPointAmount ? String(gift.giftPointAmount) : "0", giftTypeCode: gift.giftTypeCode || "normal", - heatValue: gift.heatValue === 0 || gift.heatValue ? String(gift.heatValue) : "0", name: gift.name || "", presentationJson: gift.presentationJson || "{}", priceVersion: gift.priceVersion || "default", @@ -137,12 +136,10 @@ export function applyGiftResourceSelection(form, resource, fillIdentity = true) export function applyGiftPriceDefaults(form, coinPrice) { const priceValue = String(coinPrice ?? ""); - const priceNumber = Number(priceValue); return { ...form, coinPrice: priceValue, giftPointAmount: priceValue, - heatValue: priceValue.trim() && Number.isFinite(priceNumber) ? String(Math.ceil(priceNumber / 100)) : "", }; } @@ -1420,7 +1417,6 @@ function buildGiftPayload(form) { giftId: form.giftId.trim(), giftPointAmount: Number(form.coinPrice || 0), giftTypeCode: form.giftTypeCode, - heatValue: Number(form.heatValue || 0), name: form.name.trim(), presentationJson: form.presentationJson?.trim() || "{}", priceVersion: form.priceVersion.trim(), diff --git a/src/features/resources/hooks/useResourcePages.test.js b/src/features/resources/hooks/useResourcePages.test.js index b30abda..ca8c335 100644 --- a/src/features/resources/hooks/useResourcePages.test.js +++ b/src/features/resources/hooks/useResourcePages.test.js @@ -25,22 +25,19 @@ test("fills gift name and id from selected gift resource", () => { }); }); -test("fills gift points and heat from gift price", () => { +test("fills gift points from gift price", () => { const form = { coinPrice: "", giftPointAmount: "0", - heatValue: "0", name: "Rose", }; expect(applyGiftPriceDefaults(form, "100")).toMatchObject({ coinPrice: "100", giftPointAmount: "100", - heatValue: "1", }); expect(applyGiftPriceDefaults(form, "101")).toMatchObject({ coinPrice: "101", giftPointAmount: "101", - heatValue: "2", }); }); diff --git a/src/features/resources/pages/GiftListPage.jsx b/src/features/resources/pages/GiftListPage.jsx index c9bf145..cfabe8b 100644 --- a/src/features/resources/pages/GiftListPage.jsx +++ b/src/features/resources/pages/GiftListPage.jsx @@ -72,14 +72,9 @@ const baseColumns = (giftTypeOptions) => [ }, { key: "income", - label: "积分 / 热度", + label: "积分", width: "minmax(140px, 0.8fr)", - render: (gift) => ( -