1.6 KiB
Raw Blame History

Wallet.vue

路径src/views/Wallet.vue
路由/walletname: wallet

功能用途

钱包页,展示 Portfolio、Profit/Loss、Positions、Open orders、History。支持 Deposit/Withdraw 弹窗、搜索、筛选(如 Close Losses

核心能力

  • Portfolio 卡片余额、Deposit/Withdraw 按钮
  • Profit/Loss 卡片时间范围切换1D/1W/1M/ALL、Lightweight Charts 资产变化面积图;数据格式为 [timestamp_ms, pnl][]暂无接口时全部显示为 0(真实时间轴 + 数值 0有接口后在此处对接
  • TabPositions、Open orders、History(历史记录来自 GET /hr/getHistoryRecordListClientsrc/api/historyRecord.ts需鉴权、按当前用户分页、Withdrawals提现记录
  • 可结算/领取未结算项unsettledItems由持仓中有 marketIDtokenID所属 market.closed=true 的项组成,用于「领取结算」按钮;不再使用 needClaim 判断
  • Withdrawals分页列表状态筛选全部/审核中/提现成功/审核不通过/提现失败),对接 GET /pmset/getPmSettlementRequestsListClient
  • DepositDialog、WithdrawDialog 组件
  • 401 权限错误:取消订单等接口失败时,通过 useAuthError().formatAuthError 统一提示「请先登录」或「权限不足」

使用方式

  • 登录后点击 AppBar 余额或头像菜单进入
  • 路由 /wallet

扩展方式

  1. 真实数据Positions、Orders、History 对接接口
  2. 导出History 支持导出 CSV
  3. 筛选:按市场、时间、盈亏等筛选