Commit 63932e52 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents b867f854 b5c766a9
...@@ -27,6 +27,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -27,6 +27,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
const [firstAdvertList, setFirstAdvertList] = useState([]) const [firstAdvertList, setFirstAdvertList] = useState([])
const [secondAdvertList, setSecondAdvertList] = useState([]) const [secondAdvertList, setSecondAdvertList] = useState([])
const [categoryComponents, setCategoryComponents] = useState<React.ReactNode>() const [categoryComponents, setCategoryComponents] = useState<React.ReactNode>()
const [loading, setLoading] = useState<boolean>(true)
useEffect(() => { useEffect(() => {
if (shopInfo) { if (shopInfo) {
...@@ -45,6 +46,8 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -45,6 +46,8 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
getCategoryComponents(templateId) getCategoryComponents(templateId)
findFirstAdvertsByType(templateId) findFirstAdvertsByType(templateId)
findSecondAdvertsByType(templateId) findSecondAdvertsByType(templateId)
} else {
setLoading(false)
} }
} }
}, [shopInfo]) }, [shopInfo])
...@@ -137,6 +140,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -137,6 +140,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
) )
} }
setCategoryComponents(result) setCategoryComponents(result)
setLoading(false)
} }
...@@ -150,7 +154,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -150,7 +154,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
<FloorAnchor anchorList={categoryList} type="shop" /> <FloorAnchor anchorList={categoryList} type="shop" />
<CommonTitle title="热销商品" type="primary" /> <CommonTitle title="热销商品" type="primary" />
{ {
categoryComponents ? categoryComponents : <FloorSkeleton type={LAYOUT_TYPE.shop} /> categoryComponents ? categoryComponents : loading ? <FloorSkeleton type={LAYOUT_TYPE.shop} /> : null
} }
<Advert type="service" advertList={secondAdvertList} /> <Advert type="service" advertList={secondAdvertList} />
<CommonTitle title="关于我们" type="primary" /> <CommonTitle title="关于我们" type="primary" />
......
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
font-weight: 500; font-weight: 500;
display: flex; display: flex;
&_text {
line-height: 30px;
}
&_search { &_search {
color: #303133; color: #303133;
} }
......
import React from 'react' import React from 'react'
import noResultIcon from '@/assets/imgs/no_result_icon.png'
import styles from './index.less' import styles from './index.less'
interface NoResultPropsType { interface NoResultPropsType {
...@@ -11,7 +12,9 @@ const SearchNoResult: React.FC<NoResultPropsType> = (props) => { ...@@ -11,7 +12,9 @@ const SearchNoResult: React.FC<NoResultPropsType> = (props) => {
return ( return (
<div className={styles.no_result}> <div className={styles.no_result}>
<div className={styles.no_result_tip}> <div className={styles.no_result_tip}>
<div className={styles.no_result_tip_img}></div> <div className={styles.no_result_tip_img}>
<img src={noResultIcon} />
</div>
<div className={styles.no_result_tip_text}> <div className={styles.no_result_tip_text}>
{ {
search ? ( search ? (
......
.no_result_container {
width: 1200px;
margin: 0 auto;
}
.no_result {
width: 300px;
margin: 0 auto;
padding: 200px 0;
&_tip {
font-size: 14px;
color: #D32F2F;
font-weight: 500;
display: flex;
&_text {
line-height: 30px;
}
&_search {
color: #303133;
}
&_img {
width: 30px;
height: 30px;
overflow: hidden;
margin-right: 16px;
&>img {
width: 30px;
height: 30px;
}
}
}
&_suggest {
margin-top: 12px;
font-size: 12px;
color: #909399;
padding-left: 46px;
&_list {
padding: 0;
margin: 0;
&>li {
list-style: none;
}
}
}
}
\ No newline at end of file
import React from 'react'
import noResultIcon from '@/assets/imgs/no_result_icon.png'
import styles from './index.less'
interface NoResultPropsType {
search?: string,
}
const SearchShopResult: React.FC<NoResultPropsType> = (props) => {
const { search } = props
return (
<div className={styles.no_result_container}>
<div className={styles.no_result}>
<div className={styles.no_result_tip}>
<div className={styles.no_result_tip_img}>
<img src={noResultIcon} />
</div>
<div className={styles.no_result_tip_text}>
{
search ? (
<>
抱歉,没有找到与“
<span className={styles.no_result_tip_search}>{search}</span>
”相关的店铺
</>
) : (
<>
抱歉,没有找到相关的店铺
</>
)
}
</div>
</div>
<div className={styles.no_result_suggest}>
<ul className={styles.no_result_suggest_list}>
<li>出现的可能原因:</li>
<li>1、管理员冻结了该店铺</li>
<li>2、店铺链接出现错误</li>
</ul>
</div>
</div>
</div>
)
}
export default SearchShopResult
...@@ -89,6 +89,9 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => { ...@@ -89,6 +89,9 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
<div className={styles.logo}> <div className={styles.logo}>
<a href="/"><img src={logo} /></a> <a href="/"><img src={logo} /></a>
</div> </div>
{
shopInfo ? (
<>
<div className={styles.shop_header_split}></div> <div className={styles.shop_header_split}></div>
<div className={styles.shop_header_info}> <div className={styles.shop_header_info}>
<div className={styles.shop_header_info_logo}> <div className={styles.shop_header_info_logo}>
...@@ -143,6 +146,9 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => { ...@@ -143,6 +146,9 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
<Button loading={applyLoading} className={styles.apply_member_btn} onClick={() => applyFroVip()}>申请成为本店会员</Button> <Button loading={applyLoading} className={styles.apply_member_btn} onClick={() => applyFroVip()}>申请成为本店会员</Button>
</div> </div>
</div> </div>
</>
) : null
}
<div className={styles.mall_search}> <div className={styles.mall_search}>
<div className={styles.mall_search_box}> <div className={styles.mall_search_box}>
<Input className={styles.mall_search_input} value={searchValue} placeholder="请输入关键词" onChange={e => setSearchValue(e.target.value)} onPressEnter={() => handleSearchCommodity()} /> <Input className={styles.mall_search_input} value={searchValue} placeholder="请输入关键词" onChange={e => setSearchValue(e.target.value)} onPressEnter={() => handleSearchCommodity()} />
......
...@@ -23,12 +23,15 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => { ...@@ -23,12 +23,15 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
const [firstAdvertList, setFirstAdvertList] = useState([]) const [firstAdvertList, setFirstAdvertList] = useState([])
const [secondAdvertList, setSecondAdvertList] = useState([]) const [secondAdvertList, setSecondAdvertList] = useState([])
const [categoryComponents, setCategoryComponents] = useState<React.ReactNode>() const [categoryComponents, setCategoryComponents] = useState<React.ReactNode>()
const [loading, setLoading] = useState<boolean>(true)
useEffect(() => { useEffect(() => {
if (mallTemplateId) { if (mallTemplateId) {
getCategoryComponents() getCategoryComponents()
findFirstAdvertsByType() findFirstAdvertsByType()
findSecondAdvertsByType() findSecondAdvertsByType()
} else {
setLoading(false)
} }
}, [mallTemplateId]) }, [mallTemplateId])
...@@ -133,6 +136,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => { ...@@ -133,6 +136,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
} }
} }
setCategoryComponents(result) setCategoryComponents(result)
setLoading(false)
} }
...@@ -146,7 +150,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => { ...@@ -146,7 +150,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
useMemo(() => <Advert type="interact" advertList={secondAdvertList} />, [secondAdvertList]) useMemo(() => <Advert type="interact" advertList={secondAdvertList} />, [secondAdvertList])
} }
{ {
categoryComponents ? categoryComponents : <FloorSkeleton type={LAYOUT_TYPE.mall} /> categoryComponents ? categoryComponents : loading ? <FloorSkeleton type={LAYOUT_TYPE.mall} /> : null
} }
<FindMore /> <FindMore />
<Information {...props} /> <Information {...props} />
......
...@@ -43,9 +43,13 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => { ...@@ -43,9 +43,13 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
const menuRouter = getMenuRouter(menuData, location.pathname) const menuRouter = getMenuRouter(menuData, location.pathname)
useEffect(() => { useEffect(() => {
try {
let queryParam = channelId ? atob(channelId) : undefined let queryParam = channelId ? atob(channelId) : undefined
queryParam = queryParam ? JSON.parse(queryParam) : {} queryParam = queryParam ? JSON.parse(queryParam) : {}
setQuery(queryParam) setQuery(queryParam)
} catch (error) {
}
}, []) }, [])
useEffect(() => { useEffect(() => {
......
...@@ -42,9 +42,14 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => { ...@@ -42,9 +42,14 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
const menuRouter = getMenuRouter(menuData, location.pathname) const menuRouter = getMenuRouter(menuData, location.pathname)
useEffect(() => { useEffect(() => {
try {
let queryParam = channelId ? atob(channelId) : undefined let queryParam = channelId ? atob(channelId) : undefined
queryParam = queryParam ? JSON.parse(queryParam) : {} queryParam = queryParam ? JSON.parse(queryParam) : {}
setQuery(queryParam) setQuery(queryParam)
} catch (error) {
}
}, []) }, [])
useEffect(() => { useEffect(() => {
......
...@@ -13,6 +13,7 @@ import SideNav from '../components/SideNav' ...@@ -13,6 +13,7 @@ import SideNav from '../components/SideNav'
import Footer from '../components/Footer' import Footer from '../components/Footer'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { GetTemplateShopFindShopResponse } from '@/services/TemplateApi' import { GetTemplateShopFindShopResponse } from '@/services/TemplateApi'
import SearchShopResult from '../components/SearchShopResult'
import { LAYOUT_TYPE } from '@/constants' import { LAYOUT_TYPE } from '@/constants'
import { GlobalConfig } from '@/global/config' import { GlobalConfig } from '@/global/config'
import styles from './index.less' import styles from './index.less'
...@@ -41,10 +42,13 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => { ...@@ -41,10 +42,13 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const [mallInfo, setMallInfo] = useState<any>({}) const [mallInfo, setMallInfo] = useState<any>({})
useEffect(() => { useEffect(() => {
try {
let queryParam = shopId ? atob(shopId) : undefined let queryParam = shopId ? atob(shopId) : undefined
queryParam = queryParam ? JSON.parse(queryParam) : {} queryParam = queryParam ? JSON.parse(queryParam) : {}
setQuery(queryParam) setQuery(queryParam)
} catch (error) {
console.log(error)
}
getWebMallInfo() getWebMallInfo()
}, []) }, [])
...@@ -99,7 +103,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => { ...@@ -99,7 +103,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
<ShopHeader logo={mallInfo.logoUrl} shopId={query.shopId} shopUrlParam={shopId} shopInfo={shopInfo} updateShopInfo={() => handleUpdate()} /> <ShopHeader logo={mallInfo.logoUrl} shopId={query.shopId} shopUrlParam={shopId} shopInfo={shopInfo} updateShopInfo={() => handleUpdate()} />
<MainNav menuData={menuData} pathname={location.pathname} type={LAYOUT_TYPE.shop} shopId={query.shopId} shopUrlParam={shopId} /> <MainNav menuData={menuData} pathname={location.pathname} type={LAYOUT_TYPE.shop} shopId={query.shopId} shopUrlParam={shopId} />
{ {
children && React.Children.map(children, (child: any) => { shopInfo ? shopInfo.status === 1 ? children && React.Children.map(children, (child: any) => {
return React.cloneElement(child, return React.cloneElement(child,
{ {
layoutType: LAYOUT_TYPE.shop, layoutType: LAYOUT_TYPE.shop,
...@@ -110,7 +114,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => { ...@@ -110,7 +114,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
updateShopInfo: () => handleUpdate() updateShopInfo: () => handleUpdate()
}, },
); );
}) }) : <SearchShopResult search={shopInfo.company} /> : <SearchShopResult />
} }
</div> </div>
<Footer /> <Footer />
......
...@@ -10,7 +10,6 @@ import { PublicApi } from '@/services/api' ...@@ -10,7 +10,6 @@ import { PublicApi } from '@/services/api'
import { LAYOUT_TYPE } from '@/constants' import { LAYOUT_TYPE } from '@/constants'
import { GetTemplateShopFindShopResponse, GetTemplatePlatformFindAllFirstCategoryResponse } from '@/services/TemplateApi' import { GetTemplateShopFindShopResponse, GetTemplatePlatformFindAllFirstCategoryResponse } from '@/services/TemplateApi'
import styles from './index.less' import styles from './index.less'
import { LaptopOutlined } from '@ant-design/icons'
interface ChannelIndexPropsType { interface ChannelIndexPropsType {
SiteStore?: any; SiteStore?: any;
...@@ -27,6 +26,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -27,6 +26,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
const [firstAdvertList, setFirstAdvertList] = useState([]) const [firstAdvertList, setFirstAdvertList] = useState([])
const [secondAdvertList, setSecondAdvertList] = useState([]) const [secondAdvertList, setSecondAdvertList] = useState([])
const [categoryComponents, setCategoryComponents] = useState<React.ReactNode>() const [categoryComponents, setCategoryComponents] = useState<React.ReactNode>()
const [loading, setLoading] = useState<boolean>(true)
useEffect(() => { useEffect(() => {
if (shopInfo) { if (shopInfo) {
...@@ -34,6 +34,8 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -34,6 +34,8 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
getCategoryComponents() getCategoryComponents()
findFirstAdvertsByType() findFirstAdvertsByType()
findSecondAdvertsByType() findSecondAdvertsByType()
} else {
setLoading(false)
} }
} }
}, [shopInfo]) }, [shopInfo])
...@@ -102,7 +104,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -102,7 +104,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
const getCategoryComponents = async () => { const getCategoryComponents = async () => {
let result = [] let result = []
let firstCategory: any = await fetchFirstCategory() let firstCategory: any = await fetchFirstCategory()
if (firstCategory && firstCategory.length > 0) {
for (let item of firstCategory) { for (let item of firstCategory) {
let categoryDetail: any = await fetchCategoryById(item.id) let categoryDetail: any = await fetchCategoryById(item.id)
result.push( result.push(
...@@ -122,6 +124,10 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -122,6 +124,10 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
) )
} }
setCategoryComponents(result) setCategoryComponents(result)
} else {
}
setLoading(false)
} }
...@@ -137,7 +143,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -137,7 +143,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
<AboutUs shopInfo={shopInfo} shopUrlParam={shopUrlParam} type={LAYOUT_TYPE.shop} /> <AboutUs shopInfo={shopInfo} shopUrlParam={shopUrlParam} type={LAYOUT_TYPE.shop} />
<CommonTitle title="热销商品" type="primary" /> <CommonTitle title="热销商品" type="primary" />
{ {
categoryComponents ? categoryComponents : <FloorSkeleton type={LAYOUT_TYPE.shop} /> categoryComponents ? categoryComponents : loading ? <FloorSkeleton type={LAYOUT_TYPE.shop} /> : null
} }
<Advert visible={secondAdvertList.length > 0} type="service" advertList={secondAdvertList} /> <Advert visible={secondAdvertList.length > 0} type="service" advertList={secondAdvertList} />
{/* <Information /> */} {/* <Information /> */}
......
...@@ -48,6 +48,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -48,6 +48,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
}) })
setgoodsList(arr) setgoodsList(arr)
getGoodsList(arr)
}) })
} }
const handleCancelAddMember = () => { const handleCancelAddMember = () => {
......
...@@ -76,7 +76,7 @@ const PendingSubmit: React.FC<{}> = () => { ...@@ -76,7 +76,7 @@ const PendingSubmit: React.FC<{}> = () => {
title: '操作', title: '操作',
key: 'options', key: 'options',
dataIndex: 'options', dataIndex: 'options',
render: (text: any, record: any) => <Button type='link' disabled={record.interiorState !== 1 || record.interiorState !== 3} onClick={() => { setId(record.id); setvisible(true)}}>提交报价单</Button> render: (text: any, record: any) => <Button type='link' disabled={record.externalState !== 2 && record.interiorState !== 4} onClick={() => { setId(record.id); setvisible(true)}}>提交报价单</Button>
}] }]
const format = (text) => { const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</> return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
......
...@@ -28,72 +28,72 @@ export function timeRange(val: number) { ...@@ -28,72 +28,72 @@ export function timeRange(val: number) {
moment() moment()
.startOf('days') .startOf('days')
.format('YYYY-MM-DD HH:mm:ss'), .format('YYYY-MM-DD HH:mm:ss'),
).unix(); ).valueOf();
et = moment( et = moment(
moment() moment()
.endOf('days') .endOf('days')
.format('YYYY-MM-DD HH:mm:ss'), .format('YYYY-MM-DD HH:mm:ss'),
).unix(); ).valueOf();
break; break;
case 2: case 2:
st = moment( st = moment(
moment() moment()
.subtract(7, 'days') .subtract(7, 'days')
.format('YYYY-MM-DD') + ' 00:00:00', .format('YYYY-MM-DD') + ' 00:00:00',
).unix(); ).valueOf();
et = moment( et = moment(
moment() moment()
.endOf('days') .endOf('days')
.format('YYYY-MM-DD HH:mm:ss'), .format('YYYY-MM-DD HH:mm:ss'),
).unix(); ).valueOf();
break; break;
case 3: case 3:
st = moment( st = moment(
moment() moment()
.subtract(29, 'days') .subtract(29, 'days')
.format('YYYY-MM-DD') + ' 00:00:00', .format('YYYY-MM-DD') + ' 00:00:00',
).unix(); ).valueOf();
et = moment( et = moment(
moment() moment()
.endOf('days') .endOf('days')
.format('YYYY-MM-DD HH:mm:ss'), .format('YYYY-MM-DD HH:mm:ss'),
).unix(); ).valueOf();
break; break;
case 4: case 4:
st = moment( st = moment(
moment() moment()
.subtract(89, 'days') .subtract(89, 'days')
.format('YYYY-MM-DD') + ' 00:00:00', .format('YYYY-MM-DD') + ' 00:00:00',
).unix(); ).valueOf();
et = moment( et = moment(
moment() moment()
.endOf('days') .endOf('days')
.format('YYYY-MM-DD HH:mm:ss'), .format('YYYY-MM-DD HH:mm:ss'),
).unix(); ).valueOf();
break; break;
case 5: case 5:
st = moment( st = moment(
moment() moment()
.subtract(179, 'days') .subtract(179, 'days')
.format('YYYY-MM-DD') + ' 00:00:00', .format('YYYY-MM-DD') + ' 00:00:00',
).unix(); ).valueOf();
et = moment( et = moment(
moment() moment()
.endOf('days') .endOf('days')
.format('YYYY-MM-DD HH:mm:ss'), .format('YYYY-MM-DD HH:mm:ss'),
).unix(); ).valueOf();
break; break;
case 6: case 6:
st = moment( st = moment(
moment() moment()
.subtract(364, 'days') .subtract(364, 'days')
.format('YYYY-MM-DD') + ' 00:00:00', .format('YYYY-MM-DD') + ' 00:00:00',
).unix(); ).valueOf();
et = moment( et = moment(
moment() moment()
.endOf('days') .endOf('days')
.format('YYYY-MM-DD HH:mm:ss'), .format('YYYY-MM-DD HH:mm:ss'),
).unix(); ).valueOf();
break; break;
case 7: case 7:
st = moment( st = moment(
...@@ -101,13 +101,13 @@ export function timeRange(val: number) { ...@@ -101,13 +101,13 @@ export function timeRange(val: number) {
.year(moment().year() - 1) .year(moment().year() - 1)
.startOf('year') .startOf('year')
.format('YYYY-MM-DD HH:mm:ss'), .format('YYYY-MM-DD HH:mm:ss'),
).unix(); ).valueOf();
et = moment( et = moment(
moment() moment()
.year(moment().year() - 1) .year(moment().year() - 1)
.endOf('year') .endOf('year')
.format('YYYY-MM-DD HH:mm:ss'), .format('YYYY-MM-DD HH:mm:ss'),
).unix(); ).valueOf();
break; break;
} }
return { st, et } return { st, et }
......
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