渠道接口换

This commit is contained in:
杨 2026-06-24 14:18:12 +08:00
parent 7010ed1238
commit e14dd66e2b
2 changed files with 3 additions and 36 deletions

View File

@ -139,7 +139,7 @@ import { ref, computed, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
import Dialog from '@/components/common/Dialog.vue'
import { getWalletCapital, getWithdrawChannel, getAgentWithdrawChannel, agentWithdraw, withdraw } from '@/api/modules/capital/withdraw'
import { getWalletCapital, agentWithdraw, withdraw } from '@/api/modules/capital/withdraw'
import { getStorage } from '@/utils/storage'
const { t } = useI18n()
@ -182,11 +182,6 @@ interface WalletInfo {
closing_profit: string
}
interface ChannelItem {
id: number
name: string
}
interface CalculatedItem {
type: string
typeLabel: string
@ -354,9 +349,6 @@ const walletInfo = ref<WalletInfo>({
closing_profit: '0',
})
// 渠道列表
const channelList = ref<ChannelItem[]>([])
// 计算后的扣除明细
const calculatedData = ref<CalculatedItem[]>([])
@ -452,31 +444,6 @@ const initData = async () => {
} catch (error) {
console.error('获取钱包信息失败', error)
}
// 获取渠道列表
try {
const api = isAgent.value ? getWithdrawChannel : getAgentWithdrawChannel
const res: any = await api()
if (res && Array.isArray(res)) {
channelList.value = res.map((item: any) => ({
id: item.id,
name: item.name,
channel_code: item.channel_code || '',
}))
} else if (res?.data) {
channelList.value = res.data.map((item: any) => ({
id: item.id,
name: item.name,
channel_code: item.channel_code || '',
}))
}
// 如果有默认渠道,设置当前渠道编码
if (channelList.value.length > 0) {
currentChannelCode.value = channelList.value[0].channel_code || ''
}
} catch (error) {
console.error('获取渠道列表失败', error)
}
}
// 计算扣除明细

View File

@ -370,7 +370,7 @@ import {
updateCapital,
editAgentBail,
} from '@/api/modules/profile/business.ts'
import { getAgentWithdrawChannel, agentWithdraw } from '@/api/modules/capital/withdraw'
import { getWithdrawChannel, agentWithdraw } from '@/api/modules/capital/withdraw'
const userStore = useUserStore()
@ -734,7 +734,7 @@ const withdrawChannelOptions = ref<{ label: string; value: number }[]>([])
// 获取取款渠道列表
const fetchWithdrawChannel = async () => {
try {
const res = await getAgentWithdrawChannel()
const res = await getWithdrawChannel()
withdrawChannelOptions.value = res.map((item: any) => ({
label: item.name,
value: item.id,