13 Commits

Author SHA1 Message Date
7f866c51be fea: update 2025-09-24 08:15:52 +08:00
fe33d0493c feat: update 2025-09-20 20:00:44 +08:00
87f8e1f7e2 feat: update 2025-09-20 19:52:56 +08:00
afa94e2c48 Merge branch 'trunk' into feat/material-list-updat 2025-09-20 18:28:53 +08:00
b8b33841d4 feat: 2025-09-20 18:25:58 +08:00
828e9b7512 feat: update style 2025-09-19 23:53:17 +08:00
1d8a0d7a33 feat: update 2025-09-19 23:49:31 +08:00
8c5fd1a86b feat: update 2025-09-19 22:55:21 +08:00
a4e03ae1bd Merge branch 'trunk' into feat/share-coupon 2025-09-14 21:38:42 +08:00
8e42fef4f7 feat: ps 2025-09-11 21:28:01 +08:00
6f7e78896a feat: distance 2025-09-10 21:37:20 +08:00
b9cd0a3e6d feat: update material card 2025-09-08 23:28:17 +08:00
f2e7fd9d85 feat: 2025-09-01 18:44:26 +08:00
19 changed files with 277 additions and 161 deletions

View File

@ -9,7 +9,7 @@ import { PageUrl } from '@/constants/app';
import { MaterialViewSource, WORK_YEAR_LABELS } from '@/constants/material'; import { MaterialViewSource, WORK_YEAR_LABELS } from '@/constants/material';
import { AnchorInfo } from '@/types/material'; import { AnchorInfo } from '@/types/material';
import { calcDistance } from '@/utils/location'; import { calcDistance } from '@/utils/location';
import { getBasicInfo } from '@/utils/material'; import { getBasicInfo, getSalary } from '@/utils/material';
import { navigateTo } from '@/utils/route'; import { navigateTo } from '@/utils/route';
import { activeDate } from '@/utils/time'; import { activeDate } from '@/utils/time';
@ -22,17 +22,6 @@ interface IProps {
} }
const PREFIX = 'anchor-card'; const PREFIX = 'anchor-card';
const getSalary = (data: AnchorInfo) => {
const { fullTimeMinPrice, fullTimeMaxPrice, partyTimeMinPrice, partyTimeMaxPrice } = data;
const prices: string[] = [];
if (fullTimeMinPrice && fullTimeMaxPrice) {
prices.push(`${fullTimeMinPrice / 1000}-${fullTimeMaxPrice / 1000}K/月`);
}
if (partyTimeMinPrice && partyTimeMaxPrice) {
prices.push(`${partyTimeMinPrice}-${partyTimeMaxPrice}/小时`);
}
return prices.filter(Boolean).join(' ');
};
function AnchorCard(props: IProps) { function AnchorCard(props: IProps) {
const { data, jobId, validator } = props; const { data, jobId, validator } = props;

View File

@ -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 => (

View 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;

View File

@ -11,7 +11,7 @@ import { EMPLOY_TYPE_TITLE_MAP, EmployType } from '@/constants/job';
import { JobInfo } from '@/types/job'; import { JobInfo } from '@/types/job';
// import { LocationInfo } from '@/types/location'; // import { LocationInfo } from '@/types/location';
import { getJobSalary, getJobTitle } from '@/utils/job'; import { getJobSalary, getJobTitle } from '@/utils/job';
// import { calcDistance } from '@/utils/location'; import { calcDistance } from '@/utils/location';
import { navigateTo, redirectTo } from '@/utils/route'; import { navigateTo, redirectTo } from '@/utils/route';
import './index.less'; import './index.less';
@ -45,7 +45,7 @@ function JobCard(props: IProps) {
publisher, publisher,
publisherAvatar, publisherAvatar,
jobLocation, jobLocation,
// distance, distance,
isAuthed = false, isAuthed = false,
} = data; } = data;
@ -84,12 +84,12 @@ function JobCard(props: IProps) {
<div className={`${PREFIX}__summary`}>{jobDescription || sourceText}</div> <div className={`${PREFIX}__summary`}>{jobDescription || sourceText}</div>
<div className={`${PREFIX}__distance-wrapper`}> <div className={`${PREFIX}__distance-wrapper`}>
<div className={`${PREFIX}__detailed-address`}>{jobLocation?.address}</div> <div className={`${PREFIX}__detailed-address`}>{jobLocation?.address}</div>
{/*{distance && (*/} {distance && (
{/* <>*/} <>
{/* <Image className={`${PREFIX}__distance-icon`} src={require('@/statics/svg/location.svg')} />*/} <Image className={`${PREFIX}__distance-icon`} src={require('@/statics/svg/location.svg')} />
{/* <div className={`${PREFIX}__distance`}>{calcDistance(distance)}</div>*/} <div className={`${PREFIX}__distance`}>{calcDistance(distance)}</div>
{/* </>*/} </>
{/*)}*/} )}
</div> </div>
</div> </div>
<div className={`${PREFIX}__divider`} /> <div className={`${PREFIX}__divider`} />

View File

@ -4,7 +4,7 @@
.material-card { .material-card {
padding: 32px 24px; padding: 32px 24px;
border-radius: 16px; border-radius: 16px;
background: #FFFFFF; background: #ffffff;
box-sizing: border-box; box-sizing: border-box;
&__header { &__header {
@ -16,6 +16,10 @@
.flex-row(); .flex-row();
} }
&__right {
color: @blHighlightColor;
}
&__title { &__title {
font-size: 32px; font-size: 32px;
line-height: 40px; line-height: 40px;
@ -50,7 +54,7 @@
&__body { &__body {
width: 100%; width: 100%;
height: 156px; height: 160px;
margin-top: 24px; margin-top: 24px;
.flex-column(); .flex-column();
justify-content: center; justify-content: center;
@ -80,38 +84,44 @@
} }
} }
&__scroll-view { &__info {
position: relative; .flex-row();
gap: 24px;
width: 100%;
&-left {
width: 125px;
height: 160px;
}
&-cover {
width: 100%; width: 100%;
height: 100%; height: 100%;
.flex-row(); border-radius: 12px;
&::-webkit-scrollbar {
display: none;
} }
&-right {
.name {
font-style: normal;
font-weight: 500;
font-size: 28px;
line-height: 32px;
color: @blColor;
margin-bottom: 12px;
}
.info,
.worked {
font-weight: 400;
font-size: 24px;
line-height: 36px;
color: @blColorG2;
margin-bottom: 8px;
}
.salary {
font-weight: 500;
font-size: 24px;
line-height: 36px;
color: @blColor;
&::after {
content: '';
position: absolute;
right: 0;
width: 102px;
height: 100%;
background: linear-gradient(91.41deg, rgba(255, 255, 255, 0) 1.86%, #FFFFFF 99.47%);
} }
} }
&__cover-list {
height: 100%;
.flex-row();
} }
&__cover-image {
width: 120px;
height: 100%;
margin-right: 24px;
// 不知道为啥高度不对,可能 scroll-view 默认底部是滚动条高度?
margin-top: 38px;
border-radius: 8px;
}
} }

View File

@ -1,4 +1,4 @@
import { Image, ScrollView } from '@tarojs/components'; import { Image } from '@tarojs/components';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import { Loading } from '@taroify/core'; import { Loading } from '@taroify/core';
@ -9,11 +9,12 @@ import { useCallback, useEffect, useRef, useState } from 'react';
import LoginButton from '@/components/login-button'; import LoginButton from '@/components/login-button';
import { EventName, PageUrl } from '@/constants/app'; import { EventName, PageUrl } from '@/constants/app';
import { CollectEventName, ReportEventId } from '@/constants/event'; import { CollectEventName, ReportEventId } from '@/constants/event';
import { WORK_YEAR_LABELS } from '@/constants/material';
import useUserInfo from '@/hooks/use-user-info'; import useUserInfo from '@/hooks/use-user-info';
import { MaterialProfile } from '@/types/material'; import { MaterialProfile } from '@/types/material';
import { logWithPrefix } from '@/utils/common'; import { logWithPrefix } from '@/utils/common';
import { collectEvent, reportEvent } from '@/utils/event'; import { collectEvent, reportEvent } from '@/utils/event';
import { requestProfileDetail, sortVideos } from '@/utils/material'; import { getBasicInfo, getSalary, requestProfileDetail, sortVideos } from '@/utils/material';
import { navigateTo } from '@/utils/route'; import { navigateTo } from '@/utils/route';
import Toast from '@/utils/toast'; import Toast from '@/utils/toast';
import { isValidUserInfo } from '@/utils/user'; import { isValidUserInfo } from '@/utils/user';
@ -34,8 +35,9 @@ function MaterialCard(props: IProps) {
const userInfo = useUserInfo(); const userInfo = useUserInfo();
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [profile, setProfile] = useState<MaterialProfile | null>(null); const [profile, setProfile] = useState<MaterialProfile | null>(null);
const refreshRef = useRef((_f?: boolean) => { }); const refreshRef = useRef((_f?: boolean) => {});
const hasMaterial = !!profile; const hasMaterial = !!profile;
const firstCover = sortVideos(profile?.materialVideoInfoList || [])[0];
const handleGoCreateProfile = useCallback(() => { const handleGoCreateProfile = useCallback(() => {
reportEvent(ReportEventId.CLICK_GO_TO_CREATE_MATERIAL); reportEvent(ReportEventId.CLICK_GO_TO_CREATE_MATERIAL);
@ -44,7 +46,7 @@ function MaterialCard(props: IProps) {
const handleGoProfile = useCallback(() => { const handleGoProfile = useCallback(() => {
if (!hasMaterial) { if (!hasMaterial) {
realtimeLogger.info('handleGoProfile noMaterial') realtimeLogger.info('handleGoProfile noMaterial');
return; return;
} }
navigateTo(PageUrl.MaterialProfile).catch(err => { navigateTo(PageUrl.MaterialProfile).catch(err => {
@ -67,7 +69,7 @@ function MaterialCard(props: IProps) {
try { try {
const profileDetail = await requestProfileDetail(); const profileDetail = await requestProfileDetail();
if (!profileDetail) { if (!profileDetail) {
realtimeLogger.info('getProfileDetail no profileDetail') realtimeLogger.info('getProfileDetail no profileDetail');
} }
setProfile(profileDetail); setProfile(profileDetail);
} catch (e) { } catch (e) {
@ -90,8 +92,10 @@ function MaterialCard(props: IProps) {
refreshRef.current?.(true); refreshRef.current?.(true);
}; };
Taro.eventCenter.on(EventName.CREATE_PROFILE, callback); Taro.eventCenter.on(EventName.CREATE_PROFILE, callback);
Taro.eventCenter.on(EventName.UPDATE_PROFILE, callback);
return () => { return () => {
Taro.eventCenter.off(EventName.CREATE_PROFILE, callback); Taro.eventCenter.off(EventName.CREATE_PROFILE, callback);
Taro.eventCenter.on(EventName.UPDATE_PROFILE, callback);
}; };
}, [userInfo]); }, [userInfo]);
@ -100,16 +104,11 @@ function MaterialCard(props: IProps) {
<div className={`${PREFIX}__header`}> <div className={`${PREFIX}__header`}>
<div className={`${PREFIX}__header__left`}> <div className={`${PREFIX}__header__left`}>
<div className={`${PREFIX}__header__title`}></div> <div className={`${PREFIX}__header__title`}></div>
{/* {profile && (
<div
className={`${PREFIX}__header__progress`}
>{`完成度${Math.min((profile.progressBar || 0) * 100, 100)}%`}</div>
)} */}
</div> </div>
{profile && ( {profile && (
<div className={`${PREFIX}__header__right`}> <div className={`${PREFIX}__header__right`}>
{/* <div className={`${PREFIX}__header__status`}>{profile?.isOpen ? '开放中' : '关闭'}</div> */} <div></div>
<ArrowRight className={`${PREFIX}__header__icon`} /> <ArrowRight color="#6D3DF5" className={`${PREFIX}__header__icon`} />
</div> </div>
)} )}
</div> </div>
@ -123,18 +122,21 @@ function MaterialCard(props: IProps) {
</div> </div>
)} )}
{!loading && hasMaterial && ( {!loading && hasMaterial && (
<ScrollView className={`${PREFIX}__scroll-view`} showScrollbar={false} enableFlex enhanced scrollX> <div className={`${PREFIX}__info`}>
<div className={`${PREFIX}__cover-list`}> {firstCover && (
{sortVideos(profile?.materialVideoInfoList || []).map(video => ( <div className={`${PREFIX}__info-left`}>
<Image <Image className={`${PREFIX}__info-cover`} mode="aspectFill" src={firstCover.coverUrl} />
className={`${PREFIX}__cover-image`} </div>
mode="aspectFit" )}
key={video.coverUrl} <div className={`${PREFIX}__info-right`}>
src={video.coverUrl} <div className="name">{profile?.name}</div>
/> <div className="info">
))} {WORK_YEAR_LABELS[profile?.workedYear] || ''}·{getBasicInfo({ ...profile, shoeSize: null })}
</div>
<div className="worked"> {profile?.workedSecCategoryStr}</div>
<div className="salary">{getSalary(profile)}</div>
</div>
</div> </div>
</ScrollView>
)} )}
{loading && <Loading />} {loading && <Loading />}
</div> </div>

View File

@ -36,7 +36,7 @@ export default function PartnerIntro() {
height: 2668, // 实际绘制高度 height: 2668, // 实际绘制高度
destWidth: 750, // 目标显示宽度 destWidth: 750, // 目标显示宽度
destHeight: 1334, // 目标显示高度 destHeight: 1334, // 目标显示高度
fileType: 'jpg', fileType: 'png',
}); });
resolve(tempFilePath.tempFilePath); resolve(tempFilePath.tempFilePath);
@ -61,7 +61,7 @@ export default function PartnerIntro() {
// 绘制背景图片 // 绘制背景图片
const bgImage = canvas.createImage(); const bgImage = canvas.createImage();
const poster = 'https://publiccdn.neighbourhood.com.cn/img/share-coupon-poster.png'; const poster = 'https://publiccdn.neighbourhood.com.cn/img/share-coupon-poster2.png';
bgImage.src = poster; bgImage.src = poster;
bgImage.onload = () => { bgImage.onload = () => {
ctx.drawImage(bgImage, 0, 0, 550, 918); ctx.drawImage(bgImage, 0, 0, 550, 918);
@ -69,7 +69,7 @@ export default function PartnerIntro() {
const qrCodeImage = canvas.createImage(); const qrCodeImage = canvas.createImage();
qrCodeImage.src = qrCode; // 假设 getQrcode() 返回的是二维码图片的路径 qrCodeImage.src = qrCode; // 假设 getQrcode() 返回的是二维码图片的路径
qrCodeImage.onload = () => { qrCodeImage.onload = () => {
ctx.drawImage(qrCodeImage, 196, 600, 160, 160); // 绘制二维码,位置和大小 ctx.drawImage(qrCodeImage, 196, 600, 180, 160); // 绘制二维码,位置和大小
saveCanvasToTempFile().then(tempPath => { saveCanvasToTempFile().then(tempPath => {
resolve(tempPath); resolve(tempPath);
}); });

View File

@ -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;

View 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;

View File

@ -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: '不限' },

View File

@ -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 = {

View File

@ -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();

View File

@ -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,14 @@ 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 { EMPLOY_TYPE_TITLE_MAP, EmployType, JOB_TYPE_TITLE_MAP, 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,
GENDER_TYPE_TITLE_MAP,
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 +44,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 +87,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 +125,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 +239,15 @@ export default function AnchorPage() {
useDidShow(() => requestUnreadMessageCount()); useDidShow(() => requestUnreadMessageCount());
const filters = useMemo(
() => ({
...moreFilters,
topCategory: topCategory === JobType.All ? undefined : 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 +267,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">{gender === GenderType.All ? '性别' : GENDER_TYPE_TITLE_MAP[gender]}</div>
{showFilter === FilterType.gender ? <ArrowUp /> : <ArrowDown />}
</div>
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.employType)}>
<div className="title">{employType === EmployType.All ? '类型' : EMPLOY_TYPE_TITLE_MAP[employType]}</div>
{showFilter === FilterType.employType ? <ArrowUp /> : <ArrowDown />}
</div>
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.topCategory)}>
<div className="title">{topCategory === JobType.All ? '品类' : JOB_TYPE_TITLE_MAP[topCategory]}</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 +300,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

View File

@ -200,7 +200,9 @@ const CompanyFooter = (props: { data: JobDetails }) => {
const errorCode = e.errorCode; const errorCode = e.errorCode;
const errorMsg = e.info?.() || e.message; const errorMsg = e.info?.() || e.message;
collectEvent(CollectEventName.PUBLISH_OPEN_JOB_FAILED, { jobId: data.id, error: e.info?.() || e.message }); collectEvent(CollectEventName.PUBLISH_OPEN_JOB_FAILED, { jobId: data.id, error: e.info?.() || e.message });
if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_BALANCE) { if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_FREE_BALANCE) {
setShowBuy(true);
} else if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_BALANCE) {
Toast.info('您购买的产品已耗尽使用次数'); Toast.info('您购买的产品已耗尽使用次数');
setShowBuy(true); setShowBuy(true);
} else if (errorCode === RESPONSE_ERROR_CODE.BOSS_VIP_EXPIRED) { } else if (errorCode === RESPONSE_ERROR_CODE.BOSS_VIP_EXPIRED) {

View File

@ -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';

View File

@ -26,7 +26,7 @@ export default function Partner() {
return getCommonShareMessage({ return getCommonShareMessage({
useCapture: false, useCapture: false,
inviteCode, inviteCode,
title: '宝子,送你个播络会员,找工作更方便', title: '宝子,送你个播络会员,免费找主播工作',
path: PageUrl.GiveVip, path: PageUrl.GiveVip,
params: { d: code }, params: { d: code },
imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-coupon1.png', imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-coupon1.png',

View File

@ -5,5 +5,7 @@ import Toast from '@/utils/toast';
import './index.less'; import './index.less';
export default function ProtocolWebview() { export default function ProtocolWebview() {
return <WebView src="https://neighbourhood.cn/user-agreement.html" onError={() => Toast.error('加载失败请重试')} />; return (
<WebView src="https://neighbourhood.cn/user-agreement.html?t=1" onError={() => Toast.error('加载失败请重试')} />
);
} }

View File

@ -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;
} }

View File

@ -62,6 +62,28 @@ export const getBasicInfo = (profile: Pick<MaterialProfile, 'age' | 'height' | '
return result.join('·'); return result.join('·');
}; };
export const getSalary = (
data: Pick<MaterialProfile, 'fullTimeMaxPrice' | 'fullTimeMinPrice' | 'partyTimeMaxPrice' | 'partyTimeMinPrice'>
) => {
const { fullTimeMinPrice, fullTimeMaxPrice, partyTimeMinPrice, partyTimeMaxPrice } = data;
const prices: string[] = [];
if (fullTimeMinPrice && fullTimeMaxPrice) {
if (fullTimeMinPrice >= 50000) {
prices.push(`${fullTimeMinPrice / 1000}K以上/月`);
} else {
prices.push(`${fullTimeMinPrice / 1000}-${fullTimeMaxPrice / 1000}K/月`);
}
}
if (partyTimeMinPrice && partyTimeMaxPrice) {
if (partyTimeMinPrice >= 500) {
prices.push(`500以上/小时`);
} else {
prices.push(`${partyTimeMinPrice}-${partyTimeMaxPrice}/小时`);
}
}
return prices.filter(Boolean).join(' ');
};
export const chooseMedia = async (option: Taro.chooseMedia.Option = {}) => { export const chooseMedia = async (option: Taro.chooseMedia.Option = {}) => {
try { try {
const result = await Taro.chooseMedia({ const result = await Taro.chooseMedia({