From b3a2c476e262250d2e71b10ee615e7c051f2117f Mon Sep 17 00:00:00 2001 From: lyp Date: Thu, 7 Aug 2025 14:55:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=BF=87\?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/head/Head.tsx | 9 +++++++-- src/route/index/Index.tsx | 10 +++++++--- src/store/index.ts | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/layout/head/Head.tsx b/src/layout/head/Head.tsx index 7ebfddb..e5ee816 100644 --- a/src/layout/head/Head.tsx +++ b/src/layout/head/Head.tsx @@ -159,6 +159,7 @@ import NoticeModal from '../../components/NoticeModal/NoticeModal.tsx'; // import { log } from 'console'; // import HeadCouponModal from '../../components/CouponModal/HeadCouponModal.tsx' export default function Head() { + const dispath = useDispatch() @@ -420,6 +421,7 @@ export default function Head() { const packNum = redxuState.packNum const phoneModal = redxuState.phoneModal const activityImgShow = redxuState.activityImgShow //是否显示互动图片 + const clickActivity = redxuState.clickActivity //是否点击活动按钮 // const activityModal = redxuState.activityModal // const packItems: MenuProps['items'] = [ // { @@ -867,7 +869,6 @@ export default function Head() { // }, // ] - const dispath = useDispatch() // 更新所属者表格储存至redux const upBelongArray = () => { get({ @@ -1327,7 +1328,7 @@ export default function Head() { style={{ marginRight: 20, cursor: 'pointer', - display:activityImgShow ? 'unset' : 'none', + display: activityImgShow ? 'unset' : 'none', }} onClick={() => { // setActivityModal(true) @@ -1335,6 +1336,10 @@ export default function Head() { type: 'setActivityModal', val: true, }) + dispath({ + type: 'onClickActivity', + val: !clickActivity, + }) }} > diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index f9b2453..67232a4 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -295,7 +295,7 @@ export default function Index() { const phoneModal = redxuState.phoneModal const activityModal = redxuState.activityModal const centerPoint = redxuState.centerPoint - + const clickActivity = redxuState.clickActivity //是否点击活动按钮 // 动画状态管理---------------------------------------------- const [isClosing, setIsClosing] = useState(false); const animationDuration = 300; // 动画持续时间(毫秒) @@ -315,6 +315,10 @@ export default function Index() { type: 'setActivityModal', val: false, }); + dispath({ + type: 'onClickActivity', + val: false, + }) // 当勾选"近期不再提示"时设置cookie if (activityChecked) { @@ -4799,7 +4803,7 @@ export default function Index() { */}
{ } if (action.type == 'setActivityModal') { nstate.activityModal = action.val + } + if (action.type == 'onClickActivity') { + nstate.clickActivity = action.val } if (action.type == 'upCenterPoint') { nstate.centerPoint = action.val