feat: banner
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
@import '@/styles/variables.less';
|
||||
@import '@/styles/common.less';
|
||||
|
||||
.all-job-fragment {
|
||||
&__container {
|
||||
@ -76,7 +77,7 @@
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-left: solid 2px #E0E0E0;
|
||||
border-left: solid 2px #e0e0e0;
|
||||
|
||||
font-size: 28px;
|
||||
line-height: 32px;
|
||||
@ -118,7 +119,7 @@
|
||||
&__empty-box {
|
||||
width: 386px;
|
||||
height: 278px;
|
||||
}
|
||||
}
|
||||
|
||||
&__tips-title {
|
||||
font-size: 28px;
|
||||
@ -138,10 +139,29 @@
|
||||
&__add-group-button {
|
||||
font-size: 28px;
|
||||
line-height: 40px;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
background-color: @blHighlightColor;
|
||||
border-radius: 48px;
|
||||
padding: 20px 30px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.partner-banner {
|
||||
width: 100%;
|
||||
height: 90px;
|
||||
position: relative;
|
||||
|
||||
&__image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
&__close {
|
||||
width: 64px;
|
||||
height: 38px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import { NodesRef, useDidHide } from '@tarojs/taro';
|
||||
import { Tabs } from '@taroify/core';
|
||||
import { ArrowUp, ArrowDown } from '@taroify/icons';
|
||||
import classNames from 'classnames';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { useCallback, useEffect, useState, MouseEvent } from 'react';
|
||||
|
||||
import JobList, { IJobListProps } from '@/components/job-list';
|
||||
import Overlay from '@/components/overlay';
|
||||
@ -18,6 +18,7 @@ import { SalaryRange } from '@/types/job';
|
||||
import { Coordinate } from '@/types/location';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
import { navigateTo } from '@/utils/route';
|
||||
import { getPartnerBannerClose, setPartnerBannerClose } from '@/utils/partner';
|
||||
|
||||
import './index.less';
|
||||
|
||||
@ -42,6 +43,18 @@ const CALC_LIST_PROPS: IUseListHeightProps = {
|
||||
|
||||
const log = logWithPrefix(PREFIX);
|
||||
|
||||
const PartnerBanner = (props: { onClose: (e: MouseEvent) => void }) => {
|
||||
const handleClick = useCallback(() => {
|
||||
navigateTo(PageUrl.Partner);
|
||||
}, []);
|
||||
return (
|
||||
<div className="partner-banner" onClick={handleClick}>
|
||||
<Image className="partner-banner__image" src={require('@/statics/png/partner_banner.png')} mode="aspectFill" />
|
||||
<div className="partner-banner__close" onClick={props.onClose} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const NoGroupTips = (props: { className?: string; height?: number }) => {
|
||||
const { className, height } = props;
|
||||
return (
|
||||
@ -80,6 +93,7 @@ function JobFragment(props: IProps) {
|
||||
const [salaryRange, setSalaryRange] = useState<SalaryRange | undefined>();
|
||||
const [showSalarySelect, setShowSalarySelect] = useState<boolean>(false);
|
||||
const { latitude, longitude } = coordinate;
|
||||
const [bannerClose, setBannerClose] = useState<boolean>(getPartnerBannerClose());
|
||||
|
||||
const handleClickSearch = useCallback(() => navigateTo(PageUrl.JobSearch, { city: cityCode }), [cityCode]);
|
||||
|
||||
@ -103,6 +117,13 @@ function JobFragment(props: IProps) {
|
||||
[setTabType]
|
||||
);
|
||||
|
||||
const handlePartnerBannerClose = useCallback(e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setBannerClose(true);
|
||||
setPartnerBannerClose();
|
||||
}, []);
|
||||
|
||||
useDidHide(() => setShowSalarySelect(false));
|
||||
|
||||
return (
|
||||
@ -132,6 +153,7 @@ function JobFragment(props: IProps) {
|
||||
<Tabs className={`${PREFIX}__type-tabs`} value={tabType} onChange={onTypeChange}>
|
||||
{JOB_TABS.map(tab => (
|
||||
<Tabs.TabPane title={tab.title} key={tab.type} value={tab.type}>
|
||||
{!bannerClose && <PartnerBanner onClose={handlePartnerBannerClose} />}
|
||||
<ListWrapper
|
||||
category={tab.type}
|
||||
cityCode={cityCode}
|
||||
|
||||
@ -5,7 +5,7 @@ import classNames from 'classnames';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import JobList from '@/components/job-list';
|
||||
import ProductGroupDialog from '@/components/product-group-dialog';
|
||||
import ProductGroupDialog from '@/components/product-dialog/group';
|
||||
import { APP_TAB_BAR_ID } from '@/constants/app';
|
||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
|
||||
Reference in New Issue
Block a user