|
@@ -1,49 +1,36 @@
|
|
|
<template>
|
|
|
<div class="currency-detail-page">
|
|
|
+ <v-head :title="currencyInfo.currencyName"
|
|
|
+ :show_more="false"
|
|
|
+ :show_refresh="true"
|
|
|
+ :show_list="true"
|
|
|
+ @on-refresh="onRefresh" />
|
|
|
<div class="top">
|
|
|
<img
|
|
|
class="icon-currency"
|
|
|
- :src="routerParams.iconPath"
|
|
|
- />
|
|
|
+ :src="currencyInfo.iconPath"/>
|
|
|
<div class="amount">
|
|
|
- {{routerParams.balance}} {{routerParams.currencyName}}
|
|
|
- <div class="final">${{routerParams.usdEstimateBalance}}</div>
|
|
|
+ {{currencyInfo.totalBalance}} {{currencyInfo.currencyName}}
|
|
|
+ <div class="final">${{currencyInfo.totalUsdEstimateBalance}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="bottom">
|
|
|
- <div class="btn deposit-btn" @click="clickDeposit">Deposit</div>
|
|
|
+ <div class="btn deposit-btn"
|
|
|
+ v-if="currencyInfo.currencyCode != 'USD'"
|
|
|
+ @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>
|
|
|
+ <template v-if="showCurrencySelect">
|
|
|
+ <div class="selectDiv">
|
|
|
+ <currency-select
|
|
|
+ ref="currencySelectDom"
|
|
|
+ :list="currenciesData"
|
|
|
+ @selectCurrency="selectCurrency">
|
|
|
+ </currency-select>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="selectBg" @click="showCurrencySelect = false"></div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -53,77 +40,114 @@ 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;
|
|
|
-};
|
|
|
+import VHead from '@/view/popup/components/head.vue'
|
|
|
+import currencySelect from "@/view/components/currency-select.vue";
|
|
|
+
|
|
|
+
|
|
|
+let currenciesData = ref([]);
|
|
|
+let currencyInfo = ref({});
|
|
|
+let showCurrencySelect = ref(false);
|
|
|
+
|
|
|
+let currencyOpertionType = '';
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+const selectCurrency = (params) => {
|
|
|
+ showCurrencySelect.value = false;
|
|
|
+ if(currencyOpertionType == 'WITHDRAW') {
|
|
|
+ withdrawHandle(params);
|
|
|
+ } else if(currencyOpertionType == 'DEPOSIT') {
|
|
|
+ depositHandle(params);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
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')
|
|
|
+ if(currenciesData.value.length > 1) {
|
|
|
+ showCurrencySelect.value = true;
|
|
|
+ currencyOpertionType = "WITHDRAW";
|
|
|
+ } else if(currenciesData.value.length == 1){
|
|
|
+ withdrawHandle(currenciesData.value[0]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-let top_up_info = reactive(getStorage('top_up_info')) || inject('top_up_info') || {};
|
|
|
+const withdrawHandle = (_params) => {
|
|
|
+ withdraw_info.chainInfo = _params.chainInfo;
|
|
|
+ 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')
|
|
|
+ console.log(withdraw_info.chainInfo.iconPath)
|
|
|
+ router.push('/withdraw/info')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+let 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');
|
|
|
+
|
|
|
+ if(currenciesData.value.length > 1) {
|
|
|
+ showCurrencySelect.value = true;
|
|
|
+ currencyOpertionType = "DEPOSIT";
|
|
|
+ } else if(currenciesData.value.length == 1){
|
|
|
+ depositHandle(currenciesData.value[0]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+const depositHandle = (_params) => {
|
|
|
+ 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')
|
|
|
+ top_up_info.chainInfo = {
|
|
|
+ ..._params.chainInfo
|
|
|
+ };
|
|
|
+
|
|
|
+ router.push('/top-up/info');
|
|
|
+};
|
|
|
+
|
|
|
+const onRefresh = () => {
|
|
|
+
|
|
|
+};
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
let {params = '{}'} = router.currentRoute.value.query;
|
|
|
- routerParams.value = JSON.parse(params);
|
|
|
- console.log(routerParams.value)
|
|
|
+
|
|
|
+ let {currencies = [], totalBalance = 0, totalUsdEstimateBalance = 0} = JSON.parse(params);
|
|
|
+
|
|
|
+ currenciesData.value = currencies;
|
|
|
+
|
|
|
+ if(currencies.length) {
|
|
|
+ currencyInfo.value = {
|
|
|
+ ...currencies[0],
|
|
|
+ totalBalance,
|
|
|
+ totalUsdEstimateBalance
|
|
|
+ };
|
|
|
+ }
|
|
|
})
|
|
|
</script>
|
|
|
|
|
@@ -135,7 +159,7 @@ onMounted(() => {
|
|
|
position: relative;
|
|
|
|
|
|
.top {
|
|
|
- height: calc(100% - 163px);
|
|
|
+ height: calc(100% - 212px);
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
@@ -189,85 +213,27 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .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;
|
|
|
+
|
|
|
+ .selectDiv {
|
|
|
position: absolute;
|
|
|
+ z-index: 1000;
|
|
|
+ width: 100%;
|
|
|
+ max-height: 480px;
|
|
|
+ padding-bottom: 30px;
|
|
|
+ left: 0;
|
|
|
bottom: 0;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 20px 20px 0 0;
|
|
|
+ overflow-y: scroll;
|
|
|
+ }
|
|
|
+ .selectBg {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 999;
|
|
|
+ top: 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;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: rgba($color: #000000, $alpha: 0.6);
|
|
|
}
|
|
|
}
|
|
|
</style>
|