From 890ef56f5331472692243ab39e783b0f357d00e7 Mon Sep 17 00:00:00 2001 From: lyp Date: Fri, 7 Mar 2025 09:04:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/recharge/RechargeHead.tsx | 50 ++++++++++++------------ src/layout/head/Head.tsx | 42 ++++++++++---------- src/route/proj/ProjNew.tsx | 44 ++++++++++----------- 3 files changed, 68 insertions(+), 68 deletions(-) diff --git a/src/components/recharge/RechargeHead.tsx b/src/components/recharge/RechargeHead.tsx index e752ec2..5139088 100644 --- a/src/components/recharge/RechargeHead.tsx +++ b/src/components/recharge/RechargeHead.tsx @@ -5,43 +5,43 @@ import { useEffect, useState, useContext } from "react"; import { Axios, DevUserId } from "../../util/AjaxUtils.ts"; import { EventSourcePolyfill } from 'event-source-polyfill'; import { GlobalContext, GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts"; -import { - get, +// import { +// get, -} from "../../util/AjaxUtils.ts"; -import { useDispatch } from 'react-redux' +// } from "../../util/AjaxUtils.ts"; +// import { useDispatch } from 'react-redux' type SseMsg = { msg: string; type: string; } export default function RechargeHead() { - const dispath = useDispatch() + // const dispath = useDispatch() const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false); const globalContext = useContext(GlobalContext); const globalDispatchContext = useContext(GlobalDispatchContext); const [messageApi] = message.useMessage(); - const getMyPackNum = () => { - get({ - messageApi, - url: `/api/proj/servicepkg/packageorder/count/self`, - onBefore() { + // const getMyPackNum = () => { + // get({ + // messageApi, + // url: `/api/proj/servicepkg/packageorder/count/self`, + // onBefore() { - }, - onSuccess({ data }) { - dispath({ - type: 'upPackNum', - val: { - ALL: data.ALL, - MATERIAL: data.MATERIAL, - } - }) - }, - onFinally() { + // }, + // onSuccess({ data }) { + // dispath({ + // type: 'upPackNum', + // val: { + // ALL: data.ALL, + // MATERIAL: data.MATERIAL, + // } + // }) + // }, + // onFinally() { - } - }) - } + // } + // }) + // } // sse const initSse = () => { let evtSource; @@ -60,7 +60,7 @@ export default function RechargeHead() { reloadUser(messageApi, globalDispatchContext).then(() => { setIsPaymentModalOpen(false); }); - getMyPackNum() + // getMyPackNum() } }; diff --git a/src/layout/head/Head.tsx b/src/layout/head/Head.tsx index c1064c0..ef485a0 100644 --- a/src/layout/head/Head.tsx +++ b/src/layout/head/Head.tsx @@ -766,32 +766,32 @@ export default function Head() { await reloadUser(messageApi, globalDispatchContext); }; // 我的套餐包统计 - const getMyPackNum = () => { - get({ - messageApi, - url: `/api/proj/servicepkg/packageorder/count/self`, - onBefore() { + // const getMyPackNum = () => { + // get({ + // messageApi, + // url: `/api/proj/servicepkg/packageorder/count/self`, + // onBefore() { - }, - onSuccess({ data }) { - // console.log(data); - dispath({ - type: 'upPackNum', - val: { - ALL:data.ALL, - MATERIAL:data.MATERIAL, - } - }) - }, - onFinally() { + // }, + // onSuccess({ data }) { + // // console.log(data); + // dispath({ + // type: 'upPackNum', + // val: { + // ALL:data.ALL, + // MATERIAL:data.MATERIAL, + // } + // }) + // }, + // onFinally() { - } - }) - } + // } + // }) + // } useEffect(() => { getUnRead() setInterval(reloadUserInterval, 5 * 60 * 1000); - getMyPackNum() + // getMyPackNum() }, []) diff --git a/src/route/proj/ProjNew.tsx b/src/route/proj/ProjNew.tsx index 97c95cd..69f0a52 100644 --- a/src/route/proj/ProjNew.tsx +++ b/src/route/proj/ProjNew.tsx @@ -44,31 +44,31 @@ interface DataType { packageOrderId: string; } -import { useDispatch } from 'react-redux' +// import { useDispatch } from 'react-redux' export default function ProjNew() { - const dispath = useDispatch() + // const dispath = useDispatch() // 更新redux的套餐包信息 - const getMyPackNum = () => { - get({ - messageApi, - url: `/api/proj/servicepkg/packageorder/count/self`, - onBefore() { + // const getMyPackNum = () => { + // get({ + // messageApi, + // url: `/api/proj/servicepkg/packageorder/count/self`, + // onBefore() { - }, - onSuccess({ data }) { - dispath({ - type: 'upPackNum', - val: { - ALL: data.ALL, - MATERIAL: data.MATERIAL, - } - }) - }, - onFinally() { + // }, + // onSuccess({ data }) { + // dispath({ + // type: 'upPackNum', + // val: { + // ALL: data.ALL, + // MATERIAL: data.MATERIAL, + // } + // }) + // }, + // onFinally() { - } - }) - } + // } + // }) + // } const [debounceTimer, setDebounceTimer] = useState(null); // 创建一个 ref 来引用推荐列表容器 const recommendListRef = useRef(null); @@ -1094,7 +1094,7 @@ export default function ProjNew() { reloadUser(messageApi, globalDispatchContext).then(() => { messageApi.success('扣款成功'); }); - getMyPackNum() + // getMyPackNum() }, onFinally() { setLoading(false);