Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
7545b7f0
提交
7545b7f0
authored
12月 01, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:问题修复
上级
216afbe3
流水线
#7355
已通过 于阶段
in 6 分 14 秒
变更
4
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
84 行增加
和
68 行删除
+84
-68
index.tsx
src/components/layout/header/index.tsx
+73
-64
index.tsx
src/components/layout/index.tsx
+9
-2
_app.tsx
src/pages/_app.tsx
+1
-1
index.tsx
src/pages/mall/index.tsx
+1
-1
没有找到文件。
src/components/layout/header/index.tsx
浏览文件 @
7545b7f0
...
@@ -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,72 +101,84 @@ const HeaderView: React.FC<{
...
@@ -104,72 +101,84 @@ const HeaderView: React.FC<{
},
},
];
];
return
(
return
(
<
HeaderWrap
>
<>
<
div
className=
"header-wrap"
>
<
HeaderWrap
<
div
className=
"header-location"
>
style=
{
{
<
div
className=
"location-icon"
>
background
:
placeholder
?
'#2A2A2A'
:
'rgba(86, 86, 86, 0.25)'
,
<
EnvironmentFilled
}
}
style=
{
{
color
:
'#FF552D'
,
fontSize
:
'0.86rem'
}
}
>
/>
<
div
className=
"header-wrap"
>
</
div
>
<
div
className=
"header-location"
>
<
Button
type=
{
'link'
}
className=
"location-address"
>
<
div
className=
"location-icon"
>
{
address
?.
city
||
'定位中...'
}
<
EnvironmentFilled
</
Button
>
style=
{
{
color
:
'#FF552D'
,
fontSize
:
'0.86rem'
}
}
<
div
className=
"location-hello"
>
Hi,欢迎来到云享飞
</
div
>
/>
</
div
>
</
div
>
<
div
className=
"header-nav"
>
<
Button
type=
{
'link'
}
className=
"location-address"
>
<
div
className=
"nav-tab"
>
{
address
?.
city
||
'定位中...'
}
<
Button
type=
{
'link'
}
className=
"tab-item"
>
个人中心
</
Button
>
<
Button
type=
{
'link'
}
className=
"tab-item"
>
购物车
</
Button
>
<
Button
type=
{
'link'
}
className=
"tab-item"
>
我的订单
</
Button
>
<
Button
type=
{
'link'
}
className=
"tab-item"
>
消息
</
Button
>
<
Button
type=
{
'link'
}
className=
"tab-item"
>
联系客服
</
Button
>
</
Button
>
<
div
className=
"location-hello"
>
Hi,欢迎来到云享飞
</
div
>
</
div
>
</
div
>
{
!!
userInfo
&&
(
<
div
className=
"header-nav"
>
<
div
className=
"nav-user"
>
<
div
className=
"nav-tab"
>
<
Dropdown
<
Button
type=
{
'link'
}
className=
"tab-item"
>
overlayStyle=
{
{
textAlign
:
'center'
}
}
个人中心
menu=
{
{
items
}
}
</
Button
>
placement=
"bottomRight"
<
Button
type=
{
'link'
}
className=
"tab-item"
>
arrow
购物车
>
<
div
className=
"user-avatar"
style=
{
{
backgroundImage
:
`url(${userInfo?.userImg})`
}
}
></
div
>
</
Dropdown
>
</
div
>
)
}
<
div
className=
"nav-action"
>
{
!
userInfo
&&
(
<
Button
type=
{
'primary'
}
className=
"action-item"
onClick=
{
handleLogin
}
>
登录
</
Button
>
</
Button
>
<
Button
type=
{
'link'
}
className=
"tab-item"
>
我的订单
</
Button
>
<
Button
type=
{
'link'
}
className=
"tab-item"
>
消息
</
Button
>
<
Button
type=
{
'link'
}
className=
"tab-item"
>
联系客服
</
Button
>
</
div
>
{
!!
userInfo
&&
(
<
div
className=
"nav-user"
>
<
Dropdown
overlayStyle=
{
{
textAlign
:
'center'
}
}
menu=
{
{
items
}
}
placement=
"bottomRight"
arrow
>
<
div
className=
"user-avatar"
style=
{
{
backgroundImage
:
`url(${userInfo?.userImg})`
}
}
></
div
>
</
Dropdown
>
</
div
>
)
}
)
}
<
Button
type=
{
'primary'
}
className=
"action-item"
>
<
div
className=
"nav-action"
>
发布需求
{
!
userInfo
&&
(
</
Button
>
<
Button
<
Button
type=
{
'primary'
}
className=
"action-item"
>
type=
{
'primary'
}
加盟入驻
className=
"action-item"
</
Button
>
onClick=
{
handleLogin
}
>
登录
</
Button
>
)
}
<
Button
type=
{
'primary'
}
className=
"action-item"
>
发布需求
</
Button
>
<
Button
type=
{
'primary'
}
className=
"action-item"
>
加盟入驻
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
HeaderWrap
>
</
HeaderWrap
>
{
placeholder
&&
(
<
div
className=
"header-wrap"
style=
{
{
width
:
'100%'
,
height
:
'3rem'
}
}
></
div
>
)
}
</>
);
);
};
};
...
...
src/components/layout/index.tsx
浏览文件 @
7545b7f0
...
@@ -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
>
...
...
src/pages/_app.tsx
浏览文件 @
7545b7f0
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
);
...
...
src/pages/mall/index.tsx
浏览文件 @
7545b7f0
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论