渠道接口换
This commit is contained in:
parent
7010ed1238
commit
e14dd66e2b
|
|
@ -139,7 +139,7 @@ import { ref, computed, watch } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
|
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
|
||||||
import Dialog from '@/components/common/Dialog.vue'
|
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'
|
import { getStorage } from '@/utils/storage'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
@ -182,11 +182,6 @@ interface WalletInfo {
|
||||||
closing_profit: string
|
closing_profit: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ChannelItem {
|
|
||||||
id: number
|
|
||||||
name: string
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CalculatedItem {
|
interface CalculatedItem {
|
||||||
type: string
|
type: string
|
||||||
typeLabel: string
|
typeLabel: string
|
||||||
|
|
@ -354,9 +349,6 @@ const walletInfo = ref<WalletInfo>({
|
||||||
closing_profit: '0',
|
closing_profit: '0',
|
||||||
})
|
})
|
||||||
|
|
||||||
// 渠道列表
|
|
||||||
const channelList = ref<ChannelItem[]>([])
|
|
||||||
|
|
||||||
// 计算后的扣除明细
|
// 计算后的扣除明细
|
||||||
const calculatedData = ref<CalculatedItem[]>([])
|
const calculatedData = ref<CalculatedItem[]>([])
|
||||||
|
|
||||||
|
|
@ -452,31 +444,6 @@ const initData = async () => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取钱包信息失败', 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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算扣除明细
|
// 计算扣除明细
|
||||||
|
|
|
||||||
|
|
@ -370,7 +370,7 @@ import {
|
||||||
updateCapital,
|
updateCapital,
|
||||||
editAgentBail,
|
editAgentBail,
|
||||||
} from '@/api/modules/profile/business.ts'
|
} 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()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
|
@ -734,7 +734,7 @@ const withdrawChannelOptions = ref<{ label: string; value: number }[]>([])
|
||||||
// 获取取款渠道列表
|
// 获取取款渠道列表
|
||||||
const fetchWithdrawChannel = async () => {
|
const fetchWithdrawChannel = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getAgentWithdrawChannel()
|
const res = await getWithdrawChannel()
|
||||||
withdrawChannelOptions.value = res.map((item: any) => ({
|
withdrawChannelOptions.value = res.map((item: any) => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
value: item.id,
|
value: item.id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue