Compare commits
2 Commits
8e42fef4f7
...
828e9b7512
| Author | SHA1 | Date | |
|---|---|---|---|
| 828e9b7512 | |||
| 1d8a0d7a33 |
@ -5,34 +5,19 @@ import { isEqual } from 'lodash-es';
|
|||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import PickerToolbar from '@/components/picker-toolbar';
|
import PickerToolbar from '@/components/picker-toolbar';
|
||||||
import {
|
import { FULL_PRICE_OPTIONS, PART_PRICE_OPTIONS } from '@/constants/job';
|
||||||
EmployType,
|
import { ALL_ANCHOR_READ_TYPES, ANCHOR_READ_TITLE_MAP, AnchorReadType } from '@/constants/material';
|
||||||
ALL_EMPLOY_TYPES,
|
|
||||||
FULL_PRICE_OPTIONS,
|
|
||||||
PART_PRICE_OPTIONS,
|
|
||||||
EMPLOY_TYPE_TITLE_MAP,
|
|
||||||
} from '@/constants/job';
|
|
||||||
import {
|
|
||||||
ALL_ANCHOR_READ_TYPES,
|
|
||||||
ALL_GENDER_TYPES,
|
|
||||||
ANCHOR_READ_TITLE_MAP,
|
|
||||||
AnchorReadType,
|
|
||||||
GENDER_TYPE_TITLE_MAP,
|
|
||||||
GenderType,
|
|
||||||
} from '@/constants/material';
|
|
||||||
import { IAnchorFilters } from '@/types/material';
|
import { IAnchorFilters } from '@/types/material';
|
||||||
import { isUndefined } from '@/utils/common';
|
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
|
type MoreFilter = Omit<IAnchorFilters, 'employType' | 'gender'>;
|
||||||
interface IProps {
|
interface IProps {
|
||||||
value: IAnchorFilters;
|
value: MoreFilter;
|
||||||
onConfirm: (newValue: IAnchorFilters) => void;
|
onConfirm: (newValue: MoreFilter) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PREFIX = 'anchor-picker';
|
const PREFIX = 'anchor-picker';
|
||||||
const getDefaultGender = (value: IAnchorFilters) => value.gender;
|
|
||||||
const getDefaultEmploy = (value: IAnchorFilters) => value.employType;
|
|
||||||
const getDefaultReadType = (value: IAnchorFilters) => value.readType;
|
const getDefaultReadType = (value: IAnchorFilters) => value.readType;
|
||||||
const getDefaultCategory = (value: IAnchorFilters) => value.category || '';
|
const getDefaultCategory = (value: IAnchorFilters) => value.category || '';
|
||||||
const getSalaryValue = (value: IAnchorFilters, full: boolean) => {
|
const getSalaryValue = (value: IAnchorFilters, full: boolean) => {
|
||||||
@ -47,9 +32,7 @@ const getSalaryValue = (value: IAnchorFilters, full: boolean) => {
|
|||||||
|
|
||||||
function AnchorPicker(props: IProps) {
|
function AnchorPicker(props: IProps) {
|
||||||
const { value, onConfirm } = props;
|
const { value, onConfirm } = props;
|
||||||
const [gender, setGender] = useState<GenderType | undefined>(getDefaultGender(value));
|
|
||||||
const [readType, setReadType] = useState<AnchorReadType | undefined>(getDefaultReadType(value));
|
const [readType, setReadType] = useState<AnchorReadType | undefined>(getDefaultReadType(value));
|
||||||
const [employType, setEmployType] = useState<EmployType | undefined>(getDefaultEmploy(value));
|
|
||||||
const [fullSalary, setFullSalary] = useState(getSalaryValue(value, true));
|
const [fullSalary, setFullSalary] = useState(getSalaryValue(value, true));
|
||||||
const [partSalary, setPartSalary] = useState(getSalaryValue(value, false));
|
const [partSalary, setPartSalary] = useState(getSalaryValue(value, false));
|
||||||
const [category, setCategory] = useState(getDefaultCategory(value));
|
const [category, setCategory] = useState(getDefaultCategory(value));
|
||||||
@ -59,9 +42,7 @@ function AnchorPicker(props: IProps) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleClickReset = useCallback(() => {
|
const handleClickReset = useCallback(() => {
|
||||||
setGender(undefined);
|
|
||||||
setReadType(undefined);
|
setReadType(undefined);
|
||||||
setEmployType(undefined);
|
|
||||||
setFullSalary(null);
|
setFullSalary(null);
|
||||||
setPartSalary(null);
|
setPartSalary(null);
|
||||||
setCategory('');
|
setCategory('');
|
||||||
@ -83,10 +64,6 @@ function AnchorPicker(props: IProps) {
|
|||||||
|
|
||||||
const handleClickConfirm = useCallback(() => {
|
const handleClickConfirm = useCallback(() => {
|
||||||
const filters: IAnchorFilters = {};
|
const filters: IAnchorFilters = {};
|
||||||
if (!isUndefined(gender)) {
|
|
||||||
filters.gender = gender === GenderType.All ? undefined : gender;
|
|
||||||
}
|
|
||||||
employType && (filters.employType = employType);
|
|
||||||
readType && (filters.readType = readType);
|
readType && (filters.readType = readType);
|
||||||
category && (filters.category = category);
|
category && (filters.category = category);
|
||||||
if (fullSalary) {
|
if (fullSalary) {
|
||||||
@ -98,34 +75,10 @@ function AnchorPicker(props: IProps) {
|
|||||||
filters.highPriceForPartyTime = partSalary.maxSalary;
|
filters.highPriceForPartyTime = partSalary.maxSalary;
|
||||||
}
|
}
|
||||||
onConfirm(filters);
|
onConfirm(filters);
|
||||||
}, [gender, employType, readType, category, fullSalary, partSalary, onConfirm]);
|
}, [readType, category, fullSalary, partSalary, onConfirm]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<div className={`${PREFIX}__title`}>性别</div>
|
|
||||||
<div className={`${PREFIX}__container`}>
|
|
||||||
{ALL_GENDER_TYPES.map((type: GenderType) => (
|
|
||||||
<div
|
|
||||||
key={type}
|
|
||||||
onClick={() => setGender(type)}
|
|
||||||
className={classNames(`${PREFIX}__item`, { selected: type === gender })}
|
|
||||||
>
|
|
||||||
{GENDER_TYPE_TITLE_MAP[type]}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className={`${PREFIX}__title`}>全职/兼职</div>
|
|
||||||
<div className={`${PREFIX}__container`}>
|
|
||||||
{ALL_EMPLOY_TYPES.map(type => (
|
|
||||||
<div
|
|
||||||
key={type}
|
|
||||||
onClick={() => setEmployType(type)}
|
|
||||||
className={classNames(`${PREFIX}__item`, { selected: type === employType })}
|
|
||||||
>
|
|
||||||
{EMPLOY_TYPE_TITLE_MAP[type]}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className={`${PREFIX}__title`}>已读/未读</div>
|
<div className={`${PREFIX}__title`}>已读/未读</div>
|
||||||
<div className={`${PREFIX}__container`}>
|
<div className={`${PREFIX}__container`}>
|
||||||
{ALL_ANCHOR_READ_TYPES.map(type => (
|
{ALL_ANCHOR_READ_TYPES.map(type => (
|
||||||
|
|||||||
13
src/components/gender-select/index.tsx
Normal file
13
src/components/gender-select/index.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import Select, { ISelectProps } from '@/components/select';
|
||||||
|
import { GENDER_OPTIONS, GenderType } from '@/constants/material';
|
||||||
|
|
||||||
|
interface IProps extends Omit<ISelectProps<GenderType>, 'options'> {
|
||||||
|
value: GenderType;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GenderSelect(props: IProps) {
|
||||||
|
const { value: selectValue, onSelect } = props;
|
||||||
|
return <Select options={GENDER_OPTIONS} title="性别" value={selectValue} onSelect={onSelect} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default GenderSelect;
|
||||||
@ -28,6 +28,7 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0 24px;
|
padding: 0 24px;
|
||||||
|
flex: 0 0 96px;
|
||||||
|
|
||||||
&.selected {
|
&.selected {
|
||||||
color: @blHighlightColor;
|
color: @blHighlightColor;
|
||||||
@ -45,4 +46,4 @@
|
|||||||
border-top-left-radius: 24px;
|
border-top-left-radius: 24px;
|
||||||
border-top-right-radius: 24px;
|
border-top-right-radius: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
src/components/top-category-select/index.tsx
Normal file
13
src/components/top-category-select/index.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import Select, { ISelectProps } from '@/components/select';
|
||||||
|
import { JOB_TYPE_SELECT_OPTIONS_WITH_ALL, JobType } from '@/constants/job';
|
||||||
|
|
||||||
|
interface IProps extends Omit<ISelectProps<JobType>, 'options'> {
|
||||||
|
value: JobType;
|
||||||
|
}
|
||||||
|
|
||||||
|
function TopCategorySelect(props: IProps) {
|
||||||
|
const { value: selectValue, onSelect } = props;
|
||||||
|
return <Select options={JOB_TYPE_SELECT_OPTIONS_WITH_ALL} title="品类" value={selectValue} onSelect={onSelect} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default TopCategorySelect;
|
||||||
@ -7,6 +7,7 @@ export enum JobType {
|
|||||||
Jewelry = 'JEWELRY', // 珠宝
|
Jewelry = 'JEWELRY', // 珠宝
|
||||||
Appliance = 'APPLIANCE', // 家电
|
Appliance = 'APPLIANCE', // 家电
|
||||||
Furniture = 'FURNITURE', // 日用家具
|
Furniture = 'FURNITURE', // 日用家具
|
||||||
|
OutdoorSports = 'OUTDOOR_SPORTS',
|
||||||
PetFamily = 'PET_FAMILY', // 母婴宠物
|
PetFamily = 'PET_FAMILY', // 母婴宠物
|
||||||
Luxury = 'LUXURY', // 奢品
|
Luxury = 'LUXURY', // 奢品
|
||||||
LocalLive = 'LOCAL_LIVE', // 本地生活
|
LocalLive = 'LOCAL_LIVE', // 本地生活
|
||||||
@ -87,6 +88,7 @@ export const JOB_TYPE_TITLE_MAP: { [key in JobType]: string } = {
|
|||||||
[JobType.Jewelry]: '珠宝',
|
[JobType.Jewelry]: '珠宝',
|
||||||
[JobType.Appliance]: '家电',
|
[JobType.Appliance]: '家电',
|
||||||
[JobType.Furniture]: '日用家具',
|
[JobType.Furniture]: '日用家具',
|
||||||
|
[JobType.OutdoorSports]: '户外运动',
|
||||||
[JobType.PetFamily]: '母婴宠物',
|
[JobType.PetFamily]: '母婴宠物',
|
||||||
[JobType.Luxury]: '奢品',
|
[JobType.Luxury]: '奢品',
|
||||||
[JobType.LocalLive]: '本地生活',
|
[JobType.LocalLive]: '本地生活',
|
||||||
@ -173,6 +175,7 @@ export const JOB_TYPE_SELECT_OPTIONS = [
|
|||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.Jewelry], value: JobType.Jewelry },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.Jewelry], value: JobType.Jewelry },
|
||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.Appliance], value: JobType.Appliance },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.Appliance], value: JobType.Appliance },
|
||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.Furniture], value: JobType.Furniture },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.Furniture], value: JobType.Furniture },
|
||||||
|
{ label: JOB_TYPE_TITLE_MAP[JobType.OutdoorSports], value: JobType.OutdoorSports },
|
||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.PetFamily], value: JobType.PetFamily },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.PetFamily], value: JobType.PetFamily },
|
||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.Luxury], value: JobType.Luxury },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.Luxury], value: JobType.Luxury },
|
||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.LocalLive], value: JobType.LocalLive },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.LocalLive], value: JobType.LocalLive },
|
||||||
@ -181,6 +184,11 @@ export const JOB_TYPE_SELECT_OPTIONS = [
|
|||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.Other], value: JobType.Other },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.Other], value: JobType.Other },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const JOB_TYPE_SELECT_OPTIONS_WITH_ALL = [
|
||||||
|
{ label: JOB_TYPE_TITLE_MAP[JobType.All], value: JobType.All },
|
||||||
|
...JOB_TYPE_SELECT_OPTIONS,
|
||||||
|
];
|
||||||
|
|
||||||
const MAX_SALARY = 10000000;
|
const MAX_SALARY = 10000000;
|
||||||
export const PART_EMPLOY_SALARY_OPTIONS = [
|
export const PART_EMPLOY_SALARY_OPTIONS = [
|
||||||
{ label: '不限' },
|
{ label: '不限' },
|
||||||
|
|||||||
@ -84,14 +84,25 @@ export const WORK_YEAR_OPTIONS = [
|
|||||||
{ label: WORK_YEAR_LABELS[WorkedYears.MoreThreeYear], value: WorkedYears.MoreThreeYear },
|
{ label: WORK_YEAR_LABELS[WorkedYears.MoreThreeYear], value: WorkedYears.MoreThreeYear },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ALL_GENDER_TYPES = [GenderType.All, GenderType.MEN, GenderType.WOMEN];
|
|
||||||
|
|
||||||
export const GENDER_TYPE_TITLE_MAP = {
|
export const GENDER_TYPE_TITLE_MAP = {
|
||||||
[GenderType.All]: '不限',
|
[GenderType.All]: '不限',
|
||||||
[GenderType.WOMEN]: '女',
|
[GenderType.WOMEN]: '女',
|
||||||
[GenderType.MEN]: '男',
|
[GenderType.MEN]: '男',
|
||||||
};
|
};
|
||||||
|
export const GENDER_OPTIONS = [
|
||||||
|
{
|
||||||
|
value: GenderType.All,
|
||||||
|
label: GENDER_TYPE_TITLE_MAP[GenderType.All],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: GenderType.WOMEN,
|
||||||
|
label: GENDER_TYPE_TITLE_MAP[GenderType.WOMEN],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: GenderType.MEN,
|
||||||
|
label: GENDER_TYPE_TITLE_MAP[GenderType.MEN],
|
||||||
|
},
|
||||||
|
];
|
||||||
export const ALL_ANCHOR_READ_TYPES = Object.values(AnchorReadType);
|
export const ALL_ANCHOR_READ_TYPES = Object.values(AnchorReadType);
|
||||||
|
|
||||||
export const ANCHOR_READ_TITLE_MAP = {
|
export const ANCHOR_READ_TITLE_MAP = {
|
||||||
|
|||||||
@ -52,7 +52,11 @@
|
|||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
color: @blColor;
|
color: @blColor;
|
||||||
|
gap: 20px;
|
||||||
|
|
||||||
|
&-item {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
.title {
|
.title {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
@ -61,11 +65,17 @@
|
|||||||
padding: 0 24px;
|
padding: 0 24px;
|
||||||
}
|
}
|
||||||
&__overlay-outer {
|
&__overlay-outer {
|
||||||
top: 82px;
|
top: 72px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__overlay-inner {
|
&__overlay-inner {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
.bl-select__items-container {
|
||||||
|
max-height: calc(100vh - 610rpx);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__tips-container {
|
&__tips-container {
|
||||||
@ -91,8 +101,6 @@
|
|||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
&__popup {
|
&__popup {
|
||||||
&-content {
|
&-content {
|
||||||
.flex-column();
|
.flex-column();
|
||||||
|
|||||||
@ -5,11 +5,13 @@ import { Popup } from '@taroify/core';
|
|||||||
import { ArrowDown, ArrowUp } from '@taroify/icons';
|
import { ArrowDown, ArrowUp } from '@taroify/icons';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { isEqual } from 'lodash-es';
|
import { isEqual } from 'lodash-es';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import AnchorList, { IAnchorListProps } from '@/components/anchor-list';
|
import AnchorList, { IAnchorListProps } from '@/components/anchor-list';
|
||||||
import AnchorPicker from '@/components/anchor-picker';
|
import AnchorPicker from '@/components/anchor-picker';
|
||||||
import CustomNavigationBar from '@/components/custom-navigation-bar';
|
import CustomNavigationBar from '@/components/custom-navigation-bar';
|
||||||
|
import EmployTypeSelect from '@/components/employ-type-select';
|
||||||
|
import GenderSelect from '@/components/gender-select';
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import Overlay from '@/components/overlay';
|
import Overlay from '@/components/overlay';
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
@ -17,8 +19,8 @@ import PartnerBanner from '@/components/partner-banner';
|
|||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
import SwitchBar from '@/components/switch-bar';
|
import SwitchBar from '@/components/switch-bar';
|
||||||
import { APP_TAB_BAR_ID, EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
import { APP_TAB_BAR_ID, EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { EmployType } from '@/constants/job';
|
import { EmployType, JobType } from '@/constants/job';
|
||||||
import { ALL_ANCHOR_SORT_TYPES, ANCHOR_SORT_TYPE_TITLE_MAP, AnchorSortType } from '@/constants/material';
|
import { ALL_ANCHOR_SORT_TYPES, ANCHOR_SORT_TYPE_TITLE_MAP, AnchorSortType, GenderType } from '@/constants/material';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||||
import useLocation from '@/hooks/use-location';
|
import useLocation from '@/hooks/use-location';
|
||||||
@ -36,6 +38,7 @@ import { getCommonShareMessage } from '@/utils/share';
|
|||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
import TopCategorySelect from '@/components/top-category-select';
|
||||||
|
|
||||||
const PREFIX = 'page-anchor';
|
const PREFIX = 'page-anchor';
|
||||||
const LIST_CONTAINER_CLASS = `${PREFIX}__list-container`;
|
const LIST_CONTAINER_CLASS = `${PREFIX}__list-container`;
|
||||||
@ -78,12 +81,22 @@ function ListWrapper(props: IAnchorListProps) {
|
|||||||
return <AnchorList listHeight={listHeight} {...props} onListEmpty={handleListEmpty} />;
|
return <AnchorList listHeight={listHeight} {...props} onListEmpty={handleListEmpty} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum FilterType {
|
||||||
|
gender,
|
||||||
|
employType,
|
||||||
|
topCategory,
|
||||||
|
more,
|
||||||
|
}
|
||||||
|
|
||||||
export default function AnchorPage() {
|
export default function AnchorPage() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [selectJob, setSelectJob] = useState<JobManageInfo | undefined>();
|
const [selectJob, setSelectJob] = useState<JobManageInfo | undefined>();
|
||||||
const [filters, setFilters] = useState<IAnchorFilters>({ employType: EmployType.All });
|
const [moreFilters, setMoreFilters] = useState<IAnchorFilters>({});
|
||||||
const [showFilter, setShowFilter] = useState<boolean>(false);
|
const [gender, setGender] = useState<GenderType>(GenderType.All);
|
||||||
|
const [employType, setEmployType] = useState<EmployType>(EmployType.All);
|
||||||
|
const [topCategory, setTopCategory] = useState<JobType>(JobType.All);
|
||||||
|
const [showFilter, setShowFilter] = useState<FilterType | null>(null);
|
||||||
const [sortType, setSortType] = useState<AnchorSortType>(AnchorSortType.Active);
|
const [sortType, setSortType] = useState<AnchorSortType>(AnchorSortType.Active);
|
||||||
const [openPopup, setOpenPopup] = useState<boolean>(false);
|
const [openPopup, setOpenPopup] = useState<boolean>(false);
|
||||||
const [coordinate, setCoordinate] = useState<Coordinate>({
|
const [coordinate, setCoordinate] = useState<Coordinate>({
|
||||||
@ -106,20 +119,35 @@ export default function AnchorPage() {
|
|||||||
[selectJob]
|
[selectJob]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleClickSalarySelect = useCallback(() => {
|
const handleClickFilterSelect = (type: FilterType) => () => {
|
||||||
setShowFilter(!showFilter);
|
setShowFilter(type === showFilter ? null : type);
|
||||||
}, [showFilter]);
|
};
|
||||||
|
|
||||||
const handleHideFilter = useCallback(() => setShowFilter(false), []);
|
const handleHideFilter = useCallback(() => setShowFilter(null), []);
|
||||||
|
|
||||||
const handleFilterChange = useCallback(
|
const handleFilterChange = useCallback(
|
||||||
(newFilters: IAnchorFilters) => {
|
(newFilters: IAnchorFilters) => {
|
||||||
!isEqual(newFilters, filters) && setFilters(newFilters);
|
!isEqual(newFilters, moreFilters) && setMoreFilters(newFilters);
|
||||||
setShowFilter(false);
|
setShowFilter(null);
|
||||||
},
|
},
|
||||||
[filters]
|
[moreFilters]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handleChangeSelectGender = useCallback((value: GenderType) => {
|
||||||
|
setGender(value);
|
||||||
|
setShowFilter(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleChangeSelectEmployType = useCallback((value: EmployType) => {
|
||||||
|
setEmployType(value);
|
||||||
|
setShowFilter(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleChangeSelectTopCategory = useCallback((value: JobType) => {
|
||||||
|
setTopCategory(value);
|
||||||
|
setShowFilter(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleClickSortType = useCallback(async (type: AnchorSortType) => setSortType(type), []);
|
const handleClickSortType = useCallback(async (type: AnchorSortType) => setSortType(type), []);
|
||||||
|
|
||||||
const handleJobChange = useCallback(
|
const handleJobChange = useCallback(
|
||||||
@ -205,6 +233,15 @@ export default function AnchorPage() {
|
|||||||
|
|
||||||
useDidShow(() => requestUnreadMessageCount());
|
useDidShow(() => requestUnreadMessageCount());
|
||||||
|
|
||||||
|
const filters = useMemo(
|
||||||
|
() => ({
|
||||||
|
...moreFilters,
|
||||||
|
topCategory,
|
||||||
|
gender: gender === -1 ? undefined : gender,
|
||||||
|
employType,
|
||||||
|
}),
|
||||||
|
[moreFilters, gender, employType, topCategory]
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<HomePage type={PageType.Anchor}>
|
<HomePage type={PageType.Anchor}>
|
||||||
{!!loading && <PageLoading className={`${PREFIX}__loading`} />}
|
{!!loading && <PageLoading className={`${PREFIX}__loading`} />}
|
||||||
@ -224,9 +261,23 @@ export default function AnchorPage() {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className={classNames(`${PREFIX}__filter`)} onClick={handleClickSalarySelect}>
|
<div className={classNames(`${PREFIX}__filter`)}>
|
||||||
<div className="title">筛选</div>
|
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.gender)}>
|
||||||
{showFilter ? <ArrowUp /> : <ArrowDown />}
|
<div className="title">性别</div>
|
||||||
|
{showFilter === FilterType.gender ? <ArrowUp /> : <ArrowDown />}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.employType)}>
|
||||||
|
<div className="title">类型</div>
|
||||||
|
{showFilter === FilterType.employType ? <ArrowUp /> : <ArrowDown />}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.topCategory)}>
|
||||||
|
<div className="title">品类</div>
|
||||||
|
{showFilter === FilterType.topCategory ? <ArrowUp /> : <ArrowDown />}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.more)}>
|
||||||
|
<div className="title">更多</div>
|
||||||
|
{showFilter === FilterType.more ? <ArrowUp /> : <ArrowDown />}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__banner`}>
|
<div className={`${PREFIX}__banner`}>
|
||||||
@ -243,12 +294,36 @@ export default function AnchorPage() {
|
|||||||
className={LIST_CONTAINER_CLASS}
|
className={LIST_CONTAINER_CLASS}
|
||||||
/>
|
/>
|
||||||
<Overlay
|
<Overlay
|
||||||
visible={showFilter}
|
visible={showFilter === FilterType.gender}
|
||||||
onClickOuter={handleHideFilter}
|
onClickOuter={handleHideFilter}
|
||||||
outerClassName={`${PREFIX}__overlay-outer`}
|
outerClassName={`${PREFIX}__overlay-outer`}
|
||||||
innerClassName={`${PREFIX}__overlay-inner`}
|
innerClassName={`${PREFIX}__overlay-inner`}
|
||||||
>
|
>
|
||||||
<AnchorPicker value={filters} onConfirm={handleFilterChange} />
|
<GenderSelect value={gender} onSelect={handleChangeSelectGender} />
|
||||||
|
</Overlay>
|
||||||
|
<Overlay
|
||||||
|
visible={showFilter === FilterType.employType}
|
||||||
|
onClickOuter={handleHideFilter}
|
||||||
|
outerClassName={`${PREFIX}__overlay-outer`}
|
||||||
|
innerClassName={`${PREFIX}__overlay-inner`}
|
||||||
|
>
|
||||||
|
<EmployTypeSelect value={employType} onSelect={handleChangeSelectEmployType} />
|
||||||
|
</Overlay>
|
||||||
|
<Overlay
|
||||||
|
visible={showFilter === FilterType.topCategory}
|
||||||
|
onClickOuter={handleHideFilter}
|
||||||
|
outerClassName={`${PREFIX}__overlay-outer`}
|
||||||
|
innerClassName={`${PREFIX}__overlay-inner`}
|
||||||
|
>
|
||||||
|
<TopCategorySelect value={topCategory} onSelect={handleChangeSelectTopCategory} />
|
||||||
|
</Overlay>
|
||||||
|
<Overlay
|
||||||
|
visible={showFilter === FilterType.more}
|
||||||
|
onClickOuter={handleHideFilter}
|
||||||
|
outerClassName={`${PREFIX}__overlay-outer`}
|
||||||
|
innerClassName={`${PREFIX}__overlay-inner`}
|
||||||
|
>
|
||||||
|
<AnchorPicker value={moreFilters} onConfirm={handleFilterChange} />
|
||||||
</Overlay>
|
</Overlay>
|
||||||
</div>
|
</div>
|
||||||
<Popup
|
<Popup
|
||||||
|
|||||||
@ -9,13 +9,17 @@ import PageLoading from '@/components/page-loading';
|
|||||||
import CompanyPublishJobBuy from '@/components/product-dialog/steps-ui/company-publish-job-buy';
|
import CompanyPublishJobBuy from '@/components/product-dialog/steps-ui/company-publish-job-buy';
|
||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
import { EventName, OpenSource, PageUrl, RoleType } from '@/constants/app';
|
import { EventName, OpenSource, PageUrl, RoleType } from '@/constants/app';
|
||||||
|
import { CertificationStatusType } from '@/constants/company';
|
||||||
import { CollectEventName } from '@/constants/event';
|
import { CollectEventName } from '@/constants/event';
|
||||||
import { JobManageStatus } from '@/constants/job';
|
import { JobManageStatus } from '@/constants/job';
|
||||||
import { MaterialViewSource } from '@/constants/material';
|
import { MaterialViewSource } from '@/constants/material';
|
||||||
import ProfileViewFragment from '@/fragments/profile/view';
|
import ProfileViewFragment from '@/fragments/profile/view';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import { RESPONSE_ERROR_CODE } from '@/http/constant';
|
import { RESPONSE_ERROR_CODE } from '@/http/constant';
|
||||||
import { HttpError } from '@/http/error';
|
import { HttpError } from '@/http/error';
|
||||||
|
import store from '@/store';
|
||||||
|
import { cacheJobId } from '@/store/actions';
|
||||||
import { JobManageInfo } from '@/types/job';
|
import { JobManageInfo } from '@/types/job';
|
||||||
import { MaterialProfile } from '@/types/material';
|
import { MaterialProfile } from '@/types/material';
|
||||||
import { IJobMessage } from '@/types/message';
|
import { IJobMessage } from '@/types/message';
|
||||||
@ -29,10 +33,6 @@ import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
|||||||
import { getPageQuery, navigateBack, navigateTo, redirectTo } from '@/utils/route';
|
import { getPageQuery, navigateBack, navigateTo, redirectTo } from '@/utils/route';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
|
||||||
import { CertificationStatusType } from '@/constants/company';
|
|
||||||
import store from '@/store';
|
|
||||||
import { cacheJobId } from '@/store/actions';
|
|
||||||
|
|
||||||
const PREFIX = 'page-material-view';
|
const PREFIX = 'page-material-view';
|
||||||
|
|
||||||
|
|||||||
@ -101,6 +101,7 @@ export interface IAnchorFilters {
|
|||||||
lowPriceForPartyTime?: number;
|
lowPriceForPartyTime?: number;
|
||||||
highPriceForPartyTime?: number;
|
highPriceForPartyTime?: number;
|
||||||
category?: string;
|
category?: string;
|
||||||
|
topCategory?: string;
|
||||||
readType?: AnchorReadType;
|
readType?: AnchorReadType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user