feat(金币代理收支记录页): 对接接口
This commit is contained in:
parent
eabc43826c
commit
d68c312e63
@ -121,11 +121,13 @@ export function freightRecharge(data) {
|
||||
|
||||
/**
|
||||
* 获取金币交易流水
|
||||
* @param {string} userId - 用户ID
|
||||
* @param {string} data
|
||||
* @returns {Promise} 返回交易流水记录
|
||||
*/
|
||||
export function getFreightWaterFlow(userId) {
|
||||
return get(`/wallet/freight/balance/running/water/client/flowByUserId?userId=${userId}`)
|
||||
export function getFreightWaterFlow(data) {
|
||||
return get(
|
||||
`/wallet/freight/balance/running/water/client/flowByUserId?userId=${data.userId}&type=${data.type}&searchId=${data.searchId}`
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -143,17 +143,18 @@ const searchResults = ref([])
|
||||
const isSearching = ref(false)
|
||||
const hasSearched = ref(false)
|
||||
|
||||
const activeTabId = ref(1)
|
||||
const activeTabId = ref(0)
|
||||
const tabItems = ref([]) // 存储标签DOM引用
|
||||
// 标签页数据
|
||||
const tabs = ref([
|
||||
{ id: 1, langKey: 'income' },
|
||||
{ id: 2, langKey: 'expenditure' },
|
||||
{ id: 0, langKey: 'income' },
|
||||
{ id: 1, langKey: 'expenditure' },
|
||||
])
|
||||
|
||||
// 切换标签页
|
||||
const switchTab = (tabId) => {
|
||||
activeTabId.value = tabId
|
||||
fetchRecords()
|
||||
}
|
||||
|
||||
// 计算下划线样式
|
||||
@ -161,7 +162,7 @@ const underlineStyle = computed(() => {
|
||||
console.log('计算属性')
|
||||
|
||||
if (tabItems.value.length === 0) return {} //没有这个元素
|
||||
const activeTab = tabItems.value[activeTabId.value - 1]
|
||||
const activeTab = tabItems.value[activeTabId.value]
|
||||
console.log('选中元素的左边距', activeTab.offsetLeft)
|
||||
|
||||
return {
|
||||
@ -192,7 +193,13 @@ const fetchRecords = async () => {
|
||||
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) {
|
||||
// 处理返回的数据
|
||||
@ -242,10 +249,7 @@ const performSearch = async () => {
|
||||
|
||||
searchResults.value = []
|
||||
if (searchQuery.value.trim()) {
|
||||
// const resSearchUser = await getTeamMember(searchQuery.value)
|
||||
// if (resSearchUser.status && resSearchUser.body) {
|
||||
// searchResults.value = resSearchUser.body
|
||||
// }
|
||||
fetchRecords()
|
||||
}
|
||||
|
||||
isSearching.value = false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user