From ed00fd101b6b7d83e1b23a5693a32c613a14f93c Mon Sep 17 00:00:00 2001 From: al <al@cdhncy.com> Date: Tue, 21 Jan 2025 16:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=9A=E7=9F=A5icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/globals.css | 4 ++++ components/BottomNav/index.js | 41 ++++++++++++++++++++++------------ public/images/notice.png | Bin 0 -> 1465 bytes 3 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 public/images/notice.png diff --git a/app/globals.css b/app/globals.css index 6cdd326..f861879 100644 --- a/app/globals.css +++ b/app/globals.css @@ -411,4 +411,8 @@ textarea { .ant-modal-mask, .ant-modal-wrap { position: absolute !important; +} + +.notice-toast .adm-toast-main{ + background-color: rgb(23,22,26)!important; } \ No newline at end of file diff --git a/components/BottomNav/index.js b/components/BottomNav/index.js index 878194e..312ba06 100644 --- a/components/BottomNav/index.js +++ b/components/BottomNav/index.js @@ -10,6 +10,7 @@ import { connect } from "react-redux"; import { get } from "@/utils/storeInfo"; import requireAPI from "@/utils/requireAPI"; import OwnIcon from "../OwnIcon"; +import OwnImage from "../OwnImage"; function BottomNav({ changeNoticeCount, changeInviter, noticeCount }) { const searchParams = useSearchParams(); const pathname = usePathname(); @@ -20,6 +21,9 @@ function BottomNav({ changeNoticeCount, changeInviter, noticeCount }) { // console.log("Current Inviter: " + currentInviter); changeInviter(currentInviter); } + setTimeout(() => { + handleGetWebsocketData(); + }, 2000); }, [pathname]); useEffect(() => { const getDtata = async () => { @@ -103,15 +107,23 @@ function BottomNav({ changeNoticeCount, changeInviter, noticeCount }) { return isActive; }; const handleGetWebsocketData = (data) => { - if (data.d.unread_cnt > 0) { - changeNoticeCount(data.d.unread_cnt); - const { n_type, title } = data.d.notif; - Toast.show({ - type: "info", - maskClassName: "notice-toast", - content: ( - <div className="flex flex-col gap-2"> - <p className="text-base">{`🔔 收到一条${ + // if (data.d.unread_cnt > 0) { + // changeNoticeCount(data.d.unread_cnt); + // const { n_type, title } = data.d.notif; + const n_type = 0; + const title = "系统通知的更好打开撒服务"; + Toast.show({ + type: "info", + maskClassName: "notice-toast", + content: ( + <div className="flex items-center gap-2"> + <OwnImage + outClassName="w-[42px] h-[42px]" + className="w-[42px] h-[42px]" + src="/images/notice.png" + /> + <div> + <p className="text-base">{`收到一条${ n_type === 0 ? "系统" : n_type === 1 @@ -122,11 +134,12 @@ function BottomNav({ changeNoticeCount, changeInviter, noticeCount }) { }通知`}</p> <p className="text-sm text-[#ffffff80]">{title}</p> </div> - ), - position: "top", - duration: 5000, - }); - } + </div> + ), + position: "top", + duration: 1000000, + }); + // } }; return ( <> diff --git a/public/images/notice.png b/public/images/notice.png new file mode 100644 index 0000000000000000000000000000000000000000..92c0971366b529aa881864f6c274a8da57a4aaa1 GIT binary patch literal 1465 zcmV;q1xEUbP)<h;3K|Lk000e1NJLTq001fg001fo1^@s6#ly*400009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP<VFdsH1x`ssK~#7F)mc4k z97PoVZtu^I&2cyc0ZMU^C6EFIX_AO0gd!Dm2nvL-Q-d6df({Tp5)nwyVG0TmB~=PS z>7*boFrpy3LqZ6!k$>a6^ZoI@eLLQ{_3Z8L<&457&F$^(+|IY}eecbiIpBYST$)aU z!QeSLu+=bGG^DNOa=BHE3n5pP_P(^u!SSOmZHZ&X@yW%Id_fLhfEN7eci`sFz?vNY z-oZq1=9G*e?ZP~8ex6qv(iX+SKOl*ykbF}P%RZ@3Z@?$|U*NF{@Zl?Z1Qvwsmxv=8 zSn?+7>%e>80{7ZDRuuC<xd1dfK(7zXl$9(k4P3S@o3lt#A9uu(HN5kclH@}Ma`m8# zvB76dmw;{$*gpXJgYaHXhObNko*bKUuhmtuAH7b?Hl)WnA-lz{p7qEDP?N@zQ^5e^ zk|cq-86B8JO7gr?ez?y-NN+dw1$dt?#jz<l%`n$YSD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