Compare commits
20 Commits
d0369bab36
...
feat/mater
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f866c51be | |||
| fe33d0493c | |||
| 87f8e1f7e2 | |||
| afa94e2c48 | |||
| b8b33841d4 | |||
| 828e9b7512 | |||
| 1d8a0d7a33 | |||
| 8c5fd1a86b | |||
| a4e03ae1bd | |||
| 8e42fef4f7 | |||
| 6f7e78896a | |||
| b9cd0a3e6d | |||
| c0d27a5ab2 | |||
| 6d76c82e96 | |||
| f2e7fd9d85 | |||
| 087e05a9a0 | |||
| aea8323d95 | |||
| 61686950bd | |||
| eea89263f2 | |||
| 285db3f445 |
@ -9,7 +9,7 @@ import { PageUrl } from '@/constants/app';
|
||||
import { MaterialViewSource, WORK_YEAR_LABELS } from '@/constants/material';
|
||||
import { AnchorInfo } from '@/types/material';
|
||||
import { calcDistance } from '@/utils/location';
|
||||
import { getBasicInfo } from '@/utils/material';
|
||||
import { getBasicInfo, getSalary } from '@/utils/material';
|
||||
import { navigateTo } from '@/utils/route';
|
||||
import { activeDate } from '@/utils/time';
|
||||
|
||||
@ -22,17 +22,6 @@ interface IProps {
|
||||
}
|
||||
|
||||
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) {
|
||||
const { data, jobId, validator } = props;
|
||||
|
||||
@ -5,34 +5,19 @@ import { isEqual } from 'lodash-es';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import PickerToolbar from '@/components/picker-toolbar';
|
||||
import {
|
||||
EmployType,
|
||||
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 { FULL_PRICE_OPTIONS, PART_PRICE_OPTIONS } from '@/constants/job';
|
||||
import { ALL_ANCHOR_READ_TYPES, ANCHOR_READ_TITLE_MAP, AnchorReadType } from '@/constants/material';
|
||||
import { IAnchorFilters } from '@/types/material';
|
||||
import { isUndefined } from '@/utils/common';
|
||||
|
||||
import './index.less';
|
||||
|
||||
type MoreFilter = Omit<IAnchorFilters, 'employType' | 'gender'>;
|
||||
interface IProps {
|
||||
value: IAnchorFilters;
|
||||
onConfirm: (newValue: IAnchorFilters) => void;
|
||||
value: MoreFilter;
|
||||
onConfirm: (newValue: MoreFilter) => void;
|
||||
}
|
||||
|
||||
const PREFIX = 'anchor-picker';
|
||||
const getDefaultGender = (value: IAnchorFilters) => value.gender;
|
||||
const getDefaultEmploy = (value: IAnchorFilters) => value.employType;
|
||||
const getDefaultReadType = (value: IAnchorFilters) => value.readType;
|
||||
const getDefaultCategory = (value: IAnchorFilters) => value.category || '';
|
||||
const getSalaryValue = (value: IAnchorFilters, full: boolean) => {
|
||||
@ -47,9 +32,7 @@ const getSalaryValue = (value: IAnchorFilters, full: boolean) => {
|
||||
|
||||
function AnchorPicker(props: IProps) {
|
||||
const { value, onConfirm } = props;
|
||||
const [gender, setGender] = useState<GenderType | undefined>(getDefaultGender(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 [partSalary, setPartSalary] = useState(getSalaryValue(value, false));
|
||||
const [category, setCategory] = useState(getDefaultCategory(value));
|
||||
@ -59,9 +42,7 @@ function AnchorPicker(props: IProps) {
|
||||
}, []);
|
||||
|
||||
const handleClickReset = useCallback(() => {
|
||||
setGender(undefined);
|
||||
setReadType(undefined);
|
||||
setEmployType(undefined);
|
||||
setFullSalary(null);
|
||||
setPartSalary(null);
|
||||
setCategory('');
|
||||
@ -83,10 +64,6 @@ function AnchorPicker(props: IProps) {
|
||||
|
||||
const handleClickConfirm = useCallback(() => {
|
||||
const filters: IAnchorFilters = {};
|
||||
if (!isUndefined(gender)) {
|
||||
filters.gender = gender === GenderType.All ? undefined : gender;
|
||||
}
|
||||
employType && (filters.employType = employType);
|
||||
readType && (filters.readType = readType);
|
||||
category && (filters.category = category);
|
||||
if (fullSalary) {
|
||||
@ -98,34 +75,10 @@ function AnchorPicker(props: IProps) {
|
||||
filters.highPriceForPartyTime = partSalary.maxSalary;
|
||||
}
|
||||
onConfirm(filters);
|
||||
}, [gender, employType, readType, category, fullSalary, partSalary, onConfirm]);
|
||||
}, [readType, category, fullSalary, partSalary, onConfirm]);
|
||||
|
||||
return (
|
||||
<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}__container`}>
|
||||
{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;
|
||||
@ -11,7 +11,7 @@ import { EMPLOY_TYPE_TITLE_MAP, EmployType } from '@/constants/job';
|
||||
import { JobInfo } from '@/types/job';
|
||||
// import { LocationInfo } from '@/types/location';
|
||||
import { getJobSalary, getJobTitle } from '@/utils/job';
|
||||
// import { calcDistance } from '@/utils/location';
|
||||
import { calcDistance } from '@/utils/location';
|
||||
import { navigateTo, redirectTo } from '@/utils/route';
|
||||
|
||||
import './index.less';
|
||||
@ -45,7 +45,7 @@ function JobCard(props: IProps) {
|
||||
publisher,
|
||||
publisherAvatar,
|
||||
jobLocation,
|
||||
// distance,
|
||||
distance,
|
||||
isAuthed = false,
|
||||
} = data;
|
||||
|
||||
@ -84,12 +84,12 @@ function JobCard(props: IProps) {
|
||||
<div className={`${PREFIX}__summary`}>{jobDescription || sourceText}</div>
|
||||
<div className={`${PREFIX}__distance-wrapper`}>
|
||||
<div className={`${PREFIX}__detailed-address`}>{jobLocation?.address}</div>
|
||||
{/*{distance && (*/}
|
||||
{/* <>*/}
|
||||
{/* <Image className={`${PREFIX}__distance-icon`} src={require('@/statics/svg/location.svg')} />*/}
|
||||
{/* <div className={`${PREFIX}__distance`}>{calcDistance(distance)}</div>*/}
|
||||
{/* </>*/}
|
||||
{/*)}*/}
|
||||
{distance && (
|
||||
<>
|
||||
<Image className={`${PREFIX}__distance-icon`} src={require('@/statics/svg/location.svg')} />
|
||||
<div className={`${PREFIX}__distance`}>{calcDistance(distance)}</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__divider`} />
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
.material-card {
|
||||
padding: 32px 24px;
|
||||
border-radius: 16px;
|
||||
background: #FFFFFF;
|
||||
background: #ffffff;
|
||||
box-sizing: border-box;
|
||||
|
||||
&__header {
|
||||
@ -16,6 +16,10 @@
|
||||
.flex-row();
|
||||
}
|
||||
|
||||
&__right {
|
||||
color: @blHighlightColor;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 32px;
|
||||
line-height: 40px;
|
||||
@ -50,7 +54,7 @@
|
||||
|
||||
&__body {
|
||||
width: 100%;
|
||||
height: 156px;
|
||||
height: 160px;
|
||||
margin-top: 24px;
|
||||
.flex-column();
|
||||
justify-content: center;
|
||||
@ -80,38 +84,44 @@
|
||||
}
|
||||
}
|
||||
|
||||
&__scroll-view {
|
||||
position: relative;
|
||||
&__info {
|
||||
.flex-row();
|
||||
gap: 24px;
|
||||
width: 100%;
|
||||
|
||||
&-left {
|
||||
width: 125px;
|
||||
height: 160px;
|
||||
}
|
||||
&-cover {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.flex-row();
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
border-radius: 12px;
|
||||
}
|
||||
&-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;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
import { Image, ScrollView } from '@tarojs/components';
|
||||
import { Image } from '@tarojs/components';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
import { Loading } from '@taroify/core';
|
||||
@ -9,11 +9,12 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import LoginButton from '@/components/login-button';
|
||||
import { EventName, PageUrl } from '@/constants/app';
|
||||
import { CollectEventName, ReportEventId } from '@/constants/event';
|
||||
import { WORK_YEAR_LABELS } from '@/constants/material';
|
||||
import useUserInfo from '@/hooks/use-user-info';
|
||||
import { MaterialProfile } from '@/types/material';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
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 Toast from '@/utils/toast';
|
||||
import { isValidUserInfo } from '@/utils/user';
|
||||
@ -34,8 +35,9 @@ function MaterialCard(props: IProps) {
|
||||
const userInfo = useUserInfo();
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [profile, setProfile] = useState<MaterialProfile | null>(null);
|
||||
const refreshRef = useRef((_f?: boolean) => { });
|
||||
const refreshRef = useRef((_f?: boolean) => {});
|
||||
const hasMaterial = !!profile;
|
||||
const firstCover = sortVideos(profile?.materialVideoInfoList || [])[0];
|
||||
|
||||
const handleGoCreateProfile = useCallback(() => {
|
||||
reportEvent(ReportEventId.CLICK_GO_TO_CREATE_MATERIAL);
|
||||
@ -44,7 +46,7 @@ function MaterialCard(props: IProps) {
|
||||
|
||||
const handleGoProfile = useCallback(() => {
|
||||
if (!hasMaterial) {
|
||||
realtimeLogger.info('handleGoProfile noMaterial')
|
||||
realtimeLogger.info('handleGoProfile noMaterial');
|
||||
return;
|
||||
}
|
||||
navigateTo(PageUrl.MaterialProfile).catch(err => {
|
||||
@ -67,7 +69,7 @@ function MaterialCard(props: IProps) {
|
||||
try {
|
||||
const profileDetail = await requestProfileDetail();
|
||||
if (!profileDetail) {
|
||||
realtimeLogger.info('getProfileDetail no profileDetail')
|
||||
realtimeLogger.info('getProfileDetail no profileDetail');
|
||||
}
|
||||
setProfile(profileDetail);
|
||||
} catch (e) {
|
||||
@ -90,8 +92,10 @@ function MaterialCard(props: IProps) {
|
||||
refreshRef.current?.(true);
|
||||
};
|
||||
Taro.eventCenter.on(EventName.CREATE_PROFILE, callback);
|
||||
Taro.eventCenter.on(EventName.UPDATE_PROFILE, callback);
|
||||
return () => {
|
||||
Taro.eventCenter.off(EventName.CREATE_PROFILE, callback);
|
||||
Taro.eventCenter.on(EventName.UPDATE_PROFILE, callback);
|
||||
};
|
||||
}, [userInfo]);
|
||||
|
||||
@ -100,16 +104,11 @@ function MaterialCard(props: IProps) {
|
||||
<div className={`${PREFIX}__header`}>
|
||||
<div className={`${PREFIX}__header__left`}>
|
||||
<div className={`${PREFIX}__header__title`}>我的模卡</div>
|
||||
{/* {profile && (
|
||||
<div
|
||||
className={`${PREFIX}__header__progress`}
|
||||
>{`完成度${Math.min((profile.progressBar || 0) * 100, 100)}%`}</div>
|
||||
)} */}
|
||||
</div>
|
||||
{profile && (
|
||||
<div className={`${PREFIX}__header__right`}>
|
||||
{/* <div className={`${PREFIX}__header__status`}>{profile?.isOpen ? '开放中' : '关闭'}</div> */}
|
||||
<ArrowRight className={`${PREFIX}__header__icon`} />
|
||||
<div>去分享</div>
|
||||
<ArrowRight color="#6D3DF5" className={`${PREFIX}__header__icon`} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@ -123,18 +122,21 @@ function MaterialCard(props: IProps) {
|
||||
</div>
|
||||
)}
|
||||
{!loading && hasMaterial && (
|
||||
<ScrollView className={`${PREFIX}__scroll-view`} showScrollbar={false} enableFlex enhanced scrollX>
|
||||
<div className={`${PREFIX}__cover-list`}>
|
||||
{sortVideos(profile?.materialVideoInfoList || []).map(video => (
|
||||
<Image
|
||||
className={`${PREFIX}__cover-image`}
|
||||
mode="aspectFit"
|
||||
key={video.coverUrl}
|
||||
src={video.coverUrl}
|
||||
/>
|
||||
))}
|
||||
<div className={`${PREFIX}__info`}>
|
||||
{firstCover && (
|
||||
<div className={`${PREFIX}__info-left`}>
|
||||
<Image className={`${PREFIX}__info-cover`} mode="aspectFill" src={firstCover.coverUrl} />
|
||||
</div>
|
||||
)}
|
||||
<div className={`${PREFIX}__info-right`}>
|
||||
<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>
|
||||
</ScrollView>
|
||||
)}
|
||||
{loading && <Loading />}
|
||||
</div>
|
||||
|
||||
@ -61,7 +61,7 @@ export default function PartnerBanner() {
|
||||
<div className={`${PREFIX}__close`} onClick={handlePartnerBannerClose} />
|
||||
</div>
|
||||
{visible && (
|
||||
<LoginDialog disableCheck onCancel={() => setVisible(false)} onSuccess={handleBind} needPhone={needPhone} />
|
||||
<LoginDialog onCancel={() => setVisible(false)} onSuccess={handleBind} needPhone={needPhone} />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
import { Button, Canvas } from '@tarojs/components';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { openCustomerServiceChat } from '@/utils/common';
|
||||
import { getPartnerQrcode } from '@/utils/partner';
|
||||
import { getCouponQrCode, generateMembershipCoupon } from '@/utils/coupon';
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'partner-intro';
|
||||
|
||||
export default function PartnerIntro() {
|
||||
const [posterPath, setPosterPath] = useState('');
|
||||
const getQrcode = async () => {
|
||||
try {
|
||||
const data = await getPartnerQrcode(); // 假设 getPartnerQrcode 返回 ArrayBuffer
|
||||
const { code } = await generateMembershipCoupon();
|
||||
const data = await getCouponQrCode(code);
|
||||
const base64 = Taro.arrayBufferToBase64(data);
|
||||
return `data:image/png;base64,${base64}`;
|
||||
} catch (error) {
|
||||
@ -36,11 +36,9 @@ export default function PartnerIntro() {
|
||||
height: 2668, // 实际绘制高度
|
||||
destWidth: 750, // 目标显示宽度
|
||||
destHeight: 1334, // 目标显示高度
|
||||
fileType: 'jpg',
|
||||
fileType: 'png',
|
||||
});
|
||||
|
||||
setPosterPath(tempFilePath.tempFilePath);
|
||||
|
||||
resolve(tempFilePath.tempFilePath);
|
||||
});
|
||||
} catch (error) {
|
||||
@ -57,13 +55,13 @@ export default function PartnerIntro() {
|
||||
const canvas = res[0].node;
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
canvas.width = 550*2;
|
||||
canvas.height = 918*2;
|
||||
canvas.width = 550 * 2;
|
||||
canvas.height = 918 * 2;
|
||||
ctx.scale(2, 2);
|
||||
|
||||
// 绘制背景图片
|
||||
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.onload = () => {
|
||||
ctx.drawImage(bgImage, 0, 0, 550, 918);
|
||||
@ -71,7 +69,7 @@ export default function PartnerIntro() {
|
||||
const qrCodeImage = canvas.createImage();
|
||||
qrCodeImage.src = qrCode; // 假设 getQrcode() 返回的是二维码图片的路径
|
||||
qrCodeImage.onload = () => {
|
||||
ctx.drawImage(qrCodeImage, 196, 600, 160, 160); // 绘制二维码,位置和大小
|
||||
ctx.drawImage(qrCodeImage, 196, 600, 180, 160); // 绘制二维码,位置和大小
|
||||
saveCanvasToTempFile().then(tempPath => {
|
||||
resolve(tempPath);
|
||||
});
|
||||
@ -84,13 +82,10 @@ export default function PartnerIntro() {
|
||||
});
|
||||
};
|
||||
const savePoster = async () => {
|
||||
let filePath = posterPath;
|
||||
if (!filePath) {
|
||||
Taro.showLoading({ title: '正在生成海报' });
|
||||
const qrCode = await getQrcode();
|
||||
filePath = await drawCanvas(qrCode);
|
||||
const filePath = await drawCanvas(qrCode);
|
||||
Taro.hideLoading();
|
||||
}
|
||||
|
||||
const res = await Taro.getSetting();
|
||||
const hasPermission = res.authSetting['scope.writePhotosAlbum'];
|
||||
@ -144,7 +139,9 @@ export default function PartnerIntro() {
|
||||
<div className={`${PREFIX}__block`}>
|
||||
<div className={`${PREFIX}__title`}>分享方法</div>
|
||||
<div className={`${PREFIX}__card`}>
|
||||
<div className={`${PREFIX}__body`}>分享小程序任意页面到群、朋友圈、好友即可</div>
|
||||
<div className={`${PREFIX}__body`}>
|
||||
点击底部按钮向好友群友赠送会员,或者分享通告列表、通告详情等页面给朋友即可
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__block`}>
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 0 24px;
|
||||
flex: 0 0 96px;
|
||||
|
||||
&.selected {
|
||||
color: @blHighlightColor;
|
||||
|
||||
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;
|
||||
@ -36,7 +36,7 @@ interface CityOption extends ISelectOption<CityValue> {
|
||||
const PREFIX = 'user-batch-publish';
|
||||
const log = logWithPrefix(PREFIX);
|
||||
const SERVICE_ILLUSTRATE = `服务方式:帮您把招聘需求发到众多同城合作主播群
|
||||
群发次数:每日1次,连发3天
|
||||
群发次数:杭州、广州发3次,其他城市1次
|
||||
内容要求:仅限带货主播招聘需求,其他不发
|
||||
主播联系:内容中留招聘方联系方式,主播直接联系`;
|
||||
const cityValues: CityValue[] = [
|
||||
|
||||
@ -7,6 +7,7 @@ export enum JobType {
|
||||
Jewelry = 'JEWELRY', // 珠宝
|
||||
Appliance = 'APPLIANCE', // 家电
|
||||
Furniture = 'FURNITURE', // 日用家具
|
||||
OutdoorSports = 'OUTDOOR_SPORTS',
|
||||
PetFamily = 'PET_FAMILY', // 母婴宠物
|
||||
Luxury = 'LUXURY', // 奢品
|
||||
LocalLive = 'LOCAL_LIVE', // 本地生活
|
||||
@ -87,6 +88,7 @@ export const JOB_TYPE_TITLE_MAP: { [key in JobType]: string } = {
|
||||
[JobType.Jewelry]: '珠宝',
|
||||
[JobType.Appliance]: '家电',
|
||||
[JobType.Furniture]: '日用家具',
|
||||
[JobType.OutdoorSports]: '户外运动',
|
||||
[JobType.PetFamily]: '母婴宠物',
|
||||
[JobType.Luxury]: '奢品',
|
||||
[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.Appliance], value: JobType.Appliance },
|
||||
{ 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.Luxury], value: JobType.Luxury },
|
||||
{ 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 },
|
||||
];
|
||||
|
||||
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;
|
||||
export const PART_EMPLOY_SALARY_OPTIONS = [
|
||||
{ label: '不限' },
|
||||
|
||||
@ -84,14 +84,25 @@ export const WORK_YEAR_OPTIONS = [
|
||||
{ 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 = {
|
||||
[GenderType.All]: '不限',
|
||||
[GenderType.WOMEN]: '女',
|
||||
[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 ANCHOR_READ_TITLE_MAP = {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// export const DOMAIN = 'http://192.168.60.191:8082';
|
||||
// export const DOMAIN = 'http://192.168.60.116:8082';
|
||||
export const DOMAIN = process.env.BRAND === 'dev' ? 'https://dev.neighbourhood.cn' : 'https://neighbourhood.cn';
|
||||
// export const DOMAIN = 'https://dev.neighbourhood.cn';
|
||||
export const BASE_URL = `${DOMAIN}/api`;
|
||||
@ -85,4 +85,7 @@ export enum API {
|
||||
GET_PROFIT_STAT = '/user/profits',
|
||||
WITHDRAW = '/user/withdraw',
|
||||
GET_WITHDRAW_LIST = '/user/withdraw/records',
|
||||
GENERATE_MEMBERSHIP_COUPON = '/coupon/membership/generate',
|
||||
CLAIM_MEMBERSHIP_COUPON = '/coupon/membership/claim',
|
||||
GET_VIP_QRCODE = '/user/getVipQrCode',
|
||||
}
|
||||
|
||||
@ -52,7 +52,11 @@
|
||||
font-size: 28px;
|
||||
line-height: 32px;
|
||||
color: @blColor;
|
||||
gap: 20px;
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
}
|
||||
.title {
|
||||
margin-right: 5px;
|
||||
}
|
||||
@ -61,11 +65,17 @@
|
||||
padding: 0 24px;
|
||||
}
|
||||
&__overlay-outer {
|
||||
top: 82px;
|
||||
top: 72px;
|
||||
}
|
||||
|
||||
&__overlay-inner {
|
||||
width: 100%;
|
||||
max-height: 100%;
|
||||
overflow: hidden;
|
||||
.bl-select__items-container {
|
||||
max-height: calc(100vh - 610rpx);
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&__tips-container {
|
||||
@ -91,8 +101,6 @@
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
&__popup {
|
||||
&-content {
|
||||
.flex-column();
|
||||
|
||||
@ -5,11 +5,13 @@ import { Popup } from '@taroify/core';
|
||||
import { ArrowDown, ArrowUp } from '@taroify/icons';
|
||||
import classNames from 'classnames';
|
||||
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 AnchorPicker from '@/components/anchor-picker';
|
||||
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 Overlay from '@/components/overlay';
|
||||
import PageLoading from '@/components/page-loading';
|
||||
@ -17,8 +19,14 @@ import PartnerBanner from '@/components/partner-banner';
|
||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||
import SwitchBar from '@/components/switch-bar';
|
||||
import { APP_TAB_BAR_ID, EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
||||
import { EmployType } from '@/constants/job';
|
||||
import { ALL_ANCHOR_SORT_TYPES, ANCHOR_SORT_TYPE_TITLE_MAP, AnchorSortType } from '@/constants/material';
|
||||
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,
|
||||
GENDER_TYPE_TITLE_MAP,
|
||||
GenderType,
|
||||
} from '@/constants/material';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||
import useLocation from '@/hooks/use-location';
|
||||
@ -36,6 +44,7 @@ import { getCommonShareMessage } from '@/utils/share';
|
||||
import Toast from '@/utils/toast';
|
||||
|
||||
import './index.less';
|
||||
import TopCategorySelect from '@/components/top-category-select';
|
||||
|
||||
const PREFIX = 'page-anchor';
|
||||
const LIST_CONTAINER_CLASS = `${PREFIX}__list-container`;
|
||||
@ -78,12 +87,22 @@ function ListWrapper(props: IAnchorListProps) {
|
||||
return <AnchorList listHeight={listHeight} {...props} onListEmpty={handleListEmpty} />;
|
||||
}
|
||||
|
||||
enum FilterType {
|
||||
gender,
|
||||
employType,
|
||||
topCategory,
|
||||
more,
|
||||
}
|
||||
|
||||
export default function AnchorPage() {
|
||||
const location = useLocation();
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [selectJob, setSelectJob] = useState<JobManageInfo | undefined>();
|
||||
const [filters, setFilters] = useState<IAnchorFilters>({ employType: EmployType.All });
|
||||
const [showFilter, setShowFilter] = useState<boolean>(false);
|
||||
const [moreFilters, setMoreFilters] = useState<IAnchorFilters>({});
|
||||
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 [openPopup, setOpenPopup] = useState<boolean>(false);
|
||||
const [coordinate, setCoordinate] = useState<Coordinate>({
|
||||
@ -106,20 +125,35 @@ export default function AnchorPage() {
|
||||
[selectJob]
|
||||
);
|
||||
|
||||
const handleClickSalarySelect = useCallback(() => {
|
||||
setShowFilter(!showFilter);
|
||||
}, [showFilter]);
|
||||
const handleClickFilterSelect = (type: FilterType) => () => {
|
||||
setShowFilter(type === showFilter ? null : type);
|
||||
};
|
||||
|
||||
const handleHideFilter = useCallback(() => setShowFilter(false), []);
|
||||
const handleHideFilter = useCallback(() => setShowFilter(null), []);
|
||||
|
||||
const handleFilterChange = useCallback(
|
||||
(newFilters: IAnchorFilters) => {
|
||||
!isEqual(newFilters, filters) && setFilters(newFilters);
|
||||
setShowFilter(false);
|
||||
!isEqual(newFilters, moreFilters) && setMoreFilters(newFilters);
|
||||
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 handleJobChange = useCallback(
|
||||
@ -205,6 +239,15 @@ export default function AnchorPage() {
|
||||
|
||||
useDidShow(() => requestUnreadMessageCount());
|
||||
|
||||
const filters = useMemo(
|
||||
() => ({
|
||||
...moreFilters,
|
||||
topCategory: topCategory === JobType.All ? undefined : topCategory,
|
||||
gender: gender === -1 ? undefined : gender,
|
||||
employType,
|
||||
}),
|
||||
[moreFilters, gender, employType, topCategory]
|
||||
);
|
||||
return (
|
||||
<HomePage type={PageType.Anchor}>
|
||||
{!!loading && <PageLoading className={`${PREFIX}__loading`} />}
|
||||
@ -224,9 +267,23 @@ export default function AnchorPage() {
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className={classNames(`${PREFIX}__filter`)} onClick={handleClickSalarySelect}>
|
||||
<div className="title">筛选</div>
|
||||
{showFilter ? <ArrowUp /> : <ArrowDown />}
|
||||
<div className={classNames(`${PREFIX}__filter`)}>
|
||||
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.gender)}>
|
||||
<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 className={`${PREFIX}__banner`}>
|
||||
@ -243,12 +300,36 @@ export default function AnchorPage() {
|
||||
className={LIST_CONTAINER_CLASS}
|
||||
/>
|
||||
<Overlay
|
||||
visible={showFilter}
|
||||
visible={showFilter === FilterType.gender}
|
||||
onClickOuter={handleHideFilter}
|
||||
outerClassName={`${PREFIX}__overlay-outer`}
|
||||
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>
|
||||
</div>
|
||||
<Popup
|
||||
|
||||
@ -1,27 +1,54 @@
|
||||
import { Image, Button } from '@tarojs/components';
|
||||
import { useLoad } from '@tarojs/taro';
|
||||
|
||||
import { Fragment, useCallback } from 'react';
|
||||
import { Fragment, useCallback, useState } from 'react';
|
||||
|
||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||
import { PageUrl } from '@/constants/app';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
import { switchTab } from '@/utils/route';
|
||||
|
||||
import { claimMembershipCoupon, getCouponCodeFromQuery } from '@/utils/coupon';
|
||||
import { getPageQuery, switchTab } from '@/utils/route';
|
||||
import { formatTime } from '@/utils/time';
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'give-vip';
|
||||
const log = logWithPrefix(PREFIX);
|
||||
|
||||
enum State {
|
||||
PENDING,
|
||||
SUCCESS,
|
||||
FAILED,
|
||||
}
|
||||
export default function GiveVip() {
|
||||
const [state, setState] = useState<State>(State.PENDING);
|
||||
const [expireAt, setExpireAt] = useState('');
|
||||
const [usedBefore, setUsedBefore] = useState(false);
|
||||
const handleNavigate = useCallback(() => {
|
||||
switchTab(PageUrl.Job);
|
||||
}, []);
|
||||
|
||||
useLoad(() => {
|
||||
const query = getPageQuery<{ d: string }>();
|
||||
const code = getCouponCodeFromQuery(query);
|
||||
claimMembershipCoupon(code!)
|
||||
.then(res => {
|
||||
setUsedBefore(res.usedBefore);
|
||||
setExpireAt(res.usageExpireAt);
|
||||
setState(Date.now() > new Date(res.usageExpireAt).getTime() ? State.FAILED : State.SUCCESS);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
setState(State.FAILED);
|
||||
});
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={PREFIX}>
|
||||
{state === State.SUCCESS && (
|
||||
<Fragment>
|
||||
<div className={`${PREFIX}__title`}>
|
||||
<Image src="https://publiccdn.neighbourhood.com.cn/img/partner-yes.svg" className={`${PREFIX}__icon`} />
|
||||
<div>宝子,播络会员领取成功</div>
|
||||
<div>{usedBefore ? '宝子,你已经领过了,下周再来' : '宝子,播络会员领取成功'}</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__coupon-info`}>
|
||||
<Image src="https://publiccdn.neighbourhood.com.cn/img/parnet-share-bg.png" className={`${PREFIX}__bg`} />
|
||||
@ -29,9 +56,13 @@ export default function GiveVip() {
|
||||
<div className={`${PREFIX}__coupon-intro`}>
|
||||
会员有效期内可增加<div className="highlight">10次</div>报单机会
|
||||
</div>
|
||||
<div className={`${PREFIX}__coupon-valid`}>有效期至:2025年/8/26 22:23:56</div>
|
||||
<div className={`${PREFIX}__coupon-valid`}>
|
||||
有效期至:{formatTime(expireAt, 'YYYY/MM/DD HH:mm:ss', false)}
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
{state === State.FAILED && (
|
||||
<Fragment>
|
||||
<div className={`${PREFIX}__hint`}>
|
||||
<Image
|
||||
@ -45,6 +76,7 @@ export default function GiveVip() {
|
||||
请联系分享人<div className="highlight">再次分享</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
<div className={`${PREFIX}__info-block`}>
|
||||
<div className={`${PREFIX}__info-title`}>播络简介</div>
|
||||
<div className={`${PREFIX}__info-card`}>
|
||||
|
||||
@ -200,7 +200,9 @@ const CompanyFooter = (props: { data: JobDetails }) => {
|
||||
const errorCode = e.errorCode;
|
||||
const errorMsg = 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('您购买的产品已耗尽使用次数');
|
||||
setShowBuy(true);
|
||||
} else if (errorCode === RESPONSE_ERROR_CODE.BOSS_VIP_EXPIRED) {
|
||||
|
||||
@ -56,7 +56,27 @@
|
||||
&__icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
&__block {
|
||||
margin-top: 24px;
|
||||
.flex-row();
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
&__status {
|
||||
font-size: 28px;
|
||||
line-height: 32px;
|
||||
font-weight: 400;
|
||||
color: @blColorG1;
|
||||
|
||||
&.open {
|
||||
color: @blHighlightColor;
|
||||
}
|
||||
|
||||
&.error {
|
||||
color: #FF5051;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,7 @@ import classNames from 'classnames';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { EventName, OpenSource } from '@/constants/app';
|
||||
import { JOB_MANAGE_STATUS_TITLE_MAP, JobManageStatus } from '@/constants/job';
|
||||
import { JobManageInfo } from '@/types/job';
|
||||
import { getJobLocation, requestJobManageList } from '@/utils/job';
|
||||
import { getPageQuery, navigateBack } from '@/utils/route';
|
||||
@ -15,7 +16,14 @@ import Toast from '@/utils/toast';
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'page-job-select-my-publish';
|
||||
|
||||
const STATUS_CLASS_MAP = {
|
||||
[JobManageStatus.WaitVerify]: 'pending',
|
||||
[JobManageStatus.Open]: 'open',
|
||||
[JobManageStatus.Pending]: 'pending',
|
||||
[JobManageStatus.Error]: 'error',
|
||||
[JobManageStatus.Close]: 'close',
|
||||
[JobManageStatus.Expire]: 'close',
|
||||
};
|
||||
export default function JobSelectMyPublish() {
|
||||
const [list, setList] = useState<JobManageInfo[]>([]);
|
||||
const [jobId, setJobId] = useState<string | null>('1');
|
||||
@ -57,6 +65,10 @@ export default function JobSelectMyPublish() {
|
||||
</div>
|
||||
<div className={`${PREFIX}__right`}>
|
||||
<div className={`${PREFIX}__right__time`}>{formatTime(item.updated)}</div>
|
||||
<div className={`${PREFIX}__right__block`}>
|
||||
<div className={classNames(`${PREFIX}__right__status`, { [STATUS_CLASS_MAP[item.status]]: true })}>
|
||||
{JOB_MANAGE_STATUS_TITLE_MAP[item.status]}
|
||||
</div>
|
||||
{item.id === jobId && (
|
||||
<Image
|
||||
mode="aspectFit"
|
||||
@ -66,6 +78,7 @@ export default function JobSelectMyPublish() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</List>
|
||||
</div>
|
||||
|
||||
@ -9,13 +9,17 @@ import PageLoading from '@/components/page-loading';
|
||||
import CompanyPublishJobBuy from '@/components/product-dialog/steps-ui/company-publish-job-buy';
|
||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||
import { EventName, OpenSource, PageUrl, RoleType } from '@/constants/app';
|
||||
import { CertificationStatusType } from '@/constants/company';
|
||||
import { CollectEventName } from '@/constants/event';
|
||||
import { JobManageStatus } from '@/constants/job';
|
||||
import { MaterialViewSource } from '@/constants/material';
|
||||
import ProfileViewFragment from '@/fragments/profile/view';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import useUserInfo from '@/hooks/use-user-info';
|
||||
import { RESPONSE_ERROR_CODE } from '@/http/constant';
|
||||
import { HttpError } from '@/http/error';
|
||||
import store from '@/store';
|
||||
import { cacheJobId } from '@/store/actions';
|
||||
import { JobManageInfo } from '@/types/job';
|
||||
import { MaterialProfile } from '@/types/material';
|
||||
import { IJobMessage } from '@/types/message';
|
||||
@ -29,10 +33,6 @@ import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||
import { getPageQuery, navigateBack, navigateTo, redirectTo } from '@/utils/route';
|
||||
import Toast from '@/utils/toast';
|
||||
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';
|
||||
|
||||
|
||||
@ -6,7 +6,9 @@ import { useState } from 'react';
|
||||
import PartnerIntro from '@/components/partner-intro';
|
||||
import PartnerInviteList from '@/components/partner-invite-list';
|
||||
import PartnerProfit from '@/components/partner-profit';
|
||||
import { PageUrl } from '@/constants/app';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import { generateMembershipCoupon } from '@/utils/coupon';
|
||||
import { getCommonShareMessage } from '@/utils/share';
|
||||
import './index.less';
|
||||
|
||||
@ -18,13 +20,16 @@ export default function Partner() {
|
||||
const handleChange = v => {
|
||||
setTab(v);
|
||||
};
|
||||
useShareAppMessage(() => {
|
||||
useShareAppMessage(async () => {
|
||||
console.log('Partner inviteCode', inviteCode);
|
||||
const { code } = await generateMembershipCoupon();
|
||||
return getCommonShareMessage({
|
||||
useCapture: false,
|
||||
inviteCode,
|
||||
title: '宝子,送你个播络会员,找工作更方便',
|
||||
imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-coupon.png',
|
||||
title: '宝子,送你个播络会员,免费找主播工作',
|
||||
path: PageUrl.GiveVip,
|
||||
params: { d: code },
|
||||
imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-coupon1.png',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -5,5 +5,7 @@ import Toast from '@/utils/toast';
|
||||
import './index.less';
|
||||
|
||||
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('加载失败请重试')} />
|
||||
);
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ export default function BizService() {
|
||||
<div className={`${PREFIX}__delegate-h5`}>服务说明</div>
|
||||
<div className={`${PREFIX}__delegate-card`}>
|
||||
<div className={`${PREFIX}__delegate-body`}>服务方式:帮您把招聘需求发到众多同城合作主播群</div>
|
||||
<div className={`${PREFIX}__delegate-body`}>群发次数:每日1次,连发3天</div>
|
||||
<div className={`${PREFIX}__delegate-body`}>群发次数:杭州、广州发3次,其他城市1次</div>
|
||||
<div className={`${PREFIX}__delegate-body`}>内容要求:仅限带货主播招聘需求,其他不发</div>
|
||||
<div className={`${PREFIX}__delegate-body`}>主播联系:内容中留招聘方联系方式,主播直接联系</div>
|
||||
</div>
|
||||
|
||||
11
src/types/coupon.ts
Normal file
11
src/types/coupon.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export type ClaimMembershipCouponResponse = {
|
||||
code: string;
|
||||
usedBefore: boolean;
|
||||
usageExpireAt: string;
|
||||
};
|
||||
|
||||
export type GenerateMembershipCouponResponse = {
|
||||
code: string;
|
||||
linkExpireAt: string;
|
||||
shareUrl: string;
|
||||
};
|
||||
@ -101,6 +101,7 @@ export interface IAnchorFilters {
|
||||
lowPriceForPartyTime?: number;
|
||||
highPriceForPartyTime?: number;
|
||||
category?: string;
|
||||
topCategory?: string;
|
||||
readType?: AnchorReadType;
|
||||
}
|
||||
|
||||
|
||||
31
src/utils/coupon.ts
Normal file
31
src/utils/coupon.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import http from '@/http';
|
||||
import { API } from '@/http/api';
|
||||
import { ClaimMembershipCouponResponse, GenerateMembershipCouponResponse } from '@/types/coupon';
|
||||
|
||||
export const generateMembershipCoupon = async () => {
|
||||
return await http.post<GenerateMembershipCouponResponse>(API.GENERATE_MEMBERSHIP_COUPON);
|
||||
};
|
||||
export const claimMembershipCoupon = async (code: string) => {
|
||||
return await http.post<ClaimMembershipCouponResponse>(API.CLAIM_MEMBERSHIP_COUPON, {
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
data: { code },
|
||||
});
|
||||
};
|
||||
export const getCouponQrCode = async (code: string) => {
|
||||
return await http.post(API.GET_VIP_QRCODE, {
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
responseType: 'arraybuffer',
|
||||
data: { code },
|
||||
});
|
||||
};
|
||||
export const getCouponCodeFromQuery = (query: Record<string, string>): string | undefined => {
|
||||
if (query) {
|
||||
if (query.scene) {
|
||||
return query.scene.replace('d%3D', '');
|
||||
}
|
||||
if (query.d) {
|
||||
return query.d;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
@ -62,6 +62,28 @@ export const getBasicInfo = (profile: Pick<MaterialProfile, 'age' | 'height' | '
|
||||
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 = {}) => {
|
||||
try {
|
||||
const result = await Taro.chooseMedia({
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export function formatTime(time: number | string, template = 'YYYY-MM-DD'): string {
|
||||
export function formatTime(time: number | string, template = 'YYYY-MM-DD', toNum = true): string {
|
||||
if (!time) {
|
||||
return '';
|
||||
}
|
||||
if (toNum) {
|
||||
time = Number(time);
|
||||
}
|
||||
return dayjs(time).format(template);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user