From 7182cf69262e089a273fe991ed7761a01963ccbe Mon Sep 17 00:00:00 2001 From: queenwuli <942534046@qq.com> Date: Thu, 24 Mar 2022 16:27:32 +0800 Subject: [PATCH] gx --- src/pages/index/index.vue | 184 ++++++++++++++++++++++++++++++++------------- 1 files changed, 131 insertions(+), 53 deletions(-) diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 95299ca..17bf2e1 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -27,7 +27,7 @@ <OrePool></OrePool> </van-tab> <van-tab :title='$t("message.Account")'> - <Account :ref="accountRef"></Account> + <Account ref="accountRef"></Account> </van-tab> </van-tabs> <van-overlay :show="isShowApproveModal" @click="isShowApproveModal = false" class="wrapper"> @@ -57,27 +57,18 @@ </div> </van-overlay> <van-overlay :show="isShowWalletModal" @click="isShowWalletModal = false" class="wrapper"> - <div class="block" @click.stop> + <div class="walletconnect-modal-wrap" @click.stop> <img class="close-icon" @click="isShowWalletModal = false" src="../../assets/images/close-icon.png"> <div class="wallet-box"> + <div class="sub-title"> + <span>移动</span> + </div> <p class="title">选择你的钱包</p> - <div class="wallet-warp flex align-center justify-between"> - <div> - <img src="../../assets/images/icon8.png"> - <p>coinbase</p> - </div> - <div> - <img src="../../assets/images/icon8.png"> - <p>coinbase</p> - </div> - <div> - <img src="../../assets/images/icon8.png"> - <p>coinbase</p> - </div> - <div> - <img src="../../assets/images/icon8.png"> - <p>coinbase</p> - </div> + <div class="wallet-warp flex flex-wrap align-center justify-between"> + <a :href="item.link" target="_blank" v-for="item in dappList" class="item"> + <div class="icon" :style="{background: 'url(' + item.imgUrl +')'}"></div> + <p class="text">{{item.name}}</p> + </a> </div> </div> </div> @@ -101,6 +92,7 @@ }, setup() { const { proxy } = getCurrentInstance(); + const pageLink = window.location.href; let accountRef = ref(null); let walletAddress = ref(''); let hasApprove = ref(false); @@ -140,14 +132,16 @@ showAccreditModal() } } - - onMounted(() => { - proxy.getAddress(); + async function init () { + await proxy.getAddress(); if (proxy.walletAddress) { proxy.isApprove() }else{ showAccreditModal(); } + } + onMounted(() => { + init() }) return { local: ref('zh'), @@ -171,13 +165,73 @@ walletAddress, //地址 hasApprove, //是否授权 - accountRef + accountRef, + dappList: [{ + name: 'TronLink', + link: 'https://www.tronlink.org/', + imgUrl: 'https://qny.ohmj.org/kylin/wallet/Tronlink.png' + }, + { + name: 'coinbase', + link: 'https://go.cb-w.com/MVotZpePHmb', + imgUrl: 'https://qny.ohmj.org/kylin/wallet/Coinbase.jpg' + }, + { + name: 'Trust', + link: 'https://link.trustwallet.com/open_url?coin_id=60&url=' + pageLink, + imgUrl: 'https://qny.ohmj.org/kylin/wallet/Trust.jpeg' + }, + { + name: 'MetaMask', + link: 'https://metamask.app.link/dapp/mining02.com', + imgUrl: 'https://qny.ohmj.org/kylin/wallet/MetaMask.jpeg' + }, + { + name: 'imToken', + link: 'imtokenv2://navigate?screen=DappView&url=' + pageLink, + imgUrl: 'https://qny.ohmj.org/kylin/wallet/ImToken.jpeg' + }, + { + name: 'TokenPocket', + link: '', + imgUrl: 'https://qny.ohmj.org/kylin/wallet/TokenPocket.jpeg' + }, + { + name: 'Gnosis Safe', + link: 'https://gnosis-safe.io//wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b' + pageLink, + imgUrl: 'https://qny.ohmj.org/kylin/wallet/Gnosis.jpeg' + }, + { + name: 'Crypto.com', + link: 'https://wallet.crypto.com/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b' + pageLink, + imgUrl: 'https://qny.ohmj.org/kylin/wallet/Crypto.jpeg' + }, + { + name: 'Pillar', + link: 'pillarwallet://wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b' + pageLink, + imgUrl: 'https://qny.ohmj.org/kylin/wallet/Pillar.jpeg' + }, + { + name: 'Argent', + link: 'https://argent.link/app/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b' + pageLink, + imgUrl: 'https://qny.ohmj.org/kylin/wallet/Argent.jpeg' + }, + { + name: 'MathWallet', + link: 'mathwallet://mathwallet.org?action=link&value=' + pageLink, + imgUrl: 'https://qny.ohmj.org/kylin/wallet/MathWallet.jpeg' + }, + { + name: 'BitPay', + link: 'https://link.bitpay.com/wallet/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b' + pageLink, + imgUrl: 'https://qny.ohmj.org/kylin/wallet/BitPay.jpeg' + }] }; }, methods: { // 获取地址 async getAddress () { - let address = 'TUy8XwDmdsDKPLDGUrGuNRVMhwSEKtkDcD'; + let address = ''; if(window.ethereum) { await window.ethereum.enable(); const accounts = await ethereum.request({ method: 'eth_accounts' }); @@ -250,20 +304,12 @@ }).then((res) => { if(res.code == 200) { this.hasApprove = true; + this.initAccountData(); } }) }, initAccountData(){ - // this.accountRef.value.getWalletInfo(); - alert(accountRef) - this.$axios({ - url: '/dapi/member/walletInfo', - method: 'post' - }).then((res) => { - if(res.code == 200) { - this.myAccountInfo = res.data; - } - }) + this.accountRef && this.accountRef.value.getWalletInfo(); } } } @@ -426,30 +472,62 @@ color: #080808; font-weight: bold; } -.wallet-box{ - padding: 20px; + +.walletconnect-modal-wrap{ + position: relative; + width: 83%; + background: #ffffff; + border-radius: 48px; + box-shadow: 0 10px 50px 5px rgb(0 0 0 / 40%); + padding: 24px 24px 22px; } -.wallet-box p{ - margin: 0; -} -.wallet-box .title{ +.walletconnect-modal-wrap .title{ font-size: 32px; - color: #080808; - font-weight: bold; + color: rgba(60, 66, 82, 0.6); + font-weight: 600; + margin: 20px 0 40px 0; } -.wallet-warp{ - box-sizing: border-box; - margin-top: 80px; +.walletconnect-modal-wrap .sub-title{ + width: 79%; + margin: 0 auto; + background: #d4d5d9; + padding: 8px; + border-radius: 16px; + margin-bottom: 36px; } -.wallet-warp img{ - width: 88px; - height: 88px; - border-radius: 20px; -} -.wallet-warp p{ +.walletconnect-modal-wrap .sub-title>span{ + display: block; font-size: 24px; - color: #080808; - margin-top: 15px; + background: #ffffff; + padding: 8px; + font-weight: 600; + border-radius: 10px; +} +.walletconnect-modal-wrap .wallet-box{ + padding: 24px 24px 22px; +} +.walletconnect-modal-wrap .wallet-warp{ + margin: 50px 0 20px; +} +.walletconnect-modal-wrap .wallet-warp .item{ + width: 25%; + padding: 16px 0; + box-sizing: border-box; +} +.walletconnect-modal-wrap .wallet-warp .icon{ + display: block; + margin: 0 auto; + width: 84px; + height: 84px; + border-radius: 16px; + background-size: cover!important; + box-shadow: 0 0.10667rem 0.32rem 0 rgb(37 41 46 / 25%); +} +.walletconnect-modal-wrap .wallet-warp .text{ + color: #424952; + font-weight: 600; + margin: 16px 0 0; + font-size: 24px; } .address{ width: 100px; -- Gitblit v1.9.1