|
@@ -69,12 +69,15 @@ const Footer: FC = () => {
|
|
|
router.push(path);
|
|
|
};
|
|
|
|
|
|
- const { unread, userUnred, setNotices, setUserUnread } = useGlobalNoticeStore((state) => ({
|
|
|
- unread: state.unread,
|
|
|
- setNotices: state.setNotices,
|
|
|
- setUserUnread: state.setUserUnread,
|
|
|
- userUnred: state.userUnred,
|
|
|
- }));
|
|
|
+ const { unread, userUnred, setNotices, setUserUnread, promotion_count, setPromotionCount } =
|
|
|
+ useGlobalNoticeStore((state) => ({
|
|
|
+ unread: state.unread,
|
|
|
+ setNotices: state.setNotices,
|
|
|
+ setUserUnread: state.setUserUnread,
|
|
|
+ setPromotionCount: state.setPromotionCount,
|
|
|
+ userUnred: state.userUnred,
|
|
|
+ promotion_count: state.promotion_count,
|
|
|
+ }));
|
|
|
|
|
|
const setWallet = useWalletStore((state) => state.setWallet);
|
|
|
const { run } = useRequest(getGlobalNoticeApi, {
|
|
@@ -84,6 +87,7 @@ const Footer: FC = () => {
|
|
|
pollingWhenHidden: false,
|
|
|
onSuccess: (data) => {
|
|
|
setNotices(data?.data || [], data?.summery.unread || 0);
|
|
|
+ setPromotionCount(data.summery.promotion_count || 0);
|
|
|
},
|
|
|
});
|
|
|
|
|
@@ -179,9 +183,9 @@ const Footer: FC = () => {
|
|
|
></span>
|
|
|
</Badge>
|
|
|
)}
|
|
|
- {index == 3 && (
|
|
|
+ {index == 3 && !!promotion_count && (
|
|
|
<div className="absolute -top-[0px] right-[4px] flex h-[.16rem] w-[.16rem] items-center justify-center rounded-[50%] bg-[#ff0000] text-[.1rem] text-[#fff]">
|
|
|
- 23
|
|
|
+ {promotion_count > 99 ? `99+` : promotion_count}
|
|
|
</div>
|
|
|
)}
|
|
|
</div>
|