Commit cf203c9b authored by GuanHua's avatar GuanHua

fix:商城顶部搜索找不到classList报错问题

parent 0fe96d9d
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
:global(.anticon) { :global(.anticon) {
margin-right: 8px; margin-right: 8px;
} }
:global(.ant-dropdown-menu-item) { :global(.ant-dropdown-menu-item) {
min-width: 160px; min-width: 160px;
} }
...@@ -17,6 +18,8 @@ ...@@ -17,6 +18,8 @@
height: @layout-header-height; height: @layout-header-height;
margin-left: auto; margin-left: auto;
overflow: hidden; overflow: hidden;
font-size: 12px;
.action { .action {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -24,26 +27,32 @@ ...@@ -24,26 +27,32 @@
padding: 0 12px; padding: 0 12px;
cursor: pointer; cursor: pointer;
transition: all 0.3s; transition: all 0.3s;
> span {
>span {
color: @text-color; color: @text-color;
vertical-align: middle; vertical-align: middle;
} }
&:hover { &:hover {
background: @pro-header-hover-bg; background: @pro-header-hover-bg;
} }
&:global(.opened) { &:global(.opened) {
background: @pro-header-hover-bg; background: @pro-header-hover-bg;
} }
} }
.search { .search {
padding: 0 12px; padding: 0 12px;
&:hover { &:hover {
background: transparent; background: transparent;
} }
} }
.account { .account {
.avatar { .avatar {
margin: ~'calc((@{layout-header-height} - 24px) / 2)' 0; margin:~'calc((@{layout-header-height} - 24px) / 2)'0;
margin-right: 8px; margin-right: 8px;
color: @primary-color; color: @primary-color;
vertical-align: top; vertical-align: top;
...@@ -55,9 +64,11 @@ ...@@ -55,9 +64,11 @@
.dark { .dark {
.action { .action {
color: rgba(255, 255, 255, 0.85); color: rgba(255, 255, 255, 0.85);
> span {
>span {
color: rgba(255, 255, 255, 0.85); color: rgba(255, 255, 255, 0.85);
} }
&:hover, &:hover,
&:global(.opened) { &:global(.opened) {
background: @primary-color; background: @primary-color;
...@@ -69,12 +80,15 @@ ...@@ -69,12 +80,15 @@
.dark { .dark {
.action { .action {
color: @text-color; color: @text-color;
> span {
>span {
color: @text-color; color: @text-color;
} }
&:hover { &:hover {
color: rgba(255, 255, 255, 0.85); color: rgba(255, 255, 255, 0.85);
> span {
>span {
color: rgba(255, 255, 255, 0.85); color: rgba(255, 255, 255, 0.85);
} }
} }
...@@ -86,20 +100,24 @@ ...@@ -86,20 +100,24 @@
:global(.ant-divider-vertical) { :global(.ant-divider-vertical) {
vertical-align: unset; vertical-align: unset;
} }
.name { .name {
display: none; display: none;
} }
.right { .right {
position: absolute; position: absolute;
top: 0; top: 0;
right: 12px; right: 12px;
.account { .account {
.avatar { .avatar {
margin-right: 0; margin-right: 0;
} }
} }
.search { .search {
display: none; display: none;
} }
} }
} }
\ No newline at end of file
...@@ -22,13 +22,15 @@ const Header: React.FC<HeaderPropsType> = (props) => { ...@@ -22,13 +22,15 @@ const Header: React.FC<HeaderPropsType> = (props) => {
let handleScroll = () => { let handleScroll = () => {
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop; const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
const floatSearch = document.getElementById("floatSearch") const floatSearch = document.getElementById("floatSearch")
if (scrollTop > 500) { if (floatSearch) {
if (!hasClass(floatSearch.classList, 'show')) { if (scrollTop > 500) {
floatSearch.classList.add(styles.show) if (!hasClass(floatSearch.classList, 'show')) {
} floatSearch.classList.add(styles.show)
} else { }
if (hasClass(floatSearch.classList, 'show')) { } else {
floatSearch.classList.remove(styles.show) if (hasClass(floatSearch.classList, 'show')) {
floatSearch.classList.remove(styles.show)
}
} }
} }
} }
......
...@@ -2,6 +2,7 @@ import React from 'react' ...@@ -2,6 +2,7 @@ import React from 'react'
import { EnvironmentOutlined, CaretDownOutlined } from '@ant-design/icons' import { EnvironmentOutlined, CaretDownOutlined } from '@ant-design/icons'
import { inject, observer } from 'mobx-react' import { inject, observer } from 'mobx-react'
import cx from 'classnames' import cx from 'classnames'
import { Link } from 'umi'
import ImageBox from '@/components/ImageBox' import ImageBox from '@/components/ImageBox'
import defaultAvatar from './imgs/default_avatar.png' import defaultAvatar from './imgs/default_avatar.png'
import AccountSafeIcon from './imgs/account_safe_icon.png' import AccountSafeIcon from './imgs/account_safe_icon.png'
...@@ -107,7 +108,7 @@ const TopBar: React.FC<TopBarPropsType> = (props) => { ...@@ -107,7 +108,7 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
) )
} }
<li className={styles.topbar_menu_item}> <li className={styles.topbar_menu_item}>
<a href="/memberCenter/home">会员中心</a> <Link to="/memberCenter/home">会员中心</Link>
</li> </li>
<li className={styles.topbar_menu_item}>我的消息</li> <li className={styles.topbar_menu_item}>我的消息</li>
<li className={styles.topbar_menu_item}> <li className={styles.topbar_menu_item}>
......
...@@ -55,9 +55,11 @@ const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => { ...@@ -55,9 +55,11 @@ const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => {
} }
useEffect(() => { useEffect(() => {
let body = document.getElementsByTagName('body')[0];
if (!isEmpty(mallTemplateInfo)) { if (!isEmpty(mallTemplateInfo)) {
let body = document.getElementsByTagName('body')[0];
body.className = mallTemplateInfo.fileName ? `theme-mall-${mallTemplateInfo.fileName}` : templateName; body.className = mallTemplateInfo.fileName ? `theme-mall-${mallTemplateInfo.fileName}` : templateName;
} else {
body.className = templateName
} }
}, [mallTemplateInfo]) }, [mallTemplateInfo])
......
...@@ -170,6 +170,11 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => { ...@@ -170,6 +170,11 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => {
} }
} }
const handlePageChange = (page) => {
setCurrent(page)
fetchCommodityList(page)
}
return ( return (
<div className={styles.purchaseOnline}> <div className={styles.purchaseOnline}>
<div className={styles.mall_container}> <div className={styles.mall_container}>
...@@ -225,7 +230,7 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => { ...@@ -225,7 +230,7 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => {
<> <>
<CommodityList showType={showType} commodityList={commodityList} layoutType={layoutType} /> <CommodityList showType={showType} commodityList={commodityList} layoutType={layoutType} />
<div className={styles.pagination_wrap}> <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> </div>
</> </>
) )
......
...@@ -13,8 +13,10 @@ const LoginWrap: React.FC = () => { ...@@ -13,8 +13,10 @@ const LoginWrap: React.FC = () => {
const { redirect } = history.location.query const { redirect } = history.location.query
const [validFrame, setValidFrame] = useState(false) const [validFrame, setValidFrame] = useState(false)
const [validButton, setValidButton] = useState(false) const [validButton, setValidButton] = useState(false)
const [loginLoading, setLoginLoading] = useState<boolean>(false)
const finish = (value: any) => { const finish = (value: any) => {
setLoginLoading(true)
PublicApi.postMemberLogin(value).then(res => { PublicApi.postMemberLogin(value).then(res => {
const { data, code } = res const { data, code } = res
if (code === 1000) { if (code === 1000) {
...@@ -28,7 +30,11 @@ const LoginWrap: React.FC = () => { ...@@ -28,7 +30,11 @@ const LoginWrap: React.FC = () => {
} else { } else {
window.location.replace('/memberCenter/home') window.location.replace('/memberCenter/home')
} }
} else {
setLoginLoading(false)
} }
}).catch(() => {
setLoginLoading(false)
}) })
} }
...@@ -89,7 +95,7 @@ const LoginWrap: React.FC = () => { ...@@ -89,7 +95,7 @@ const LoginWrap: React.FC = () => {
</Form.Item>) </Form.Item>)
} }
<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.Item>
</Form> </Form>
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment