优化提现成功后没有及时刷新交易记录
This commit is contained in:
@@ -28,7 +28,7 @@ interface Transaction {
|
||||
interface WalletInfo {
|
||||
balance: number;
|
||||
frozen_balance?: number;
|
||||
total_balance: number;
|
||||
total_balance?: number;
|
||||
total_income?: number;
|
||||
total_withdraw?: number;
|
||||
}
|
||||
@@ -157,12 +157,32 @@ const WalletPage: React.FC = () => {
|
||||
useEffect(() => {
|
||||
load_transactions();
|
||||
}, [load_transactions_params]);
|
||||
|
||||
// 页面显示时加载数据
|
||||
useDidShow(() => {
|
||||
load_wallet_data();
|
||||
check_password_status();
|
||||
const currentPage = Taro.getCurrentInstance().page
|
||||
const updateList = currentPage.data.updateList
|
||||
|
||||
if (updateList) {
|
||||
set_transactions([])
|
||||
// 直接使用新参数调用加载方法
|
||||
const newParams = {
|
||||
...load_transactions_params,
|
||||
page: 1
|
||||
}
|
||||
set_load_transactions_params(newParams)
|
||||
load_transactions() // 立即调用
|
||||
|
||||
// 清除标记
|
||||
currentPage.setData({ updateList: null })
|
||||
}
|
||||
|
||||
load_wallet_data()
|
||||
check_password_status()
|
||||
});
|
||||
|
||||
|
||||
|
||||
const modify_load_transactions_params = () => {
|
||||
set_transactions([]);
|
||||
const { type, transaction_sub_type } = filterParams;
|
||||
|
||||
Reference in New Issue
Block a user