From b5fb647dd0b9036fc355c8ff841a6a842b702d1d Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Fri, 1 Apr 2022 08:18:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=93=BE=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/market/wallet/WalletPanel.vue | 16 ++++++++++++++-- src/configs/config_chain.ts | 4 +++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/components/market/wallet/WalletPanel.vue b/src/components/market/wallet/WalletPanel.vue index 84873a4..fef5ca4 100644 --- a/src/components/market/wallet/WalletPanel.vue +++ b/src/components/market/wallet/WalletPanel.vue @@ -60,7 +60,7 @@ import GameCoinCard from '@/components/market/wallet/GameCoinCard.vue' import { AppModule } from '@/store/modules/app' import PlaceholderPanel from '@/components/market/wallet/PlaceholderPanel.vue' import ChainManager from '@/chain/ChainManager' -import { CONTRACT_ADDRESS } from '@/configs/config_chain' +import { CONTRACT_ADDRESS, OFFICE_ACCOUNT } from '@/configs/config_chain' import { formatPrice } from '@/utils/chain.util' import { getUserInfo } from '@/api/User' import PricePickerModal, { SHOW_AMOUNT_MODAL } from '@/components/market/PricePickerModal.vue' @@ -281,7 +281,7 @@ export default class WalletPanel extends Vue { async beginTransfer(data: ICoinData, amount: number) { return this.chainManager.transferToAccount({ - to: '0x50A8e60041A206AcaA5F844a1104896224be6F39', + to: OFFICE_ACCOUNT, amount: amount, chainId: data.chain!, address: data.address! @@ -374,6 +374,12 @@ export default class WalletPanel extends Vue { this.updateGameCoins() this.updateBalanceSet() this.$alert('Congratulations', 'Deposit Success', { type: 'success', confirmButtonText: 'OK' }) + } else if (res.state === 3) { + this.resetTmpOrderId() + this.showOrderStatus = false + this.updateGameCoins() + this.updateBalanceSet() + this.$alert('Sorry', 'Deposit failed', { type: 'error', confirmButtonText: 'OK' }) } } catch (err) { console.log(err) @@ -399,6 +405,12 @@ export default class WalletPanel extends Vue { this.updateGameCoins() this.updateBalanceSet() this.$alert('Congratulations', 'Claim Success', { type: 'success', confirmButtonText: 'OK' }) + } else if (res.state === 3) { + this.resetTmpOrderId() + this.showOrderStatus = false + this.updateGameCoins() + this.updateBalanceSet() + this.$alert('Sorry', 'Claim failed', { type: 'error', confirmButtonText: 'OK' }) } } catch (err) { console.log(err) diff --git a/src/configs/config_chain.ts b/src/configs/config_chain.ts index 2394407..d70fbcb 100644 --- a/src/configs/config_chain.ts +++ b/src/configs/config_chain.ts @@ -14,11 +14,13 @@ export const AVAILABLE_CHAINS = env === 'development' ? [322, 97] : [321, 32] export const MALL_ADDRESS = '0xF278ff771F9E24968083B0bA54Cb42eb4B23C2d7' +export const OFFICE_ACCOUNT = '0x50A8e60041A206AcaA5F844a1104896224be6F39' + export const CONTRACT_ADDRESS:{[key: number]: any} = { 322: { cec: '0xfeFc3aab779863c1624eE008aba485c53805dCeb', ceg: '0xE388e872e63aadF5a4F1521E4d96C10A28091457', - eth: '0xb296bab2ed122a85977423b602ddf3527582a3da', + eth: '0x67f6a7BbE0da067A747C6b2bEdF8aBBF7D6f60dc', mall: '0xF278ff771F9E24968083B0bA54Cb42eb4B23C2d7' }, 97: {