修复钱包相关功能

This commit is contained in:
张成
2025-10-18 17:24:39 +08:00
parent 0737b12b0e
commit de52dc4762
4 changed files with 35 additions and 11 deletions

View File

@@ -20,13 +20,16 @@ interface Transaction {
create_time: string;
last_modify_time: string;
related_id: number;
type_text: string | null;
total_balance_after:string;
}
// 钱包信息类型
interface WalletInfo {
balance: number;
frozen_balance?: number;
total_balance?: number;
total_balance: number;
total_income?: number;
total_withdraw?: number;
}
@@ -292,7 +295,7 @@ const WalletPage: React.FC = () => {
}
if (wallet_info.balance <= 0) {
Taro.showToast({
title: "额不足",
title: "可提现金额不足",
icon: "error",
duration: 2000,
});
@@ -473,14 +476,14 @@ const WalletPage: React.FC = () => {
<Text className="currency_symbol">¥</Text>
<View className="amount_group">
<Text className="main_amount">
{Math.floor(wallet_info.balance)}
{(wallet_info.total_balance)?.toFixed(2)}
</Text>
<Text className="decimal_amount">
{/* <Text className="decimal_amount">
.
{((wallet_info.balance % 1) * 100)
.toFixed(0)
.padStart(2, "0")}
</Text>
</Text> */}
</View>
</View>
<Button className="withdraw_btn" onClick={handle_withdraw}>
@@ -580,11 +583,19 @@ const WalletPage: React.FC = () => {
</View>
</View>
<View className="transaction_right">
<Text className="transaction_amount">
{get_amount_display(transaction)}
</Text>
<View>
<Text className="type_text_tag">
{transaction.type_text}
</Text>
<Text className="transaction_amount">
{get_amount_display(transaction)}
</Text>
</View>
<Text className="balance_info">
¥{format_amount(wallet_info.balance)}
¥{format_amount(transaction.total_balance_after)}
</Text>
</View>
</View>