diff --git a/src/i18n/locales/zh-CN/index.ts b/src/i18n/locales/zh-CN/index.ts
index 8d1f77a..4c66c34 100644
--- a/src/i18n/locales/zh-CN/index.ts
+++ b/src/i18n/locales/zh-CN/index.ts
@@ -138,8 +138,8 @@ export default {
pointDiff: '点差佣金',
service: '服务费',
risk: '风险金',
- profit: '头寸',
- headPosition: '头寸',
+ profit: '盈亏',
+ headPosition: '盈亏',
available: '可用余额',
},
table: {
diff --git a/src/views/capital/withdraw/components/WithdrawDialog.vue b/src/views/capital/withdraw/components/WithdrawDialog.vue
index 37f6cbd..742a5d5 100644
--- a/src/views/capital/withdraw/components/WithdrawDialog.vue
+++ b/src/views/capital/withdraw/components/WithdrawDialog.vue
@@ -8,29 +8,9 @@
{{ t('withdraw.dialog.walletBalance') }}
-
- {{ t('withdraw.wallet.feeHandling') }}
- {{ walletInfo.commission_fee_handling || '0.00' }}
-
-
- {{ t('withdraw.wallet.pointDiff') }}
- {{ walletInfo.commission_point_diff || '0.00' }}
-
-
- {{ t('withdraw.wallet.service') }}
- {{ walletInfo.service || '0.00' }}
-
-
- {{ t('withdraw.wallet.risk') }}
- {{ walletInfo.risk || '0.00' }}
-
-
- {{ t('withdraw.wallet.profit') }}
- {{ walletInfo.closing_profit || '0.00' }}
-
-
-
{{ t('withdraw.wallet.available') }}
-
{{ availableBalance || '0.00' }}
+
+ {{ item.label }}
+ {{ item.value }}
@@ -248,7 +228,7 @@ const isAgent = computed(() => roleId >= 5)
// 当前货币类型(从渠道信息获取)
const currentCurrency = computed(() => props.channelInfo?.currency?.symbol || '-')
-// 计算可用余额 = amount - freeze - (手续费 + 点差 + 服务费 + 风险金 + 头寸)
+// 计算可用余额 = amount - freeze - (手续费 + 点差 + 服务费 + 风险金 + 盈亏)
const availableBalance = computed(() => {
const amount = parseFloat(walletInfo.value.amount || '0')
const freeze = parseFloat(walletInfo.value.freeze || '0')
@@ -259,7 +239,7 @@ const availableBalance = computed(() => {
Math.max(0, parseFloat(walletInfo.value.service || '0')) +
Math.max(0, parseFloat(walletInfo.value.risk || '0')) +
Math.max(0, parseFloat(walletInfo.value.closing_profit || '0'))
- return Math.max(0, amount - freeze - walletSum)
+ return Math.max(0, amount - walletSum)
})
// 计算钱包余额总和(用于验证输入金额上限)
@@ -267,8 +247,9 @@ const availableBalance = computed(() => {
const totalWalletBalance = computed(() => {
const amount = parseFloat(walletInfo.value.amount || '0')
const freeze = parseFloat(walletInfo.value.freeze || '0')
+ console.log('walletInfo.value:', walletInfo.value);
- // 钱包余额总和(手续费 + 点差 + 服务费 + 风险金 + 头寸)
+ // 钱包余额总和(手续费 + 点差 + 服务费 + 风险金 + 盈亏)
const walletSum =
parseFloat(walletInfo.value.commission_fee_handling || '0') +
parseFloat(walletInfo.value.commission_point_diff || '0') +
@@ -279,49 +260,71 @@ const totalWalletBalance = computed(() => {
if (roleId >= 5) {
// roleId >= 5 时,总余额包含可用余额
// availableBalance = amount - freeze - walletSum
- const availableBal = Math.max(0, amount - freeze - walletSum)
+ const availableBal = Math.max(0, amount - walletSum)
return walletSum + availableBal
}
return walletSum
})
-// 根据角色显示对应的费用项
-const showRiskFee = computed(() => [1].includes(roleId))
-
-// 费用项顺序
-const feeOrder = computed(() => {
- const orders: Record
= {
- 1: ['手续费', '点差', '服务费', '风险金', '头寸', '可用余额'], // 平台
- 2: ['手续费', '点差', '服务费', '可用余额'], // 承包商
- 3: ['手续费', '点差', '服务费', '头寸', '可用余额'], // 特殊做市商
- 4: ['手续费', '点差', '服务费', '头寸', '可用余额'], // 普通做市商
- 5: ['手续费', '点差', '可用余额'], // 代理
- 6: ['手续费', '点差', '可用余额'], // 用户
- }
- return orders[roleId] ?? orders[6] ?? []
-})
-
-// 费用项对应的字段
-const feeFieldMap: Record = {
- '手续费': 'commission_fee_handling',
- '点差': 'commission_point_diff',
- '服务费': 'service',
- '风险金': 'risk',
- '头寸': 'closing_profit',
- '可用余额': 'available', // 特殊处理,用 computed 计算
-}
-
// 费用项标签映射
const feeLabelMap: Record = {
'手续费': '手续费佣金',
'点差': '点差佣金',
'服务费': '服务费',
'风险金': '风险金',
- '头寸': '头寸',
+ '盈亏': '盈亏',
'可用余额': '可用余额',
}
+// 费用项对应的字段
+const feeFieldMap: Record = {
+ '手续费': 'commission_fee_handling',
+ '点差': 'commission_point_diff',
+ '服务费': 'service',
+ '风险金': 'risk',
+ '盈亏': 'closing_profit',
+ '可用余额': 'available', // 特殊处理,用 computed 计算
+}
+
+// 费用项顺序
+const feeOrder = computed(() => {
+ const orders: Record = {
+ 1: ['手续费', '点差', '服务费', '风险金', '盈亏', '可用余额'], // 平台
+ 2: ['手续费', '点差', '服务费', '可用余额'], // 承包商
+ 3: ['手续费', '点差', '服务费', '盈亏', '可用余额'], // 特殊做市商
+ 4: ['手续费', '点差', '服务费', '盈亏', '可用余额'], // 普通做市商
+ 5: ['手续费', '点差', '可用余额'], // 代理
+ 6: ['手续费', '点差', '可用余额'], // 用户
+ }
+ return orders[roleId] ?? orders[6] ?? []
+})
+
+// 根据角色动态计算钱包项
+const walletItems = computed(() => {
+ const items: { label: string; value: string; field: string }[] = []
+
+ for (const feeType of feeOrder.value) {
+ const field = feeFieldMap[feeType]
+ if (!field) continue
+
+ let value: string
+ if (field === 'available') {
+ value = availableBalance.value.toFixed(2)
+ } else {
+ value = walletInfo.value[field] || '0.00'
+ }
+
+ items.push({
+ label: feeLabelMap[feeType] || feeType,
+ value,
+ field,
+ })
+ }
+
+ return items
+})
+
// 钱包信息
const walletInfo = ref({
user_id: '',
@@ -523,13 +526,39 @@ const handleNextStep = () => {
return
}
- // 填充表单数据
- formData.value.withdraw_fee_handle = calculatedData.value.find(item => item.type === '手续费')?.deducted || '0'
- formData.value.withdraw_point_diff = calculatedData.value.find(item => item.type === '点差')?.deducted || '0'
- formData.value.withdraw_service_fee = calculatedData.value.find(item => item.type === '服务费')?.deducted || '0'
- formData.value.withdraw_risk_fee = calculatedData.value.find(item => item.type === '风险金')?.deducted || '0'
- formData.value.withdraw_head_fee = calculatedData.value.find(item => item.type === '头寸')?.deducted || '0'
- formData.value.withdraw_blance = calculatedData.value.find(item => item.type === '可用余额')?.deducted || '0'
+ // 清空所有费用字段
+ formData.value.withdraw_fee_handle = '0'
+ formData.value.withdraw_point_diff = '0'
+ formData.value.withdraw_service_fee = '0'
+ formData.value.withdraw_risk_fee = '0'
+ formData.value.withdraw_head_fee = '0'
+ formData.value.withdraw_blance = '0'
+
+ // 根据当前角色的费用项顺序填充表单数据
+ for (const feeType of feeOrder.value) {
+ const deducted = calculatedData.value.find(item => item.type === feeType)?.deducted || '0'
+
+ switch (feeType) {
+ case '手续费':
+ formData.value.withdraw_fee_handle = deducted
+ break
+ case '点差':
+ formData.value.withdraw_point_diff = deducted
+ break
+ case '服务费':
+ formData.value.withdraw_service_fee = deducted
+ break
+ case '风险金':
+ formData.value.withdraw_risk_fee = deducted
+ break
+ case '盈亏':
+ formData.value.withdraw_head_fee = deducted
+ break
+ case '可用余额':
+ formData.value.withdraw_blance = deducted
+ break
+ }
+ }
currentStep.value = 2
}
@@ -548,14 +577,35 @@ const handleSubmit = async () => {
const params: any = {
channel_id: props.channelId,
amount: +withdrawAmount.value,
- withdraw_fee_handle: formData.value.withdraw_fee_handle,
- withdraw_point_diff: formData.value.withdraw_point_diff,
withdraw_address: formData.value.withdraw_address,
}
+ // 根据当前角色的费用项顺序添加对应的费用参数
+ for (const feeType of feeOrder.value) {
+ switch (feeType) {
+ case '手续费':
+ params.withdraw_fee_handle = formData.value.withdraw_fee_handle
+ break
+ case '点差':
+ params.withdraw_point_diff = formData.value.withdraw_point_diff
+ break
+ case '服务费':
+ params.withdraw_service_fee = formData.value.withdraw_service_fee
+ break
+ case '风险金':
+ params.withdraw_risk_fee = formData.value.withdraw_risk_fee
+ break
+ case '盈亏':
+ params.withdraw_head_fee = formData.value.withdraw_head_fee
+ break
+ case '可用余额':
+ params.withdraw_blance = formData.value.withdraw_blance
+ break
+ }
+ }
+
if (isAgent.value) {
// 用户取款
- params.withdraw_blance = formData.value.withdraw_blance
params.beneficiary_name = formData.value.beneficiary_name
params.beneficiary_bank_name = formData.value.beneficiary_bank_name
params.swift_bic_code = formData.value.swift_bic_code
@@ -565,10 +615,6 @@ const handleSubmit = async () => {
await withdraw(params)
} else {
// 代理取款
- params.withdraw_service_fee = formData.value.withdraw_service_fee
- params.withdraw_head_fee = formData.value.withdraw_head_fee
- params.withdraw_risk_fee = formData.value.withdraw_risk_fee
-
await agentWithdraw(params)
}
diff --git a/src/views/dashboard/components/view/index.vue b/src/views/dashboard/components/view/index.vue
index 81be4cb..181b18e 100644
--- a/src/views/dashboard/components/view/index.vue
+++ b/src/views/dashboard/components/view/index.vue
@@ -1,278 +1,431 @@
-
-
- 如何开始
-
-
-
-
-
- 实名认证
-
-
-
-
-
-
- 存款
-
-
-
-
-
-
-
交易
+
+
+
+
+
+ 如何开始
+
+
+
+
+
+ {{ index + 1 }}
+
+
+ {{ step.title }}
+ {{ step.desc }}
+
+
-
-
- 常用功能
-
-
-
-
-
- 存款
-
-
-
-
-
- 取款
-
-
-
-
-
- 交易
-
-
-
-
- 我的钱包
+
-
-
- 转账
- 取款
- 资金明细
-
-
-
-
-
- USD
- 总金额
- 可用资金
- 冻结资金
-
-
-
主钱包
-
{{ walletCapital.amount_total }}
-
{{ walletCapital.amount }}
-
{{ walletCapital.freeze }}
+
+
+
+
+ 常用功能
+
+
+
+
+
+
+
+
+
+
{{ action.title }}
+
{{ action.desc }}
+
+
+
+
+
+
+
+
+
+
+ 我的钱包
+ USD 主钱包
+
+
+
+
-
-
-
-
-
- 个人账户
- 添加子账户
-
-
-
-
-
-
账户名称:
-
{{ item.account_name }}
+
+
-
-
账户名称:
+
+
+ 点差
+ {{ walletCapital.commission_point_diff || '0.00' }}
+
+
+ 手续费
+ {{ walletCapital.commission_fee_handling || '0.00' }}
+
+
+
+
+
+
+
+ 转账
+
+
+
+ 取款
+
+
+
+ 资金明细
+
+
+
+
+
+
+
+
+
+ 个人账户
+
+
+ 添加子账户
+
+
+
+
+
-
-
-
- 推广
- 统计起始时间:2026-3-20
-
-
-
-
推广链接
-
-
{{ copyText }}
-
-
-
+
+
+
+