wkw 1 week ago
parent
commit
b662ecb872
2 changed files with 10 additions and 7 deletions
  1. 7 3
      src/pages/trade/index.vue
  2. 3 4
      src/utils/web.js

+ 7 - 3
src/pages/trade/index.vue

@@ -376,7 +376,9 @@ const getMatchEnroll = async (hash) =>{
       icon: 'none',
       duration: 1000
     })
-    getGameMatchList(false);
+    setTimeout(() => {
+      getGameMatchList(false);
+    }, 1500);
   }else{
     uni.hideLoading()
   }
@@ -423,7 +425,7 @@ const awardFun = async (item) => {
   if(item.is_receive) return;
   let res = await userPrize({dapp_id:15,match_id:gameDetail.value?.id,address:walletAddress.value});
   if (res.status == 200) {
-    if(!res.data.prize_money){
+    if(!res.data.prize_money || res.data.prize_money == 0){
       uni.showToast({
         title: '正在结算中!',
         icon: 'none',
@@ -449,7 +451,9 @@ const getClaimPrize = async (hash) =>{
       icon: 'none',
       duration: 1000
     })
-    getGameRank(gameDetail.value?.id)
+    setTimeout(() => {
+      getGameRank(gameDetail.value?.id)
+    }, 1500);
   }
 }
 

+ 3 - 4
src/utils/web.js

@@ -81,12 +81,11 @@ async function sendSingleReward(privateKey, amount) {
 
 // 通用报名函数(支持 WGT 和 STT)
 async function tokenSignUp(privateKey, amount, type) {
-    privateKey = normalizePrivateKey(privateKey);
-    const tokenAddress = TOKEN_ADDRESSES[type.toLowerCase()];
-    const tokenAmount = web3.utils.toWei(amount.toString(), "ether");
-
     try {
         const web3 = await getWeb3();
+        privateKey = normalizePrivateKey(privateKey);
+        const tokenAddress = TOKEN_ADDRESSES[type.toLowerCase()];
+        const tokenAmount = web3.utils.toWei(amount.toString(), "ether");
         const account = web3.eth.accounts.privateKeyToAccount(privateKey);
         const sender = account.address;