From 109cf3459fe3354fb46ba1fafeff1d939cebf4c5 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Thu, 9 Oct 2025 17:31:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BF=A1=E6=81=AF=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E9=A1=B5):=20UI=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/MessageView.vue | 102 ++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 55 deletions(-) diff --git a/src/views/MessageView.vue b/src/views/MessageView.vue index dd1cd17..87aa836 100644 --- a/src/views/MessageView.vue +++ b/src/views/MessageView.vue @@ -9,32 +9,20 @@
-
+
- - + +
@@ -53,9 +41,9 @@ import { useRouter } from 'vue-router' import MobileHeader from '../components/MobileHeader.vue' import { getApplyRecord } from '../api/teamBill.js' import { processUserApply } from '../api/wallet.js' -import {getTeamId} from "@/utils/userStore.js"; -import {showError, showSuccess, showWarning} from "@/utils/toast.js"; -import { formatUTCTime } from '@/utils/utcFormat.js'; +import { getTeamId } from '@/utils/userStore.js' +import { showError, showSuccess, showWarning } from '@/utils/toast.js' +import { formatUTCTime } from '@/utils/utcFormat.js' const router = useRouter() const loading = ref(false) @@ -67,8 +55,8 @@ const mockMessages = [ id: '1234567890', name: 'User1', avatar: '', - type: 'team_join_request' - } + type: 'team_join_request', + }, ] // 获取消息列表 @@ -79,7 +67,7 @@ const fetchMessages = async () => { if (response.status && response.body) { // 根据新的接口结构映射数据 - messages.value = response.body.map(item => ({ + messages.value = response.body.map((item) => ({ id: item.id, reason: item.reason, teamId: item.teamId, @@ -93,7 +81,7 @@ const fetchMessages = async () => { userSex: item.createUserProfile.userSex, age: item.createUserProfile.age, countryName: item.createUserProfile.countryName, - countryCode: item.createUserProfile.countryCode + countryCode: item.createUserProfile.countryCode, })) } } catch (error) { @@ -108,13 +96,13 @@ const handleAgree = async (message) => { try { const response = await processUserApply({ id: message.id, - status: 'AGREE' + status: 'AGREE', }) if (response.status) { showSuccess(`Approved ${message.name}'s application`) // 从列表中移除 - const index = messages.value.findIndex(m => m.id === message.id) + const index = messages.value.findIndex((m) => m.id === message.id) if (index > -1) { messages.value.splice(index, 1) } @@ -132,13 +120,13 @@ const handleRefuse = async (message) => { try { const response = await processUserApply({ id: message.id, - status: 'REJECT' + status: 'REJECT', }) if (response.status) { showWarning(`Rejected ${message.name}'s application`) // 从列表中移除 - const index = messages.value.findIndex(m => m.id === message.id) + const index = messages.value.findIndex((m) => m.id === message.id) if (index > -1) { messages.value.splice(index, 1) } @@ -157,6 +145,11 @@ onMounted(() => {