From dc350caa19d91cb4bae3a4527bb77765ced2c553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9A=E5=95=A6C=E6=A2=A6?= <15709267061@163.com> Date: Tue, 8 Jul 2025 17:33:43 +0800 Subject: [PATCH] update --- src/api/admin.js | 14 ++ src/api/merchant.js | 7 + src/components/Chat/Information.vue | 166 ++++++++++-------- .../components/PersonalCenterBanner.vue | 2 +- 4 files changed, 112 insertions(+), 77 deletions(-) diff --git a/src/api/admin.js b/src/api/admin.js index 8c98f26..a72aa12 100644 --- a/src/api/admin.js +++ b/src/api/admin.js @@ -303,6 +303,13 @@ const admin = { data: data }); }, + advDel: async (data) => { + return request({ + url: '/admin/adv/del', + method: Method.POST, + data: data + }); + }, getNoticeList: async (data) => { return request({ url: '/admin/notice/getList', @@ -665,6 +672,13 @@ const admin = { data: data, }); }, + addInterventionV2: async (data) => { + return request({ + url: '/admin/Intervention/postIntervention', + method: Method.POST, + data: data, + }); + }, withdrawallogTranfer: async (data) => { return request({ url: '/admin/withdrawalLog/tranfer', diff --git a/src/api/merchant.js b/src/api/merchant.js index 7d8e9b4..92ad4f1 100644 --- a/src/api/merchant.js +++ b/src/api/merchant.js @@ -589,6 +589,13 @@ const merchant = { data: data }); }, + interventionV2: async (data) => { + return request({ + url: '/index/Task/addIntervention', + method: Method.POST, + data: data + }); + }, } export default merchant; diff --git a/src/components/Chat/Information.vue b/src/components/Chat/Information.vue index 6c00e9b..8049edc 100644 --- a/src/components/Chat/Information.vue +++ b/src/components/Chat/Information.vue @@ -6,10 +6,10 @@ import Api from "../../api"; import {Message} from "@arco-design/web-vue"; import useTableQuery from "../../hooks/useTableQuery.js"; import dayjs from "dayjs"; -import {throttle} from "lodash"; +import {debounce, throttle} from "lodash"; import {useSystemStore} from "../../pinia/SystemStore/index.js"; -import UploadSlot from "../upload/UploadSlot.vue"; import useUploadLength from "../../hooks/useUploadLength.js"; +import UploadSlot from "../upload/UploadSlot.vue"; const SystemStore = useSystemStore(); const emits = defineEmits(['success']); @@ -44,6 +44,7 @@ const {loading, pagination, initFetchData, fetchData} = useTableQuery({ api: SystemStore.isRoot ? Api.admin.getExchangeLogIntervention : Api.merchant.getExchangeLog, callback: (data) => { if (data.rows.length === 0) { + if (pagination.current > 1) pagination.current--; } else { tempPage = pagination.current; vo.info = data.info; @@ -59,7 +60,7 @@ const {loading, pagination, initFetchData, fetchData} = useTableQuery({ } }); -const send = async () => { +const send = debounce(async () => { const {msg} = await Api.merchant.addExchangeLog({ id: task.id, ...form, @@ -68,7 +69,8 @@ const send = async () => { form.content = null; form.images.length = 0; pagination.current = tempPage; -} + await fetchData() +}, 1000); const handleScroll = ({target}) => { const {scrollTop, clientHeight, scrollHeight} = target; @@ -79,97 +81,109 @@ const handleScroll = ({target}) => { } } -const addIntervention = async () => { - const {msg} = await Api.admin.addIntervention({...form, id: task.id,}); +const addIntervention = debounce(async (id) => { + const {msg} = await Api.admin.addInterventionV2({...form, id: id}); Message.success(msg); - await fetchData(); + pagination.current = tempPage; + await fetchData() emits('success') -} +}, 1000); -const intervention = async () => { - const {msg} = await Api.merchant.intervention({...form, id: task.id}); +const intervention = debounce(async () => { + const {msg} = await Api.merchant.interventionV2({...form, id: task.id}); Message.success(msg); + form.content = null; + form.images.length = 0; + pagination.current = tempPage; await fetchData(); emits('success') -} +}, 1000)