|
@@ -2,7 +2,7 @@
|
|
|
<div class="currency-detail-page">
|
|
|
<v-head :title="currencyInfo.tokenSymbol"
|
|
|
:show_more="false"
|
|
|
- :show_refresh="false"
|
|
|
+ :show_refresh="true"
|
|
|
:show_list="true"
|
|
|
:transactionsRouterParams="{
|
|
|
backUrl: 'back'
|
|
@@ -58,7 +58,7 @@ import router from "@/router/popup.js";
|
|
|
import Report from "@/log-center/log";
|
|
|
import { getStorage } from "@/uilts/help";
|
|
|
|
|
|
-import { syncChainTokenRechargeRecord } from "@/http/publishApi";
|
|
|
+import { getCurrencyInfoBySymbol } from "@/http/publishApi";
|
|
|
|
|
|
import VHead from '@/view/popup/components/head.vue'
|
|
|
import currencySelect from "@/view/components/currency-select.vue";
|
|
@@ -154,30 +154,24 @@ const depositHandle = (_params) => {
|
|
|
};
|
|
|
|
|
|
const onRefresh = () => {
|
|
|
- asyncTokenRechRecord(currencyInfo.value, (res) => {
|
|
|
- if(res.code == 0 && res.data && res.data.length) {
|
|
|
- let currencyData = res.data[0];
|
|
|
- if(currencyData.currencyCode == currencyInfo.value.currencyCode) {
|
|
|
- currencyInfo.value.balance = currencyData.balance;
|
|
|
- currencyInfo.value.usdEstimateBalance = currencyData.usdEstimateBalance;
|
|
|
- }
|
|
|
+ getCurrencyInfoBySymbol({
|
|
|
+ params: {
|
|
|
+ symbol: currencyInfo.value.tokenSymbol
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code == 0) {
|
|
|
+ if(res.data && res.data.currencyCategories && res.data.currencyCategories.length) {
|
|
|
+ let data = res.data.currencyCategories[0].data;
|
|
|
+ if(data.length) {
|
|
|
+ let {totalBalance = '', totalUsdEstimateBalance = ''} = data[0] || {};
|
|
|
+ currencyInfo.value.totalBalance = totalBalance;
|
|
|
+ currencyInfo.value.totalUsdEstimateBalance = totalUsdEstimateBalance;
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
+ })
|
|
|
};
|
|
|
|
|
|
-
|
|
|
-const asyncTokenRechRecord = (_params, cb) => {
|
|
|
- let { currencyCode = '' } = _params;
|
|
|
- if(!currencyCode || currenciesData.value.length > 1) return;
|
|
|
- syncChainTokenRechargeRecord({
|
|
|
- params: {
|
|
|
- currencyCode: currencyCode
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- cb && cb(res)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
let {params = '{}'} = router.currentRoute.value.query;
|
|
|
|