feat(收支详情页): 对接接口

This commit is contained in:
hzj 2025-11-17 17:00:26 +08:00
parent 00cf3277df
commit 5fdf486193
3 changed files with 52 additions and 83 deletions

View File

@ -343,12 +343,12 @@ export const withdrawApply = async (data) => {
} }
// 获取提现记录 // 获取提现记录
export const apiGetCashOutRecords = async () => { export const apiGetWithdrawRecords = async () => {
try { try {
const response = await get(`/activity/lottery/withdraw/records`) const response = await get(`/team/bd/withdraw/details`)
return response return response
} catch (error) { } 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) console.error('error:' + error.response.errorMsg)
throw error throw error
} }

View File

@ -19,10 +19,10 @@
" "
> >
<div style="font-weight: 600">{{ t('available_salaries') }}</div> <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> <div style="color: rgba(0, 0, 0, 0.4)">{{ t('details') }}</div>
<img src="../../assets/icon/arrow.png" alt="" width="16px" class="flipImg" /> <img src="../../assets/icon/arrow.png" alt="" width="16px" class="flipImg" />
</div> --> </div>
</div> </div>
<div <div
style=" style="

View File

@ -21,16 +21,16 @@
> >
<!-- 提现记录 --> <!-- 提现记录 -->
<div <div
v-if="record.type === 'cashOut'" v-if="record.type === 'CASH_OUT'"
style="display: flex; flex-direction: column; gap: 4px" style="display: flex; flex-direction: column; gap: 4px"
> >
<div style="display: flex; justify-content: space-between; align-items: center"> <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">{{ t('cash_out') }}</div>
<div style="font-weight: 600">${{ record.amount }}</div> <div style="font-weight: 600">{{ record.amountText }}</div>
</div> </div>
<div style="display: flex; justify-content: space-between; align-items: center"> <div style="display: flex; justify-content: space-between; align-items: center">
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 500"> <div style="color: rgba(0, 0, 0, 0.4); font-weight: 500">
{{ record.date }} {{ record.timeText }}
</div> </div>
<div <div
style=" style="
@ -55,15 +55,17 @@
<!-- 转账记录 --> <!-- 转账记录 -->
<div <div
v-if="record.type === 'Transfer'" v-if="record.type === 'TRANSFER'"
style="display: flex; flex-direction: column; gap: 4px" style="display: flex; flex-direction: column; gap: 4px"
> >
<!-- 标题 -->
<div style="font-weight: 700">{{ t('transfer') }}</div> <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"> <div style="display: flex; justify-content: center; align-items: center">
<img <img
:src="record.avatar || ''" :src="record.userInfo?.avatar || ''"
alt="" alt=""
@error="defaultAvatarUrl" @error="defaultAvatarUrl"
style=" style="
@ -75,40 +77,60 @@
" "
/> />
</div> </div>
<div style="display: flex; flex-direction: column; justify-content: space-between"> <div
<div style="font-weight: 600; font-size: 0.9em">{{ record.name }}</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"> <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>
</div> </div>
<!-- 金额 -->
<div style="font-weight: 600; font-size: 0.9em"> <div style="font-weight: 600; font-size: 0.9em">
{{ t('plus_coins', { amount: record.amount }) }} {{ t('plus_coins', { amount: record.amount }) }}
</div> </div>
</div> </div>
<!-- 时间 -->
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 500; font-size: 0.9em"> <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> </div>
<!-- 充值和收入 --> <!-- 充值和收入 -->
<div <div
v-if=" v-if="
record.type === 'Exchange Coins' || record.type === 'EXCHANGE' ||
record.type === 'BD income' || record.type === 'BD_INCOME' ||
record.type === 'BD Leader 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="display: flex; flex-direction: column">
<div style="font-weight: 600">{{ record.type }}</div> <div style="font-weight: 600">{{ record.typeText }}</div>
<div style="font-weight: 600">-${{ record.amount }}</div> <div style="color: rgba(0, 0, 0, 0.4); font-weight: 500">
</div> {{ record.timeText }}
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 500"> </div>
{{ record.date }}
</div> </div>
<div style="font-weight: 600">{{ record.amountText }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -120,7 +142,7 @@ import { useI18n } from 'vue-i18n'
import GeneralHeader from '@/components/GeneralHeader.vue' import GeneralHeader from '@/components/GeneralHeader.vue'
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { setDocumentDirection } from '@/locales/i18n' import { setDocumentDirection } from '@/locales/i18n'
import { apiGetCashOutRecords } from '@/api/wallet' import { apiGetWithdrawRecords } from '@/api/wallet'
const { t, locale } = useI18n() const { t, locale } = useI18n()
@ -128,60 +150,7 @@ const { t, locale } = useI18n()
locale.value && setDocumentDirection(locale.value) locale.value && setDocumentDirection(locale.value)
// //
const Records = ref([ 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 getStatusText = (status) => { const getStatusText = (status) => {
@ -205,10 +174,10 @@ const defaultAvatarUrl = (e) => {
// //
const getCashOutRecords = async () => { const getCashOutRecords = async () => {
const resCashOutRecords = await apiGetCashOutRecords() const resCashOutRecords = await apiGetWithdrawRecords()
console.log('已邀请列表:', resCashOutRecords) console.log('已邀请列表:', resCashOutRecords)
if (resCashOutRecords.status && resCashOutRecords.body) { if (resCashOutRecords.status && resCashOutRecords.body) {
// invitedUserList.value = resCashOutRecords.body Records.value = resCashOutRecords.body
} }
} }