|
|
@@ -1,26 +1,26 @@
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
- v-model="dialogVisible"
|
|
|
- :title="t('提现设置')"
|
|
|
- width="860px"
|
|
|
- center
|
|
|
- class="custom-dark-dialog settings-main-dialog"
|
|
|
- align-center
|
|
|
- append-to-body
|
|
|
- @open="onDialogOpen"
|
|
|
+ v-model="dialogVisible"
|
|
|
+ :title="t('提现设置')"
|
|
|
+ width="860px"
|
|
|
+ center
|
|
|
+ class="custom-dark-dialog settings-main-dialog"
|
|
|
+ align-center
|
|
|
+ append-to-body
|
|
|
+ @open="onDialogOpen"
|
|
|
>
|
|
|
<div class="settings-modal-body" v-loading="loading">
|
|
|
|
|
|
<div class="channel-pills-container">
|
|
|
<div
|
|
|
- class="pill-item"
|
|
|
- v-for="ch in channelOptions"
|
|
|
- :key="ch.value"
|
|
|
- :class="{ 'is-active': activeChannel === ch.value }"
|
|
|
- @click="switchChannel(ch.value)"
|
|
|
- v-show="ch.value !== 'rgtx'"
|
|
|
+ class="pill-item"
|
|
|
+ v-for="ch in channelOptions"
|
|
|
+ :key="ch.value"
|
|
|
+ :class="{ 'is-active': activeChannel === ch.value }"
|
|
|
+ @click="switchChannel(ch.value)"
|
|
|
+ v-show="ch.value !== 'rgtx'"
|
|
|
>
|
|
|
- <el-icon v-if="ch.value === 'USDT'"><Link /></el-icon>
|
|
|
+ <el-icon v-if="ch.value === 'usdt'"><Link /></el-icon>
|
|
|
<el-icon v-else-if="ch.value === 'DF002'"><Monitor /></el-icon>
|
|
|
<el-icon v-else><CreditCard /></el-icon>
|
|
|
<span class="ml-1">{{ ch.label }}</span>
|
|
|
@@ -36,15 +36,15 @@
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
- class="wallet-card"
|
|
|
- :class="getCardSkin(activeChannel)"
|
|
|
- v-for="item in accountList"
|
|
|
- :key="item.id"
|
|
|
+ class="wallet-card"
|
|
|
+ :class="getCardSkin(activeChannel)"
|
|
|
+ v-for="item in accountList"
|
|
|
+ :key="item.id"
|
|
|
>
|
|
|
- <template v-if="activeChannel === 'USDT'">
|
|
|
+ <template v-if="activeChannel === 'usdt'">
|
|
|
<div class="card-header">
|
|
|
<div class="bank-name">
|
|
|
- <el-icon class="mr-1"><Link /></el-icon> USDT
|
|
|
+ <el-icon class="mr-1"><Link /></el-icon> {{ getChannelLabel('usdt') || 'USDT' }}
|
|
|
</div>
|
|
|
<div class="channel-tag" v-if="item.alias">{{ item.alias }}</div>
|
|
|
</div>
|
|
|
@@ -81,35 +81,35 @@
|
|
|
</div>
|
|
|
|
|
|
<el-empty
|
|
|
- v-if="accountList.length === 0 && !loading"
|
|
|
- :description="t('当前通道暂无账户记录')"
|
|
|
- class="dark-empty"
|
|
|
+ v-if="accountList.length === 0 && !loading"
|
|
|
+ :description="t('当前通道暂无账户记录')"
|
|
|
+ class="dark-empty"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog
|
|
|
- v-model="showBankModal"
|
|
|
- :title="bankForm.id ? t('编辑账户') : t('添加账户')"
|
|
|
- width="480px"
|
|
|
- center
|
|
|
- custom-class="dark-dialog"
|
|
|
- append-to-body
|
|
|
- @closed="resetBankForm"
|
|
|
+ v-model="showBankModal"
|
|
|
+ :title="bankForm.id ? t('编辑账户') : t('添加账户')"
|
|
|
+ width="480px"
|
|
|
+ center
|
|
|
+ custom-class="dark-dialog"
|
|
|
+ append-to-body
|
|
|
+ @closed="resetBankForm"
|
|
|
>
|
|
|
<div class="modal-form-body">
|
|
|
<div class="form-item">
|
|
|
<div class="label">{{ t('提现通道') }}</div>
|
|
|
<el-input
|
|
|
- :model-value="getChannelLabel(bankForm.channel)"
|
|
|
- class="dark-input std-input"
|
|
|
- disabled
|
|
|
+ :model-value="getChannelLabel(bankForm.channel)"
|
|
|
+ class="dark-input std-input"
|
|
|
+ disabled
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
<div class="label">{{ t('银行名称/平台') }} <span class="required">*</span></div>
|
|
|
- <el-input v-model="bankForm.bank_name" class="dark-input std-input" :placeholder="t('请输入银行名称或平台名')" />
|
|
|
+ <el-input v-model="bankForm.bank_name" class="dark-input std-input" :placeholder="getBankNamePlaceholder()" />
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
<div class="label">{{ t('收款账号') }} <span class="required">*</span></div>
|
|
|
@@ -133,18 +133,18 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog
|
|
|
- v-model="showAddressModal"
|
|
|
- :title="addressForm.id ? t('编辑账户') : t('添加账户')"
|
|
|
- width="480px"
|
|
|
- center
|
|
|
- custom-class="dark-dialog"
|
|
|
- append-to-body
|
|
|
- @closed="resetAddressForm"
|
|
|
+ v-model="showAddressModal"
|
|
|
+ :title="addressForm.id ? t('编辑账户') : t('添加账户')"
|
|
|
+ width="480px"
|
|
|
+ center
|
|
|
+ custom-class="dark-dialog"
|
|
|
+ append-to-body
|
|
|
+ @closed="resetAddressForm"
|
|
|
>
|
|
|
<div class="modal-form-body">
|
|
|
<div class="form-item">
|
|
|
<div class="label">{{ t('提现通道') }}</div>
|
|
|
- <el-input :model-value="'USDT'" class="dark-input std-input" disabled />
|
|
|
+ <el-input :model-value="getChannelLabel('usdt') || 'USDT'" class="dark-input std-input" disabled />
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
<div class="label">{{ t('USDT 提现地址') }} <span class="required">*</span></div>
|
|
|
@@ -194,7 +194,18 @@ const submitLoading = ref(false);
|
|
|
// 通道与列表状态
|
|
|
const channelOptions = ref([]);
|
|
|
const activeChannel = ref('');
|
|
|
-const accountList = ref([]);
|
|
|
+
|
|
|
+// 列表数据管理
|
|
|
+const bankList = ref([]);
|
|
|
+const addressList = ref([]);
|
|
|
+
|
|
|
+// 计算当前过滤后的账户列表
|
|
|
+const accountList = computed(() => {
|
|
|
+ if (activeChannel.value === 'usdt') {
|
|
|
+ return addressList.value;
|
|
|
+ }
|
|
|
+ return bankList.value.filter(item => item.channel === activeChannel.value);
|
|
|
+});
|
|
|
|
|
|
// 子弹窗状态
|
|
|
const showBankModal = ref(false);
|
|
|
@@ -220,16 +231,14 @@ const addressForm = reactive({
|
|
|
const onDialogOpen = async () => {
|
|
|
await fetchWithdrawChannels();
|
|
|
if (channelOptions.value.length > 0) {
|
|
|
- // 默认选中第一个通道,并加载数据
|
|
|
activeChannel.value = channelOptions.value[0].value;
|
|
|
- fetchAccountList();
|
|
|
}
|
|
|
+ await fetchAllAccounts();
|
|
|
};
|
|
|
|
|
|
const switchChannel = (channelValue) => {
|
|
|
if (activeChannel.value === channelValue) return;
|
|
|
activeChannel.value = channelValue;
|
|
|
- fetchAccountList();
|
|
|
};
|
|
|
|
|
|
// ----------------------------------------
|
|
|
@@ -256,9 +265,9 @@ const customRequest = (path, method = 'GET', data = {}) => {
|
|
|
}
|
|
|
|
|
|
fetch(url, options)
|
|
|
- .then(res => res.json())
|
|
|
- .then(resData => resolve(resData))
|
|
|
- .catch(err => reject(err));
|
|
|
+ .then(res => res.json())
|
|
|
+ .then(resData => resolve(resData))
|
|
|
+ .catch(err => reject(err));
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -269,7 +278,6 @@ const fetchWithdrawChannels = async () => {
|
|
|
try {
|
|
|
const res = await customRequest('wallet/withdrawChannel', 'GET');
|
|
|
if (res.code === 0 || res.code === 1) {
|
|
|
- // 保留所有通道,包括 USDT
|
|
|
channelOptions.value = res.data || [];
|
|
|
}
|
|
|
} catch (error) {
|
|
|
@@ -282,8 +290,15 @@ const getChannelLabel = (value) => {
|
|
|
return target ? target.label : value;
|
|
|
};
|
|
|
|
|
|
+// 动态处理输入框提示
|
|
|
+const getBankNamePlaceholder = () => {
|
|
|
+ const current = channelOptions.value.find(c => c.value === activeChannel.value);
|
|
|
+ if (current && current.label === '支付宝') return t('例如:支付宝');
|
|
|
+ return t('请输入银行名称或平台名');
|
|
|
+};
|
|
|
+
|
|
|
const getCardSkin = (channelVal) => {
|
|
|
- if (channelVal === 'USDT') return 'usdt-card';
|
|
|
+ if (channelVal === 'usdt') return 'usdt-card';
|
|
|
switch(channelVal) {
|
|
|
case 'DF001': return 'bank-card-default';
|
|
|
case 'DF002': return 'bank-card-alipay';
|
|
|
@@ -293,22 +308,24 @@ const getCardSkin = (channelVal) => {
|
|
|
};
|
|
|
|
|
|
// ========================================
|
|
|
-// 业务逻辑:获取账户列表
|
|
|
+// 业务逻辑:获取全部账户列表
|
|
|
// ========================================
|
|
|
-const fetchAccountList = async () => {
|
|
|
+const fetchAllAccounts = async () => {
|
|
|
loading.value = true;
|
|
|
try {
|
|
|
- if (activeChannel.value === 'USDT') {
|
|
|
- // 调地址接口
|
|
|
- const res = await customRequest('wallet/address', 'GET');
|
|
|
- accountList.value = (res.code === 0 || res.code === 1) ? (res.data?.list || []) : [];
|
|
|
- } else {
|
|
|
- // 调银行卡接口,带上所选 channel
|
|
|
- const res = await customRequest('wallet/bankList', 'GET', { channel: activeChannel.value });
|
|
|
- accountList.value = (res.code === 0 || res.code === 1) ? (res.data?.list || []) : [];
|
|
|
+ const [bankRes, addressRes] = await Promise.all([
|
|
|
+ customRequest('wallet/bankList', 'GET'),
|
|
|
+ customRequest('wallet/address', 'GET')
|
|
|
+ ]);
|
|
|
+
|
|
|
+ if (bankRes.code === 0 || bankRes.code === 1) {
|
|
|
+ bankList.value = bankRes.data?.list || [];
|
|
|
+ }
|
|
|
+ if (addressRes.code === 0 || addressRes.code === 1) {
|
|
|
+ addressList.value = addressRes.data?.list || [];
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.error(error);
|
|
|
+ console.error('获取账户失败', error);
|
|
|
} finally {
|
|
|
loading.value = false;
|
|
|
}
|
|
|
@@ -318,7 +335,8 @@ const fetchAccountList = async () => {
|
|
|
// 业务逻辑:打开添加/编辑弹窗
|
|
|
// ========================================
|
|
|
const openModal = (item = null) => {
|
|
|
- if (activeChannel.value === 'USDT') {
|
|
|
+ // 修正:判断小写的 usdt
|
|
|
+ if (activeChannel.value === 'usdt') {
|
|
|
if (item) {
|
|
|
addressForm.id = item.id;
|
|
|
addressForm.address = item.address || '';
|
|
|
@@ -337,7 +355,6 @@ const openModal = (item = null) => {
|
|
|
bankForm.alias = item.alias || '';
|
|
|
} else {
|
|
|
resetBankForm();
|
|
|
- // 固定将 channel 置为当前外部点选的通道
|
|
|
bankForm.channel = activeChannel.value;
|
|
|
}
|
|
|
showBankModal.value = true;
|
|
|
@@ -375,7 +392,7 @@ const submitBank = async () => {
|
|
|
if (res.code === 0 || res.code === 1) {
|
|
|
ElMessage.success(res.msg || t('保存成功'));
|
|
|
showBankModal.value = false;
|
|
|
- fetchAccountList(); // 刷新当前列表
|
|
|
+ await fetchAllAccounts();
|
|
|
} else {
|
|
|
ElMessage.error(res.msg || t('保存失败'));
|
|
|
}
|
|
|
@@ -399,7 +416,7 @@ const submitAddress = async () => {
|
|
|
if (res.code === 0 || res.code === 1) {
|
|
|
ElMessage.success(res.msg || t('保存成功'));
|
|
|
showAddressModal.value = false;
|
|
|
- fetchAccountList(); // 刷新当前列表
|
|
|
+ await fetchAllAccounts();
|
|
|
} else {
|
|
|
ElMessage.error(res.msg || t('保存失败'));
|
|
|
}
|
|
|
@@ -423,7 +440,8 @@ const handleDelete = (id) => {
|
|
|
loading.value = true;
|
|
|
try {
|
|
|
let res;
|
|
|
- if (activeChannel.value === 'USDT') {
|
|
|
+ // 修正:判断小写的 usdt
|
|
|
+ if (activeChannel.value === 'usdt') {
|
|
|
res = await customRequest('wallet/delAddress', 'GET', { id });
|
|
|
} else {
|
|
|
res = await customRequest('wallet/delBank', 'GET', { id });
|
|
|
@@ -431,7 +449,7 @@ const handleDelete = (id) => {
|
|
|
|
|
|
if (res.code === 0 || res.code === 1) {
|
|
|
ElMessage.success(res.msg || t('删除成功'));
|
|
|
- fetchAccountList();
|
|
|
+ await fetchAllAccounts();
|
|
|
} else {
|
|
|
ElMessage.error(res.msg || t('删除失败'));
|
|
|
}
|
|
|
@@ -477,7 +495,6 @@ $text-secondary: #999;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
|
|
|
- /* 药丸式通道切换栏 */
|
|
|
.channel-pills-container {
|
|
|
display: flex;
|
|
|
gap: 12px;
|
|
|
@@ -486,7 +503,7 @@ $text-secondary: #999;
|
|
|
background: rgba(255, 255, 255, 0.02);
|
|
|
overflow-x: auto;
|
|
|
|
|
|
- &::-webkit-scrollbar { display: none; } /* 隐藏滚动条让视觉更干净 */
|
|
|
+ &::-webkit-scrollbar { display: none; }
|
|
|
|
|
|
.pill-item {
|
|
|
padding: 10px 20px;
|
|
|
@@ -534,7 +551,6 @@ $text-secondary: #999;
|
|
|
gap: 20px;
|
|
|
}
|
|
|
|
|
|
-/* 添加按钮卡片 */
|
|
|
.add-card-btn {
|
|
|
height: 140px;
|
|
|
border: 1px dashed #555;
|
|
|
@@ -559,7 +575,6 @@ $text-secondary: #999;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/* 数据卡片基础样式 */
|
|
|
.wallet-card {
|
|
|
height: 140px;
|
|
|
border-radius: 12px;
|
|
|
@@ -614,9 +629,6 @@ $text-secondary: #999;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/* ==================================
|
|
|
- 动态专属卡片皮肤配色
|
|
|
- ================================== */
|
|
|
.bank-card-default {
|
|
|
background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
|
|
|
border: 1px solid #4e4376;
|
|
|
@@ -634,9 +646,6 @@ $text-secondary: #999;
|
|
|
border: 1px solid #11998e;
|
|
|
}
|
|
|
|
|
|
-/* ==================================
|
|
|
- 弹窗与表单
|
|
|
- ================================== */
|
|
|
.modal-form-body {
|
|
|
padding: 10px 0 20px;
|
|
|
|
|
|
@@ -656,7 +665,6 @@ $text-secondary: #999;
|
|
|
.ml-1 { margin-left: 4px; }
|
|
|
.mr-1 { margin-right: 4px; }
|
|
|
|
|
|
-/* 覆盖输入框样式 */
|
|
|
:deep(.dark-input) {
|
|
|
.el-input__wrapper {
|
|
|
background-color: #111 !important;
|
|
|
@@ -665,7 +673,6 @@ $text-secondary: #999;
|
|
|
transition: all 0.3s;
|
|
|
&:hover, &.is-focus { box-shadow: 0 0 0 1px $main-color inset !important; }
|
|
|
|
|
|
- /* 禁用状态的显示处理 */
|
|
|
&.is-disabled {
|
|
|
background-color: #000 !important;
|
|
|
.el-input__inner { color: $main-color !important; -webkit-text-fill-color: $main-color !important; font-weight: bold; }
|
|
|
@@ -674,7 +681,6 @@ $text-secondary: #999;
|
|
|
.el-input__inner { color: #fff !important; }
|
|
|
}
|
|
|
|
|
|
-/* 弹窗及按钮覆盖 */
|
|
|
:deep(.dark-dialog) {
|
|
|
background-color: $card-bg;
|
|
|
border: 1px solid $border-color;
|
|
|
@@ -692,7 +698,6 @@ $text-secondary: #999;
|
|
|
</style>
|
|
|
|
|
|
<style>
|
|
|
-/* MessageBox 的暗黑模式补充 */
|
|
|
.dark-message-box {
|
|
|
background-color: #1e1e1e !important;
|
|
|
border: 1px solid #333 !important;
|
|
|
@@ -715,4 +720,4 @@ $text-secondary: #999;
|
|
|
border-color: #f8b932 !important;
|
|
|
color: #000 !important;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|