feat: 优化资产详情页面,添加利润钱包数据获取逻辑,更新记录展示方式
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
<script lang='ts' setup>
|
||||
import { arrowDownCircleOutline, arrowUpCircleOutline, listOutline, walletOutline } from "ionicons/icons";
|
||||
import { client, safeClient } from "@/api";
|
||||
|
||||
const walletStore = useWalletStore();
|
||||
const balanceWallet = await walletStore.getWalletByType("balance");
|
||||
const profitWallet = await walletStore.getWalletByType("profit");
|
||||
const { data } = await safeClient(client.api.ledger.entries.get());
|
||||
|
||||
// 当前选中的标签
|
||||
const selectedTab = ref<"all" | "income" | "investment">("all");
|
||||
@@ -17,73 +20,6 @@ interface TransactionRecord {
|
||||
description?: string;
|
||||
}
|
||||
|
||||
// 模拟数据
|
||||
const allRecords = ref<TransactionRecord[]>([
|
||||
{
|
||||
id: 1,
|
||||
type: "income",
|
||||
title: "投资收益",
|
||||
amount: 1250.50,
|
||||
time: "2026-01-18 14:30:20",
|
||||
status: "success",
|
||||
description: "稳健增长基金收益",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
type: "investment",
|
||||
title: "投资支出",
|
||||
amount: -5000.00,
|
||||
time: "2026-01-17 10:15:30",
|
||||
status: "success",
|
||||
description: "购买稳健增长基金",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
type: "withdraw",
|
||||
title: "提现",
|
||||
amount: -1000.00,
|
||||
time: "2026-01-16 16:45:10",
|
||||
status: "success",
|
||||
description: "提现至银行卡",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
type: "recharge",
|
||||
title: "充值",
|
||||
amount: 3000.00,
|
||||
time: "2026-01-15 09:20:00",
|
||||
status: "success",
|
||||
description: "银行卡充值",
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
type: "income",
|
||||
title: "投资收益",
|
||||
amount: 890.30,
|
||||
time: "2026-01-14 14:30:20",
|
||||
status: "success",
|
||||
description: "价值投资基金收益",
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
type: "investment",
|
||||
title: "投资支出",
|
||||
amount: -3000.00,
|
||||
time: "2026-01-13 11:20:45",
|
||||
status: "success",
|
||||
description: "购买均衡配置基金",
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
type: "income",
|
||||
title: "投资收益",
|
||||
amount: 456.80,
|
||||
time: "2026-01-12 14:30:20",
|
||||
status: "success",
|
||||
description: "高收益债券收益",
|
||||
},
|
||||
]);
|
||||
|
||||
// 筛选后的记录
|
||||
const filteredRecords = computed(() => {
|
||||
if (selectedTab.value === "all") {
|
||||
@@ -215,9 +151,16 @@ function formatAmount(amount: number) {
|
||||
|
||||
<!-- 记录列表 -->
|
||||
<div class="records-list">
|
||||
<div v-if="filteredRecords.length > 0" class="ion-padding-horizontal">
|
||||
<div v-if="data?.data.length === 0" class="empty-state">
|
||||
<empty title="暂无记录">
|
||||
<template #icon>
|
||||
<ion-icon :icon="listOutline" class="empty-icon" />
|
||||
</template>
|
||||
</empty>
|
||||
</div>
|
||||
<div v-else class="ion-padding-horizontal">
|
||||
<div
|
||||
v-for="record in filteredRecords"
|
||||
v-for="record in data?.data"
|
||||
:key="record.id"
|
||||
class="record-item"
|
||||
>
|
||||
@@ -252,15 +195,6 @@ function formatAmount(amount: number) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<div v-else class="empty-state">
|
||||
<empty title="暂无记录">
|
||||
<template #icon>
|
||||
<ion-icon :icon="listOutline" class="empty-icon" />
|
||||
</template>
|
||||
</empty>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-page>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang='ts' setup>
|
||||
import { Clipboard } from "@capacitor/clipboard";
|
||||
import { onIonViewWillEnter, toastController } from "@ionic/vue";
|
||||
import dayjs from "dayjs";
|
||||
import { checkmarkCircleOutline, copyOutline, downloadOutline, linkOutline, ticketOutline } from "ionicons/icons";
|
||||
import { client, safeClient } from "@/api";
|
||||
|
||||
@@ -25,8 +26,7 @@ const [inviteQuery] = useResetRef({
|
||||
});
|
||||
|
||||
const { data: inviteList, execute: executeInviteList } = safeClient(() =>
|
||||
client.api.referrals.members.get({ query: { ...inviteQuery.value } }),
|
||||
);
|
||||
client.api.referrals.members.get({ query: { ...inviteQuery.value } }), { immediate: false });
|
||||
|
||||
const invitedMembers = computed(() => inviteList.value?.data || []);
|
||||
const totalInvites = computed(() => inviteList.value?.pagination.total || 0);
|
||||
@@ -200,7 +200,7 @@ function nextPage() {
|
||||
>
|
||||
<div class="member-header">
|
||||
<div class="member-avatar">
|
||||
{{ member.profile.avatar }}
|
||||
<img src="@/assets/images/avatar.jpg">
|
||||
</div>
|
||||
<div class="member-info">
|
||||
<div class="member-name">
|
||||
@@ -214,12 +214,12 @@ function nextPage() {
|
||||
<div class="member-details">
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">加入时间</span>
|
||||
<span class="detail-value">{{ member?.joinTime }}</span>
|
||||
<span class="detail-value">{{ dayjs(member?.profile.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<!-- <div class="detail-item">
|
||||
<span class="detail-label">投资金额</span>
|
||||
<span class="detail-value amount">¥{{ member?.investAmount?.toFixed(2) || '0.00' }}</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -387,6 +387,8 @@ function nextPage() {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
flex-shrink: 0;
|
||||
overflow: hidden;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
.member-info {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang='ts' setup>
|
||||
import dayjs from "dayjs";
|
||||
import { peopleOutline, trendingUpOutline, walletOutline } from "ionicons/icons";
|
||||
import { client, safeClient } from "@/api";
|
||||
|
||||
@@ -154,7 +155,7 @@ function nextPage() {
|
||||
</div>
|
||||
|
||||
<!-- 助力统计 -->
|
||||
<div class="stats-section">
|
||||
<!-- <div class="stats-section">
|
||||
<div class="section-title">
|
||||
<ion-icon :icon="trendingUpOutline" class="title-icon" />
|
||||
<span>团队助力</span>
|
||||
@@ -181,10 +182,10 @@ function nextPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- 收益统计 -->
|
||||
<div class="stats-section">
|
||||
<!-- <div class="stats-section">
|
||||
<div class="section-title">
|
||||
<ion-icon :icon="walletOutline" class="title-icon" />
|
||||
<span>团队收益</span>
|
||||
@@ -192,7 +193,7 @@ function nextPage() {
|
||||
<div class="unified-card">
|
||||
<div class="unified-left">
|
||||
<div class="unified-value">
|
||||
¥{{ statistics.todayIncome.toFixed(2) }}
|
||||
¥{{ statistics?.todayIncome.toFixed(2) }}
|
||||
</div>
|
||||
<div class="unified-label">
|
||||
今日收益
|
||||
@@ -211,7 +212,7 @@ function nextPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- 团队列表 -->
|
||||
<div class="team-list-section">
|
||||
@@ -240,25 +241,31 @@ function nextPage() {
|
||||
class="member-card"
|
||||
>
|
||||
<div class="member-header">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="member-avatar">
|
||||
<img src="@/assets/images/avatar.jpg">
|
||||
</div>
|
||||
<div>
|
||||
<div class="member-name">
|
||||
{{ member.profile.nickname }}
|
||||
</div>
|
||||
<div class="info-row-item">
|
||||
<span class="value">178888888</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="member-amount">
|
||||
¥{{ member.investAmount.toFixed(2) }}
|
||||
¥{{ 1243 }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="member-info">
|
||||
<div class="info-row-item">
|
||||
<span class="label">手机号</span>
|
||||
<span class="value">{{ member.profile.phone }}</span>
|
||||
</div>
|
||||
<div class="info-row-item">
|
||||
<span class="label">加入时间</span>
|
||||
<span class="value">{{ member.joinTime }}</span>
|
||||
<span class="value">{{ dayjs(member.profile.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
|
||||
</div>
|
||||
<div class="info-row-item">
|
||||
<span class="label">邀请人数</span>
|
||||
<span class="value highlight">{{ member.inviteCount }}人</span>
|
||||
<span class="value highlight">{{ member.directCount }}人</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -301,6 +308,21 @@ function nextPage() {
|
||||
</template>
|
||||
|
||||
<style lang='css' scoped>
|
||||
.member-avatar {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #c41e3a 0%, #8b1a2e 100%);
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
flex-shrink: 0;
|
||||
overflow: hidden;
|
||||
border-radius: 100%;
|
||||
}
|
||||
.stats-section {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
@@ -325,7 +347,7 @@ function nextPage() {
|
||||
.team-size-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: linear-gradient(135deg, #c41e3a 0%, #8b1a2e 100%);
|
||||
background: linear-gradient(135deg, #fff7f0 0%, #ffe8e8 100%);
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
gap: 20px;
|
||||
@@ -335,19 +357,17 @@ function nextPage() {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding-right: 20px;
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.3);
|
||||
border-right: 1px solid #333;
|
||||
}
|
||||
|
||||
.total-value {
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
color: white;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.total-label {
|
||||
font-size: 14px;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.team-growth {
|
||||
@@ -365,13 +385,11 @@ function nextPage() {
|
||||
|
||||
.growth-label {
|
||||
font-size: 14px;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
}
|
||||
|
||||
.growth-value {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.unified-card {
|
||||
@@ -387,7 +405,7 @@ function nextPage() {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding-right: 20px;
|
||||
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-right: 1px solid #333;
|
||||
}
|
||||
|
||||
.unified-value {
|
||||
@@ -470,11 +488,12 @@ function nextPage() {
|
||||
|
||||
.member-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.member-name {
|
||||
|
||||
Reference in New Issue
Block a user