From 84974f0e786dc4ba4dfbea458dce311a0fbe7354 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Tue, 17 Dec 2024 11:13:28 +0800 Subject: [PATCH] fix: amount type --- src/components/ServerCard.tsx | 32 ++++++++++++++++++++--------- src/components/ServerCardInline.tsx | 32 ++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/src/components/ServerCard.tsx b/src/components/ServerCard.tsx index b0ad92b..fa73c41 100644 --- a/src/components/ServerCard.tsx +++ b/src/components/ServerCard.tsx @@ -72,12 +72,15 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf

剩余时间: {isNeverExpire ? "永久" : daysLeft + "天"}

- {parsedData.billingDataMod.amount !== "0" ? ( -

+ {parsedData.billingDataMod.amount !== "0" && + parsedData.billingDataMod.amount !== "-1" ? ( +

价格: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}

+ ) : parsedData.billingDataMod.amount === "0" ? ( +

免费

) : ( -

免费

+

按量收费

)} ) : ( @@ -85,12 +88,15 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf

已过期: {daysLeft * -1} 天

- {parsedData.billingDataMod.amount !== "0" ? ( + {parsedData.billingDataMod.amount !== "0" && + parsedData.billingDataMod.amount !== "-1" ? (

价格: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}

- ) : ( + ) : parsedData.billingDataMod.amount === "0" ? (

免费

+ ) : ( +

按量收费

)} ))} @@ -202,12 +208,15 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf

剩余时间: {isNeverExpire ? "永久" : daysLeft + "天"}

- {parsedData.billingDataMod.amount !== "0" ? ( -

+ {parsedData.billingDataMod.amount !== "0" && + parsedData.billingDataMod.amount !== "-1" ? ( +

价格: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}

+ ) : parsedData.billingDataMod.amount === "0" ? ( +

免费

) : ( -

免费

+

按量收费

)} ) : ( @@ -215,12 +224,15 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf

已过期: {daysLeft * -1} 天

- {parsedData.billingDataMod.amount !== "0" ? ( + {parsedData.billingDataMod.amount !== "0" && + parsedData.billingDataMod.amount !== "-1" ? (

价格: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}

- ) : ( + ) : parsedData.billingDataMod.amount === "0" ? (

免费

+ ) : ( +

按量收费

)} ))} diff --git a/src/components/ServerCardInline.tsx b/src/components/ServerCardInline.tsx index 624cc35..ddaccc8 100644 --- a/src/components/ServerCardInline.tsx +++ b/src/components/ServerCardInline.tsx @@ -86,12 +86,15 @@ export default function ServerCardInline({

剩余时间: {isNeverExpire ? "永久" : daysLeft + "天"}

- {parsedData.billingDataMod.amount !== "0" ? ( -

+ {parsedData.billingDataMod.amount !== "0" && + parsedData.billingDataMod.amount !== "-1" ? ( +

价格: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}

+ ) : parsedData.billingDataMod.amount === "0" ? ( +

免费

) : ( -

免费

+

按量收费

)} ) : ( @@ -99,12 +102,15 @@ export default function ServerCardInline({

已过期: {daysLeft * -1} 天

- {parsedData.billingDataMod.amount !== "0" ? ( + {parsedData.billingDataMod.amount !== "0" && + parsedData.billingDataMod.amount !== "-1" ? (

价格: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}

- ) : ( + ) : parsedData.billingDataMod.amount === "0" ? (

免费

+ ) : ( +

按量收费

)} ))} @@ -241,12 +247,15 @@ export default function ServerCardInline({

剩余时间: {isNeverExpire ? "永久" : daysLeft + "天"}

- {parsedData.billingDataMod.amount !== "0" ? ( -

+ {parsedData.billingDataMod.amount !== "0" && + parsedData.billingDataMod.amount !== "-1" ? ( +

价格: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}

+ ) : parsedData.billingDataMod.amount === "0" ? ( +

免费

) : ( -

免费

+

按量收费

)} ) : ( @@ -254,12 +263,15 @@ export default function ServerCardInline({

已过期: {daysLeft * -1} 天

- {parsedData.billingDataMod.amount !== "0" ? ( + {parsedData.billingDataMod.amount !== "0" && + parsedData.billingDataMod.amount !== "-1" ? (

价格: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}

- ) : ( + ) : parsedData.billingDataMod.amount === "0" ? (

免费

+ ) : ( +

按量收费

)} ))}