feat: update of partner
This commit is contained in:
@ -146,22 +146,3 @@
|
||||
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,10 +4,11 @@ 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, MouseEvent } from 'react';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import JobList, { IJobListProps } from '@/components/job-list';
|
||||
import Overlay from '@/components/overlay';
|
||||
import PartnerBanner from '@/components/partner-banner';
|
||||
import SalarySelect from '@/components/salary-select';
|
||||
import SearchInput from '@/components/search';
|
||||
import { APP_TAB_BAR_ID, PageUrl } from '@/constants/app';
|
||||
@ -18,8 +19,6 @@ 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';
|
||||
|
||||
interface IProps {
|
||||
@ -43,18 +42,6 @@ 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 (
|
||||
@ -93,7 +80,6 @@ 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]);
|
||||
|
||||
@ -117,13 +103,6 @@ function JobFragment(props: IProps) {
|
||||
[setTabType]
|
||||
);
|
||||
|
||||
const handlePartnerBannerClose = useCallback(e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setBannerClose(true);
|
||||
setPartnerBannerClose();
|
||||
}, []);
|
||||
|
||||
useDidHide(() => setShowSalarySelect(false));
|
||||
|
||||
return (
|
||||
@ -153,7 +132,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} />}
|
||||
<PartnerBanner />
|
||||
<ListWrapper
|
||||
category={tab.type}
|
||||
cityCode={cityCode}
|
||||
|
||||
Reference in New Issue
Block a user