diff --git a/component/header.vue b/component/header.vue index 77fe6b5..9e934ac 100644 --- a/component/header.vue +++ b/component/header.vue @@ -60,6 +60,7 @@ uni.setStorageSync('current', this.current) this.isShowLang = false this.i++ + window.location.href='' }, showLang() { this.i++ diff --git a/index.html b/index.html index d7afbbc..3d8f672 100644 --- a/index.html +++ b/index.html @@ -143,10 +143,10 @@ - + diff --git a/pages/index/index.vue b/pages/index/index.vue index 085903c..70a0f59 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -93,7 +93,9 @@ } else { this.form.supAddress = '0x622d7b79a904e00e5fcab06396ff009e441f0186' } - this.init() + setTimeout(() => { + this.init() + }, 500) }, onReachBottom() { @@ -103,17 +105,17 @@ methods: { // 点击复制按钮 onCopy(v) { - uni.setClipboardData({ - data: v, - success: () => { - uni.showToast({ - title: 'success', - icon: 'none', - }) - } - }) + uni.setClipboardData({ + data: v, + success: () => { + uni.$u.toast('success') + } + }) }, init() { + if (!web3x.hasRuntime()) { + uni.$u.toast(this.$t("tabBar").nosupport) + } web3x.connectViaInPage() .then(res => { this.form.address = web3x.selectedAddress @@ -157,6 +159,8 @@ web3x.ippt.$creatCode(this.form.supAddress, web3x .selectedAddress) uni.hideLoading() + }).catch(() => { + uni.hideLoading() }) } else { web3x.usdt.$approve(ipptAddress, 0) @@ -172,12 +176,12 @@ web3x.ippt.$creatCode(this.form.supAddress, web3x .selectedAddress) uni.hideLoading() + }).catch(() => { + uni.hideLoading() }) }) } - } - // 授权当前钱包的 USDT 给 IPPT (参数为 IPPT 合约地址) // web3x.usdt.approveMAX("0x622d7b79a904e00e5fcab06396ff009e441f0186") // .on("transactionHash", async (receipt) => { diff --git a/utils/language/en_US.js b/utils/language/en_US.js index 3443056..7e00cf2 100644 --- a/utils/language/en_US.js +++ b/utils/language/en_US.js @@ -12,6 +12,7 @@ export default { we: 'We believe that through a new mining plan, the ippswap fund will become a more prosperous and active community, bringing more opportunities and benefits to all participants. Welcome to join us! Thank you for your support and trust.', ji: 'ippswap Foundation', empty:'Inviter address is empty', + nosupport:'The current environment does not support', }, } diff --git a/utils/language/zh_TW.js b/utils/language/zh_TW.js index 0742a00..ca2e14e 100644 --- a/utils/language/zh_TW.js +++ b/utils/language/zh_TW.js @@ -12,7 +12,7 @@ export default { we: '我們相信,通過全新的挖礦計畫,ippswap基金將成為更繁榮、活躍的社區,為所有參與者帶來更多機會和福利。歡迎加入我們!謝謝大家的支持和信任。', ji: 'ippswap基金會', empty:'邀請人地址為空', - + nosupport:'當前環境不支持', }, }