提交 7545b7f0 作者: ZhangLingKun

功能:问题修复

上级 216afbe3
流水线 #7355 已通过 于阶段
in 6 分 14 秒
...@@ -15,11 +15,8 @@ import { setUserInfo, UserInfoState } from '@/store/module/userInfo'; ...@@ -15,11 +15,8 @@ import { setUserInfo, UserInfoState } from '@/store/module/userInfo';
import getLocationByIP from '@/utils/getLocationByIP'; import getLocationByIP from '@/utils/getLocationByIP';
const HeaderView: React.FC<{ const HeaderView: React.FC<{
placeholder?: boolean; placeholder: boolean;
}> = ({ placeholder }) => { }> = ({ placeholder }) => {
HeaderView.defaultProps = {
placeholder: true,
};
// 当前的路由数据 // 当前的路由数据
const router = useRouter(); const router = useRouter();
// store // store
...@@ -104,7 +101,12 @@ const HeaderView: React.FC<{ ...@@ -104,7 +101,12 @@ const HeaderView: React.FC<{
}, },
]; ];
return ( return (
<HeaderWrap> <>
<HeaderWrap
style={{
background: placeholder ? '#2A2A2A' : 'rgba(86, 86, 86, 0.25)',
}}
>
<div className="header-wrap"> <div className="header-wrap">
<div className="header-location"> <div className="header-location">
<div className="location-icon"> <div className="location-icon">
...@@ -170,6 +172,13 @@ const HeaderView: React.FC<{ ...@@ -170,6 +172,13 @@ const HeaderView: React.FC<{
</div> </div>
</div> </div>
</HeaderWrap> </HeaderWrap>
{placeholder && (
<div
className="header-wrap"
style={{ width: '100%', height: '3rem' }}
></div>
)}
</>
); );
}; };
......
...@@ -9,7 +9,10 @@ import QrcodeModalView from '@/components/qrcodeModal'; ...@@ -9,7 +9,10 @@ import QrcodeModalView from '@/components/qrcodeModal';
import { RootState } from '@/store'; import { RootState } from '@/store';
import { GlobalDataState, setGlobalData } from '@/store/module/globalData'; import { GlobalDataState, setGlobalData } from '@/store/module/globalData';
const LayoutView = ({ children }: { children?: React.ReactNode }) => { const LayoutView: React.FC<{
children?: React.ReactNode;
placeholder?: boolean;
}> = ({ children, placeholder }) => {
// 打开二维码弹窗 // 打开二维码弹窗
const [qrcodeShow, setQrcodeShow] = useState<boolean>(false); const [qrcodeShow, setQrcodeShow] = useState<boolean>(false);
// store // store
...@@ -34,7 +37,11 @@ const LayoutView = ({ children }: { children?: React.ReactNode }) => { ...@@ -34,7 +37,11 @@ const LayoutView = ({ children }: { children?: React.ReactNode }) => {
// setQrcodeShow(!qrcodeShow); // setQrcodeShow(!qrcodeShow);
}} }}
> >
<HeaderView></HeaderView> {placeholder ? (
<HeaderView placeholder={true}></HeaderView>
) : (
<HeaderView placeholder={false}></HeaderView>
)}
<ContentView>{children}</ContentView> <ContentView>{children}</ContentView>
<FooterView></FooterView> <FooterView></FooterView>
</div> </div>
......
import React from 'react'; import React from 'react';
import { ConfigProvider, theme } from 'antd'; import { ConfigProvider, theme } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import type { AppProps } from 'next/app'; import type { AppProps } from 'next/app';
import '../styles/animate.css'; import '../styles/animate.css';
import '../styles/globals.css'; import '../styles/globals.css';
...@@ -7,7 +8,6 @@ import { Provider } from 'react-redux'; ...@@ -7,7 +8,6 @@ import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react'; import { PersistGate } from 'redux-persist/integration/react';
import { wrapper } from '@/store'; import { wrapper } from '@/store';
import themeConfig from '../theme/themeConfig'; import themeConfig from '../theme/themeConfig';
import zhCN from 'antd/locale/zh_CN';
const App = ({ Component, pageProps, ...rest }: AppProps) => { const App = ({ Component, pageProps, ...rest }: AppProps) => {
const { store } = wrapper.useWrappedStore(rest); const { store } = wrapper.useWrappedStore(rest);
......
...@@ -39,7 +39,7 @@ const MallView = (props: any) => { ...@@ -39,7 +39,7 @@ const MallView = (props: any) => {
}, [props]); }, [props]);
return ( return (
<> <>
<LayoutView> <LayoutView placeholder={true}>
<div>测试</div> <div>测试</div>
<Button <Button
onClick={() => { onClick={() => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论