Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
cf203c9b
Commit
cf203c9b
authored
Oct 22, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:商城顶部搜索找不到classList报错问题
parent
0fe96d9d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
17 deletions
+52
-17
RightContent.less
src/layouts/styles/RightContent.less
+25
-6
index.tsx
src/pages/lxMall/components/Header/index.tsx
+9
-7
index.tsx
src/pages/lxMall/components/TopBar/index.tsx
+2
-1
LXMallLayout.tsx
src/pages/lxMall/layouts/LXMallLayout.tsx
+3
-1
index.tsx
src/pages/lxMall/purchaseOnline/index.tsx
+6
-1
LoginWrap.tsx
src/pages/user/components/LoginWrap.tsx
+7
-1
No files found.
src/layouts/styles/RightContent.less
View file @
cf203c9b
...
...
@@ -6,6 +6,7 @@
:global(.anticon) {
margin-right: 8px;
}
:global(.ant-dropdown-menu-item) {
min-width: 160px;
}
...
...
@@ -17,6 +18,8 @@
height: @layout-header-height;
margin-left: auto;
overflow: hidden;
font-size: 12px;
.action {
display: flex;
align-items: center;
...
...
@@ -24,26 +27,32 @@
padding: 0 12px;
cursor: pointer;
transition: all 0.3s;
> span {
>span {
color: @text-color;
vertical-align: middle;
}
&:hover {
background: @pro-header-hover-bg;
}
&:global(.opened) {
background: @pro-header-hover-bg;
}
}
.search {
padding: 0 12px;
&:hover {
background: transparent;
}
}
.account {
.avatar {
margin:
~'calc((@{layout-header-height} - 24px) / 2)'
0;
margin:
~'calc((@{layout-header-height} - 24px) / 2)'
0;
margin-right: 8px;
color: @primary-color;
vertical-align: top;
...
...
@@ -55,9 +64,11 @@
.dark {
.action {
color: rgba(255, 255, 255, 0.85);
> span {
>span {
color: rgba(255, 255, 255, 0.85);
}
&:hover,
&:global(.opened) {
background: @primary-color;
...
...
@@ -69,12 +80,15 @@
.dark {
.action {
color: @text-color;
> span {
>span {
color: @text-color;
}
&:hover {
color: rgba(255, 255, 255, 0.85);
> span {
>span {
color: rgba(255, 255, 255, 0.85);
}
}
...
...
@@ -86,20 +100,24 @@
:global(.ant-divider-vertical) {
vertical-align: unset;
}
.name {
display: none;
}
.right {
position: absolute;
top: 0;
right: 12px;
.account {
.avatar {
margin-right: 0;
}
}
.search {
display: none;
}
}
}
}
\ No newline at end of file
src/pages/lxMall/components/Header/index.tsx
View file @
cf203c9b
...
...
@@ -22,13 +22,15 @@ const Header: React.FC<HeaderPropsType> = (props) => {
let
handleScroll
=
()
=>
{
const
scrollTop
=
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
const
floatSearch
=
document
.
getElementById
(
"floatSearch"
)
if
(
scrollTop
>
500
)
{
if
(
!
hasClass
(
floatSearch
.
classList
,
'show'
))
{
floatSearch
.
classList
.
add
(
styles
.
show
)
}
}
else
{
if
(
hasClass
(
floatSearch
.
classList
,
'show'
))
{
floatSearch
.
classList
.
remove
(
styles
.
show
)
if
(
floatSearch
)
{
if
(
scrollTop
>
500
)
{
if
(
!
hasClass
(
floatSearch
.
classList
,
'show'
))
{
floatSearch
.
classList
.
add
(
styles
.
show
)
}
}
else
{
if
(
hasClass
(
floatSearch
.
classList
,
'show'
))
{
floatSearch
.
classList
.
remove
(
styles
.
show
)
}
}
}
}
...
...
src/pages/lxMall/components/TopBar/index.tsx
View file @
cf203c9b
...
...
@@ -2,6 +2,7 @@ import React from 'react'
import
{
EnvironmentOutlined
,
CaretDownOutlined
}
from
'@ant-design/icons'
import
{
inject
,
observer
}
from
'mobx-react'
import
cx
from
'classnames'
import
{
Link
}
from
'umi'
import
ImageBox
from
'@/components/ImageBox'
import
defaultAvatar
from
'./imgs/default_avatar.png'
import
AccountSafeIcon
from
'./imgs/account_safe_icon.png'
...
...
@@ -107,7 +108,7 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
)
}
<
li
className=
{
styles
.
topbar_menu_item
}
>
<
a
href=
"/memberCenter/home"
>
会员中心
</
a
>
<
Link
to=
"/memberCenter/home"
>
会员中心
</
Link
>
</
li
>
<
li
className=
{
styles
.
topbar_menu_item
}
>
我的消息
</
li
>
<
li
className=
{
styles
.
topbar_menu_item
}
>
...
...
src/pages/lxMall/layouts/LXMallLayout.tsx
View file @
cf203c9b
...
...
@@ -55,9 +55,11 @@ const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => {
}
useEffect
(()
=>
{
let
body
=
document
.
getElementsByTagName
(
'body'
)[
0
];
if
(
!
isEmpty
(
mallTemplateInfo
))
{
let
body
=
document
.
getElementsByTagName
(
'body'
)[
0
];
body
.
className
=
mallTemplateInfo
.
fileName
?
`theme-mall-
${
mallTemplateInfo
.
fileName
}
`
:
templateName
;
}
else
{
body
.
className
=
templateName
}
},
[
mallTemplateInfo
])
...
...
src/pages/lxMall/purchaseOnline/index.tsx
View file @
cf203c9b
...
...
@@ -170,6 +170,11 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => {
}
}
const
handlePageChange
=
(
page
)
=>
{
setCurrent
(
page
)
fetchCommodityList
(
page
)
}
return
(
<
div
className=
{
styles
.
purchaseOnline
}
>
<
div
className=
{
styles
.
mall_container
}
>
...
...
@@ -225,7 +230,7 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => {
<>
<
CommodityList
showType=
{
showType
}
commodityList=
{
commodityList
}
layoutType=
{
layoutType
}
/>
<
div
className=
{
styles
.
pagination_wrap
}
>
<
Pagination
showQuickJumper
showSizeChanger=
{
false
}
current=
{
current
}
total=
{
totalCount
}
pageSize=
{
pageSize
}
/>
<
Pagination
showQuickJumper
showSizeChanger=
{
false
}
onChange=
{
handlePageChange
}
current=
{
current
}
total=
{
totalCount
}
pageSize=
{
pageSize
}
/>
</
div
>
</>
)
...
...
src/pages/user/components/LoginWrap.tsx
View file @
cf203c9b
...
...
@@ -13,8 +13,10 @@ const LoginWrap: React.FC = () => {
const
{
redirect
}
=
history
.
location
.
query
const
[
validFrame
,
setValidFrame
]
=
useState
(
false
)
const
[
validButton
,
setValidButton
]
=
useState
(
false
)
const
[
loginLoading
,
setLoginLoading
]
=
useState
<
boolean
>
(
false
)
const
finish
=
(
value
:
any
)
=>
{
setLoginLoading
(
true
)
PublicApi
.
postMemberLogin
(
value
).
then
(
res
=>
{
const
{
data
,
code
}
=
res
if
(
code
===
1000
)
{
...
...
@@ -28,7 +30,11 @@ const LoginWrap: React.FC = () => {
}
else
{
window
.
location
.
replace
(
'/memberCenter/home'
)
}
}
else
{
setLoginLoading
(
false
)
}
}).
catch
(()
=>
{
setLoginLoading
(
false
)
})
}
...
...
@@ -89,7 +95,7 @@ const LoginWrap: React.FC = () => {
</
Form
.
Item
>)
}
<
Form
.
Item
>
<
Button
type=
'primary'
size=
'large'
htmlType=
'submit'
block
>
登录
</
Button
>
<
Button
type=
'primary'
loading=
{
loginLoading
}
size=
'large'
htmlType=
'submit'
block
>
登录
</
Button
>
</
Form
.
Item
>
</
Form
>
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment