123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <template>
- <div class="currency-detail-page">
- <div class="top">
- <img
- class="icon-currency"
- :src="routerParams.iconPath"
- />
- <div class="amount">
- {{routerParams.balance}} {{routerParams.currencyName}}
- <div class="final">${{routerParams.usdEstimateBalance}}</div>
- </div>
- </div>
- <div class="bottom">
- <div class="btn deposit-btn" @click="clickDeposit">Deposit</div>
- <div class="btn withdrawal-btn" @click="clickWithdraw">Withdrawal</div>
- </div>
- <div class="popup" v-if="showPopup" @click="clickPopup">
- <div class="content">
- <div class="item" v-for="(item, index) in listData" :key="index">
- <div class="chain">
- <img
- class="icon-chain"
- src="https://d1mcov78iir8kk.cloudfront.net/image/currency_icon/BSC_USDT.png"
- />
- {{ item.chain }}
- </div>
- <div class="currency">
- <div class="left">
- <img
- class="icon-currency"
- src="https://d1mcov78iir8kk.cloudfront.net/image/currency_icon/BSC_USDT.png"
- />
- <div class="info">
- <div class="unit">{{ item.currency }}</div>
- TetherUS
- </div>
- </div>
- <div class="right">
- {{ item.amount }}
- <div class="final">${{ item.amount }}</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- import { ref, onMounted, inject, reactive } from "vue";
- import router from "@/router/popup.js";
- import Report from "@/log-center/log";
- import { getStorage } from "@/uilts/help";
- let routerParams = ref({});
- let showPopup = ref(true);
- let listData = ref([
- {
- chain: "BNB Smart Chain (BEP20)",
- currency: "USDT",
- amount: "10",
- },
- {
- chain: "BNB Smart Chain (BEP20)",
- currency: "USDT",
- amount: "10",
- },
- ]);
- const clickPopup = () => {
- showPopup.value = false;
- };
- let withdraw_info = inject('withdraw_info')
- // 点击提现
- const clickWithdraw = () => {
- let _params = routerParams.value;
- Report.reportLog({
- pageSource: Report.pageSource.denetHomePage,
- businessType: Report.businessType.buttonClick,
- objectType: Report.objectType.withdrawButton
- });
- if (_params.currencyCode == 'USD') {
- withdraw_info.currency_code = _params.currencyCode
- router.push('/withdraw/paypal')
- } else {
- withdraw_info.source = 'home'
- withdraw_info.balance = _params.balance
- withdraw_info.token_symbol = _params.tokenSymbol || ''
- withdraw_info.currency_name = _params.currencyName || ''
- withdraw_info.token_chain = _params.tokenChain || 'BNB Chain'
- withdraw_info.currency_code = _params.currencyCode
- withdraw_info.icon_token = _params.iconPath || ''
- withdraw_info.icon_net = require('@/assets/svg/icon-BNB.svg')
- router.push('/withdraw/info')
- }
- }
- let top_up_info = reactive(getStorage('top_up_info')) || inject('top_up_info') || {};
- const clickDeposit = () => {
- let _params = routerParams.value;
- top_up_info.token = _params.currencyName || ''
- top_up_info.token_chain = _params.tokenChain
- top_up_info.token_symbol = _params.tokenSymbol || ''
- top_up_info.currency_code = _params.currencyCode
- top_up_info.icon_token = _params.iconPath || ''
- top_up_info.icon_net = require('@/assets/svg/icon-BNB.svg')
- Report.reportLog({
- pageSource: Report.pageSource.denetHomePage,
- businessType: Report.businessType.buttonClick,
- objectType: Report.objectType.topupButton
- });
- router.push('/top-up/info');
- }
- onMounted(() => {
- let {params = '{}'} = router.currentRoute.value.query;
- routerParams.value = JSON.parse(params);
- console.log(routerParams.value)
- })
- </script>
- <style lang='scss' scoped>
- .currency-detail-page {
- width: 100%;
- height: 100%;
- position: relative;
- .top {
- height: calc(100% - 163px);
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- .icon-currency {
- width: 100px;
- margin-bottom: 30px;
- }
- .amount {
- font-weight: 700;
- font-size: 28px;
- .final {
- margin-top: 9px;
- font-weight: 500;
- font-size: 22px;
- color: #a2a2a2;
- text-align: center;
- }
- }
- }
- .bottom {
- height: 162px;
- padding: 0 20px;
- box-sizing: border-box;
- .btn {
- width: 100%;
- height: 57px;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: 500;
- font-size: 17px;
- border-radius: 100px;
- cursor: pointer;
- }
- .deposit-btn {
- margin-bottom: 18px;
- background: #1d9bf0;
- color: #fff;
- }
- .withdrawal-btn {
- background: rgba(244, 244, 244, 0.01);
- border: 1px solid #d7e8f4;
- box-sizing: border-box;
- color: #1d9bf0;
- }
- }
- .popup {
- width: 100%;
- height: 100%;
- position: absolute;
- left: 0;
- top: 0;
- background: rgba(0, 0, 0, 0.6);
- cursor: pointer;
- .content {
- background: #f7f7f7;
- border-radius: 20px 20px 0px 0px;
- width: 100%;
- height: 230px;
- position: absolute;
- bottom: 0;
- left: 0;
- overflow-y: auto;
- cursor: default;
- .item {
- .chain {
- font-weight: 500;
- font-size: 14px;
- padding: 12px 14px;
- box-sizing: border-box;
- background: #f7f7f7;
- .icon-chain {
- width: 18px;
- height: 18px;
- margin-right: 8px;
- }
- }
- .currency {
- background: #fff;
- padding: 12px 20px;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- cursor: pointer;
- .left {
- display: flex;
- .icon-currency {
- width: 24px;
- height: 24px;
- margin-right: 12px;
- margin-top: 4px;
- }
- .info {
- font-weight: 400;
- font-size: 12px;
- color: #a2a2a2;
- .unit {
- font-weight: 500;
- font-size: 15px;
- color: #000;
- margin-bottom: 5px;
- }
- }
- }
- .right {
- font-weight: 500;
- font-size: 15px;
-
- .final {
- font-weight: 400;
- font-size: 12px;
- color: #A2A2A2;
- }
- }
- }
- }
- }
- }
- }
- </style>
|