不过\
This commit is contained in:
parent
b11729e67f
commit
b3a2c476e2
@ -159,6 +159,7 @@ import NoticeModal from '../../components/NoticeModal/NoticeModal.tsx';
|
|||||||
// import { log } from 'console';
|
// import { log } from 'console';
|
||||||
// import HeadCouponModal from '../../components/CouponModal/HeadCouponModal.tsx'
|
// import HeadCouponModal from '../../components/CouponModal/HeadCouponModal.tsx'
|
||||||
export default function Head() {
|
export default function Head() {
|
||||||
|
const dispath = useDispatch()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -420,6 +421,7 @@ export default function Head() {
|
|||||||
const packNum = redxuState.packNum
|
const packNum = redxuState.packNum
|
||||||
const phoneModal = redxuState.phoneModal
|
const phoneModal = redxuState.phoneModal
|
||||||
const activityImgShow = redxuState.activityImgShow //是否显示互动图片
|
const activityImgShow = redxuState.activityImgShow //是否显示互动图片
|
||||||
|
const clickActivity = redxuState.clickActivity //是否点击活动按钮
|
||||||
// const activityModal = redxuState.activityModal
|
// const activityModal = redxuState.activityModal
|
||||||
// const packItems: MenuProps['items'] = [
|
// const packItems: MenuProps['items'] = [
|
||||||
// {
|
// {
|
||||||
@ -867,7 +869,6 @@ export default function Head() {
|
|||||||
// },
|
// },
|
||||||
|
|
||||||
// ]
|
// ]
|
||||||
const dispath = useDispatch()
|
|
||||||
// 更新所属者表格储存至redux
|
// 更新所属者表格储存至redux
|
||||||
const upBelongArray = () => {
|
const upBelongArray = () => {
|
||||||
get({
|
get({
|
||||||
@ -1327,7 +1328,7 @@ export default function Head() {
|
|||||||
style={{
|
style={{
|
||||||
marginRight: 20,
|
marginRight: 20,
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
display:activityImgShow ? 'unset' : 'none',
|
display: activityImgShow ? 'unset' : 'none',
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// setActivityModal(true)
|
// setActivityModal(true)
|
||||||
@ -1335,6 +1336,10 @@ export default function Head() {
|
|||||||
type: 'setActivityModal',
|
type: 'setActivityModal',
|
||||||
val: true,
|
val: true,
|
||||||
})
|
})
|
||||||
|
dispath({
|
||||||
|
type: 'onClickActivity',
|
||||||
|
val: !clickActivity,
|
||||||
|
})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img src={active} alt="" height={36} />
|
<img src={active} alt="" height={36} />
|
||||||
|
@ -295,7 +295,7 @@ export default function Index() {
|
|||||||
const phoneModal = redxuState.phoneModal
|
const phoneModal = redxuState.phoneModal
|
||||||
const activityModal = redxuState.activityModal
|
const activityModal = redxuState.activityModal
|
||||||
const centerPoint = redxuState.centerPoint
|
const centerPoint = redxuState.centerPoint
|
||||||
|
const clickActivity = redxuState.clickActivity //是否点击活动按钮
|
||||||
// 动画状态管理----------------------------------------------
|
// 动画状态管理----------------------------------------------
|
||||||
const [isClosing, setIsClosing] = useState(false);
|
const [isClosing, setIsClosing] = useState(false);
|
||||||
const animationDuration = 300; // 动画持续时间(毫秒)
|
const animationDuration = 300; // 动画持续时间(毫秒)
|
||||||
@ -315,6 +315,10 @@ export default function Index() {
|
|||||||
type: 'setActivityModal',
|
type: 'setActivityModal',
|
||||||
val: false,
|
val: false,
|
||||||
});
|
});
|
||||||
|
dispath({
|
||||||
|
type: 'onClickActivity',
|
||||||
|
val: false,
|
||||||
|
})
|
||||||
|
|
||||||
// 当勾选"近期不再提示"时设置cookie
|
// 当勾选"近期不再提示"时设置cookie
|
||||||
if (activityChecked) {
|
if (activityChecked) {
|
||||||
@ -4799,7 +4803,7 @@ export default function Index() {
|
|||||||
</Modal> */}
|
</Modal> */}
|
||||||
<div className='couponMask-box'
|
<div className='couponMask-box'
|
||||||
style={{
|
style={{
|
||||||
display: activityModal && (location.pathname == '/' || location.pathname.includes('/home')) ? 'unset' : 'none',
|
display: (activityModal && (location.pathname == '/' || location.pathname.includes('/home'))) || clickActivity ? 'unset' : 'none',
|
||||||
zIndex: 98,
|
zIndex: 98,
|
||||||
|
|
||||||
// 动画
|
// 动画
|
||||||
@ -4814,7 +4818,7 @@ export default function Index() {
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
// 初始位置:居中显示(保持不变)
|
// 初始位置:居中显示(保持不变)
|
||||||
top: isClosing ? centerPoint.y : '50%', // 关闭时top直接设为目标点y坐标
|
top: isClosing ? centerPoint.y : '50%', // 关闭时top直接设为目标点y坐标
|
||||||
left: isClosing ? centerPoint.x - 80 : '50%', // 关闭时left直接设为目标点x坐标
|
left: isClosing ? centerPoint.x - 50 : '50%', // 关闭时left直接设为目标点x坐标
|
||||||
// 关键:用translate(-50%, -50%)确保元素中心点与目标点对齐
|
// 关键:用translate(-50%, -50%)确保元素中心点与目标点对齐
|
||||||
transform: isClosing
|
transform: isClosing
|
||||||
? 'translate(-50%, -50%) scale(0.1)' // 关闭时:缩放到目标点(中心点对齐)
|
? 'translate(-50%, -50%) scale(0.1)' // 关闭时:缩放到目标点(中心点对齐)
|
||||||
|
@ -30,6 +30,7 @@ const baseState = {
|
|||||||
replaceTotal: 0,
|
replaceTotal: 0,
|
||||||
newReplace: false,
|
newReplace: false,
|
||||||
activityModal: false, //活动弹窗
|
activityModal: false, //活动弹窗
|
||||||
|
clickActivity: false, //是否点击活动按钮
|
||||||
activityImgShow: true, //活动图片是否展示
|
activityImgShow: true, //活动图片是否展示
|
||||||
// 坐标
|
// 坐标
|
||||||
centerPoint: { x: 0, y: 0 },
|
centerPoint: { x: 0, y: 0 },
|
||||||
@ -103,6 +104,9 @@ const reducer = (state = baseState, action: any) => {
|
|||||||
}
|
}
|
||||||
if (action.type == 'setActivityModal') {
|
if (action.type == 'setActivityModal') {
|
||||||
nstate.activityModal = action.val
|
nstate.activityModal = action.val
|
||||||
|
}
|
||||||
|
if (action.type == 'onClickActivity') {
|
||||||
|
nstate.clickActivity = action.val
|
||||||
}
|
}
|
||||||
if (action.type == 'upCenterPoint') {
|
if (action.type == 'upCenterPoint') {
|
||||||
nstate.centerPoint = action.val
|
nstate.centerPoint = action.val
|
||||||
|
Loading…
Reference in New Issue
Block a user