From 6cd1d790d0a55b8f763de8d1d129cca2772393e4 Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Mon, 22 Dec 2025 18:37:14 +0800
Subject: [PATCH] 1
---
src/views/my/assets.vue | 100 +++++++++++++++++++++++++++++++-------------------
1 files changed, 62 insertions(+), 38 deletions(-)
diff --git a/src/views/my/assets.vue b/src/views/my/assets.vue
index 7671cd7..f6e505d 100644
--- a/src/views/my/assets.vue
+++ b/src/views/my/assets.vue
@@ -2,8 +2,8 @@
<div class="assets">
<div class="assets_title">{{ $t('总资产估值') }}</div>
<div class="assets_money font-bold mt-5 flex justify-start items-end">
- {{ currency.currency_symbol }}{{ forexAssets?.money_contract ?
- (forexAssets?.money_contract * (currency.rate ?? 0)).toFixed(2) : '0.00' }}
+ {{ currency.currency_symbol }}{{ formatWithCommas(forexAssets?.money_contract ?
+ (forexAssets?.money_contract * (currency.rate ?? 0)).toFixed(2) : '0.00') }}
<div class="pricing_jj ml-5">
{{ pricing }}
@@ -14,16 +14,20 @@
</van-dropdown-item>
</van-dropdown-menu>
</div>
- <div class="assets_revenue mt-5">
- <span>{{ $t('ProfitDay') }}</span>
- {{ currency.currency_symbol }}{{ forexAssets?.money_contract_profit_today ?
- (forexAssets?.money_contract_profit_today * (currency.rate ?? 0)).toFixed(2) :
- '--' }}
- </div>
+ <!-- <div class="assets_revenue mt-5">
+ <span>{{ $t('当日') }}</span>
+ {{ currency.currency_symbol }}
+ <span
+ :style="forexAssets?.money_contract_profit_today > 0 ? 'color:green' : forexAssets?.money_contract_profit_today < 0 ? 'color:red' : ''">
+ {{ forexAssets?.money_contract_profit_today ?
+ (forexAssets?.money_contract_profit_today * (currency.rate ?? 0)).toFixed(2) :
+ '--' }}
+ </span>
+ </div> -->
<div class="tabbers flex justify-between mt-20 pl-1 pr-1">
<div class="item" v-for="item in tabList" :key="item.key" @click="toPage(item.path)">
- <img :src="item.icon" alt="">
+ <img style="width: 100px;" :src="item.icon" alt="">
<div class="mt-3 text-center">{{ item.name }}</div>
</div>
</div>
@@ -40,15 +44,15 @@
<div class="assets_item flex justify-start items-center mt-14 font-bold">
<div class="icon" style="background-color: #8A90FE;"></div>
<span class="ml-5 flex-1">{{ $t('资金账户') }}</span>
- <span class="mr-5">{{ assetObj.capital }}</span>
+ <span class="mr-5">{{ formatWithCommas(assetObj.capital) }}</span>
<van-icon name="arrow" />
</div>
- <div class="assets_item flex justify-start items-center mt-14 font-bold">
+ <!-- <div class="assets_item flex justify-start items-center mt-14 font-bold">
<div class="icon" style="background-color: #f7b600;"></div>
<span class="ml-5 flex-1">{{ $t('交易账户') }}</span>
- <span class="mr-5">{{ assetObj.contract }}</span>
+ <span class="mr-5">{{ formatWithCommas(assetObj.contract) }}</span>
<van-icon name="arrow" />
- </div>
+ </div> -->
</van-collapse-item>
</van-collapse>
@@ -61,26 +65,15 @@
:key="item.id">
<img :src="`${HOST_URL}/symbol/${item.symbol_data}.png`" />
- <span class="ml-5 flex-1">{{ item.symbol_data.toUpperCase() }}/USDT</span>
+ <span class="ml-5 flex-1">{{ arrGk((item.name || '').toUpperCase())[0] }}</span>
<div class="mr-3">
- <!-- <div class="text-right">0</div>
- <div class="assets_item_light text-right">0.00</div> -->
- <div class="text-right" v-if="item.symbol == 'btc'">
- {{ item.volume ? Number(item.volume).toFixed(8) : '0.0' }}
- </div>
- <div class="text-right" v-else-if="item.symbol == 'eth'">
- {{ item.volume ? Number(item.volume).toFixed(8) : '0.0' }}
- </div>
- <div class="text-right" v-else-if="item.symbol == 'usdt'">
- {{ item.volume ? Number(item.volume).toFixed(2) : '0.0' }}
- </div>
- <div class="text-right" v-else>
- {{ item.volume ? Number(item.volume).toFixed(8) : '0.0' }}
+ <div class="text-right">
+ {{ item.volume ? formatWithCommas(Number(item.volume).toFixed(2)) : '0.0' }}
</div>
<div class="assets_item_light text-right">
≈{{ currency.currency_symbol }}
- {{ item.usdt ? Number(item.usdt).toFixed(2) : '0.0' }}
+ {{ item.usdt ? formatWithCommas(Number(item.usdt).toFixed(2)) : '0.0' }}
</div>
</div>
</div>
@@ -102,6 +95,7 @@
import { _getassets } from "@/service/user.api.js";
import { _getAllWallet } from '@/service/fund.api';
import { HOST_URL } from '@/config';
+import { formatWithCommas } from '@/utils';
const router = useRouter()
const { t } = useI18n()
@@ -110,10 +104,18 @@
const tabList = [
{ key: 1, name: t('充值'), icon: new URL('@/assets/imgs/assets/chonbi.png', import.meta.url), path: '/cryptos/recharge/rechargeList?isForeign=true' },
- { key: 2, name: t('提现'), icon: new URL('@/assets/imgs/assets/tibi.png', import.meta.url), path: '/exchange/withdraw-usdt' },
- { key: 3, name: t('划转'), icon: new URL('@/assets/imgs/assets/huazhuan.png', import.meta.url), path: '/my/transfer' },
+ { key: 2, name: t('提现'), icon: new URL('@/assets/imgs/assets/tibi.png', import.meta.url), path: '/cryptos/Withdraw/withdrawPage' },
+ // { key: 3, name: t('划转'), icon: new URL('@/assets/imgs/assets/huazhuan.png', import.meta.url), path: '/my/transfer' },
+ { key: 5, name: t('闪兑'), icon: new URL('@/assets/imgs/assets/sd.png', import.meta.url), path: '/cryptos/exchangePage' },
{ key: 4, name: t('账单'), icon: new URL('@/assets/imgs/assets/zd.png', import.meta.url), path: '/cryptos/accountChange' },
]
+
+// 处理分隔符
+const arrGk = (str) => {
+ if (!str) return ['--'];
+ let arr = str.split('/');
+ return arr;
+}
// 计价切换
const pricing = ref('')
@@ -183,12 +185,16 @@
<style lang="scss" scoped>
+@import '@/assets/theme/index.scss';
+
.assets {
min-height: 100vh;
background: $mainbgWhiteColor;
padding: 2.8rem 2rem 10rem 2rem;
- $assets_title_color: #9a9a9a;
- color: $assets_title_color;
+
+ @include themify() {
+ color: themed("text_color2");
+ }
:deep(.van-cell) {
padding-left: 0;
@@ -214,8 +220,11 @@
}
.assets_money {
- color: $text_color4;
font-size: 3.4rem;
+
+ @include themify() {
+ color: themed("text_color");
+ }
.pricing_jj {
font-size: 1.6rem;
@@ -247,13 +256,19 @@
.assets_revenue {
font-size: 2rem;
- color: #646464;
font-weight: 600;
+ @include themify() {
+ color: themed("text_color1");
+ }
+
span {
- color: #6e6e6e;
text-decoration: underline dotted;
font-weight: 400;
+
+ @include themify() {
+ color: themed("text_color1");
+ }
}
}
@@ -262,7 +277,10 @@
$item_width: 8.3rem;
width: $item_width;
font-size: 1.8rem;
- color: $text_color4;
+
+ @include themify() {
+ color: themed("text_color2");
+ }
img {
height: $item_width;
@@ -294,8 +312,11 @@
}
.assets_item {
- color: $text_color4;
font-size: 2.1rem;
+
+ @include themify() {
+ color: themed("text_color2");
+ }
.icon {
width: 1.8rem;
@@ -311,8 +332,11 @@
}
.assets_item_light {
- color: #9b9b9b;
font-weight: 300;
+
+ @include themify() {
+ color: themed("text_color2");
+ }
}
}
}
--
Gitblit v1.9.3