fix: 对齐首充双倍展示状态
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
ArrowRight,
|
||||
AlertCircle,
|
||||
ArrowRight,
|
||||
BookOpen,
|
||||
Camera,
|
||||
CheckCircle2,
|
||||
@@ -16,8 +16,8 @@ import {
|
||||
Heart,
|
||||
LogIn,
|
||||
MessageCircle,
|
||||
Pencil,
|
||||
Palette,
|
||||
Pencil,
|
||||
Plus,
|
||||
Search,
|
||||
Settings,
|
||||
@@ -47,22 +47,22 @@ import communityQqQrImage from '../../../media/social-media-group/qq.png';
|
||||
import communityWechatQrImage from '../../../media/social-media-group/wechat.png';
|
||||
import type { PublicUserSummary } from '../../../packages/shared/src/contracts/auth';
|
||||
import type {
|
||||
ConfirmWechatProfileRechargeOrderResponse,
|
||||
CustomWorldLibraryEntry,
|
||||
PlatformBrowseHistoryEntry,
|
||||
ConfirmWechatProfileRechargeOrderResponse,
|
||||
ProfileDashboardCardKey,
|
||||
ProfileDashboardSummary,
|
||||
ProfilePlayedWorkSummary,
|
||||
ProfilePlayStatsResponse,
|
||||
ProfileReferralInviteCenterResponse,
|
||||
ProfileRechargeCenterResponse,
|
||||
ProfileRechargeProduct,
|
||||
WechatMiniProgramPayParams,
|
||||
ProfileReferralInviteCenterResponse,
|
||||
ProfileSaveArchiveSummary,
|
||||
ProfileTaskCenterResponse,
|
||||
ProfileTaskItem,
|
||||
ProfileWalletLedgerResponse,
|
||||
RedeemProfileRewardCodeResponse,
|
||||
WechatMiniProgramPayParams,
|
||||
} from '../../../packages/shared/src/contracts/runtime';
|
||||
import type { HydratedSavedGameSnapshot } from '../../persistence/runtimeSnapshotTypes';
|
||||
import { buildPublicWorkDetailUrl } from '../../routing/appPageRoutes';
|
||||
@@ -77,8 +77,8 @@ import {
|
||||
claimRpgProfileTaskReward,
|
||||
confirmWechatRpgProfileRechargeOrder,
|
||||
createRpgProfileRechargeOrder,
|
||||
getRpgProfileReferralInviteCenter,
|
||||
getRpgProfileRechargeCenter,
|
||||
getRpgProfileReferralInviteCenter,
|
||||
getRpgProfileTasks,
|
||||
getRpgProfileWalletLedger,
|
||||
redeemRpgProfileReferralInviteCode,
|
||||
@@ -2498,17 +2498,23 @@ async function confirmWechatRechargeOrderUntilSettled(
|
||||
|
||||
function RechargeProductCard({
|
||||
product,
|
||||
hasPointsRecharged,
|
||||
submittingProductId,
|
||||
onBuy,
|
||||
}: {
|
||||
product: ProfileRechargeProduct;
|
||||
hasPointsRecharged: boolean;
|
||||
submittingProductId: string | null;
|
||||
onBuy: (product: ProfileRechargeProduct) => void;
|
||||
}) {
|
||||
const submitting = submittingProductId === product.productId;
|
||||
const effectiveBonusPoints =
|
||||
product.kind === 'points' && hasPointsRecharged ? 0 : product.bonusPoints;
|
||||
const badgeLabel =
|
||||
product.kind === 'points' && hasPointsRecharged ? '' : product.badgeLabel;
|
||||
const value =
|
||||
product.kind === 'points'
|
||||
? `${product.pointsAmount}${product.bonusPoints > 0 ? `+${product.bonusPoints}` : ''}泥点`
|
||||
? `${product.pointsAmount}${effectiveBonusPoints > 0 ? `+${effectiveBonusPoints}` : ''}泥点`
|
||||
: `${product.durationDays}天`;
|
||||
|
||||
return (
|
||||
@@ -2518,9 +2524,9 @@ function RechargeProductCard({
|
||||
disabled={Boolean(submittingProductId)}
|
||||
className="platform-subpanel platform-interactive-card relative min-h-[7.25rem] rounded-[1.15rem] px-3.5 py-3.5 text-left disabled:cursor-not-allowed disabled:opacity-60"
|
||||
>
|
||||
{product.badgeLabel ? (
|
||||
{badgeLabel ? (
|
||||
<span className="platform-pill platform-pill--warm absolute right-3 top-3 max-w-[7rem] truncate px-2 py-0.5 text-[10px]">
|
||||
{product.badgeLabel}
|
||||
{badgeLabel}
|
||||
</span>
|
||||
) : null}
|
||||
<div className="pr-20 text-sm font-black text-[var(--platform-text-strong)]">
|
||||
@@ -2640,6 +2646,7 @@ function ProfileRechargeModal({
|
||||
<RechargeProductCard
|
||||
key={product.productId}
|
||||
product={product}
|
||||
hasPointsRecharged={center?.hasPointsRecharged === true}
|
||||
submittingProductId={submittingProductId}
|
||||
onBuy={onBuy}
|
||||
/>
|
||||
@@ -3928,7 +3935,7 @@ export function RpgEntryHomeView({
|
||||
setIsWalletLedgerOpen(true);
|
||||
loadWalletLedger();
|
||||
};
|
||||
const loadRechargeCenter = () => {
|
||||
const loadRechargeCenter = useCallback(() => {
|
||||
setRechargeError(null);
|
||||
setIsLoadingRechargeCenter(true);
|
||||
void getRpgProfileRechargeCenter()
|
||||
@@ -3940,15 +3947,12 @@ export function RpgEntryHomeView({
|
||||
);
|
||||
})
|
||||
.finally(() => setIsLoadingRechargeCenter(false));
|
||||
};
|
||||
const refreshRechargeState = useCallback(
|
||||
() => {
|
||||
loadRechargeCenter();
|
||||
setSubmittingRechargeProductId(null);
|
||||
pendingWechatRechargeOrderIdRef.current = null;
|
||||
},
|
||||
[loadRechargeCenter],
|
||||
);
|
||||
}, []);
|
||||
const refreshRechargeState = useCallback(() => {
|
||||
loadRechargeCenter();
|
||||
setSubmittingRechargeProductId(null);
|
||||
pendingWechatRechargeOrderIdRef.current = null;
|
||||
}, [loadRechargeCenter]);
|
||||
const handleWechatPayResult = useCallback(() => {
|
||||
const payResult = readWechatPayResultFromHash();
|
||||
if (!payResult) {
|
||||
|
||||
Reference in New Issue
Block a user