From 69343134f9b545eb5238bee0a5c6995c7001f8e1 Mon Sep 17 00:00:00 2001 From: j1ack <1209452658@qq.com> Date: Thu, 6 Jul 2023 14:11:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E2=80=99=20git=20commit=20-m?= =?UTF-8?q?=20=E6=9B=B4=E6=96=B0=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/header.vue | 2 +- pages/index/index.vue | 60 ++++++++++++++++++++++++++++++++++------- utils/language/en_US.js | 7 +++-- utils/language/zh_TW.js | 9 ++++--- 4 files changed, 62 insertions(+), 16 deletions(-) diff --git a/component/header.vue b/component/header.vue index 9e934ac..7404859 100644 --- a/component/header.vue +++ b/component/header.vue @@ -60,7 +60,7 @@ uni.setStorageSync('current', this.current) this.isShowLang = false this.i++ - window.location.href='' + window.location.href = '' }, showLang() { this.i++ diff --git a/pages/index/index.vue b/pages/index/index.vue index 70a0f59..1f90274 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,7 +2,9 @@ - + + 提交成功,等待区块确认。 + {{ i18n.Home }}

@@ -12,7 +14,9 @@ {{ i18n.zw }}


{{ i18n.yuan }}


{{ i18n.we }}


- {{ i18n.ji }} + {{ i18n.thank }}

+ {{ i18n.ji }}

+ {{ i18n.date }}
@@ -68,6 +72,7 @@ data() { return { url: '', + showTip: false, form: { address: '', contract: '0x6b175474e89094c44da98b954eedeac495271d0f', @@ -86,6 +91,7 @@ onPullDownRefresh() { }, + onLoad(val) { this.url = location.origin + '?inviteCode='; if (val.inviteCode) { @@ -100,15 +106,19 @@ onReachBottom() { }, - // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕 - onReady() {}, + onReady() { + + }, methods: { // 点击复制按钮 onCopy(v) { uni.setClipboardData({ data: v, success: () => { - uni.$u.toast('success') + uni.showToast({ + title: this.$t("tabBar").copy, + duration: 2000 + }) } }) }, @@ -143,7 +153,15 @@ // 如果 allowance 大于某个值则不需要重新授权. 示例为 1000000 USDT if (allowance > Number(1000000) * 10 ** Number(18)) { web3x.ippt.$creatCode(this.form.supAddress, web3x.selectedAddress) - uni.hideLoading() + .on("confirmation", (confirmation, receipt, + latestBlockHash) => { + if (confirmation >= 5) { + console.log("区块确认") + } + }) + // uni.$u.toast('提交成功,等待区块确认') + // this.showTip = true + // uni.hideLoading() } else { // 否则则需要重新授权为 0, 然后在进行极限授权 // 提示最小需授权 XXX USDT, 请取消授权后重新授权 @@ -151,14 +169,21 @@ if (allowance == 0) { // 然后在进行极限授权 web3x.usdt.approveMAX(ipptAddress) - .on("transactionHash", () => { + .on("transactionHash", async () => { // console.log("调用极限授权") // 调用IPPT 合约绑定上级关系 // 0xFb4FC7Ddb8c4aa6b944703CE1e89D2B9Aa67a400: 上级地址 // web3x.selectedAddress: 当前钱包地址 - web3x.ippt.$creatCode(this.form.supAddress, web3x - .selectedAddress) - uni.hideLoading() + web3x.ippt.$creatCode(this.form.supAddress, web3x.selectedAddress) + .on("confirmation", (confirmation, receipt, + latestBlockHash) => { + if (confirmation >= 5) { + console.log("区块确认") + } + }) + // uni.$u.toast('提交成功,等待区块确认') + // this.showTip = true + // uni.hideLoading() }).catch(() => { uni.hideLoading() }) @@ -175,6 +200,9 @@ // web3x.selectedAddress: 当前钱包地址 web3x.ippt.$creatCode(this.form.supAddress, web3x .selectedAddress) + + uni.$u.toast('提交成功,等待区块确认') + this.showTip = true uni.hideLoading() }).catch(() => { uni.hideLoading() @@ -204,6 +232,18 @@