feat(收支详情页): 对接接口
This commit is contained in:
parent
00cf3277df
commit
5fdf486193
@ -343,12 +343,12 @@ export const withdrawApply = async (data) => {
|
||||
}
|
||||
|
||||
// 获取提现记录
|
||||
export const apiGetCashOutRecords = async () => {
|
||||
export const apiGetWithdrawRecords = async () => {
|
||||
try {
|
||||
const response = await get(`/activity/lottery/withdraw/records`)
|
||||
const response = await get(`/team/bd/withdraw/details`)
|
||||
return response
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch get cash out records:', error)
|
||||
console.error('Failed to fetch get all withdraw records:', error)
|
||||
console.error('error:' + error.response.errorMsg)
|
||||
throw error
|
||||
}
|
||||
|
||||
@ -19,10 +19,10 @@
|
||||
"
|
||||
>
|
||||
<div style="font-weight: 600">{{ t('available_salaries') }}</div>
|
||||
<!-- <div style="display: flex; align-items: center" @click="showDetails">
|
||||
<div style="display: flex; align-items: center" @click="showDetails">
|
||||
<div style="color: rgba(0, 0, 0, 0.4)">{{ t('details') }}</div>
|
||||
<img src="../../assets/icon/arrow.png" alt="" width="16px" class="flipImg" />
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
|
||||
@ -21,16 +21,16 @@
|
||||
>
|
||||
<!-- 提现记录 -->
|
||||
<div
|
||||
v-if="record.type === 'cashOut'"
|
||||
v-if="record.type === 'CASH_OUT'"
|
||||
style="display: flex; flex-direction: column; gap: 4px"
|
||||
>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div style="font-weight: 600">{{ t('cash_out') }}</div>
|
||||
<div style="font-weight: 600">${{ record.amount }}</div>
|
||||
<div style="font-weight: 600">{{ record.amountText }}</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 500">
|
||||
{{ record.date }}
|
||||
{{ record.timeText }}
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
@ -55,15 +55,17 @@
|
||||
|
||||
<!-- 转账记录 -->
|
||||
<div
|
||||
v-if="record.type === 'Transfer'"
|
||||
v-if="record.type === 'TRANSFER'"
|
||||
style="display: flex; flex-direction: column; gap: 4px"
|
||||
>
|
||||
<!-- 标题 -->
|
||||
<div style="font-weight: 700">{{ t('transfer') }}</div>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div style="width: 70%; display: flex">
|
||||
<!-- 信息部分 -->
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; gap: 4px">
|
||||
<div style="flex: 1; min-width: 0; display: flex">
|
||||
<div style="display: flex; justify-content: center; align-items: center">
|
||||
<img
|
||||
:src="record.avatar || ''"
|
||||
:src="record.userInfo?.avatar || ''"
|
||||
alt=""
|
||||
@error="defaultAvatarUrl"
|
||||
style="
|
||||
@ -75,40 +77,60 @@
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column; justify-content: space-between">
|
||||
<div style="font-weight: 600; font-size: 0.9em">{{ record.name }}</div>
|
||||
<div
|
||||
style="
|
||||
min-width: 0;
|
||||
width: calc(100% - 10vw);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
font-weight: 600;
|
||||
font-size: 0.9em;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
"
|
||||
>
|
||||
{{ record.userInfo?.userNickname }}11111111111111111111111111111111111111111111
|
||||
</div>
|
||||
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 500; font-size: 0.9em">
|
||||
ID:{{ record.id }}
|
||||
ID:{{ record.userInfo?.account }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 金额 -->
|
||||
<div style="font-weight: 600; font-size: 0.9em">
|
||||
{{ t('plus_coins', { amount: record.amount }) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 时间 -->
|
||||
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 500; font-size: 0.9em">
|
||||
21/10/2025 17:56
|
||||
{{ record.timeText }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 充值和收入 -->
|
||||
<div
|
||||
v-if="
|
||||
record.type === 'Exchange Coins' ||
|
||||
record.type === 'BD income' ||
|
||||
record.type === 'BD Leader income'
|
||||
record.type === 'EXCHANGE' ||
|
||||
record.type === 'BD_INCOME' ||
|
||||
record.type === 'BD_LEADER_INCOME'
|
||||
"
|
||||
style="display: flex; flex-direction: column; gap: 4px"
|
||||
style="display: flex; justify-content: space-between; align-items: center; gap: 4px"
|
||||
>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div style="font-weight: 600">{{ record.type }}</div>
|
||||
<div style="font-weight: 600">-${{ record.amount }}</div>
|
||||
</div>
|
||||
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 500">
|
||||
{{ record.date }}
|
||||
<div style="display: flex; flex-direction: column">
|
||||
<div style="font-weight: 600">{{ record.typeText }}</div>
|
||||
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 500">
|
||||
{{ record.timeText }}
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-weight: 600">{{ record.amountText }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -120,7 +142,7 @@ import { useI18n } from 'vue-i18n'
|
||||
import GeneralHeader from '@/components/GeneralHeader.vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { setDocumentDirection } from '@/locales/i18n'
|
||||
import { apiGetCashOutRecords } from '@/api/wallet'
|
||||
import { apiGetWithdrawRecords } from '@/api/wallet'
|
||||
|
||||
const { t, locale } = useI18n()
|
||||
|
||||
@ -128,60 +150,7 @@ const { t, locale } = useI18n()
|
||||
locale.value && setDocumentDirection(locale.value)
|
||||
|
||||
// 记录数据
|
||||
const Records = ref([
|
||||
{
|
||||
id: 1,
|
||||
type: 'cashOut',
|
||||
amount: 10,
|
||||
date: '21/10/2025 17:56',
|
||||
status: 'Under review',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
type: 'cashOut',
|
||||
amount: 10,
|
||||
date: '21/10/2025 17:56',
|
||||
status: 'Approved',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
type: 'cashOut',
|
||||
amount: 10,
|
||||
date: '21/10/2025 17:56',
|
||||
status: 'Rejection',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
type: 'Transfer',
|
||||
avatar: '',
|
||||
name: 'asdfasdfasdfasdsfasfasfasd',
|
||||
id: '1234567890',
|
||||
addStatus: '1',
|
||||
amount: '10000',
|
||||
date: '21/10/2025 17:56',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
type: 'Exchange Coins',
|
||||
addStatus: '0',
|
||||
amount: '10',
|
||||
date: '21/10/2025 17:56',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
type: 'BD income',
|
||||
addStatus: '1',
|
||||
amount: '10',
|
||||
date: '21/10/2025 17:56',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
type: 'BD Leader income',
|
||||
addStatus: '1',
|
||||
amount: '10',
|
||||
date: '21/10/2025 17:56',
|
||||
},
|
||||
])
|
||||
const Records = ref([])
|
||||
|
||||
// 获取状态文本翻译
|
||||
const getStatusText = (status) => {
|
||||
@ -205,10 +174,10 @@ const defaultAvatarUrl = (e) => {
|
||||
|
||||
// 获取提现记录
|
||||
const getCashOutRecords = async () => {
|
||||
const resCashOutRecords = await apiGetCashOutRecords()
|
||||
const resCashOutRecords = await apiGetWithdrawRecords()
|
||||
console.log('已邀请列表:', resCashOutRecords)
|
||||
if (resCashOutRecords.status && resCashOutRecords.body) {
|
||||
// invitedUserList.value = resCashOutRecords.body
|
||||
Records.value = resCashOutRecords.body
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user