feat(金币代理收支记录页): 对接接口

This commit is contained in:
hzj 2025-12-05 19:25:10 +08:00
parent eabc43826c
commit d68c312e63
2 changed files with 18 additions and 12 deletions

View File

@ -121,11 +121,13 @@ export function freightRecharge(data) {
/** /**
* 获取金币交易流水 * 获取金币交易流水
* @param {string} userId - 用户ID * @param {string} data
* @returns {Promise} 返回交易流水记录 * @returns {Promise} 返回交易流水记录
*/ */
export function getFreightWaterFlow(userId) { export function getFreightWaterFlow(data) {
return get(`/wallet/freight/balance/running/water/client/flowByUserId?userId=${userId}`) return get(
`/wallet/freight/balance/running/water/client/flowByUserId?userId=${data.userId}&type=${data.type}&searchId=${data.searchId}`
)
} }
/** /**

View File

@ -143,17 +143,18 @@ const searchResults = ref([])
const isSearching = ref(false) const isSearching = ref(false)
const hasSearched = ref(false) const hasSearched = ref(false)
const activeTabId = ref(1) const activeTabId = ref(0)
const tabItems = ref([]) // DOM const tabItems = ref([]) // DOM
// //
const tabs = ref([ const tabs = ref([
{ id: 1, langKey: 'income' }, { id: 0, langKey: 'income' },
{ id: 2, langKey: 'expenditure' }, { id: 1, langKey: 'expenditure' },
]) ])
// //
const switchTab = (tabId) => { const switchTab = (tabId) => {
activeTabId.value = tabId activeTabId.value = tabId
fetchRecords()
} }
// 线 // 线
@ -161,7 +162,7 @@ const underlineStyle = computed(() => {
console.log('计算属性') console.log('计算属性')
if (tabItems.value.length === 0) return {} // if (tabItems.value.length === 0) return {} //
const activeTab = tabItems.value[activeTabId.value - 1] const activeTab = tabItems.value[activeTabId.value]
console.log('选中元素的左边距', activeTab.offsetLeft) console.log('选中元素的左边距', activeTab.offsetLeft)
return { return {
@ -192,7 +193,13 @@ const fetchRecords = async () => {
return return
} }
const response = await getFreightWaterFlow(userId) let data = {
userId: userId,
type: activeTabId.value,
searchId: searchQuery.value,
}
const response = await getFreightWaterFlow(data)
if (response && response.status && response.body) { if (response && response.status && response.body) {
// //
@ -242,10 +249,7 @@ const performSearch = async () => {
searchResults.value = [] searchResults.value = []
if (searchQuery.value.trim()) { if (searchQuery.value.trim()) {
// const resSearchUser = await getTeamMember(searchQuery.value) fetchRecords()
// if (resSearchUser.status && resSearchUser.body) {
// searchResults.value = resSearchUser.body
// }
} }
isSearching.value = false isSearching.value = false