更新通知icon
This commit is contained in:
parent
dc7f10ad82
commit
ed00fd101b
|
@ -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;
|
||||
}
|
|
@ -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 (
|
||||
<>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue