From d68c312e6303776bb9344bb2779a8f282cf1088c Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Fri, 5 Dec 2025 19:25:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=87=91=E5=B8=81=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E6=94=B6=E6=94=AF=E8=AE=B0=E5=BD=95=E9=A1=B5):=20=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wallet.js | 8 ++++--- .../RechargeAgency/SellerRecordsView.vue | 22 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/api/wallet.js b/src/api/wallet.js index cb874c2..0d4ea91 100644 --- a/src/api/wallet.js +++ b/src/api/wallet.js @@ -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}` + ) } /** diff --git a/src/views/RechargeAgency/SellerRecordsView.vue b/src/views/RechargeAgency/SellerRecordsView.vue index 91d2ef6..0c4d8f3 100644 --- a/src/views/RechargeAgency/SellerRecordsView.vue +++ b/src/views/RechargeAgency/SellerRecordsView.vue @@ -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