Compare commits
39 Commits
trunk
...
feat/vip_m
| Author | SHA1 | Date | |
|---|---|---|---|
| e5facdff6a | |||
| 6c1e1cfd2d | |||
| d4fb682852 | |||
| 587436058a | |||
| 4ed1d45873 | |||
| 6b084b2df2 | |||
| 288521ebd9 | |||
| a07b015d8e | |||
| 3533a0a877 | |||
| 966c0782fc | |||
| 1165e027a7 | |||
| 4d146fb1e4 | |||
| 5e3e6903cb | |||
| fde2027588 | |||
| a179654898 | |||
| bc141fcf1b | |||
| 3d2b121b92 | |||
| 7ba04b27ff | |||
| 7f866c51be | |||
| fe33d0493c | |||
| 87f8e1f7e2 | |||
| afa94e2c48 | |||
| b8b33841d4 | |||
| 828e9b7512 | |||
| 1d8a0d7a33 | |||
| 8c5fd1a86b | |||
| a4e03ae1bd | |||
| 8e42fef4f7 | |||
| 6f7e78896a | |||
| b9cd0a3e6d | |||
| c0d27a5ab2 | |||
| 6d76c82e96 | |||
| 087e05a9a0 | |||
| aea8323d95 | |||
| 61686950bd | |||
| eea89263f2 | |||
| d0369bab36 | |||
| 898c6ab6ca | |||
| 670a389f12 |
900
pnpm-lock.yaml
generated
900
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -12,4 +12,9 @@ page {
|
|||||||
.taroify-tabs__wrap__scroll {
|
.taroify-tabs__wrap__scroll {
|
||||||
.base-bg();
|
.base-bg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Alimama ShuHeiTi';
|
||||||
|
src: url('https://publiccdn.neighbourhood.com.cn/font/almmheiti.ttf');
|
||||||
|
}
|
||||||
|
|||||||
32
src/app.tsx
32
src/app.tsx
@ -1,4 +1,4 @@
|
|||||||
import { useLaunch } from '@tarojs/taro';
|
import Taro, { useDidShow, useLaunch } from '@tarojs/taro';
|
||||||
|
|
||||||
import { PropsWithChildren } from 'react';
|
import { PropsWithChildren } from 'react';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
@ -6,8 +6,9 @@ import { Provider } from 'react-redux';
|
|||||||
import { REFRESH_UNREAD_COUNT_TIME } from '@/constants/message';
|
import { REFRESH_UNREAD_COUNT_TIME } from '@/constants/message';
|
||||||
import http from '@/http';
|
import http from '@/http';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
import { requestCityConfigs } from '@/utils/location';
|
||||||
import { requestUnreadMessageCount } from '@/utils/message';
|
import { requestUnreadMessageCount } from '@/utils/message';
|
||||||
import { getInviteCode, getInviteCodeFromQuery } from '@/utils/partner';
|
import { decryptOpenGid, getInviteCode, getInviteCodeFromQuery } from '@/utils/partner';
|
||||||
import qiniuUpload from '@/utils/qiniu-upload';
|
import qiniuUpload from '@/utils/qiniu-upload';
|
||||||
import { requestUserInfo, updateLastLoginTime } from '@/utils/user';
|
import { requestUserInfo, updateLastLoginTime } from '@/utils/user';
|
||||||
|
|
||||||
@ -28,6 +29,33 @@ function App({ children }: PropsWithChildren<BL.Anything>) {
|
|||||||
setInterval(() => requestUnreadMessageCount(), REFRESH_UNREAD_COUNT_TIME);
|
setInterval(() => requestUnreadMessageCount(), REFRESH_UNREAD_COUNT_TIME);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useDidShow(options => {
|
||||||
|
requestCityConfigs();
|
||||||
|
|
||||||
|
console.log(options);
|
||||||
|
const inviteCode = getInviteCodeFromQuery(options?.query || {});
|
||||||
|
const authCode = options?.query?.authCode;
|
||||||
|
if (inviteCode || authCode) {
|
||||||
|
Taro.getGroupEnterInfo()
|
||||||
|
.then(info => {
|
||||||
|
decryptOpenGid({
|
||||||
|
inviteCode,
|
||||||
|
authCode,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-expect-error
|
||||||
|
iv: info.iv,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-expect-error
|
||||||
|
encryptedData: info.encryptedData,
|
||||||
|
});
|
||||||
|
console.log('getGroupEnterInfo', info);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log('没有解析到群', options?.scene);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return <Provider store={store}>{children}</Provider>;
|
return <Provider store={store}>{children}</Provider>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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 => (
|
||||||
|
|||||||
@ -2,20 +2,36 @@
|
|||||||
@import '@/styles/variables.less';
|
@import '@/styles/variables.less';
|
||||||
|
|
||||||
.profile-checkbox {
|
.profile-checkbox {
|
||||||
|
|
||||||
&__group {
|
&__group {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.flex-row();
|
.flex-row();
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__item {
|
&__item {
|
||||||
flex: 1;
|
flex: 0 1 auto;
|
||||||
height: 100%;
|
padding: 34px 36px;
|
||||||
}
|
line-height: 32px;
|
||||||
|
border-radius: 16px;
|
||||||
|
border: 2px solid #fff;
|
||||||
|
background: #fff;
|
||||||
|
margin-right: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
&.active {
|
||||||
|
background: rgba(109, 61, 245, 0.12);
|
||||||
|
border: 2px solid #6d3df5;
|
||||||
|
|
||||||
&__icon {
|
.taroify-checkbox__label {
|
||||||
width: 36px;
|
color: #6d3df5;
|
||||||
height: 36px;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.taroify-checkbox__label {
|
||||||
|
line-height: 32px;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,42 +1,44 @@
|
|||||||
import { Image } from '@tarojs/components';
|
|
||||||
|
|
||||||
import { Checkbox } from '@taroify/core';
|
import { Checkbox } from '@taroify/core';
|
||||||
import { CheckboxProps, CheckboxGroupProps } from '@taroify/core/checkbox';
|
import { CheckboxProps, CheckboxGroupProps } from '@taroify/core/checkbox';
|
||||||
|
import CheckboxGroupContext from '@taroify/core/checkbox/checkbox-group.context';
|
||||||
|
import { useContext } from 'react';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
interface IProps extends CheckboxProps {
|
interface IProps extends CheckboxProps {
|
||||||
text: string;
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IGroupProps extends CheckboxGroupProps {
|
||||||
value: BL.Anything[];
|
value: BL.Anything[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IGroupProps extends CheckboxGroupProps {}
|
|
||||||
|
|
||||||
const PREFIX = 'profile-checkbox';
|
const PREFIX = 'profile-checkbox';
|
||||||
|
|
||||||
export function BlCheckboxGroup(props: IGroupProps) {
|
export function BlCheckboxGroup({ value, onChange, children }: IGroupProps) {
|
||||||
return <Checkbox.Group className={`${PREFIX}__group`} direction="horizontal" {...props} />;
|
return (
|
||||||
|
<Checkbox.Group className={`${PREFIX}__group`} value={value} onChange={onChange}>
|
||||||
|
{children}
|
||||||
|
</Checkbox.Group>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function BlCheckbox(props: IProps) {
|
export function BlCheckbox(props: IProps) {
|
||||||
const { name, text, value } = props;
|
const { name, text } = props;
|
||||||
|
const { value: names = [], onChange: onNamesChange } = useContext(CheckboxGroupContext);
|
||||||
|
const checked = names.includes(name);
|
||||||
|
const handleClick = () => {
|
||||||
|
if (!name) return;
|
||||||
|
|
||||||
|
if (checked) {
|
||||||
|
onNamesChange?.(names.filter(aName => aName !== name));
|
||||||
|
} else {
|
||||||
|
onNamesChange?.([...names, name]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Checkbox
|
<Checkbox className={`${PREFIX}__item ${checked ? 'active' : ''}`} name={name} icon={null} onClick={handleClick}>
|
||||||
className={`${PREFIX}__item`}
|
|
||||||
name={name}
|
|
||||||
icon={
|
|
||||||
<Image
|
|
||||||
className={`${PREFIX}__icon`}
|
|
||||||
mode="aspectFit"
|
|
||||||
src={
|
|
||||||
value.includes(name)
|
|
||||||
? require('@/statics/svg/radio-checked.svg')
|
|
||||||
: require('@/statics/svg/radio-uncheck.svg')
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{text}
|
{text}
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
);
|
);
|
||||||
|
|||||||
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;
|
||||||
85
src/components/group-certification-list/index.less
Normal file
85
src/components/group-certification-list/index.less
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
@import '@/styles/common.less';
|
||||||
|
|
||||||
|
.group-certification-list {
|
||||||
|
min-height: calc(100vh - 98rpx);
|
||||||
|
&__banner {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24px;
|
||||||
|
height: 74px;
|
||||||
|
padding: 32px 32px 25px;
|
||||||
|
line-height: 36px;
|
||||||
|
color: #999999;
|
||||||
|
background: #F5F6FA;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 1;
|
||||||
|
top: 99px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
&__title {
|
||||||
|
height: 72px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 24px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 72px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: rgba(0, 0, 0, 0.5);
|
||||||
|
position: fixed;
|
||||||
|
top: 227rpx;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
&-border {
|
||||||
|
border-bottom: 1px solid #e6e7e8;
|
||||||
|
.flex-row();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-time {
|
||||||
|
padding: 0 8px;
|
||||||
|
flex: 0 0 120px;
|
||||||
|
width: 120px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-name {
|
||||||
|
text-align: right;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__pull-refresh {
|
||||||
|
margin-top: 204px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__item {
|
||||||
|
height: 100px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 24px 32px 0 32px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 28px;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
&-border {
|
||||||
|
border-bottom: 1px solid #e6e7e8;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
.flex-row();
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-time {
|
||||||
|
padding: 0 8px;
|
||||||
|
flex: 0 0 120px;
|
||||||
|
width: 120px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-name {
|
||||||
|
text-align: right;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
153
src/components/group-certification-list/index.tsx
Normal file
153
src/components/group-certification-list/index.tsx
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
import { List, PullRefresh } from '@taroify/core';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import ListPlaceholder from '@/components/list-placeholder';
|
||||||
|
import { AuthedGroupInfo } from '@/types/partner';
|
||||||
|
import { logWithPrefix } from '@/utils/common';
|
||||||
|
import { formatTimestamp, getAuthedGroupList as requestData } from '@/utils/partner';
|
||||||
|
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const PREFIX = 'group-certification-list';
|
||||||
|
const log = logWithPrefix(PREFIX);
|
||||||
|
|
||||||
|
const FIRST_PAGE = 0;
|
||||||
|
|
||||||
|
function GroupCertificationList(props: {
|
||||||
|
refreshDisabled?: boolean;
|
||||||
|
visible?: boolean;
|
||||||
|
listHeight?: number;
|
||||||
|
className?: string;
|
||||||
|
onListEmpty?: () => void;
|
||||||
|
}) {
|
||||||
|
const { className, listHeight, refreshDisabled, visible = true, onListEmpty } = props;
|
||||||
|
const [hasMore, setHasMore] = useState(false);
|
||||||
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
|
const [loadingMore, setLoadingMore] = useState(false);
|
||||||
|
const [loadMoreError, setLoadMoreError] = useState(false);
|
||||||
|
const [dataList, setDataList] = useState<AuthedGroupInfo[]>([]);
|
||||||
|
const currentPage = useRef<number>(FIRST_PAGE);
|
||||||
|
const onListEmptyRef = useRef(onListEmpty);
|
||||||
|
|
||||||
|
const handleRefresh = useCallback(async () => {
|
||||||
|
log('start pull refresh');
|
||||||
|
try {
|
||||||
|
setRefreshing(true);
|
||||||
|
setLoadMoreError(false);
|
||||||
|
const content = await requestData();
|
||||||
|
setDataList(content);
|
||||||
|
currentPage.current = 1;
|
||||||
|
// setHasMore(currentPage.current < totalPages);
|
||||||
|
!content.length && onListEmptyRef.current?.();
|
||||||
|
log('pull refresh success');
|
||||||
|
} catch (e) {
|
||||||
|
setDataList([]);
|
||||||
|
setHasMore(false);
|
||||||
|
setLoadMoreError(true);
|
||||||
|
currentPage.current = FIRST_PAGE;
|
||||||
|
log('pull refresh failed');
|
||||||
|
} finally {
|
||||||
|
setRefreshing(false);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleLoadMore = useCallback(async () => {
|
||||||
|
log('start load more', hasMore);
|
||||||
|
if (!hasMore) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setLoadMoreError(false);
|
||||||
|
setLoadingMore(true);
|
||||||
|
try {
|
||||||
|
const content = await requestData();
|
||||||
|
setDataList([...dataList, ...content]);
|
||||||
|
currentPage.current = currentPage.current + 1;
|
||||||
|
// setHasMore(currentPage.current < totalPages);
|
||||||
|
log('load more success');
|
||||||
|
} catch (e) {
|
||||||
|
setLoadMoreError(true);
|
||||||
|
log('load more failed');
|
||||||
|
} finally {
|
||||||
|
setLoadingMore(false);
|
||||||
|
}
|
||||||
|
}, [dataList, hasMore]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
onListEmptyRef.current = onListEmpty;
|
||||||
|
}, [onListEmpty]);
|
||||||
|
|
||||||
|
// 初始化数据&配置变更后刷新数据
|
||||||
|
useEffect(() => {
|
||||||
|
// 列表不可见时,先不做处理
|
||||||
|
if (!visible) {
|
||||||
|
log('visible changed, but is not visible, only clear list');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const refresh = async () => {
|
||||||
|
log('visible changed, start refresh list data');
|
||||||
|
try {
|
||||||
|
setDataList([]);
|
||||||
|
setLoadingMore(true);
|
||||||
|
setLoadMoreError(false);
|
||||||
|
const content = await requestData();
|
||||||
|
setDataList(content);
|
||||||
|
currentPage.current = 1;
|
||||||
|
// setHasMore(currentPage.current < totalPages);
|
||||||
|
!content.length && onListEmptyRef.current?.();
|
||||||
|
} catch (e) {
|
||||||
|
setDataList([]);
|
||||||
|
setHasMore(false);
|
||||||
|
setLoadMoreError(true);
|
||||||
|
} finally {
|
||||||
|
log('visible changed, refresh list data end');
|
||||||
|
setLoadingMore(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
refresh();
|
||||||
|
}, [visible]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<div className={`${PREFIX}__banner`}>
|
||||||
|
以下均为认证成功的群,没认证成功请先确认是否有拉运营进群,如果在,可以尝试重新分享小程序
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__title`}>
|
||||||
|
<div className={`${PREFIX}__title-border`}>
|
||||||
|
<div className={`${PREFIX}__title-time`}>认证日期</div>
|
||||||
|
<div className={`${PREFIX}__title-name`}>群名称</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<PullRefresh
|
||||||
|
className={classNames(`${PREFIX}__pull-refresh`, className)}
|
||||||
|
loading={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
disabled={refreshDisabled}
|
||||||
|
>
|
||||||
|
<List
|
||||||
|
hasMore={hasMore}
|
||||||
|
onLoad={handleLoadMore}
|
||||||
|
loading={loadingMore || refreshing}
|
||||||
|
disabled={loadMoreError || !visible}
|
||||||
|
fixedHeight={typeof listHeight !== 'undefined'}
|
||||||
|
style={listHeight ? { height: `${listHeight}px` } : undefined}
|
||||||
|
>
|
||||||
|
{dataList.map(item => (
|
||||||
|
<div className={`${PREFIX}__item`} key={item.openGid}>
|
||||||
|
<div className={`${PREFIX}__item-border`}>
|
||||||
|
<div className={`${PREFIX}__item-content`}>
|
||||||
|
<div className={`${PREFIX}__item-time`}>{formatTimestamp(item.authDate, true)}</div>
|
||||||
|
<div className={`${PREFIX}__item-name`}>{item.groupName}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
<ListPlaceholder hasMore={false} loadingMore={loadingMore} loadMoreError={loadMoreError} />
|
||||||
|
</List>
|
||||||
|
</PullRefresh>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default GroupCertificationList;
|
||||||
@ -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`} />
|
||||||
|
|||||||
@ -6,12 +6,12 @@
|
|||||||
height: 152px;
|
height: 152px;
|
||||||
.flex-row();
|
.flex-row();
|
||||||
padding: 24px 32px;
|
padding: 24px 32px;
|
||||||
background: #FFF;
|
background: #fff;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: "";
|
content: '';
|
||||||
height: 2px;
|
height: 2px;
|
||||||
background: #00000026;
|
background: #00000026;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -52,7 +52,11 @@
|
|||||||
|
|
||||||
&__status {
|
&__status {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.flex-row();
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-end;
|
||||||
|
gap: 24px;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@ -63,7 +67,27 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.error {
|
&.error {
|
||||||
color: #FF5051;
|
color: #ff5051;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
&__buy-tag {
|
||||||
|
padding: 8px;
|
||||||
|
background: rgba(255, 80, 81, 0.12);
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #ff5051;
|
||||||
|
.flex-row();
|
||||||
|
|
||||||
|
&-wrapper {
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
width: 13px;
|
||||||
|
height: 18px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
|
import { Image } from '@tarojs/components';
|
||||||
|
|
||||||
|
import { Arrow } from '@taroify/icons';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
|
|
||||||
|
import { cityValues } from '@/components/user-batch-publish';
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageUrl } from '@/constants/app';
|
||||||
import { JOB_MANAGE_STATUS_TITLE_MAP, JobManageStatus } from '@/constants/job';
|
import { JOB_MANAGE_STATUS_TITLE_MAP, JobManageStatus } from '@/constants/job';
|
||||||
import { JobManageInfo } from '@/types/job';
|
import { JobManageInfo } from '@/types/job';
|
||||||
@ -25,6 +29,29 @@ const STATUS_CLASS_MAP = {
|
|||||||
[JobManageStatus.Expire]: 'close',
|
[JobManageStatus.Expire]: 'close',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function GoBatchTag({ cityCode, jobId }: { cityCode: string; jobId: JobManageInfo['id'] }) {
|
||||||
|
const handleClick = useCallback(
|
||||||
|
e => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
navigateTo(PageUrl.GroupDelegatePublish, { cityCode, jobId });
|
||||||
|
},
|
||||||
|
[cityCode, jobId]
|
||||||
|
);
|
||||||
|
if (!cityValues.find(c => c.cityCode === cityCode)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div onClick={handleClick} className={`${PREFIX}__buy-tag-wrapper`}>
|
||||||
|
<div className={`${PREFIX}__buy-tag`}>
|
||||||
|
<Image className={`${PREFIX}__buy-tag-icon`} src="https://publiccdn.neighbourhood.com.cn/img/lightning.svg" />
|
||||||
|
<div>加速招聘</div>
|
||||||
|
<Arrow size={12} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function JobManageCard(props: IProps) {
|
function JobManageCard(props: IProps) {
|
||||||
const { data = {} } = props;
|
const { data = {} } = props;
|
||||||
const { id, title, status } = data as JobManageInfo;
|
const { id, title, status } = data as JobManageInfo;
|
||||||
@ -41,6 +68,7 @@ function JobManageCard(props: IProps) {
|
|||||||
</div>
|
</div>
|
||||||
<div className={classNames(`${PREFIX}__status`, { [STATUS_CLASS_MAP[status]]: true })}>
|
<div className={classNames(`${PREFIX}__status`, { [STATUS_CLASS_MAP[status]]: true })}>
|
||||||
<div>{JOB_MANAGE_STATUS_TITLE_MAP[status]}</div>
|
<div>{JOB_MANAGE_STATUS_TITLE_MAP[status]}</div>
|
||||||
|
<GoBatchTag cityCode={props.data.cityCode} jobId={props.data.id} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -7,12 +7,11 @@ import { useCallback, useState } from 'react';
|
|||||||
import { RoleType } from '@/constants/app';
|
import { RoleType } from '@/constants/app';
|
||||||
import { CacheKey } from '@/constants/cache-key';
|
import { CacheKey } from '@/constants/cache-key';
|
||||||
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||||
import { GROUPS } from '@/constants/group';
|
import useCityOperators from '@/hooks/use-city-operators';
|
||||||
import { getRoleTypeWithDefault } from '@/utils/app';
|
import { getRoleTypeWithDefault } from '@/utils/app';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { getCurrentCityCode } from '@/utils/location';
|
import { getCurrentCityCode } from '@/utils/location';
|
||||||
import { checkCityCode, validCityCode } from '@/utils/user';
|
import { checkCityCode, validCityCode } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'join-group-hint';
|
const PREFIX = 'join-group-hint';
|
||||||
@ -25,13 +24,14 @@ const DEFAULT_GROUP = {
|
|||||||
export function JoinGroupHint() {
|
export function JoinGroupHint() {
|
||||||
const cityCode = getCurrentCityCode();
|
const cityCode = getCurrentCityCode();
|
||||||
const roleType = getRoleTypeWithDefault();
|
const roleType = getRoleTypeWithDefault();
|
||||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
const cityOperators = useCityOperators();
|
||||||
|
const group = cityOperators.find(g => String(g.cityCode) === cityCode);
|
||||||
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED));
|
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED));
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
if (group && !checkCityCode(cityCode)) {
|
if (group && !checkCityCode(cityCode)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
openCustomerServiceChat(group ? group.serviceUrl : DEFAULT_GROUP.serviceUrl);
|
openCustomerServiceChat(group ? group.groupLink : DEFAULT_GROUP.serviceUrl);
|
||||||
Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true);
|
Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true);
|
||||||
setClicked(true);
|
setClicked(true);
|
||||||
}, [cityCode, group]);
|
}, [cityCode, group]);
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { useCallback, useState } from 'react';
|
|||||||
import { AgreementPopup } from '@/components/agreement-popup';
|
import { AgreementPopup } from '@/components/agreement-popup';
|
||||||
import LoginDialog from '@/components/login-dialog';
|
import LoginDialog from '@/components/login-dialog';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import { getAgreementSigned, isNeedLogin, setAgreementSigned } from '@/utils/user';
|
import { getAgreementSigned, isNeedLogin, requestUserInfo, setAgreementSigned } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
@ -18,13 +18,14 @@ export enum BindPhoneStatus {
|
|||||||
|
|
||||||
export interface ILoginButtonProps extends ButtonProps {
|
export interface ILoginButtonProps extends ButtonProps {
|
||||||
needPhone?: boolean;
|
needPhone?: boolean;
|
||||||
|
needRefresh?: boolean;
|
||||||
needAssignment?: boolean;
|
needAssignment?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PREFIX = 'login-button';
|
const PREFIX = 'login-button';
|
||||||
|
|
||||||
function LoginButton(props: ILoginButtonProps) {
|
function LoginButton(props: ILoginButtonProps) {
|
||||||
const { className, children, needPhone, onClick, ...otherProps } = props;
|
const { className, children, needPhone, onClick, needRefresh, ...otherProps } = props;
|
||||||
const userInfo = useUserInfo();
|
const userInfo = useUserInfo();
|
||||||
const [loginVisible, setLoginVisible] = useState(false);
|
const [loginVisible, setLoginVisible] = useState(false);
|
||||||
const [assignVisible, setAssignVisible] = useState(false);
|
const [assignVisible, setAssignVisible] = useState(false);
|
||||||
@ -70,9 +71,12 @@ function LoginButton(props: ILoginButtonProps) {
|
|||||||
const handleLoginSuccess = useCallback(
|
const handleLoginSuccess = useCallback(
|
||||||
e => {
|
e => {
|
||||||
setLoginVisible(false);
|
setLoginVisible(false);
|
||||||
|
if (needRefresh) {
|
||||||
|
requestUserInfo();
|
||||||
|
}
|
||||||
onClick?.(e);
|
onClick?.(e);
|
||||||
},
|
},
|
||||||
[onClick]
|
[needRefresh, onClick]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export default function LoginDialog(props: IProps) {
|
|||||||
const { title = '使用播络服务前,请先登录', needPhone, onSuccess, onCancel, onBindPhone } = props;
|
const { title = '使用播络服务前,请先登录', needPhone, onSuccess, onCancel, onBindPhone } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open onClose={onCancel}>
|
<Dialog open onClose={onCancel} className={PREFIX}>
|
||||||
<Dialog.Content>
|
<Dialog.Content>
|
||||||
<div className={`${PREFIX}__container`}>
|
<div className={`${PREFIX}__container`}>
|
||||||
<div className={`${PREFIX}__title`}>{title}</div>
|
<div className={`${PREFIX}__title`}>{title}</div>
|
||||||
|
|||||||
@ -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%;
|
width: 100%;
|
||||||
height: 100%;
|
|
||||||
.flex-row();
|
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
&-left {
|
||||||
display: none;
|
width: 125px;
|
||||||
|
height: 160px;
|
||||||
}
|
}
|
||||||
|
&-cover {
|
||||||
&::after {
|
width: 100%;
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
width: 102px;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: linear-gradient(91.41deg, rgba(255, 255, 255, 0) 1.86%, #FFFFFF 99.47%);
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
&__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 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>
|
||||||
</ScrollView>
|
</div>
|
||||||
)}
|
)}
|
||||||
{loading && <Loading />}
|
{loading && <Loading />}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import './index.less';
|
|||||||
|
|
||||||
const PREFIX = 'partner-fragment-banner';
|
const PREFIX = 'partner-fragment-banner';
|
||||||
|
|
||||||
export default function PartnerBanner() {
|
export default function PartnerBanner({ isBoss = false }) {
|
||||||
const userInfo = useUserInfo();
|
const userInfo = useUserInfo();
|
||||||
const needPhone = isNeedPhone(userInfo);
|
const needPhone = isNeedPhone(userInfo);
|
||||||
const isPartner = userInfo.isPartner;
|
const isPartner = userInfo.isPartner;
|
||||||
@ -50,7 +50,11 @@ export default function PartnerBanner() {
|
|||||||
<div className={PREFIX} onClick={handleClick}>
|
<div className={PREFIX} onClick={handleClick}>
|
||||||
<Image
|
<Image
|
||||||
className={`${PREFIX}__image`}
|
className={`${PREFIX}__image`}
|
||||||
src="https://publiccdn.neighbourhood.com.cn/img/partner_banner.png"
|
src={
|
||||||
|
isBoss
|
||||||
|
? 'https://publiccdn.neighbourhood.com.cn/img/partner_banner.png'
|
||||||
|
: 'https://publiccdn.neighbourhood.com.cn/img/partner-banner-boss.png'
|
||||||
|
}
|
||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
/>
|
/>
|
||||||
{needPhone && (
|
{needPhone && (
|
||||||
@ -60,9 +64,7 @@ export default function PartnerBanner() {
|
|||||||
)}
|
)}
|
||||||
<div className={`${PREFIX}__close`} onClick={handlePartnerBannerClose} />
|
<div className={`${PREFIX}__close`} onClick={handlePartnerBannerClose} />
|
||||||
</div>
|
</div>
|
||||||
{visible && (
|
{visible && <LoginDialog onCancel={() => setVisible(false)} onSuccess={handleBind} needPhone={needPhone} />}
|
||||||
<LoginDialog disableCheck onCancel={() => setVisible(false)} onSuccess={handleBind} needPhone={needPhone} />
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,26 +2,53 @@
|
|||||||
@import '@/styles/common.less';
|
@import '@/styles/common.less';
|
||||||
|
|
||||||
.partner-intro {
|
.partner-intro {
|
||||||
padding-top: 112px;
|
background: #eae5fb;
|
||||||
padding-bottom: calc(112px + constant(safe-area-inset-bottom));
|
padding-top: 271px;
|
||||||
padding-bottom: calc(112px + env(safe-area-inset-bottom));
|
position: relative;
|
||||||
|
padding-bottom: calc(142px + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(142px + env(safe-area-inset-bottom));
|
||||||
|
|
||||||
&__banner {
|
&__bg {
|
||||||
background: fade(@blHighlightBg, 8);
|
width: 100%;
|
||||||
height: 88px;
|
height: 705px;
|
||||||
line-height: 88px;
|
position: absolute;
|
||||||
text-align: center;
|
top: 0;
|
||||||
font-size: 28px;
|
|
||||||
position: fixed;
|
|
||||||
top: 98px;
|
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
}
|
||||||
width: 100vw;
|
&__slogan {
|
||||||
|
top: 66px;
|
||||||
|
left: 44px;
|
||||||
|
position: absolute;
|
||||||
|
font-family: 'Alimama ShuHeiTi';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 44px;
|
||||||
|
line-height: 62px;
|
||||||
|
color: #333333;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-highlight {
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 12px;
|
||||||
|
padding-right: 9px;
|
||||||
|
font-size: 64px;
|
||||||
|
line-height: 62px;
|
||||||
|
background: linear-gradient(87.53deg, #683de3 0.4%, #39227d 84.55%);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-clip: text;
|
||||||
|
text-fill-color: transparent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__main {
|
&__main {
|
||||||
padding-left: 24px;
|
padding-left: 24px;
|
||||||
padding-right: 24px;
|
padding-right: 24px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__highlight {
|
&__highlight {
|
||||||
@ -34,14 +61,90 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__block {
|
&__block {
|
||||||
margin-bottom: 40px;
|
margin-bottom: 12px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__swiper {
|
||||||
|
&-wrapper {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24px;
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid #6d3df5;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__swiper-item {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 130px;
|
||||||
|
padding: 24px 32px;
|
||||||
|
&-top-line {
|
||||||
|
.flex-row();
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #333333;
|
||||||
|
font-weight: 400;
|
||||||
|
position: relative;
|
||||||
|
.noWrap();
|
||||||
|
}
|
||||||
|
&-id {
|
||||||
|
.id {
|
||||||
|
color: #999999;
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-time {
|
||||||
|
padding-right: 55px;
|
||||||
|
}
|
||||||
|
&-details {
|
||||||
|
margin-top: 5px;
|
||||||
|
.flex-row();
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
&-tag {
|
||||||
|
height: 36px;
|
||||||
|
margin-right: 16px;
|
||||||
|
padding: 0 12px;
|
||||||
|
border: 1px solid #6d3df5;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 36px;
|
||||||
|
color: #6d3df5;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
&-info {
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #333333;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 16px;
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.money {
|
||||||
|
color: #ff5051;
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&__card {
|
&__card {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 24px;
|
border-radius: 24px;
|
||||||
padding: 24px 32px;
|
padding: 68px 32px 44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__h1 {
|
&__h1 {
|
||||||
@ -51,33 +154,81 @@
|
|||||||
color: #1d2129;
|
color: #1d2129;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
margin-top: 32px;
|
margin-top: 32px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
|
|
||||||
|
&.no-dot {
|
||||||
|
&:after {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
background: #ffd236;
|
||||||
|
border-radius: 50%;
|
||||||
|
position: absolute;
|
||||||
|
left: -6px;
|
||||||
|
top: -3px;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__body {
|
&__body {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
|
color: @blColor;
|
||||||
|
|
||||||
&.grey {
|
&.grey {
|
||||||
color: @blColorG2
|
color: @blColorG2;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.center {
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__title {
|
&__title {
|
||||||
margin-bottom: 24px;
|
margin-left: 48px;
|
||||||
|
margin-right: 48px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
line-height: 32px;
|
line-height: 80px;
|
||||||
|
height: 80px;
|
||||||
|
transform: translateY(50%);
|
||||||
|
background: #ffd236;
|
||||||
|
box-shadow: 0px 12px 0px #ffa35d;
|
||||||
|
border-radius: 60px;
|
||||||
color: #1d2129;
|
color: #1d2129;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__recommend {
|
||||||
|
display: inline-flex;
|
||||||
|
line-height: 36px;
|
||||||
|
padding: 0 8px;
|
||||||
|
height: 36px;
|
||||||
|
background: rgb(255, 80, 81);
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #fff;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
gap: 6px;
|
||||||
|
right: -25px;
|
||||||
|
top: -18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__special {
|
&__special {
|
||||||
padding: 32px;
|
padding-top: 75px;
|
||||||
.flex-column();
|
.flex-column();
|
||||||
|
|
||||||
.partner-intro__body {
|
.partner-intro__body {
|
||||||
@ -100,6 +251,7 @@
|
|||||||
&__footer {
|
&__footer {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
z-index: 2;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 12px 32px;
|
padding: 12px 32px;
|
||||||
@ -112,17 +264,20 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__download-button {
|
&__download-button {
|
||||||
flex: 1 1;
|
//flex: 1 1;
|
||||||
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px; @highlight: 0);
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px; @highlight: 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
&__share-button {
|
&__share-button {
|
||||||
flex: 2 2;
|
//flex: 2 2;
|
||||||
|
flex: 0 0 406px;
|
||||||
|
width: 406px;
|
||||||
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px;);
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px;);
|
||||||
margin-left: 32px;
|
//margin-left: 32px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,174 +1,220 @@
|
|||||||
import { Button, Canvas } from '@tarojs/components';
|
import { Button, Canvas, Image } from '@tarojs/components';
|
||||||
import Taro from '@tarojs/taro';
|
|
||||||
|
|
||||||
import { useCallback, useState } from 'react';
|
import { Swiper } from '@taroify/core';
|
||||||
|
import { GoodJob } from '@taroify/icons';
|
||||||
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import LoginDialog from '@/components/login-dialog';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
|
import { EarnType, UserProfitListItem } from '@/types/partner';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { getPartnerQrcode } from '@/utils/partner';
|
import { becomePartner, formatMoney, formatTimestamp, formatUserId, getLastProfitList } from '@/utils/partner';
|
||||||
|
import { navigateTo } from '@/utils/route';
|
||||||
|
import { isNeedPhone, requestUserInfo } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'partner-intro';
|
const PREFIX = 'partner-intro';
|
||||||
|
|
||||||
export default function PartnerIntro() {
|
export default function PartnerIntro() {
|
||||||
const [posterPath, setPosterPath] = useState('');
|
const userInfo = useUserInfo();
|
||||||
const getQrcode = async () => {
|
const needPhone = isNeedPhone(userInfo);
|
||||||
try {
|
const [loginVisible, setLoginVisible] = useState(false);
|
||||||
const data = await getPartnerQrcode(); // 假设 getPartnerQrcode 返回 ArrayBuffer
|
|
||||||
const base64 = Taro.arrayBufferToBase64(data);
|
|
||||||
return `data:image/png;base64,${base64}`;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取二维码失败', error);
|
|
||||||
Taro.showToast({ title: '获取二维码失败', icon: 'none' });
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const saveCanvasToTempFile = (): Promise<string> => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
try {
|
|
||||||
const query = Taro.createSelectorQuery().select('#posterCanvas');
|
|
||||||
query.fields({ node: true }).exec(async res => {
|
|
||||||
const canvas = res[0].node;
|
|
||||||
const tempFilePath = await Taro.canvasToTempFilePath({
|
|
||||||
canvas,
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
width: 1500, // 实际绘制宽度
|
|
||||||
height: 2668, // 实际绘制高度
|
|
||||||
destWidth: 750, // 目标显示宽度
|
|
||||||
destHeight: 1334, // 目标显示高度
|
|
||||||
fileType: 'jpg',
|
|
||||||
});
|
|
||||||
|
|
||||||
setPosterPath(tempFilePath.tempFilePath);
|
|
||||||
|
|
||||||
resolve(tempFilePath.tempFilePath);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error('保存 Canvas 到临时文件失败', error);
|
|
||||||
Taro.showToast({ title: '保存 Canvas 失败', icon: 'none' });
|
|
||||||
reject(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const drawCanvas = (qrCode: string): Promise<string> => {
|
|
||||||
const query = Taro.createSelectorQuery().select('#posterCanvas');
|
|
||||||
return new Promise(resolve => {
|
|
||||||
query.fields({ node: true, size: true }).exec(async res => {
|
|
||||||
const canvas = res[0].node;
|
|
||||||
const ctx = canvas.getContext('2d');
|
|
||||||
|
|
||||||
canvas.width = 1500;
|
|
||||||
canvas.height = 2668;
|
|
||||||
ctx.scale(2, 2);
|
|
||||||
|
|
||||||
// 绘制背景图片
|
|
||||||
const bgImage = canvas.createImage();
|
|
||||||
const poster = 'https://publiccdn.neighbourhood.com.cn/img/poster.png'
|
|
||||||
bgImage.src = poster;
|
|
||||||
bgImage.onload = () => {
|
|
||||||
ctx.drawImage(bgImage, 0, 0, 750, 1334);
|
|
||||||
|
|
||||||
const qrCodeImage = canvas.createImage();
|
|
||||||
qrCodeImage.src = qrCode; // 假设 getQrcode() 返回的是二维码图片的路径
|
|
||||||
qrCodeImage.onload = () => {
|
|
||||||
ctx.drawImage(qrCodeImage, 235, 894, 280, 280); // 绘制二维码,位置和大小
|
|
||||||
saveCanvasToTempFile().then(tempPath => {
|
|
||||||
resolve(tempPath);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
bgImage.onerror = err => {
|
|
||||||
console.error(err);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const savePoster = async () => {
|
|
||||||
let filePath = posterPath;
|
|
||||||
if (!filePath) {
|
|
||||||
Taro.showLoading({ title: '正在生成海报' });
|
|
||||||
const qrCode = await getQrcode();
|
|
||||||
filePath = await drawCanvas(qrCode);
|
|
||||||
Taro.hideLoading();
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await Taro.getSetting();
|
|
||||||
const hasPermission = res.authSetting['scope.writePhotosAlbum'];
|
|
||||||
if (hasPermission === false) {
|
|
||||||
Taro.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '需要访问相册权限才能保存图片,请前往设置开启权限',
|
|
||||||
showCancel: false,
|
|
||||||
success() {
|
|
||||||
Taro.openSetting();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
await Taro.authorize({ scope: 'scope.writePhotosAlbum' });
|
|
||||||
await Taro.saveImageToPhotosAlbum({ filePath });
|
|
||||||
Taro.showToast({ title: '保存成功', icon: 'success' });
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
Taro.showToast({ title: '保存失败', icon: 'none' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleOpenService = useCallback(() => {
|
const handleOpenService = useCallback(() => {
|
||||||
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfc4fcf6b109b3771d7');
|
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfc4fcf6b109b3771d7');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleBindSuccess = useCallback(async () => {
|
||||||
|
await becomePartner();
|
||||||
|
await requestUserInfo();
|
||||||
|
setLoginVisible(false);
|
||||||
|
}, []);
|
||||||
|
const handleBecomePartner = useCallback(() => {
|
||||||
|
if (needPhone) {
|
||||||
|
setLoginVisible(true);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
handleBindSuccess();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}, [handleBindSuccess, needPhone]);
|
||||||
|
|
||||||
|
const handleConfirm = useCallback(() => {
|
||||||
|
if (!userInfo.isPartner && !handleBecomePartner()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
navigateTo(PageUrl.GroupOwnerCertificate);
|
||||||
|
}, [handleBecomePartner, userInfo.isPartner]);
|
||||||
|
|
||||||
|
const handleJump = useCallback(() => {
|
||||||
|
if (!userInfo.isPartner && !handleBecomePartner()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
navigateTo(PageUrl.PartnerShareVip);
|
||||||
|
}, [handleBecomePartner, userInfo.isPartner]);
|
||||||
|
|
||||||
|
const timerRef = useRef<NodeJS.Timeout | null>(null);
|
||||||
|
const [bannerList, setBannerList] = useState<UserProfitListItem[]>([]);
|
||||||
|
|
||||||
|
const getBannerList = useCallback(async () => {
|
||||||
|
if (timerRef.current) {
|
||||||
|
clearTimeout(timerRef.current);
|
||||||
|
timerRef.current = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const list = await getLastProfitList();
|
||||||
|
setBannerList(list);
|
||||||
|
|
||||||
|
timerRef.current = setTimeout(
|
||||||
|
() => {
|
||||||
|
getBannerList();
|
||||||
|
},
|
||||||
|
3000 * (list.length || 10)
|
||||||
|
);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getBannerList();
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
if (timerRef.current) {
|
||||||
|
clearTimeout(timerRef.current);
|
||||||
|
timerRef.current = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}, [getBannerList]);
|
||||||
|
|
||||||
|
const showedRef = useRef(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (showedRef.current || !userInfo.userId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showedRef.current = true;
|
||||||
|
if (!userInfo.isPartner) {
|
||||||
|
handleBecomePartner();
|
||||||
|
}
|
||||||
|
}, [userInfo]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<div className={`${PREFIX}__banner`}>
|
<Image
|
||||||
邀请朋友加入播络,高达<span className={`${PREFIX}__highlight`}>75%</span>分成
|
src="https://publiccdn.neighbourhood.com.cn/img/partner-intro-bg.png"
|
||||||
|
className={`${PREFIX}__bg`}
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<div className={`${PREFIX}__slogan`}>
|
||||||
|
<div>邀请朋友加入播络</div>
|
||||||
|
<div>
|
||||||
|
高达<div className={`${PREFIX}__slogan-highlight`}>75%</div>分成
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__main`}>
|
<div className={`${PREFIX}__main`}>
|
||||||
|
<div className={`${PREFIX}__swiper-wrapper`}>
|
||||||
|
<Image
|
||||||
|
className={`${PREFIX}__swiper-bg`}
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/partner-swipe-item.png"
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<Swiper className={`${PREFIX}__swiper`} autoplay={3000} touchable={false}>
|
||||||
|
{bannerList.map((item, index) => (
|
||||||
|
<Swiper.Item className={`${PREFIX}__swiper-item`} key={`${item.userId}-${index}`}>
|
||||||
|
<div className={`${PREFIX}__swiper-item-top-line`}>
|
||||||
|
<div className={`${PREFIX}__swiper-item-time`}>{formatTimestamp(item.updatedAt)}</div>
|
||||||
|
<div className={`${PREFIX}__swiper-item-id`}>
|
||||||
|
用户 <div className="id">{formatUserId(item.userId)}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__swiper-item-details`}>
|
||||||
|
<div>
|
||||||
|
<div className={`${PREFIX}__swiper-item-tag`}>分成收入</div>
|
||||||
|
<div className={`${PREFIX}__swiper-item-info`}>
|
||||||
|
{[EarnType.CHAT_ACTIVITY_SHARE_L1, EarnType.CHAT_ACTIVITY_SHARE_L2].includes(item.earnType)
|
||||||
|
? '主播被开聊'
|
||||||
|
: '会员支付'}
|
||||||
|
<div className="money">+{formatMoney(item.amount)}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__swiper-item-info`}>
|
||||||
|
累计<div className="money">{formatMoney(item.total)}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Swiper.Item>
|
||||||
|
))}
|
||||||
|
</Swiper>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className={`${PREFIX}__block`}>
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>
|
||||||
|
群主认证
|
||||||
|
<div className={`${PREFIX}__recommend`}>
|
||||||
|
<GoodJob />
|
||||||
|
强烈推荐
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__card ${PREFIX}__special`}>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div className="center">
|
||||||
|
完成群主认证后,群成员通过该群访问任何人分享的播络小程序进行注册,你都能获得分成
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Button className={`${PREFIX}__service`} onClick={handleConfirm}>
|
||||||
|
立即认证
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>3重收益</div>
|
||||||
<div className={`${PREFIX}__card`}>
|
<div className={`${PREFIX}__card`}>
|
||||||
<div className={`${PREFIX}__h1`}>收益一</div>
|
<div className={`${PREFIX}__h1`}>直接分成:</div>
|
||||||
<div className={`${PREFIX}__body`}>
|
<div className={`${PREFIX}__body`}>
|
||||||
直接获得被邀请人付款金额的<span className={`${PREFIX}__highlight`}>20%</span>
|
直接获得被邀请人付款金额的<span className={`${PREFIX}__highlight`}>20%</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__h1`}>收益二</div>
|
<div className={`${PREFIX}__h1`}>主播分成:</div>
|
||||||
<div className={`${PREFIX}__body`}>
|
<div className={`${PREFIX}__body`}>
|
||||||
邀请的主播创建模卡,被企业开聊,每日可获得收益,分成比例高达
|
邀请的主播创建模卡,被企业开聊,每日可获得收益,分成比例高达
|
||||||
<span className={`${PREFIX}__highlight`}>50%</span>
|
<span className={`${PREFIX}__highlight`}>50%</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__h1`}>收益三</div>
|
<div className={`${PREFIX}__h1`}>邀请合伙人:</div>
|
||||||
<div className={`${PREFIX}__body`}>
|
<div className={`${PREFIX}__body`}>
|
||||||
邀请朋友加入合伙人,可额外获得所邀合伙人收益的<span className={`${PREFIX}__highlight`}>5%</span>
|
你邀请的人也加入合伙人,你可获得所邀合伙人收益的<span className={`${PREFIX}__highlight`}>5%</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__block`}>
|
<div className={`${PREFIX}__block`}>
|
||||||
<div className={`${PREFIX}__title`}>分享方法</div>
|
<div className={`${PREFIX}__title`}>邀请方法</div>
|
||||||
<div className={`${PREFIX}__card`}>
|
<div className={`${PREFIX}__card`}>
|
||||||
<div className={`${PREFIX}__body`}>分享小程序任意页面到群、朋友圈、好友即可</div>
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div className={`${PREFIX}__h1`}>方法一:</div>
|
||||||
|
<div>点击下方“赠送会员给好友”,给群员、好友送会员,每周可以送一次</div>
|
||||||
|
<div className={`${PREFIX}__h1`}>方法二:</div>
|
||||||
|
<div>分享通告列表页、通告详情页等页面至群、好友</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__block`}>
|
<div className={`${PREFIX}__block`}>
|
||||||
<div className={`${PREFIX}__title`}>合伙人交流群</div>
|
<div className={`${PREFIX}__title`}>交流群</div>
|
||||||
<div className={`${PREFIX}__card ${PREFIX}__special`}>
|
<div className={`${PREFIX}__card ${PREFIX}__special`}>
|
||||||
<div className={`${PREFIX}__h1`}>加入播络合伙人交流群</div>
|
<div className={`${PREFIX}__h1 no-dot`}>加入播络合伙人交流群,分享经验</div>
|
||||||
<div className={`${PREFIX}__body grey`}>学习分享邀请经验,一起赚钱</div>
|
|
||||||
<Button className={`${PREFIX}__service`} onClick={handleOpenService}>
|
<Button className={`${PREFIX}__service`} onClick={handleOpenService}>
|
||||||
点击加入
|
点击加入
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__tip`}>注:收益不设时限,可重复享有,播络保留活动最终解释权</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Canvas id="posterCanvas" canvas-id="posterCanvas" type="2d" style="width: 750px; height: 1334px;" />
|
<Canvas id="posterCanvas" canvas-id="posterCanvas" type="2d" style="width: 750px; height: 1334px;" />
|
||||||
|
|
||||||
<div className={`${PREFIX}__footer`}>
|
<div className={`${PREFIX}__footer`}>
|
||||||
<Button className={`${PREFIX}__download-button`} onClick={savePoster}>
|
<Button className={`${PREFIX}__share-button`} onClick={handleJump}>
|
||||||
下载海报
|
赠送会员给好友
|
||||||
</Button>
|
|
||||||
<Button className={`${PREFIX}__share-button`} openType="share">
|
|
||||||
分享邀请
|
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{loginVisible && (
|
||||||
|
<LoginDialog onCancel={() => setLoginVisible(false)} onSuccess={handleBindSuccess} needPhone={needPhone} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,18 +1,20 @@
|
|||||||
import { Button, Image } from '@tarojs/components';
|
import { Button, Image } from '@tarojs/components';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
import { Popup, Dialog } from '@taroify/core';
|
import { Dialog, Popup } from '@taroify/core';
|
||||||
import { Fragment, useCallback, useState } from 'react';
|
import { Fragment, useCallback, useState } from 'react';
|
||||||
|
|
||||||
import JobBuy from '@/components/product-dialog/steps-ui/job-buy';
|
import JobBuy from '@/components/product-dialog/steps-ui/job-buy';
|
||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageUrl } from '@/constants/app';
|
||||||
|
import { CacheKey } from '@/constants/cache-key';
|
||||||
import { GET_CONTACT_TYPE } from '@/constants/job';
|
import { GET_CONTACT_TYPE } from '@/constants/job';
|
||||||
import { navigateTo } from '@/utils/route';
|
import { switchTab, navigateTo } from '@/utils/route';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
|
isCreateResume?: boolean;
|
||||||
onConfirm: (type: GET_CONTACT_TYPE) => void;
|
onConfirm: (type: GET_CONTACT_TYPE) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,14 +32,22 @@ const GET_CONTACT_TYPE_OPTIONS = [
|
|||||||
type: GET_CONTACT_TYPE.VIP,
|
type: GET_CONTACT_TYPE.VIP,
|
||||||
icon: 'https://publiccdn.neighbourhood.com.cn/img/diamond.svg',
|
icon: 'https://publiccdn.neighbourhood.com.cn/img/diamond.svg',
|
||||||
title: '播络会员',
|
title: '播络会员',
|
||||||
desc: '开通会员每天可查看10个',
|
desc: '开通会员每天免费查看',
|
||||||
btnText: '开通',
|
btnText: '开通',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: GET_CONTACT_TYPE.GROUP,
|
||||||
|
icon: 'https://publiccdn.neighbourhood.com.cn/img/group-avatar.png',
|
||||||
|
title: '进群领会员(免费报单)',
|
||||||
|
desc: '群内定期发放会员,免费报单',
|
||||||
|
btnText: '进群',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
export function PrejobPopup({ onCancel, isCreateResume, onConfirm }: IProps) {
|
||||||
const [openPopup, setOpenPopup] = useState(true);
|
const [openPopup, setOpenPopup] = useState(true);
|
||||||
const [openDialog, setOpenDialog] = useState(false);
|
const [openDialog, setOpenDialog] = useState(false);
|
||||||
|
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_POPUP_CLICKED));
|
||||||
const handleClick = (type: GET_CONTACT_TYPE) => () => {
|
const handleClick = (type: GET_CONTACT_TYPE) => () => {
|
||||||
if (type === GET_CONTACT_TYPE.MATERIAL) {
|
if (type === GET_CONTACT_TYPE.MATERIAL) {
|
||||||
navigateTo(PageUrl.MaterialUploadVideo);
|
navigateTo(PageUrl.MaterialUploadVideo);
|
||||||
@ -47,6 +57,12 @@ export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
|||||||
setOpenPopup(false);
|
setOpenPopup(false);
|
||||||
setOpenDialog(true);
|
setOpenDialog(true);
|
||||||
}
|
}
|
||||||
|
if (type === GET_CONTACT_TYPE.GROUP) {
|
||||||
|
Taro.setStorageSync(CacheKey.JOIN_GROUP_POPUP_CLICKED, true);
|
||||||
|
setClicked(true);
|
||||||
|
switchTab(PageUrl.GroupV2);
|
||||||
|
onConfirm(type);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const handleAfterBuy = useCallback(async () => {
|
const handleAfterBuy = useCallback(async () => {
|
||||||
onConfirm(GET_CONTACT_TYPE.VIP);
|
onConfirm(GET_CONTACT_TYPE.VIP);
|
||||||
@ -58,6 +74,9 @@ export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
|||||||
<div className={`${PREFIX}__title`}>以下方式任选其一均可获取联系方式</div>
|
<div className={`${PREFIX}__title`}>以下方式任选其一均可获取联系方式</div>
|
||||||
<div className={`${PREFIX}__body`}>
|
<div className={`${PREFIX}__body`}>
|
||||||
{GET_CONTACT_TYPE_OPTIONS.map(option => {
|
{GET_CONTACT_TYPE_OPTIONS.map(option => {
|
||||||
|
if (clicked && option.type === GET_CONTACT_TYPE.GROUP) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div className={`${PREFIX}__item`} key={option.type}>
|
<div className={`${PREFIX}__item`} key={option.type}>
|
||||||
<div className={`${PREFIX}__item-icon ${option.type}`}>
|
<div className={`${PREFIX}__item-icon ${option.type}`}>
|
||||||
@ -81,7 +100,7 @@ export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
|||||||
</Popup>
|
</Popup>
|
||||||
<Dialog open={openDialog} onClose={onCancel}>
|
<Dialog open={openDialog} onClose={onCancel}>
|
||||||
<Dialog.Content>
|
<Dialog.Content>
|
||||||
<JobBuy onConfirm={handleAfterBuy} buyOnly />
|
<JobBuy onConfirm={handleAfterBuy} isCreateResume={isCreateResume} />
|
||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|||||||
175
src/components/product-dialog/job-contact/index.tsx
Normal file
175
src/components/product-dialog/job-contact/index.tsx
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Dialog } from '@taroify/core';
|
||||||
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
import { DialogStatus, PREFIX } from '@/components/product-dialog/const';
|
||||||
|
import JobBuy from '@/components/product-dialog/steps-ui/job-buy';
|
||||||
|
import ContactCustomerService from '@/components/product-dialog/steps-ui/job-contact-customer';
|
||||||
|
import ContactDirect from '@/components/product-dialog/steps-ui/job-contact-direct';
|
||||||
|
import UnableUnlockContent from '@/components/product-dialog/steps-ui/job-unable';
|
||||||
|
import { DeclarationType, ProductType } from '@/constants/product';
|
||||||
|
import { JobDetails } from '@/types/job';
|
||||||
|
import { GetProductIsUnlockResponse, ProductInfo } from '@/types/product';
|
||||||
|
import { logWithPrefix } from '@/utils/common';
|
||||||
|
import { requestUseProduct } from '@/utils/product';
|
||||||
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
|
import '../index.less';
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
data: JobDetails;
|
||||||
|
/** Product use record from parent - if exists, user has already unlocked this job */
|
||||||
|
productRecord?: GetProductIsUnlockResponse | null;
|
||||||
|
/** Product balance info from parent */
|
||||||
|
productInfo?: ProductInfo;
|
||||||
|
/** Callback to refresh product balance in parent after purchase */
|
||||||
|
onRefreshBalance?: () => Promise<ProductInfo | undefined>;
|
||||||
|
onClose: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const PRODUCT_CODE = ProductType.VIP;
|
||||||
|
const log = logWithPrefix('product-job-contact-dialog');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Integrated dialog component for job contact flow
|
||||||
|
* Handles: balance check -> buy if needed -> use product -> show contact info
|
||||||
|
*
|
||||||
|
* @param productRecord - Pass from parent to avoid duplicate API calls
|
||||||
|
* @param productInfo - Pass from parent to avoid duplicate API calls
|
||||||
|
* @param onRefreshBalance - Callback to refresh balance in parent after purchase
|
||||||
|
*/
|
||||||
|
function ProductJobContactDialog(props: IProps) {
|
||||||
|
const { data, productRecord, productInfo, onRefreshBalance, onClose } = props;
|
||||||
|
const [status, setStatus] = useState<DialogStatus>(DialogStatus.LOADING);
|
||||||
|
const [publisherAcctNo, setPublisherAcctNo] = useState<string>('');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle contact display based on declaration type
|
||||||
|
*/
|
||||||
|
const showContactResult = useCallback((declarationTypeResult?: ProductInfo['declarationTypeResult']) => {
|
||||||
|
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
||||||
|
log('show JOB_CONTACT_DIRECT', declarationTypeResult.publisherAcctNo);
|
||||||
|
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
||||||
|
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
||||||
|
} else {
|
||||||
|
log('show JOB_CONTACT_CS');
|
||||||
|
setStatus(DialogStatus.JOB_CONTACT_CS);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use product and show contact info
|
||||||
|
*/
|
||||||
|
const consumeProductAndShowContact = useCallback(async () => {
|
||||||
|
const productResult = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||||
|
log('consumeProductAndShowContact result', productResult);
|
||||||
|
// Refresh balance in parent after consuming product
|
||||||
|
await onRefreshBalance?.();
|
||||||
|
showContactResult(productResult?.declarationTypeResult);
|
||||||
|
}, [data.id, showContactResult, onRefreshBalance]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback after successful purchase
|
||||||
|
* Refresh balance via parent callback and use product to show contact info
|
||||||
|
*/
|
||||||
|
const handleAfterBuy = useCallback(async () => {
|
||||||
|
log('handleAfterBuy - start');
|
||||||
|
try {
|
||||||
|
Taro.showLoading({ mask: true, title: '加载中...' });
|
||||||
|
|
||||||
|
// Refresh balance via parent callback
|
||||||
|
await onRefreshBalance?.();
|
||||||
|
|
||||||
|
// Use product and show contact info after purchase
|
||||||
|
await consumeProductAndShowContact();
|
||||||
|
} catch (e) {
|
||||||
|
log('handleAfterBuy error', e);
|
||||||
|
Toast.error('出错了,请重试');
|
||||||
|
onClose();
|
||||||
|
} finally {
|
||||||
|
Taro.hideLoading();
|
||||||
|
}
|
||||||
|
}, [consumeProductAndShowContact, onRefreshBalance, onClose]);
|
||||||
|
|
||||||
|
const handleReport = useCallback(() => {
|
||||||
|
log('report', data.id);
|
||||||
|
}, [data.id]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize dialog on mount
|
||||||
|
*/
|
||||||
|
useEffect(() => {
|
||||||
|
let isMounted = true;
|
||||||
|
|
||||||
|
const init = async () => {
|
||||||
|
try {
|
||||||
|
Taro.showLoading({ mask: true, title: '加载中...' });
|
||||||
|
|
||||||
|
log('init with productRecord', productRecord);
|
||||||
|
log('init with productInfo', productInfo);
|
||||||
|
|
||||||
|
// Step 1: Already unlocked - show contact directly
|
||||||
|
if (productRecord) {
|
||||||
|
log('show JOB_CONTACT_DIRECT from productRecord', productRecord.declarationTypeResult);
|
||||||
|
showContactResult(productRecord.declarationTypeResult);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 2: No productInfo - error state
|
||||||
|
if (!productInfo) {
|
||||||
|
log('no productInfo provided, closing');
|
||||||
|
Toast.error('出错了,请重试');
|
||||||
|
onClose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 3: Determine status based on balance
|
||||||
|
if (!productInfo.isPaidVip && !productInfo.freeBalance) {
|
||||||
|
log('show JOB_BUY');
|
||||||
|
if (isMounted) setStatus(DialogStatus.JOB_BUY);
|
||||||
|
} else if (!productInfo.balance) {
|
||||||
|
log('show JOB_UNABLE_UNLOCK');
|
||||||
|
if (isMounted) setStatus(DialogStatus.JOB_UNABLE_UNLOCK);
|
||||||
|
} else {
|
||||||
|
await consumeProductAndShowContact();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
log('init error', e);
|
||||||
|
Toast.error('出错了,请重试');
|
||||||
|
onClose();
|
||||||
|
} finally {
|
||||||
|
Taro.hideLoading();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
isMounted = false;
|
||||||
|
};
|
||||||
|
// Only run on mount - props are captured at dialog open time
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if (status === DialogStatus.LOADING) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dialog className={PREFIX} onClose={onClose} open>
|
||||||
|
<Dialog.Content>
|
||||||
|
{status === DialogStatus.JOB_CONTACT_CS && <ContactCustomerService onAfterConfirm={onClose} />}
|
||||||
|
{status === DialogStatus.JOB_CONTACT_DIRECT && (
|
||||||
|
<ContactDirect publisherAcctNo={publisherAcctNo} onAfterConfirm={onClose} onReport={handleReport} />
|
||||||
|
)}
|
||||||
|
{status === DialogStatus.JOB_BUY && (
|
||||||
|
<JobBuy onConfirm={handleAfterBuy} isCreateResume={productInfo?.isCreateResume} />
|
||||||
|
)}
|
||||||
|
{status === DialogStatus.JOB_UNABLE_UNLOCK && <UnableUnlockContent onConfirm={onClose} />}
|
||||||
|
</Dialog.Content>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ProductJobContactDialog;
|
||||||
@ -2,7 +2,7 @@ import Taro from '@tarojs/taro';
|
|||||||
|
|
||||||
import { Button } from '@taroify/core';
|
import { Button } from '@taroify/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { Fragment, useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import Badge from '@/components/badge';
|
import Badge from '@/components/badge';
|
||||||
import { PREFIX } from '@/components/product-dialog/const';
|
import { PREFIX } from '@/components/product-dialog/const';
|
||||||
@ -11,9 +11,17 @@ import { OrderStatus, OrderType, ProductSpecId, ProductType } from '@/constants/
|
|||||||
import { SubscribeTempId } from '@/constants/subscribe';
|
import { SubscribeTempId } from '@/constants/subscribe';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { collectEvent, reportEvent } from '@/utils/event';
|
import { collectEvent, reportEvent } from '@/utils/event';
|
||||||
import { getOrderPrice, isCancelPay, requestCreatePayInfo, requestOrderInfo, requestPayment } from '@/utils/product';
|
import {
|
||||||
|
getOrderPrice,
|
||||||
|
isCancelPay,
|
||||||
|
requestCreatePayInfo,
|
||||||
|
requestOrderInfo,
|
||||||
|
requestPayment,
|
||||||
|
requestProductTypeList,
|
||||||
|
} from '@/utils/product';
|
||||||
import { postSubscribe, subscribeMessage } from '@/utils/subscribe';
|
import { postSubscribe, subscribeMessage } from '@/utils/subscribe';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
import { ProductSpecResult } from '@/types/product';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
onNext: () => void;
|
onNext: () => void;
|
||||||
@ -48,8 +56,8 @@ const LIST: Item[] = [
|
|||||||
{
|
{
|
||||||
id: ProductSpecId.BOSS_VIP_NEW_2,
|
id: ProductSpecId.BOSS_VIP_NEW_2,
|
||||||
title: '推荐一月',
|
title: '推荐一月',
|
||||||
price: '480播豆',
|
price: '680播豆',
|
||||||
amt: 48,
|
amt: 68,
|
||||||
badge: '限时体验',
|
badge: '限时体验',
|
||||||
contents: [
|
contents: [
|
||||||
{ content: '-通告每日优先展示', highlight: true },
|
{ content: '-通告每日优先展示', highlight: true },
|
||||||
@ -61,8 +69,8 @@ const LIST: Item[] = [
|
|||||||
{
|
{
|
||||||
id: ProductSpecId.BOSS_VIP_NEW_3,
|
id: ProductSpecId.BOSS_VIP_NEW_3,
|
||||||
title: '推荐一季',
|
title: '推荐一季',
|
||||||
price: '960播豆',
|
price: '1360播豆',
|
||||||
amt: 96,
|
amt: 136,
|
||||||
badge: '6.7折',
|
badge: '6.7折',
|
||||||
contents: [
|
contents: [
|
||||||
{ content: '-通告每日优先展示', highlight: true },
|
{ content: '-通告每日优先展示', highlight: true },
|
||||||
@ -82,22 +90,35 @@ const subscribe = async () => {
|
|||||||
postSubscribe(TEMP_IDS, successIds);
|
postSubscribe(TEMP_IDS, successIds);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getJsonContent = (jsonString: string) => {
|
||||||
|
try {
|
||||||
|
return JSON.parse(jsonString);
|
||||||
|
} catch (e) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export default function CompanyPublishJobBuy(props: IProps) {
|
export default function CompanyPublishJobBuy(props: IProps) {
|
||||||
const { onNext } = props;
|
const { onNext } = props;
|
||||||
const [selectItem, setSelectItem] = useState(LIST[0]);
|
const [productList, setProductList] = useState<ProductSpecResult[]>([]);
|
||||||
|
const [selectItem, setSelectItem] = useState<ProductSpecResult | undefined>();
|
||||||
|
|
||||||
const handleClickItem = useCallback((newSelectItem: Item) => setSelectItem(newSelectItem), []);
|
const handleClickItem = useCallback((newSelectItem: ProductSpecResult) => setSelectItem(newSelectItem), []);
|
||||||
|
|
||||||
const handleBuy = useCallback(async () => {
|
const handleBuy = useCallback(async () => {
|
||||||
log('handleBuy');
|
log('handleBuy');
|
||||||
reportEvent(ReportEventId.CLICK_PAY_PUBLISH_JOB);
|
reportEvent(ReportEventId.CLICK_PAY_PUBLISH_JOB);
|
||||||
|
if (!selectItem) {
|
||||||
|
Toast.error('请选择购买的产品');
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Taro.showLoading();
|
Taro.showLoading();
|
||||||
const { payOrderNo, createPayInfo } = await requestCreatePayInfo({
|
const { payOrderNo, createPayInfo } = await requestCreatePayInfo({
|
||||||
type: OrderType.CompanyVip,
|
type: OrderType.CompanyVip,
|
||||||
amt: getOrderPrice(selectItem.amt),
|
amt: selectItem.payPrice,
|
||||||
productCode: ProductType.BOSS_VIP_NEW,
|
productCode: ProductType.BOSS_VIP_NEW,
|
||||||
productSpecId: selectItem.id,
|
productSpecId: selectItem.productSpecId,
|
||||||
});
|
});
|
||||||
log('handleBuy payInfo', payOrderNo, createPayInfo);
|
log('handleBuy payInfo', payOrderNo, createPayInfo);
|
||||||
await requestPayment({
|
await requestPayment({
|
||||||
@ -121,8 +142,14 @@ export default function CompanyPublishJobBuy(props: IProps) {
|
|||||||
log('handleBuy error', e);
|
log('handleBuy error', e);
|
||||||
}
|
}
|
||||||
}, [selectItem, onNext]);
|
}, [selectItem, onNext]);
|
||||||
|
const handleGetProductInfo = useCallback(async () => {
|
||||||
|
const result = await requestProductTypeList(ProductType.BOSS_VIP_NEW);
|
||||||
|
setProductList(result);
|
||||||
|
setSelectItem(result[0]);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
handleGetProductInfo();
|
||||||
collectEvent(CollectEventName.CREATE_ORDER_VIEW, { orderType: OrderType.BossVip, source: 'user-page' });
|
collectEvent(CollectEventName.CREATE_ORDER_VIEW, { orderType: OrderType.BossVip, source: 'user-page' });
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -130,19 +157,21 @@ export default function CompanyPublishJobBuy(props: IProps) {
|
|||||||
<div className={`${PREFIX}__company-publish-job-buy`}>
|
<div className={`${PREFIX}__company-publish-job-buy`}>
|
||||||
<div className={`${PREFIX}__company-publish-job-buy__header`}>发认证通告限时折扣</div>
|
<div className={`${PREFIX}__company-publish-job-buy__header`}>发认证通告限时折扣</div>
|
||||||
<div className={`${PREFIX}__company-publish-job-buy__price-container`}>
|
<div className={`${PREFIX}__company-publish-job-buy__price-container`}>
|
||||||
{LIST.map(item => (
|
{productList.map(item => (
|
||||||
<div
|
<div
|
||||||
key={item.price}
|
key={item.payPrice}
|
||||||
className={classNames(`${PREFIX}__company-publish-job-buy__item`, {
|
className={classNames(`${PREFIX}__company-publish-job-buy__item`, {
|
||||||
selected: item.amt === selectItem.amt,
|
selected: selectItem && item.payPrice === selectItem.payPrice,
|
||||||
disabled: item.amt === 0,
|
disabled: item.payPrice === 0,
|
||||||
})}
|
})}
|
||||||
onClick={item.amt === 0 ? undefined : () => handleClickItem(item)}
|
onClick={item.payPrice === 0 ? undefined : () => handleClickItem(item)}
|
||||||
>
|
>
|
||||||
<div className={classNames(`${PREFIX}__company-publish-job-buy__item__title`, { free: item.amt === 0 })}>
|
<div
|
||||||
|
className={classNames(`${PREFIX}__company-publish-job-buy__item__title`, { free: item.payPrice === 0 })}
|
||||||
|
>
|
||||||
{item.title}
|
{item.title}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__company-publish-job-buy__item__price`}>{item.price}</div>
|
<div className={`${PREFIX}__company-publish-job-buy__item__price`}>{item.priceText}</div>
|
||||||
{item.badge && <Badge className={`${PREFIX}__company-publish-job-buy__item__badge`} text={item.badge} />}
|
{item.badge && <Badge className={`${PREFIX}__company-publish-job-buy__item__badge`} text={item.badge} />}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@ -152,20 +181,24 @@ export default function CompanyPublishJobBuy(props: IProps) {
|
|||||||
<div className={`${PREFIX}__company-publish-job-buy__divider__title`}>包含</div>
|
<div className={`${PREFIX}__company-publish-job-buy__divider__title`}>包含</div>
|
||||||
<div className={`${PREFIX}__company-publish-job-buy__divider__right-line`} />
|
<div className={`${PREFIX}__company-publish-job-buy__divider__right-line`} />
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__company-publish-job-buy__contents`}>
|
{selectItem && (
|
||||||
{selectItem.contents.map(i => (
|
<Fragment>
|
||||||
<div
|
<div className={`${PREFIX}__company-publish-job-buy__contents`}>
|
||||||
className={classNames(`${PREFIX}__company-publish-job-buy__content`, { highlight: i.highlight })}
|
{getJsonContent(selectItem.contentsJson).map(i => (
|
||||||
key={i.content}
|
<div
|
||||||
>
|
className={classNames(`${PREFIX}__company-publish-job-buy__content`, { highlight: i.highlight })}
|
||||||
{i.content}
|
key={i.content}
|
||||||
{i.inlineHighlight && <div className="highlight-span">{i.inlineHighlight}</div>}
|
>
|
||||||
|
{i.content}
|
||||||
|
{i.inlineHighlight && <div className="highlight-span">{i.inlineHighlight}</div>}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
))}
|
<Button className={`${PREFIX}__company-publish-job-buy__button`} onClick={handleBuy}>
|
||||||
</div>
|
{`支付${selectItem.showPrice}元`}
|
||||||
<Button className={`${PREFIX}__company-publish-job-buy__button`} onClick={handleBuy}>
|
</Button>
|
||||||
{`支付${selectItem.amt}元`}
|
</Fragment>
|
||||||
</Button>
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,51 +6,60 @@ import { useCallback, useEffect, useState } from 'react';
|
|||||||
|
|
||||||
import Badge from '@/components/badge';
|
import Badge from '@/components/badge';
|
||||||
import { PREFIX } from '@/components/product-dialog/const';
|
import { PREFIX } from '@/components/product-dialog/const';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
import { CollectEventName } from '@/constants/event';
|
import { CollectEventName } from '@/constants/event';
|
||||||
import { OrderStatus, OrderType, ProductSpecId, ProductType } from '@/constants/product';
|
import { OrderStatus, OrderType, ProductType } from '@/constants/product';
|
||||||
import { SubscribeTempId } from '@/constants/subscribe';
|
import { SubscribeTempId } from '@/constants/subscribe';
|
||||||
|
import { ProductSpecResult } from '@/types/product';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { collectEvent } from '@/utils/event';
|
import { collectEvent } from '@/utils/event';
|
||||||
import { getOrderPrice, isCancelPay, requestCreatePayInfo, requestOrderInfo, requestPayment } from '@/utils/product';
|
import {
|
||||||
|
isCancelPay,
|
||||||
|
requestCreatePayInfo,
|
||||||
|
requestOrderInfo,
|
||||||
|
requestPayment,
|
||||||
|
requestProductTypeList,
|
||||||
|
} from '@/utils/product';
|
||||||
|
import { navigateTo } from '@/utils/route';
|
||||||
import { postSubscribe, subscribeMessage } from '@/utils/subscribe';
|
import { postSubscribe, subscribeMessage } from '@/utils/subscribe';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
buyOnly?: boolean;
|
|
||||||
onConfirm: () => void;
|
onConfirm: () => void;
|
||||||
|
isCreateResume?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Item {
|
// interface Item {
|
||||||
id: ProductSpecId;
|
// id: ProductSpecId;
|
||||||
title: string;
|
// title: string;
|
||||||
content: string;
|
// content: string;
|
||||||
buyOnlyContent?: string;
|
// buyOnlyContent?: string;
|
||||||
price: string;
|
// price: string;
|
||||||
amt: number;
|
// amt: number;
|
||||||
badge?: string;
|
// badge?: string;
|
||||||
}
|
// }
|
||||||
|
|
||||||
const LIST: Item[] = [
|
// const LIST: Item[] = [
|
||||||
{ id: ProductSpecId.WeeklyVIP, title: '非会员', content: '每日2次', price: '免费', amt: 0 },
|
// { id: ProductSpecId.WeeklyVIP, title: '非会员', content: '每日2次', price: '免费', amt: 0 },
|
||||||
{
|
// {
|
||||||
id: ProductSpecId.DailyVIP,
|
// id: ProductSpecId.DailyVIP,
|
||||||
title: '日会员',
|
// title: '日会员',
|
||||||
content: '每日+10次',
|
// content: '每日+10次',
|
||||||
buyOnlyContent: '每日12次',
|
// buyOnlyContent: '每日12次',
|
||||||
price: '60播豆',
|
// price: '60播豆',
|
||||||
amt: 6,
|
// amt: 6,
|
||||||
badge: '限时体验',
|
// badge: '限时体验',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: ProductSpecId.WeeklyVIP,
|
// id: ProductSpecId.WeeklyVIP,
|
||||||
title: '周会员',
|
// title: '周会员',
|
||||||
content: '每日+10次',
|
// content: '每日+10次',
|
||||||
buyOnlyContent: '每日12次',
|
// buyOnlyContent: '每日12次',
|
||||||
price: '180播豆',
|
// price: '180播豆',
|
||||||
amt: 18,
|
// amt: 18,
|
||||||
badge: ' 超值',
|
// badge: ' 超值',
|
||||||
},
|
// },
|
||||||
];
|
// ];
|
||||||
|
|
||||||
const log = logWithPrefix('job-buy');
|
const log = logWithPrefix('job-buy');
|
||||||
const SUBSCRIBE_ID = SubscribeTempId.SUBSCRIBE_VIP;
|
const SUBSCRIBE_ID = SubscribeTempId.SUBSCRIBE_VIP;
|
||||||
@ -66,20 +75,26 @@ const subscribe = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function JobBuy(props: IProps) {
|
export default function JobBuy(props: IProps) {
|
||||||
const { onConfirm, buyOnly } = props;
|
const { onConfirm, isCreateResume } = props;
|
||||||
const [selectItem, setSelectItem] = useState(LIST[1]);
|
const [productList, setProductList] = useState<ProductSpecResult[]>([]);
|
||||||
|
const [selectItem, setSelectItem] = useState<ProductSpecResult | undefined>();
|
||||||
|
|
||||||
const handleClickItem = useCallback((newSelectItem: Item) => setSelectItem(newSelectItem), []);
|
const handleClickItem = useCallback((newSelectItem: ProductSpecResult) => setSelectItem(newSelectItem), []);
|
||||||
|
|
||||||
const handleBuy = useCallback(async () => {
|
const handleBuy = useCallback(async () => {
|
||||||
log('handleBuy', selectItem);
|
log('handleBuy', selectItem);
|
||||||
|
if (!selectItem) {
|
||||||
|
Toast.error('请选择购买的产品');
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Taro.showLoading();
|
Taro.showLoading();
|
||||||
|
|
||||||
const { payOrderNo, createPayInfo } = await requestCreatePayInfo({
|
const { payOrderNo, createPayInfo } = await requestCreatePayInfo({
|
||||||
type: OrderType.VIP,
|
type: OrderType.VIP,
|
||||||
amt: getOrderPrice(selectItem.amt),
|
amt: selectItem.payPrice,
|
||||||
productCode: ProductType.VIP,
|
productCode: ProductType.VIP,
|
||||||
productSpecId: selectItem.id,
|
productSpecId: selectItem.productSpecId,
|
||||||
});
|
});
|
||||||
log('handleBuy payInfo', payOrderNo, createPayInfo);
|
log('handleBuy payInfo', payOrderNo, createPayInfo);
|
||||||
await requestPayment({
|
await requestPayment({
|
||||||
@ -104,59 +119,67 @@ export default function JobBuy(props: IProps) {
|
|||||||
}
|
}
|
||||||
}, [selectItem, onConfirm]);
|
}, [selectItem, onConfirm]);
|
||||||
|
|
||||||
|
const handleGetProductInfo = useCallback(async () => {
|
||||||
|
const result = await requestProductTypeList(ProductType.VIP);
|
||||||
|
setProductList(result);
|
||||||
|
setSelectItem(result[0]);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleResume = useCallback(() => {
|
||||||
|
navigateTo(PageUrl.MaterialUploadVideo);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
handleGetProductInfo();
|
||||||
collectEvent(CollectEventName.CREATE_ORDER_VIEW, { orderType: OrderType.VIP });
|
collectEvent(CollectEventName.CREATE_ORDER_VIEW, { orderType: OrderType.VIP });
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`${PREFIX}__job-buy`}>
|
<div className={`${PREFIX}__job-buy`}>
|
||||||
{buyOnly ? (
|
<div className={`${PREFIX}__job-buy__header`}>
|
||||||
<div className={`${PREFIX}__job-buy__header`}>开通播络会员即可直接查看联系方式</div>
|
<div>免费查看次数已用完</div>
|
||||||
) : (
|
<div className="highlight">请升级会员</div>
|
||||||
<div className={`${PREFIX}__job-buy__header`}>
|
</div>
|
||||||
<div>今日通告对接次数</div>
|
{!isCreateResume && (
|
||||||
<div className="highlight">已用完</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{buyOnly ? (
|
|
||||||
<div className={`${PREFIX}__job-buy__describe`}>每天可获取12个联系方式</div>
|
|
||||||
) : (
|
|
||||||
<div className={`${PREFIX}__job-buy__describe`}>
|
<div className={`${PREFIX}__job-buy__describe`}>
|
||||||
<div>请</div>
|
<div>完善模卡</div>
|
||||||
<div className="highlight">明日</div>
|
<div> 赠5次查看 </div>
|
||||||
<div>再来 或 </div>
|
<div className="highlight" onClick={handleResume}>
|
||||||
<div className="highlight">升级会员</div>
|
去完善
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className={`${PREFIX}__job-buy__container`}>
|
<div className={`${PREFIX}__job-buy__container`}>
|
||||||
{LIST.map(item => {
|
{productList.map(item => {
|
||||||
if (buyOnly && !item.amt) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={item.price}
|
key={item.payPrice}
|
||||||
className={classNames(`${PREFIX}__job-buy__item`, {
|
className={classNames(`${PREFIX}__job-buy__item`, {
|
||||||
selected: item.amt === selectItem.amt,
|
selected: selectItem && item.payPrice === selectItem.payPrice,
|
||||||
disabled: item.amt === 0,
|
disabled: item.payPrice === 0,
|
||||||
})}
|
})}
|
||||||
onClick={item.amt === 0 ? undefined : () => handleClickItem(item)}
|
onClick={item.payPrice === 0 ? undefined : () => handleClickItem(item)}
|
||||||
>
|
>
|
||||||
<div className={classNames(`${PREFIX}__job-buy__item__title`, { free: item.amt === 0 })}>
|
<div className={classNames(`${PREFIX}__job-buy__item__title`, { free: item.payPrice === 0 })}>
|
||||||
{item.title}
|
{item.title}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__job-buy__item__content`}>{buyOnly ? item.buyOnlyContent : item.content}</div>
|
<div className={`${PREFIX}__job-buy__item__content`}>{item.contentSingle}</div>
|
||||||
<div className={`${PREFIX}__job-buy__item__price`}>{item.price}</div>
|
<div className={`${PREFIX}__job-buy__item__price`}>{item.showPrice}元</div>
|
||||||
{item.badge && <Badge className={`${PREFIX}__job-buy__item__badge`} text={item.badge} />}
|
{item.badge && <Badge className={`${PREFIX}__job-buy__item__badge`} text={item.badge} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__job-buy__hint`}>
|
{selectItem && (
|
||||||
注:日会员有效期为 <div className="highlight">支付后24小时</div>
|
<div className={`${PREFIX}__job-buy__hint`}>
|
||||||
</div>
|
注:{selectItem?.title}有效期为
|
||||||
<Button className={`${PREFIX}__job-buy__button`} onClick={handleBuy}>
|
<div className="highlight">
|
||||||
{`支付 ${selectItem.amt} 元`}
|
支付后{selectItem?.expire > 1 ? `${selectItem.expire}天` : `${selectItem.expire * 24}小时`}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<Button className={`${PREFIX}__job-buy__button`} disabled={!selectItem} onClick={handleBuy}>
|
||||||
|
{`支付 ${selectItem?.showPrice} 元`}
|
||||||
</Button>
|
</Button>
|
||||||
{/* <div className={`${PREFIX}__job-buy__tips`}>{`已选:${selectItem.title},含进本地群服务`}</div> */}
|
{/* <div className={`${PREFIX}__job-buy__tips`}>{`已选:${selectItem.title},含进本地群服务`}</div> */}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -10,7 +10,7 @@ interface IContactDirectProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function ContactDirect(props: IContactDirectProps) {
|
export default function ContactDirect(props: IContactDirectProps) {
|
||||||
const { publisherAcctNo, onAfterConfirm, onReport } = props;
|
const { publisherAcctNo, onAfterConfirm } = props;
|
||||||
|
|
||||||
const handleCopyAndContact = async () => {
|
const handleCopyAndContact = async () => {
|
||||||
await copy(publisherAcctNo);
|
await copy(publisherAcctNo);
|
||||||
|
|||||||
@ -2,9 +2,10 @@ import { BaseEventOrig, InputProps, ScrollView } from '@tarojs/components';
|
|||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
import { Search } from '@taroify/core';
|
import { Search } from '@taroify/core';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { Fragment, useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { CITY_CODE_TO_NAME_MAP, CITY_INDEXES_LIST, GROUP_CITY_INDEXES_LIST } from '@/constants/city';
|
import { CITY_CODE_TO_NAME_MAP, CITY_INDEXES_LIST } from '@/constants/city';
|
||||||
|
import useCityOperators from '@/hooks/use-city-operators';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
@ -68,8 +69,19 @@ export default function SearchCity({
|
|||||||
const [touchAnchor, setTouchAnchor] = useState<string | undefined>();
|
const [touchAnchor, setTouchAnchor] = useState<string | undefined>();
|
||||||
const [touchMoving, setTouchMoving] = useState(false);
|
const [touchMoving, setTouchMoving] = useState(false);
|
||||||
const [searchResult, setSearchResult] = useState<Item[]>([]);
|
const [searchResult, setSearchResult] = useState<Item[]>([]);
|
||||||
|
const cityOperators = useCityOperators();
|
||||||
|
const groupCityCodes = cityOperators.map(it => (it.groupLink ? it.cityCode : null)).filter(Boolean);
|
||||||
const showSearchList = searchResult.length > 0;
|
const showSearchList = searchResult.length > 0;
|
||||||
const CITY_LIST = forGroup ? GROUP_CITY_INDEXES_LIST : CITY_INDEXES_LIST;
|
const CITY_LIST = forGroup
|
||||||
|
? CITY_INDEXES_LIST.map(({ letter, data }) => {
|
||||||
|
return {
|
||||||
|
letter,
|
||||||
|
data: data.filter(it => groupCityCodes.includes(it.cityCode)),
|
||||||
|
};
|
||||||
|
}).filter(item => item.data.length > 0)
|
||||||
|
: CITY_INDEXES_LIST;
|
||||||
|
|
||||||
|
const HOT_CITY_LIST = forGroup ? HOT_CITY.filter(it => groupCityCodes.includes(`${it.cityCode}`)) : HOT_CITY;
|
||||||
|
|
||||||
const handleSearchChange = useCallback((event: BaseEventOrig<InputProps.inputEventDetail>) => {
|
const handleSearchChange = useCallback((event: BaseEventOrig<InputProps.inputEventDetail>) => {
|
||||||
const value = event.detail.value;
|
const value = event.detail.value;
|
||||||
@ -173,19 +185,25 @@ export default function SearchCity({
|
|||||||
<div>
|
<div>
|
||||||
<div className={`${PREFIX}__position-title`}>当前城市</div>
|
<div className={`${PREFIX}__position-title`}>当前城市</div>
|
||||||
<div className={`${PREFIX}__position-city`}>{CITY_CODE_TO_NAME_MAP.get(currentCity)}</div>
|
<div className={`${PREFIX}__position-city`}>{CITY_CODE_TO_NAME_MAP.get(currentCity)}</div>
|
||||||
<div className={`${PREFIX}__hot-city-title`}>热门城市</div>
|
{!!HOT_CITY_LIST.length && (
|
||||||
<div className={`${PREFIX}__hot-city-container`}>
|
<Fragment>
|
||||||
{HOT_CITY.map(city => (
|
<div className={`${PREFIX}__hot-city-title`}>热门城市</div>
|
||||||
<div
|
<div className={`${PREFIX}__hot-city-container`}>
|
||||||
key={city.cityCode}
|
{HOT_CITY_LIST.map(city => {
|
||||||
className={`${PREFIX}__hot-city-item`}
|
return (
|
||||||
data-code={city.cityCode}
|
<div
|
||||||
onClick={handleSelectCity}
|
key={city.cityCode}
|
||||||
>
|
className={`${PREFIX}__hot-city-item`}
|
||||||
{city.cityName}
|
data-code={city.cityCode}
|
||||||
|
onClick={handleSelectCity}
|
||||||
|
>
|
||||||
|
{city.cityName}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
))}
|
</Fragment>
|
||||||
</div>
|
)}
|
||||||
<div className={`${PREFIX}__indexes-list`}>
|
<div className={`${PREFIX}__indexes-list`}>
|
||||||
{CITY_LIST.map(item => {
|
{CITY_LIST.map(item => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -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;
|
||||||
@ -13,9 +13,9 @@
|
|||||||
&__title {
|
&__title {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
line-height: 48px;
|
line-height: 48px;
|
||||||
font-weight: 500;
|
margin-top: 32px;
|
||||||
color: @blColor;
|
font-weight: 400;
|
||||||
margin-top: 24px;
|
color: #1d2129;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
@ -30,13 +30,21 @@
|
|||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__extra {
|
||||||
|
margin-top: 24px;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: @blHighlightColor;
|
||||||
|
}
|
||||||
|
|
||||||
&__cost-describe {
|
&__cost-describe {
|
||||||
height: 100px;
|
height: 100px;
|
||||||
padding: 0 32px;
|
padding: 0 32px;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
.flex-row();
|
.flex-row();
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background: #FFFFFF;
|
background: #ffffff;
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
|
|
||||||
&__price {
|
&__price {
|
||||||
@ -64,9 +72,22 @@
|
|||||||
line-height: 48px;
|
line-height: 48px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: @blColorG2;
|
color: @blColorG2;
|
||||||
background: #FFFFFF;
|
background: #ffffff;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
|
|
||||||
|
.underline {
|
||||||
|
display: inline;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 48px;
|
||||||
|
color: @blColor;
|
||||||
|
position: relative;
|
||||||
|
background-image: linear-gradient(to bottom, rgba(109, 61, 245, 0.6) 0%, rgba(109, 61, 245, 0.6) 100%);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 12px;
|
||||||
|
background-position: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
&__describe {
|
&__describe {
|
||||||
.flex-row();
|
.flex-row();
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
@ -86,4 +107,16 @@
|
|||||||
.button(@width: 100%; @height: 80px; @fontSize: 32px);
|
.button(@width: 100%; @height: 80px; @fontSize: 32px);
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__publish-title {
|
||||||
|
font-size: 36px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 56px;
|
||||||
|
color: @blColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__publish-button {
|
||||||
|
.button(@width: 360px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px);
|
||||||
|
margin: 40px auto auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,21 @@
|
|||||||
import { Button, Text } from '@tarojs/components';
|
import { Button } from '@tarojs/components';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
import { Cell } from '@taroify/core';
|
import { Cell, Dialog } from '@taroify/core';
|
||||||
import { useCallback, useState, useEffect } from 'react';
|
import { Fragment, useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
import { PublishJobQrCodeDialog } from '@/components/product-dialog/publish-job';
|
import { PublishJobQrCodeDialog } from '@/components/product-dialog/publish-job';
|
||||||
|
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 { ISelectOption, PopupSelect } from '@/components/select';
|
import { ISelectOption } from '@/components/select';
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageUrl } from '@/constants/app';
|
||||||
|
import { JobManageStatus } from '@/constants/job';
|
||||||
import { OrderStatus, OrderType, ProductSpecId, ProductType } from '@/constants/product';
|
import { OrderStatus, OrderType, ProductSpecId, ProductType } from '@/constants/product';
|
||||||
|
import { usePublishJob } from '@/hooks/use-publish-job';
|
||||||
import { BatchPublishGroup } from '@/types/group';
|
import { BatchPublishGroup } from '@/types/group';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
|
import { requestJobDetail } from '@/utils/job';
|
||||||
import {
|
import {
|
||||||
getOrderPrice,
|
getOrderPrice,
|
||||||
isCancelPay,
|
isCancelPay,
|
||||||
@ -22,7 +26,6 @@ import {
|
|||||||
} from '@/utils/product';
|
} from '@/utils/product';
|
||||||
import { navigateTo } from '@/utils/route';
|
import { navigateTo } from '@/utils/route';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
interface CityValue extends BatchPublishGroup {
|
interface CityValue extends BatchPublishGroup {
|
||||||
@ -35,11 +38,7 @@ interface CityOption extends ISelectOption<CityValue> {
|
|||||||
|
|
||||||
const PREFIX = 'user-batch-publish';
|
const PREFIX = 'user-batch-publish';
|
||||||
const log = logWithPrefix(PREFIX);
|
const log = logWithPrefix(PREFIX);
|
||||||
const SERVICE_ILLUSTRATE = `服务方式:帮您把招聘需求发到众多同城合作主播群
|
export const cityValues: CityValue[] = [
|
||||||
群发次数:杭州、广州发3次,其他城市1次
|
|
||||||
内容要求:仅限带货主播招聘需求,其他不发
|
|
||||||
主播联系:内容中留招聘方联系方式,主播直接联系`;
|
|
||||||
const cityValues: CityValue[] = [
|
|
||||||
{ cityCode: '440100', cityName: '广州', count: 800 },
|
{ cityCode: '440100', cityName: '广州', count: 800 },
|
||||||
{ cityCode: '440300', cityName: '深圳', count: 100 },
|
{ cityCode: '440300', cityName: '深圳', count: 100 },
|
||||||
{ cityCode: '330100', cityName: '杭州', count: 750 },
|
{ cityCode: '330100', cityName: '杭州', count: 750 },
|
||||||
@ -79,20 +78,14 @@ const calcPrice = (city: CityValue | null) => {
|
|||||||
return { price, originalPrice, productSpecId };
|
return { price, originalPrice, productSpecId };
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function UserBatchPublish() {
|
export default function UserBatchPublish({ cityCode, jobId }: { cityCode: string; jobId: string }) {
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [showCitySelect, setShowCitySelect] = useState(false);
|
|
||||||
const [showQrCode, setShowQrCode] = useState(false);
|
const [showQrCode, setShowQrCode] = useState(false);
|
||||||
const [city, setCity] = useState<CityOption['value'] | null>(null);
|
const [city, setCity] = useState<CityOption['value'] | null>(null);
|
||||||
const [cityOptions, setCityOptions] = useState<CityOption[]>([]);
|
|
||||||
const { price, originalPrice, productSpecId } = calcPrice(city);
|
const { price, originalPrice, productSpecId } = calcPrice(city);
|
||||||
|
const [showPublishJob, setShowPublishJob] = useState(false);
|
||||||
|
|
||||||
const handleClickCity = useCallback(() => setShowCitySelect(true), []);
|
const [showBuy, setShowBuy, handlePublishJob] = usePublishJob(jobId);
|
||||||
|
|
||||||
const handleSelectCity = useCallback(value => {
|
|
||||||
setCity(value);
|
|
||||||
setShowCitySelect(false);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleClickViewGroup = useCallback(() => navigateTo(PageUrl.GroupList, { city: city?.cityCode }), [city]);
|
const handleClickViewGroup = useCallback(() => navigateTo(PageUrl.GroupList, { city: city?.cityCode }), [city]);
|
||||||
|
|
||||||
@ -114,6 +107,15 @@ export default function UserBatchPublish() {
|
|||||||
setShowQrCode(true);
|
setShowQrCode(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const jobDetail = await requestJobDetail(jobId);
|
||||||
|
|
||||||
|
if (jobDetail.status !== JobManageStatus.Open) {
|
||||||
|
Taro.hideLoading();
|
||||||
|
setShowPublishJob(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const { payOrderNo, createPayInfo } = await requestCreatePayInfo({
|
const { payOrderNo, createPayInfo } = await requestCreatePayInfo({
|
||||||
type: OrderType.GroupBatchPublish,
|
type: OrderType.GroupBatchPublish,
|
||||||
amt: getOrderPrice(price),
|
amt: getOrderPrice(price),
|
||||||
@ -141,21 +143,25 @@ export default function UserBatchPublish() {
|
|||||||
Toast.error(isCancelPay(e) ? '取消购买' : '购买失败请重试');
|
Toast.error(isCancelPay(e) ? '取消购买' : '购买失败请重试');
|
||||||
log('handleBuy error', e);
|
log('handleBuy error', e);
|
||||||
}
|
}
|
||||||
}, [price, productSpecId]);
|
}, [jobId, price, productSpecId]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!cityCode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const cOptions: CityOption[] = cityValues.map(value => ({ value, label: value.cityName }));
|
const initCity = cityValues.find(o => o.cityCode === cityCode);
|
||||||
const initCity = (cOptions.find(o => o.label === '重庆') || cOptions[0]).value;
|
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setCity(initCity);
|
if (initCity) {
|
||||||
setCityOptions(cOptions);
|
setCity(initCity);
|
||||||
log('init data done', cOptions);
|
} else {
|
||||||
|
Toast.info('当前城市不支持代发');
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Toast.error('加载失败请重试');
|
Toast.error('加载失败请重试');
|
||||||
}
|
}
|
||||||
}, []);
|
}, [cityCode]);
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <PageLoading />;
|
return <PageLoading />;
|
||||||
@ -164,38 +170,46 @@ export default function UserBatchPublish() {
|
|||||||
return (
|
return (
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
{/*<Image mode="widthFix" className={`${PREFIX}__header-image`} src="https://neighbourhood.cn/pubJob.png" />*/}
|
{/*<Image mode="widthFix" className={`${PREFIX}__header-image`} src="https://neighbourhood.cn/pubJob.png" />*/}
|
||||||
<div className={`${PREFIX}__title`}>请选择城市</div>
|
|
||||||
<Cell isLink align="center" className={`${PREFIX}__cell`} title={city?.cityName} onClick={handleClickCity} />
|
|
||||||
<div className={`${PREFIX}__title`}>可购买群数</div>
|
|
||||||
<Cell align="center" className={`${PREFIX}__cell`} title={city?.count} />
|
|
||||||
<div className={`${PREFIX}__title`}>服务费用</div>
|
|
||||||
<div className={`${PREFIX}__cost-describe`}>
|
|
||||||
<div className={`${PREFIX}__cost-describe__price`}>{`${price}元`}</div>
|
|
||||||
<div className={`${PREFIX}__cost-describe__original_price`}>{`原价:${originalPrice}元`}</div>
|
|
||||||
</div>
|
|
||||||
<div className={`${PREFIX}__title`}>服务说明</div>
|
<div className={`${PREFIX}__title`}>服务说明</div>
|
||||||
<div className={`${PREFIX}__illustrate`}>
|
<div className={`${PREFIX}__illustrate`}>
|
||||||
<Text>{SERVICE_ILLUSTRATE}</Text>
|
服务方式:帮您把招聘需求<div className="underline">发到本地主播群,投递量大幅增加</div>
|
||||||
<div className={`${PREFIX}__illustrate__describe`}>
|
|
||||||
<div>附:</div>
|
|
||||||
<div className={`${PREFIX}__illustrate__describe__view`} onClick={handleClickViewGroup}>
|
|
||||||
播络合作群列表
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<Button className={`${PREFIX}__buy-button`} onClick={handleClickBuy}>
|
<div className={`${PREFIX}__title`}>当前通告城市</div>
|
||||||
立即购买
|
<Cell align="center" className={`${PREFIX}__cell`} title={city ? city.cityName : '暂不支持代发'} />
|
||||||
</Button>
|
{city && (
|
||||||
|
<Fragment>
|
||||||
|
<div className={`${PREFIX}__extra`} onClick={handleClickViewGroup}>
|
||||||
|
查看该城市合作群列表
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__title`}>可购买群数</div>
|
||||||
|
<Cell align="center" className={`${PREFIX}__cell`} title={city?.count} />
|
||||||
|
<div className={`${PREFIX}__title`}>服务费用</div>
|
||||||
|
<div className={`${PREFIX}__cost-describe`}>
|
||||||
|
<div className={`${PREFIX}__cost-describe__price`}>{`${price}元`}</div>
|
||||||
|
<div className={`${PREFIX}__cost-describe__original_price`}>{`原价:${originalPrice}元`}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Button className={`${PREFIX}__buy-button`} onClick={handleClickBuy}>
|
||||||
|
立即购买
|
||||||
|
</Button>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
<SafeBottomPadding />
|
<SafeBottomPadding />
|
||||||
<div>
|
<div>
|
||||||
<PopupSelect
|
|
||||||
value={city}
|
|
||||||
options={cityOptions}
|
|
||||||
open={showCitySelect}
|
|
||||||
onSelect={handleSelectCity}
|
|
||||||
onClose={() => setShowCitySelect(false)}
|
|
||||||
/>
|
|
||||||
<PublishJobQrCodeDialog onClose={() => setShowQrCode(false)} open={showQrCode} />
|
<PublishJobQrCodeDialog onClose={() => setShowQrCode(false)} open={showQrCode} />
|
||||||
|
<Dialog open={showBuy} onClose={() => setShowBuy(false)}>
|
||||||
|
<Dialog.Content>
|
||||||
|
<CompanyPublishJobBuy onNext={handlePublishJob} />
|
||||||
|
</Dialog.Content>
|
||||||
|
</Dialog>
|
||||||
|
<Dialog open={showPublishJob} onClose={() => setShowPublishJob(false)}>
|
||||||
|
<Dialog.Content>
|
||||||
|
<div className={`${PREFIX}__publish-title`}>请先发布通告</div>
|
||||||
|
<Button className={`${PREFIX}__publish-button`} onClick={handlePublishJob}>
|
||||||
|
发布该通告
|
||||||
|
</Button>
|
||||||
|
</Dialog.Content>
|
||||||
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -17,6 +17,7 @@ export enum EventName {
|
|||||||
ADD_GROUP = 'add_group',
|
ADD_GROUP = 'add_group',
|
||||||
SELECT_CITY = 'select_city',
|
SELECT_CITY = 'select_city',
|
||||||
CREATE_PROFILE = 'create_profile',
|
CREATE_PROFILE = 'create_profile',
|
||||||
|
READ_CONTACT = 'read_contact',
|
||||||
UPDATE_PROFILE = 'update_profile',
|
UPDATE_PROFILE = 'update_profile',
|
||||||
EDIT_JOB_DESCRIBE = 'edit_job_describe',
|
EDIT_JOB_DESCRIBE = 'edit_job_describe',
|
||||||
JOB_UPDATE = 'job_update',
|
JOB_UPDATE = 'job_update',
|
||||||
@ -35,6 +36,7 @@ export enum OpenSource {
|
|||||||
UserPage = 'user_page',
|
UserPage = 'user_page',
|
||||||
AnchorPage = 'anchor_page',
|
AnchorPage = 'anchor_page',
|
||||||
MaterialViewPage = 'material_view_page',
|
MaterialViewPage = 'material_view_page',
|
||||||
|
GroupOwnerCertificate = 'group_owner_certificate',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PageUrl {
|
export enum PageUrl {
|
||||||
@ -77,6 +79,8 @@ export enum PageUrl {
|
|||||||
WithdrawRecord = 'pages/withdraw-record/index',
|
WithdrawRecord = 'pages/withdraw-record/index',
|
||||||
GroupDelegatePublish = 'pages/group-delegate-publish/index',
|
GroupDelegatePublish = 'pages/group-delegate-publish/index',
|
||||||
GiveVip = 'pages/give-vip/index',
|
GiveVip = 'pages/give-vip/index',
|
||||||
|
GroupOwnerCertificate = 'pages/group-owner-certification/index',
|
||||||
|
PartnerShareVip = 'pages/partner-share-vip/index',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PluginUrl {
|
export enum PluginUrl {
|
||||||
|
|||||||
@ -13,4 +13,5 @@ export enum CacheKey {
|
|||||||
AGREEMENT_SIGNED = '__agreement_signed__',
|
AGREEMENT_SIGNED = '__agreement_signed__',
|
||||||
CITY_CODES = '__city_codes__',
|
CITY_CODES = '__city_codes__',
|
||||||
JOIN_GROUP_CARD_CLICKED = '__join_group_card_clicked__',
|
JOIN_GROUP_CARD_CLICKED = '__join_group_card_clicked__',
|
||||||
|
JOIN_GROUP_POPUP_CLICKED = '__join_group_popup_clicked__',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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', // 本地生活
|
||||||
@ -74,7 +75,7 @@ export const EMPLOY_TYPE_TITLE_MAP = {
|
|||||||
|
|
||||||
export const JOB_SOURCE_TYPE_TITLE_MAP = {
|
export const JOB_SOURCE_TYPE_TITLE_MAP = {
|
||||||
[JobSourceType.All]: '全部',
|
[JobSourceType.All]: '全部',
|
||||||
[JobSourceType.BL]: '认证通告',
|
[JobSourceType.BL]: '急招',
|
||||||
[JobSourceType.VX]: '群通告',
|
[JobSourceType.VX]: '群通告',
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -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]: '本地生活',
|
||||||
@ -120,10 +122,10 @@ export const JOB_PAGE_TABS = [
|
|||||||
type: JobSourceType.BL,
|
type: JobSourceType.BL,
|
||||||
title: JOB_SOURCE_TYPE_TITLE_MAP[JobSourceType.BL],
|
title: JOB_SOURCE_TYPE_TITLE_MAP[JobSourceType.BL],
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
type: JobSourceType.VX,
|
// type: JobSourceType.VX,
|
||||||
title: JOB_SOURCE_TYPE_TITLE_MAP[JobSourceType.VX],
|
// title: JOB_SOURCE_TYPE_TITLE_MAP[JobSourceType.VX],
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const JOB_EMPLOY_TYPE_OPTIONS = [
|
export const JOB_EMPLOY_TYPE_OPTIONS = [
|
||||||
@ -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: '不限' },
|
||||||
@ -205,4 +213,5 @@ export const FULL_PRICE_OPTIONS = FULL_EMPLOY_SALARY_OPTIONS.filter(o => !!o.val
|
|||||||
export enum GET_CONTACT_TYPE {
|
export enum GET_CONTACT_TYPE {
|
||||||
VIP = 'vip',
|
VIP = 'vip',
|
||||||
MATERIAL = 'material',
|
MATERIAL = 'material',
|
||||||
|
GROUP = 'group',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ export enum ProfileGroupType {
|
|||||||
Intention = 'intention',
|
Intention = 'intention',
|
||||||
Experience = 'experience',
|
Experience = 'experience',
|
||||||
Advantages = 'advantages',
|
Advantages = 'advantages',
|
||||||
|
Others = 'others',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ProfileTitleMap = {
|
export const ProfileTitleMap = {
|
||||||
@ -10,6 +11,7 @@ export const ProfileTitleMap = {
|
|||||||
[ProfileGroupType.Intention]: '求职意向',
|
[ProfileGroupType.Intention]: '求职意向',
|
||||||
[ProfileGroupType.Experience]: '直播经验',
|
[ProfileGroupType.Experience]: '直播经验',
|
||||||
[ProfileGroupType.Advantages]: '自身优势',
|
[ProfileGroupType.Advantages]: '自身优势',
|
||||||
|
[ProfileGroupType.Others]: '身型、学历',
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum WorkedYears {
|
export enum WorkedYears {
|
||||||
@ -19,6 +21,13 @@ export enum WorkedYears {
|
|||||||
MoreThreeYear = 3,
|
MoreThreeYear = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum EducationType {
|
||||||
|
MiddleSchool = 1,
|
||||||
|
HighSchool = 2,
|
||||||
|
AssociateDegree = 3,
|
||||||
|
BachelorOrAbove = 4,
|
||||||
|
}
|
||||||
|
|
||||||
export enum GenderType {
|
export enum GenderType {
|
||||||
All = -1,
|
All = -1,
|
||||||
MEN = 0,
|
MEN = 0,
|
||||||
@ -84,14 +93,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 = {
|
||||||
@ -99,3 +119,15 @@ export const ANCHOR_READ_TITLE_MAP = {
|
|||||||
[AnchorReadType.Read]: '已读',
|
[AnchorReadType.Read]: '已读',
|
||||||
[AnchorReadType.Unread]: '未读',
|
[AnchorReadType.Unread]: '未读',
|
||||||
};
|
};
|
||||||
|
export const EDUCATION_TYPE_LABELS = {
|
||||||
|
[EducationType.MiddleSchool]: '初中',
|
||||||
|
[EducationType.HighSchool]: '职高/高中',
|
||||||
|
[EducationType.AssociateDegree]: '大专',
|
||||||
|
[EducationType.BachelorOrAbove]: '本科及以上',
|
||||||
|
};
|
||||||
|
export const EDUCATION_TYPE_OPTIONS = [
|
||||||
|
{ label: EDUCATION_TYPE_LABELS[EducationType.MiddleSchool], value: EducationType.MiddleSchool },
|
||||||
|
{ label: EDUCATION_TYPE_LABELS[EducationType.HighSchool], value: EducationType.HighSchool },
|
||||||
|
{ label: EDUCATION_TYPE_LABELS[EducationType.AssociateDegree], value: EducationType.AssociateDegree },
|
||||||
|
{ label: EDUCATION_TYPE_LABELS[EducationType.BachelorOrAbove], value: EducationType.BachelorOrAbove },
|
||||||
|
];
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
export enum SubscribeTempId {
|
export enum SubscribeTempId {
|
||||||
INTERVIEW_INVITATION = 'obPJO1nmXoSwAovbuuUz4aVfb6Ir8AOp1kY_JlQ18dY',
|
INTERVIEW_INVITATION = 'obPJO1nmXoSwAovbuuUz4aVfb6Ir8AOp1kY_JlQ18dY',
|
||||||
UNREAD_MESSAGE_REMINDER = 'm-Zx9zgf5KGnlHgxbxSkEtpd7XXCg1r1adC2UZS7sXs',
|
UNREAD_MESSAGE_REMINDER = '5QcNcHdNnWpMvNOUwbazYlWv0VXXAzdF87L7c7vVq2s',
|
||||||
NEW_MESSAGE_REMINDER = '4lkxb_mDLbJ889PZqunxP5U8auvQHS6hZgzfxgGHo9U',
|
NEW_MESSAGE_REMINDER = '4lkxb_mDLbJ889PZqunxP5U8auvQHS6hZgzfxgGHo9U',
|
||||||
SUBSCRIBE_JOB = 'PYekheJ60PA53SB51wFjySYjMUQjS17elPNnLwoIEQM',
|
SUBSCRIBE_JOB = 'PYekheJ60PA53SB51wFjySYjMUQjS17elPNnLwoIEQM',
|
||||||
SUBSCRIBE_VIP = 'TxQSUxuB9av1bkWudq-UcM1ey9ChVYqTSC9qBPpW0e8',
|
SUBSCRIBE_VIP = 'TxQSUxuB9av1bkWudq-UcM1ey9ChVYqTSC9qBPpW0e8',
|
||||||
|
|||||||
@ -124,7 +124,6 @@ function JobFragment(props: IProps) {
|
|||||||
|
|
||||||
const handleSelectEmployType = useCallback(
|
const handleSelectEmployType = useCallback(
|
||||||
(value?: EmployType) => {
|
(value?: EmployType) => {
|
||||||
console.log('哈哈哈', value);
|
|
||||||
setShowEmployTypeSelect(false);
|
setShowEmployTypeSelect(false);
|
||||||
onClickEmployType(value!);
|
onClickEmployType(value!);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -23,9 +23,7 @@ function ProfileBasicFragment(props: IProps, ref) {
|
|||||||
const [name, setName] = useState(profile.name || '');
|
const [name, setName] = useState(profile.name || '');
|
||||||
const [gender, setGender] = useState<GenderType>(profile.gender || GenderType.WOMEN);
|
const [gender, setGender] = useState<GenderType>(profile.gender || GenderType.WOMEN);
|
||||||
const [age, setAge] = useState(profile.age || '');
|
const [age, setAge] = useState(profile.age || '');
|
||||||
const [height, setHeight] = useState(profile.height || '');
|
const [workedSecCategoryStr, setWorkedSecCategoryStr] = useState(profile.workedSecCategoryStr || '');
|
||||||
const [weight, setWeight] = useState(profile.weight || '');
|
|
||||||
const [shoeSize, setShoeSize] = useState(profile.shoeSize || '');
|
|
||||||
|
|
||||||
const handleInputName = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
const handleInputName = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
||||||
const value = e.detail.value || '';
|
const value = e.detail.value || '';
|
||||||
@ -40,41 +38,21 @@ function ProfileBasicFragment(props: IProps, ref) {
|
|||||||
setAge(string2Number(value));
|
setAge(string2Number(value));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleInputHeight = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
|
||||||
const value = e.detail.value || '';
|
|
||||||
if (Number.isNaN(Number(value))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setHeight(string2Number(value));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleInputWeight = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
|
||||||
const value = e.detail.value || '';
|
|
||||||
if (Number.isNaN(Number(value))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setWeight(string2Number(value));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleInputShoeSize = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
|
||||||
const value = e.detail.value || '';
|
|
||||||
if (Number.isNaN(Number(value))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setShoeSize(string2Number(value));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleGenderChange = useCallback((value: GenderType) => {
|
const handleGenderChange = useCallback((value: GenderType) => {
|
||||||
log('handleGenderChange', value);
|
log('handleGenderChange', value);
|
||||||
setGender(value);
|
setGender(value);
|
||||||
}, []);
|
}, []);
|
||||||
|
const handleInputWorkedSecCategoryStr = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
||||||
|
const value = e.detail.value || '';
|
||||||
|
setWorkedSecCategoryStr(value);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useImperativeHandle(
|
useImperativeHandle(
|
||||||
ref,
|
ref,
|
||||||
() => ({
|
() => ({
|
||||||
getData: () => ({ name, gender, age, height, weight, shoeSize }),
|
getData: () => ({ name, gender, age, workedSecCategoryStr }),
|
||||||
}),
|
}),
|
||||||
[name, gender, age, height, weight, shoeSize]
|
[name, gender, age, workedSecCategoryStr]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -82,29 +60,17 @@ function ProfileBasicFragment(props: IProps, ref) {
|
|||||||
<BlFormItem title="称呼">
|
<BlFormItem title="称呼">
|
||||||
<BlFormInput value={name} onInput={handleInputName} />
|
<BlFormInput value={name} onInput={handleInputName} />
|
||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
|
<BlFormItem title="年龄">
|
||||||
|
<BlFormInput value={String(age)} type="number" maxlength={3} onInput={handleInputAge} rightText="岁" />
|
||||||
|
</BlFormItem>
|
||||||
<BlFormItem title="性别">
|
<BlFormItem title="性别">
|
||||||
<BlFormRadioGroup direction="horizontal" value={gender} onChange={handleGenderChange}>
|
<BlFormRadioGroup direction="horizontal" value={gender} onChange={handleGenderChange}>
|
||||||
<BlFormRadio name={GenderType.WOMEN} text="女" value={gender} />
|
<BlFormRadio name={GenderType.WOMEN} text="女" value={gender} />
|
||||||
<BlFormRadio name={GenderType.MEN} text="男" value={gender} />
|
<BlFormRadio name={GenderType.MEN} text="男" value={gender} />
|
||||||
</BlFormRadioGroup>
|
</BlFormRadioGroup>
|
||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
<BlFormItem title="年龄">
|
<BlFormItem title="直播过的品类" optional>
|
||||||
<BlFormInput value={String(age)} type="number" maxlength={3} onInput={handleInputAge} rightText="岁" />
|
<BlFormInput value={workedSecCategoryStr} maxlength={140} onInput={handleInputWorkedSecCategoryStr} />
|
||||||
</BlFormItem>
|
|
||||||
<BlFormItem title="身高">
|
|
||||||
<BlFormInput value={String(height)} type="number" maxlength={3} onInput={handleInputHeight} rightText="CM" />
|
|
||||||
</BlFormItem>
|
|
||||||
<BlFormItem title="体重">
|
|
||||||
<BlFormInput value={String(weight)} type="number" maxlength={3} onInput={handleInputWeight} rightText="KG" />
|
|
||||||
</BlFormItem>
|
|
||||||
<BlFormItem title="鞋码" optional>
|
|
||||||
<BlFormInput
|
|
||||||
value={String(shoeSize)}
|
|
||||||
type="number"
|
|
||||||
maxlength={2}
|
|
||||||
onInput={handleInputShoeSize}
|
|
||||||
rightText="码"
|
|
||||||
/>
|
|
||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -48,10 +48,9 @@ function ProfileExperienceFragment(props: IProps, ref) {
|
|||||||
const [workedYear, setWorkedYear] = useState(profile.workedYear);
|
const [workedYear, setWorkedYear] = useState(profile.workedYear);
|
||||||
const [workedAccounts, setWorkedAccounts] = useState(profile.workedAccounts || '');
|
const [workedAccounts, setWorkedAccounts] = useState(profile.workedAccounts || '');
|
||||||
const [newAccountExperience, setNewAccountExperience] = useState(profile.newAccountExperience);
|
const [newAccountExperience, setNewAccountExperience] = useState(profile.newAccountExperience);
|
||||||
const [workedSecCategoryStr, setWorkedSecCategoryStr] = useState(profile.workedSecCategoryStr || '');
|
|
||||||
// const [style, setStyle] = useState(calcInitStyle(profile.style));
|
// const [style, setStyle] = useState(calcInitStyle(profile.style));
|
||||||
const [maxGmv, setMaxGmv] = useState(calcInitMaxGmv(profile?.maxGmv || 0));
|
const [maxGmv, setMaxGmv] = useState(calcInitMaxGmv(profile?.maxGmv || 0));
|
||||||
const [maxOnline, setMaxOnline] = useState(profile.maxOnline || '');
|
// const [maxOnline, setMaxOnline] = useState(profile.maxOnline || '');
|
||||||
|
|
||||||
const handleSelectWorkYear = useCallback((newYear: WorkedYears) => {
|
const handleSelectWorkYear = useCallback((newYear: WorkedYears) => {
|
||||||
setWorkedYear(newYear);
|
setWorkedYear(newYear);
|
||||||
@ -67,11 +66,6 @@ function ProfileExperienceFragment(props: IProps, ref) {
|
|||||||
setNewAccountExperience(value);
|
setNewAccountExperience(value);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleInputWorkedSecCategoryStr = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
|
||||||
const value = e.detail.value || '';
|
|
||||||
setWorkedSecCategoryStr(value);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// const handleStyleChange = useCallback((value: StyleType[]) => {
|
// const handleStyleChange = useCallback((value: StyleType[]) => {
|
||||||
// log('handleStyleChange', value);
|
// log('handleStyleChange', value);
|
||||||
// setStyle(value);
|
// setStyle(value);
|
||||||
@ -84,14 +78,14 @@ function ProfileExperienceFragment(props: IProps, ref) {
|
|||||||
}
|
}
|
||||||
setMaxGmv(string2Number(value));
|
setMaxGmv(string2Number(value));
|
||||||
}, []);
|
}, []);
|
||||||
|
//
|
||||||
const handleInputMaxOnline = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
// const handleInputMaxOnline = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
||||||
const value = e.detail.value || '';
|
// const value = e.detail.value || '';
|
||||||
if (Number.isNaN(Number(value))) {
|
// if (Number.isNaN(Number(value))) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
setMaxOnline(string2Number(value));
|
// setMaxOnline(string2Number(value));
|
||||||
}, []);
|
// }, []);
|
||||||
|
|
||||||
useImperativeHandle(
|
useImperativeHandle(
|
||||||
ref,
|
ref,
|
||||||
@ -100,22 +94,21 @@ function ProfileExperienceFragment(props: IProps, ref) {
|
|||||||
workedYear,
|
workedYear,
|
||||||
workedAccounts,
|
workedAccounts,
|
||||||
newAccountExperience,
|
newAccountExperience,
|
||||||
workedSecCategoryStr,
|
|
||||||
// style: getStyleString(style.sort()),
|
// style: getStyleString(style.sort()),
|
||||||
maxOnline: maxOnline === '' ? undefined : maxOnline,
|
// maxOnline: maxOnline === '' ? undefined : maxOnline,
|
||||||
maxGmv: maxGmv === '' ? undefined : getMaxGmv(Number(maxGmv)),
|
maxGmv: maxGmv === '' ? undefined : getMaxGmv(Number(maxGmv)),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
[workedYear, workedAccounts, newAccountExperience, workedSecCategoryStr, maxGmv, maxOnline]
|
[workedYear, workedAccounts, newAccountExperience, maxGmv]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<BlFormItem title="直播经验">
|
<BlFormItem title="直播经验" optional>
|
||||||
<BlFormSelect title="直播经验" value={workedYear} options={WORK_YEAR_OPTIONS} onSelect={handleSelectWorkYear} />
|
<BlFormSelect title="直播经验" value={workedYear} options={WORK_YEAR_OPTIONS} onSelect={handleSelectWorkYear} />
|
||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
<BlFormItem title="直播过的品类" optional>
|
<BlFormItem title="直播过的账号" optional>
|
||||||
<BlFormInput value={workedSecCategoryStr} maxlength={140} onInput={handleInputWorkedSecCategoryStr} />
|
<BlFormInput value={workedAccounts} maxlength={140} onInput={handleInputWorkedAccounts} />
|
||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
<BlFormItem title="自然流起号经验" optional>
|
<BlFormItem title="自然流起号经验" optional>
|
||||||
<BlFormRadioGroup
|
<BlFormRadioGroup
|
||||||
@ -127,9 +120,6 @@ function ProfileExperienceFragment(props: IProps, ref) {
|
|||||||
<BlFormRadio name text="有" value={newAccountExperience} />
|
<BlFormRadio name text="有" value={newAccountExperience} />
|
||||||
</BlFormRadioGroup>
|
</BlFormRadioGroup>
|
||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
<BlFormItem title="直播过的账号" optional>
|
|
||||||
<BlFormInput value={workedAccounts} maxlength={140} onInput={handleInputWorkedAccounts} />
|
|
||||||
</BlFormItem>
|
|
||||||
{/* <ProfileEditItem title="直播风格" optional>
|
{/* <ProfileEditItem title="直播风格" optional>
|
||||||
<ProfileCheckboxGroup value={style} onChange={handleStyleChange}>
|
<ProfileCheckboxGroup value={style} onChange={handleStyleChange}>
|
||||||
<ProfileCheckbox value={style} name={StyleType.Broadcasting} text="平播" />
|
<ProfileCheckbox value={style} name={StyleType.Broadcasting} text="平播" />
|
||||||
@ -140,9 +130,9 @@ function ProfileExperienceFragment(props: IProps, ref) {
|
|||||||
<BlFormItem title="最高GMV" optional>
|
<BlFormItem title="最高GMV" optional>
|
||||||
<BlFormInput value={String(maxGmv)} type="number" maxlength={10} onInput={handleInputMaxGmv} rightText="W" />
|
<BlFormInput value={String(maxGmv)} type="number" maxlength={10} onInput={handleInputMaxGmv} rightText="W" />
|
||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
<BlFormItem title="最高在线人数" optional>
|
{/*<BlFormItem title="最高在线人数" optional>*/}
|
||||||
<BlFormInput value={String(maxOnline)} type="number" onInput={handleInputMaxOnline} rightText="人" />
|
{/* <BlFormInput value={String(maxOnline)} type="number" onInput={handleInputMaxOnline} rightText="人" />*/}
|
||||||
</BlFormItem>
|
{/*</BlFormItem>*/}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,4 +45,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
.transparent {
|
||||||
|
background: transparent;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -3,12 +3,21 @@ import Taro from '@tarojs/taro';
|
|||||||
|
|
||||||
import { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from 'react';
|
import { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from 'react';
|
||||||
|
|
||||||
|
import { BlCheckbox, BlCheckboxGroup } from '@/components/bl-checkbox';
|
||||||
import BlFormItem from '@/components/bl-form-item';
|
import BlFormItem from '@/components/bl-form-item';
|
||||||
import { BlFormRadio, BlFormRadioGroup } from '@/components/bl-form-radio';
|
import { BlFormRadio, BlFormRadioGroup } from '@/components/bl-form-radio';
|
||||||
import BlFormSelect from '@/components/bl-form-select';
|
import BlFormSelect from '@/components/bl-form-select';
|
||||||
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
||||||
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||||
import { EmployType, EMPLOY_TYPE_TITLE_MAP, FULL_PRICE_OPTIONS, PART_PRICE_OPTIONS } from '@/constants/job';
|
import {
|
||||||
|
EmployType,
|
||||||
|
EMPLOY_TYPE_TITLE_MAP,
|
||||||
|
FULL_PRICE_OPTIONS,
|
||||||
|
PART_PRICE_OPTIONS,
|
||||||
|
ALL_JOB_TYPES,
|
||||||
|
JobType,
|
||||||
|
JOB_TYPE_TITLE_MAP,
|
||||||
|
} from '@/constants/job';
|
||||||
import { SalaryRange } from '@/types/job';
|
import { SalaryRange } from '@/types/job';
|
||||||
import { MaterialProfile } from '@/types/material';
|
import { MaterialProfile } from '@/types/material';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
@ -60,6 +69,12 @@ const getSalaryPrice = (fullSalary?: SalaryRange, partSalary?: SalaryRange) => {
|
|||||||
return price;
|
return price;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getWorkedCategoryString = (workedCategory: JobType[]) => workedCategory.join(',');
|
||||||
|
|
||||||
|
const getWorkedCategory = (workedCategory?: string): JobType[] => {
|
||||||
|
return workedCategory ? (workedCategory.split(',') as JobType[]).filter(v => ALL_JOB_TYPES.includes(v)) : [];
|
||||||
|
};
|
||||||
|
|
||||||
function ProfileIntentionFragment(props: IProps, ref) {
|
function ProfileIntentionFragment(props: IProps, ref) {
|
||||||
const { profile } = props;
|
const { profile } = props;
|
||||||
const [cityCodes, setCityCodes] = useState(calcInitCityCodes(profile.cityCodes || ''));
|
const [cityCodes, setCityCodes] = useState(calcInitCityCodes(profile.cityCodes || ''));
|
||||||
@ -67,6 +82,7 @@ function ProfileIntentionFragment(props: IProps, ref) {
|
|||||||
const [fullSalary, setFullSalary] = useState(calcSalarySelect(profile, true));
|
const [fullSalary, setFullSalary] = useState(calcSalarySelect(profile, true));
|
||||||
const [partSalary, setPartSalary] = useState(calcSalarySelect(profile, false));
|
const [partSalary, setPartSalary] = useState(calcSalarySelect(profile, false));
|
||||||
const [acceptWorkForSit, setAcceptWorkForSit] = useState(profile.acceptWorkForSit);
|
const [acceptWorkForSit, setAcceptWorkForSit] = useState(profile.acceptWorkForSit);
|
||||||
|
const [workedCategory, setWorkedCategory] = useState<JobType[]>(getWorkedCategory(profile.workedCategory));
|
||||||
|
|
||||||
const handleDeleteCity = useCallback(
|
const handleDeleteCity = useCallback(
|
||||||
(deleteCode: string) => {
|
(deleteCode: string) => {
|
||||||
@ -85,7 +101,7 @@ function ProfileIntentionFragment(props: IProps, ref) {
|
|||||||
data => {
|
data => {
|
||||||
log('handleSelectCity', data);
|
log('handleSelectCity', data);
|
||||||
realtimeLogger.info('handleSelectCity', data);
|
realtimeLogger.info('handleSelectCity', data);
|
||||||
const { openSource, cityCode: code } = data;
|
const { cityCode: code } = data;
|
||||||
// if (openSource !== OpenSource.AddIndentCity) {
|
// if (openSource !== OpenSource.AddIndentCity) {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
@ -118,6 +134,11 @@ function ProfileIntentionFragment(props: IProps, ref) {
|
|||||||
setAcceptWorkForSit(value);
|
setAcceptWorkForSit(value);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleWorkedCategoryChange = useCallback((value: JobType[]) => {
|
||||||
|
log('handleWorkedCategoryChange', value);
|
||||||
|
setWorkedCategory(value);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Taro.eventCenter.on(EventName.SELECT_CITY, handleSelectCity);
|
Taro.eventCenter.on(EventName.SELECT_CITY, handleSelectCity);
|
||||||
return () => {
|
return () => {
|
||||||
@ -132,10 +153,11 @@ function ProfileIntentionFragment(props: IProps, ref) {
|
|||||||
cityCodes: getCityCodeString(cityCodes),
|
cityCodes: getCityCodeString(cityCodes),
|
||||||
employType,
|
employType,
|
||||||
acceptWorkForSit,
|
acceptWorkForSit,
|
||||||
|
workedCategory: getWorkedCategoryString(workedCategory),
|
||||||
...getSalaryPrice(fullSalary, partSalary),
|
...getSalaryPrice(fullSalary, partSalary),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
[cityCodes, employType, fullSalary, partSalary, acceptWorkForSit]
|
[cityCodes, employType, fullSalary, partSalary, acceptWorkForSit, workedCategory]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -174,7 +196,7 @@ function ProfileIntentionFragment(props: IProps, ref) {
|
|||||||
</BlFormRadioGroup>
|
</BlFormRadioGroup>
|
||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
{isFullTimePriceRequired(employType) && (
|
{isFullTimePriceRequired(employType) && (
|
||||||
<BlFormItem title="期望全职薪资">
|
<BlFormItem title="期望全职薪资" subTitle="重要">
|
||||||
<BlFormSelect
|
<BlFormSelect
|
||||||
title="期望全职薪资"
|
title="期望全职薪资"
|
||||||
value={fullSalary}
|
value={fullSalary}
|
||||||
@ -184,7 +206,7 @@ function ProfileIntentionFragment(props: IProps, ref) {
|
|||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
)}
|
)}
|
||||||
{isPartTimePriceRequired(employType) && (
|
{isPartTimePriceRequired(employType) && (
|
||||||
<BlFormItem title="期望兼职薪资">
|
<BlFormItem title="期望兼职薪资" subTitle="重要">
|
||||||
<BlFormSelect
|
<BlFormSelect
|
||||||
title="期望兼职薪资"
|
title="期望兼职薪资"
|
||||||
value={partSalary}
|
value={partSalary}
|
||||||
@ -193,12 +215,19 @@ function ProfileIntentionFragment(props: IProps, ref) {
|
|||||||
/>
|
/>
|
||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
)}
|
)}
|
||||||
<BlFormItem title="是否接受坐班">
|
<BlFormItem title="是否接受坐班" optional>
|
||||||
<BlFormRadioGroup direction="horizontal" value={acceptWorkForSit} onChange={handleAcceptSittingChange}>
|
<BlFormRadioGroup direction="horizontal" value={acceptWorkForSit} onChange={handleAcceptSittingChange}>
|
||||||
<BlFormRadio name text="接受" value={acceptWorkForSit} />
|
<BlFormRadio name text="接受" value={acceptWorkForSit} />
|
||||||
<BlFormRadio name={false} text="不接受" value={acceptWorkForSit} />
|
<BlFormRadio name={false} text="不接受" value={acceptWorkForSit} />
|
||||||
</BlFormRadioGroup>
|
</BlFormRadioGroup>
|
||||||
</BlFormItem>
|
</BlFormItem>
|
||||||
|
<BlFormItem title="意向类目" subTitle="多选" dynamicHeight contentClassName="transparent">
|
||||||
|
<BlCheckboxGroup value={workedCategory} onChange={handleWorkedCategoryChange}>
|
||||||
|
{ALL_JOB_TYPES.filter(type => type !== JobType.All).map(type => {
|
||||||
|
return <BlCheckbox text={JOB_TYPE_TITLE_MAP[type]} key={type} name={type} />;
|
||||||
|
})}
|
||||||
|
</BlCheckboxGroup>
|
||||||
|
</BlFormItem>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
15
src/fragments/profile/others/index.less
Normal file
15
src/fragments/profile/others/index.less
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
@import '@/styles/common.less';
|
||||||
|
@import '@/styles/variables.less';
|
||||||
|
|
||||||
|
.fragment-profile-others {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 40px;
|
||||||
|
|
||||||
|
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
94
src/fragments/profile/others/index.tsx
Normal file
94
src/fragments/profile/others/index.tsx
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
import { BaseEventOrig, InputProps } from '@tarojs/components';
|
||||||
|
|
||||||
|
import { forwardRef, useCallback, useImperativeHandle, useState } from 'react';
|
||||||
|
|
||||||
|
import BlFormInput from '@/components/bl-form-input';
|
||||||
|
import BlFormItem from '@/components/bl-form-item';
|
||||||
|
import BlFormSelect from '@/components/bl-form-select';
|
||||||
|
import { EDUCATION_TYPE_OPTIONS, EducationType } from '@/constants/material';
|
||||||
|
import { MaterialProfile } from '@/types/material';
|
||||||
|
import { logWithPrefix, string2Number } from '@/utils/common';
|
||||||
|
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
profile: Partial<MaterialProfile>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const PREFIX = 'fragment-profile-others';
|
||||||
|
const log = logWithPrefix(PREFIX);
|
||||||
|
|
||||||
|
function ProfileOthersFragment(props: IProps, ref) {
|
||||||
|
const { profile } = props;
|
||||||
|
const [educationType, setEducationType] = useState(profile.educationType || '');
|
||||||
|
const [height, setHeight] = useState(profile.height || '');
|
||||||
|
const [weight, setWeight] = useState(profile.weight || '');
|
||||||
|
const [shoeSize, setShoeSize] = useState(profile.shoeSize || '');
|
||||||
|
|
||||||
|
const handleInputHeight = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
||||||
|
const value = e.detail.value || '';
|
||||||
|
if (Number.isNaN(Number(value))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setHeight(string2Number(value));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleInputWeight = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
||||||
|
const value = e.detail.value || '';
|
||||||
|
if (Number.isNaN(Number(value))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setWeight(string2Number(value));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleInputShoeSize = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
|
||||||
|
const value = e.detail.value || '';
|
||||||
|
if (Number.isNaN(Number(value))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setShoeSize(string2Number(value));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleSelectEducationType = useCallback((type: EducationType) => {
|
||||||
|
setEducationType(type);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useImperativeHandle(
|
||||||
|
ref,
|
||||||
|
() => ({
|
||||||
|
getData: () => ({ height, weight, shoeSize, educationType }),
|
||||||
|
}),
|
||||||
|
[height, weight, shoeSize, educationType]
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<div className={`${PREFIX}__title`}>服饰等穿版品类必填,其他品类选填</div>
|
||||||
|
<BlFormItem title="身高" optional>
|
||||||
|
<BlFormInput value={String(height)} type="number" maxlength={3} onInput={handleInputHeight} rightText="CM" />
|
||||||
|
</BlFormItem>
|
||||||
|
<BlFormItem title="体重" optional>
|
||||||
|
<BlFormInput value={String(weight)} type="number" maxlength={3} onInput={handleInputWeight} rightText="KG" />
|
||||||
|
</BlFormItem>
|
||||||
|
<BlFormItem title="鞋码" optional>
|
||||||
|
<BlFormInput
|
||||||
|
value={String(shoeSize)}
|
||||||
|
type="number"
|
||||||
|
maxlength={2}
|
||||||
|
onInput={handleInputShoeSize}
|
||||||
|
rightText="码"
|
||||||
|
/>
|
||||||
|
</BlFormItem>
|
||||||
|
<BlFormItem title="学历" optional>
|
||||||
|
<BlFormSelect
|
||||||
|
title="学历"
|
||||||
|
value={educationType}
|
||||||
|
options={EDUCATION_TYPE_OPTIONS}
|
||||||
|
onSelect={handleSelectEducationType}
|
||||||
|
/>
|
||||||
|
</BlFormItem>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default forwardRef(ProfileOthersFragment);
|
||||||
@ -8,16 +8,22 @@ import DevDiv from '@/components/dev-div';
|
|||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
import { OpenSource, PageUrl } from '@/constants/app';
|
import { OpenSource, PageUrl } from '@/constants/app';
|
||||||
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||||
import { FULL_PRICE_OPTIONS, PART_PRICE_OPTIONS } from '@/constants/job';
|
import { FULL_PRICE_OPTIONS, JOB_TYPE_TITLE_MAP, JobType, PART_PRICE_OPTIONS } from '@/constants/job';
|
||||||
import { ProfileGroupType, ProfileTitleMap, WORK_YEAR_OPTIONS } from '@/constants/material';
|
import {
|
||||||
|
EDUCATION_TYPE_LABELS,
|
||||||
|
GenderType,
|
||||||
|
ProfileGroupType,
|
||||||
|
ProfileTitleMap,
|
||||||
|
WORK_YEAR_OPTIONS,
|
||||||
|
} from '@/constants/material';
|
||||||
import { MaterialProfile } from '@/types/material';
|
import { MaterialProfile } from '@/types/material';
|
||||||
import { logWithPrefix, isDesktop } from '@/utils/common';
|
import { isDesktop, logWithPrefix } from '@/utils/common';
|
||||||
import { getBasicInfo, sortVideos } from '@/utils/material';
|
import { sortVideos } from '@/utils/material';
|
||||||
import { navigateTo } from '@/utils/route';
|
import { navigateTo } from '@/utils/route';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
import onChangeEventDetail = SwiperProps.onChangeEventDetail;
|
|
||||||
import { JoinGroupHint } from '@/components/join-group-hint';
|
import { JoinGroupHint } from '@/components/join-group-hint';
|
||||||
|
import onChangeEventDetail = SwiperProps.onChangeEventDetail;
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
editable: boolean;
|
editable: boolean;
|
||||||
@ -30,7 +36,7 @@ const log = logWithPrefix(PREFIX);
|
|||||||
const DEFAULT_TEXT = '未填写';
|
const DEFAULT_TEXT = '未填写';
|
||||||
|
|
||||||
const getIndentCity = (codeString: string = '') => {
|
const getIndentCity = (codeString: string = '') => {
|
||||||
const codes = (codeString||'').split('、');
|
const codes = (codeString || '').split('、');
|
||||||
const cityNames: string[] = [];
|
const cityNames: string[] = [];
|
||||||
codes.forEach(code => {
|
codes.forEach(code => {
|
||||||
const cityName = CITY_CODE_TO_NAME_MAP.get(code);
|
const cityName = CITY_CODE_TO_NAME_MAP.get(code);
|
||||||
@ -63,7 +69,14 @@ const getWorkYear = (year: number) => {
|
|||||||
const y = Math.min(year, 3);
|
const y = Math.min(year, 3);
|
||||||
return WORK_YEAR_OPTIONS.find(option => option.value === y)?.label || `${y}年`;
|
return WORK_YEAR_OPTIONS.find(option => option.value === y)?.label || `${y}年`;
|
||||||
};
|
};
|
||||||
|
const getWorkedCategory = (workedCategory?: string): string => {
|
||||||
|
return workedCategory
|
||||||
|
? (workedCategory.split(',') as JobType[])
|
||||||
|
.map(v => (v !== JobType.All ? JOB_TYPE_TITLE_MAP[v] : null))
|
||||||
|
.filter(Boolean)
|
||||||
|
.join('、')
|
||||||
|
: '';
|
||||||
|
};
|
||||||
const getDataGroup = (profile: MaterialProfile | null) => {
|
const getDataGroup = (profile: MaterialProfile | null) => {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
return [];
|
return [];
|
||||||
@ -77,6 +90,7 @@ const getDataGroup = (profile: MaterialProfile | null) => {
|
|||||||
{ title: '兼职薪资', value: getIndentPrice(profile.partyTimeMinPrice, profile.partyTimeMaxPrice, false) || '' },
|
{ title: '兼职薪资', value: getIndentPrice(profile.partyTimeMinPrice, profile.partyTimeMaxPrice, false) || '' },
|
||||||
{ title: '意向城市', value: getIndentCity(profile.cityCodes) || DEFAULT_TEXT },
|
{ title: '意向城市', value: getIndentCity(profile.cityCodes) || DEFAULT_TEXT },
|
||||||
{ title: '是否接受坐班', value: profile.acceptWorkForSit ? '是' : '否' },
|
{ title: '是否接受坐班', value: profile.acceptWorkForSit ? '是' : '否' },
|
||||||
|
{ title: '意向品类', value: getWorkedCategory(profile.workedCategory) || DEFAULT_TEXT, fullLine: true },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -86,9 +100,18 @@ const getDataGroup = (profile: MaterialProfile | null) => {
|
|||||||
{ title: '直播年限', value: getWorkYear(profile.workedYear) || DEFAULT_TEXT },
|
{ title: '直播年限', value: getWorkYear(profile.workedYear) || DEFAULT_TEXT },
|
||||||
{ title: '直播过的账号', value: profile.workedAccounts || DEFAULT_TEXT },
|
{ title: '直播过的账号', value: profile.workedAccounts || DEFAULT_TEXT },
|
||||||
{ title: '自然流起号经验', value: Boolean(profile.newAccountExperience) ? '有' : '无' },
|
{ title: '自然流起号经验', value: Boolean(profile.newAccountExperience) ? '有' : '无' },
|
||||||
{ title: '直播过的品类', value: profile.workedSecCategoryStr || DEFAULT_TEXT },
|
// { title: '直播过的品类', value: profile.workedSecCategoryStr || DEFAULT_TEXT },
|
||||||
{ title: '最高GMV', value: profile.maxGmv ? `${profile.maxGmv / 10000}万` : DEFAULT_TEXT },
|
{ title: '最高GMV', value: profile.maxGmv ? `${profile.maxGmv / 10000}万` : DEFAULT_TEXT },
|
||||||
{ title: '最高在线人数', value: profile.maxOnline || DEFAULT_TEXT },
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: ProfileTitleMap[ProfileGroupType.Others],
|
||||||
|
type: ProfileGroupType.Others,
|
||||||
|
items: [
|
||||||
|
{ title: '身高', value: profile.height ? `${profile.height}cm` : DEFAULT_TEXT },
|
||||||
|
{ title: '体重', value: profile.weight ? `${profile.weight}kg` : DEFAULT_TEXT },
|
||||||
|
{ title: '鞋码', value: profile.shoeSize ? `${profile.shoeSize}码` : DEFAULT_TEXT },
|
||||||
|
{ title: '学历', value: EDUCATION_TYPE_LABELS[profile.educationType] || DEFAULT_TEXT },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -99,6 +122,16 @@ const getDataGroup = (profile: MaterialProfile | null) => {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getBasicInfo = (profile: Pick<MaterialProfile, 'age' | 'gender'>) => {
|
||||||
|
const result: string[] = [];
|
||||||
|
if (typeof profile.age !== 'undefined' && profile.age !== null) {
|
||||||
|
result.push(`${profile.age}岁`);
|
||||||
|
}
|
||||||
|
result.push(profile.gender === GenderType.MEN ? '男' : '女');
|
||||||
|
|
||||||
|
return result.join('·');
|
||||||
|
};
|
||||||
|
|
||||||
export default function ProfileViewFragment(props: IProps) {
|
export default function ProfileViewFragment(props: IProps) {
|
||||||
const { profile, editable, onDev } = props;
|
const { profile, editable, onDev } = props;
|
||||||
const [coverIndex, setCoverIndex] = useState(0);
|
const [coverIndex, setCoverIndex] = useState(0);
|
||||||
@ -221,7 +254,10 @@ export default function ProfileViewFragment(props: IProps) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__basic-info__content`}>{getBasicInfo(profile)}</div>
|
<DevDiv className={`${PREFIX}__basic-info__content`} OnDev={onDev}>
|
||||||
|
<div>{getBasicInfo(profile)}</div>
|
||||||
|
<div>{profile.workedSecCategoryStr ? `播过:${profile.workedSecCategoryStr}` : ''}</div>
|
||||||
|
</DevDiv>
|
||||||
<div className={`${PREFIX}__divider`} />
|
<div className={`${PREFIX}__divider`} />
|
||||||
</div>
|
</div>
|
||||||
{dataGroup.map((data, index: number) => (
|
{dataGroup.map((data, index: number) => (
|
||||||
|
|||||||
@ -13,6 +13,21 @@
|
|||||||
.taroify-cell__value {
|
.taroify-cell__value {
|
||||||
color: @blColor;
|
color: @blColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(255, 80, 81, 0.16);
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 16px;
|
||||||
|
> image {
|
||||||
|
width: 18px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__go-publish-cell {
|
&__go-publish-cell {
|
||||||
@ -24,4 +39,6 @@
|
|||||||
color: @blHighlightColor;
|
color: @blHighlightColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { Image } from '@tarojs/components';
|
||||||
|
|
||||||
import { Cell } from '@taroify/core';
|
import { Cell } from '@taroify/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
@ -27,7 +29,14 @@ export default function CompanyFragment() {
|
|||||||
<Cell
|
<Cell
|
||||||
isLink
|
isLink
|
||||||
align="center"
|
align="center"
|
||||||
title="发通告,让主播主动报单"
|
title={
|
||||||
|
<div>
|
||||||
|
<div className={`${PREFIX}__cell-icon`}>
|
||||||
|
<Image src="https://publiccdn.neighbourhood.com.cn/img/lightning.svg" />
|
||||||
|
</div>
|
||||||
|
发布急招通告,优先展示
|
||||||
|
</div>
|
||||||
|
}
|
||||||
className={classNames(`${PREFIX}__cell`, `${PREFIX}__go-publish-cell`)}
|
className={classNames(`${PREFIX}__cell`, `${PREFIX}__go-publish-cell`)}
|
||||||
onClick={handlePublishJob}
|
onClick={handlePublishJob}
|
||||||
>
|
>
|
||||||
|
|||||||
10
src/hooks/use-city-operators.tsx
Normal file
10
src/hooks/use-city-operators.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
|
import { selectCityConfigs } from '@/store/selector';
|
||||||
|
|
||||||
|
function useCityOperators() {
|
||||||
|
const data = useSelector(selectCityConfigs);
|
||||||
|
return data || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
export default useCityOperators;
|
||||||
@ -48,7 +48,7 @@ const CompanyTabs: TabItemType[] = [
|
|||||||
{
|
{
|
||||||
type: PageType.BatchPublish,
|
type: PageType.BatchPublish,
|
||||||
pagePath: PageUrl.UserBatchPublish,
|
pagePath: PageUrl.UserBatchPublish,
|
||||||
text: '代招代发',
|
text: '代招',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -99,6 +99,8 @@ export const APP_CONFIG: AppConfigType = {
|
|||||||
PageUrl.WithdrawRecord,
|
PageUrl.WithdrawRecord,
|
||||||
PageUrl.GroupDelegatePublish,
|
PageUrl.GroupDelegatePublish,
|
||||||
PageUrl.GiveVip,
|
PageUrl.GiveVip,
|
||||||
|
PageUrl.GroupOwnerCertificate,
|
||||||
|
PageUrl.PartnerShareVip,
|
||||||
// PageUrl.DevDebug,
|
// PageUrl.DevDebug,
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
|
|||||||
56
src/hooks/use-publish-job.ts
Normal file
56
src/hooks/use-publish-job.ts
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Dispatch, SetStateAction, useCallback, useState } from 'react';
|
||||||
|
|
||||||
|
import { EventName, PageUrl } from '@/constants/app';
|
||||||
|
import { CertificationStatusType } from '@/constants/company';
|
||||||
|
import { CollectEventName } from '@/constants/event';
|
||||||
|
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 { collectEvent } from '@/utils/event';
|
||||||
|
import { postPublishJob } from '@/utils/job';
|
||||||
|
import { navigateTo } from '@/utils/route';
|
||||||
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
|
export const usePublishJob = (jobId: string): [boolean, Dispatch<SetStateAction<boolean>>, () => Promise<void>] => {
|
||||||
|
const userInfo = useUserInfo();
|
||||||
|
const [showBuy, setShowBuy] = useState(false);
|
||||||
|
|
||||||
|
const handlePublishJob = useCallback(async () => {
|
||||||
|
try {
|
||||||
|
if (userInfo.bossAuthStatus !== CertificationStatusType.Success) {
|
||||||
|
store.dispatch(cacheJobId(jobId));
|
||||||
|
navigateTo(PageUrl.CertificationStart);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Taro.showLoading();
|
||||||
|
await postPublishJob(jobId);
|
||||||
|
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
||||||
|
setShowBuy(false);
|
||||||
|
Toast.success('发布成功');
|
||||||
|
Taro.hideLoading();
|
||||||
|
} catch (error) {
|
||||||
|
Taro.hideLoading();
|
||||||
|
const e = error as HttpError;
|
||||||
|
const errorCode = e.errorCode;
|
||||||
|
const errorMsg = e.info?.() || e.message;
|
||||||
|
collectEvent(CollectEventName.PUBLISH_OPEN_JOB_FAILED, { jobId, error: e.info?.() || e.message });
|
||||||
|
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) {
|
||||||
|
Toast.info('该通告已到期,请创建新通告', 3000);
|
||||||
|
} else {
|
||||||
|
Toast.error(errorMsg || '发布失败请重试', 3000);
|
||||||
|
}
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}, [jobId, userInfo.bossAuthStatus]);
|
||||||
|
|
||||||
|
return [showBuy, setShowBuy, handlePublishJob];
|
||||||
|
};
|
||||||
@ -3,8 +3,8 @@ import { useSelector } from 'react-redux';
|
|||||||
import { selectUserInfo } from '@/store/selector/user';
|
import { selectUserInfo } from '@/store/selector/user';
|
||||||
|
|
||||||
function useUserInfo() {
|
function useUserInfo() {
|
||||||
const useInfo = useSelector(selectUserInfo);
|
const userInfo = useSelector(selectUserInfo);
|
||||||
return useInfo;
|
return userInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default useUserInfo;
|
export default useUserInfo;
|
||||||
|
|||||||
@ -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 = process.env.BRAND === 'dev' ? 'https://dev.neighbourhood.cn' : 'https://neighbourhood.cn';
|
||||||
// export const DOMAIN = 'https://dev.neighbourhood.cn';
|
// export const DOMAIN = 'https://dev.neighbourhood.cn';
|
||||||
export const BASE_URL = `${DOMAIN}/api`;
|
export const BASE_URL = `${DOMAIN}/api`;
|
||||||
@ -41,6 +41,8 @@ export enum API {
|
|||||||
PRODUCT_USE_RECORD = '/product/getProductUseRecord', // 查询某个产品是否已经解锁
|
PRODUCT_USE_RECORD = '/product/getProductUseRecord', // 查询某个产品是否已经解锁
|
||||||
USE_PRODUCT = '/product/use', // 使用某个产品扣费/次数
|
USE_PRODUCT = '/product/use', // 使用某个产品扣费/次数
|
||||||
ALLOW_BUY_PRODUCT = '/product/allowBuyProduct', // 是否可以购买某个产品
|
ALLOW_BUY_PRODUCT = '/product/allowBuyProduct', // 是否可以购买某个产品
|
||||||
|
LIST_PRODUCT_TYPE = '/product/listByType/{productType}',
|
||||||
|
|
||||||
CS_QR_CODE = '/customerService/get', // 客服微信二维码
|
CS_QR_CODE = '/customerService/get', // 客服微信二维码
|
||||||
CREATE_PAY_ORDER = '/payOrder/create', // 创建支付订单
|
CREATE_PAY_ORDER = '/payOrder/create', // 创建支付订单
|
||||||
GET_PAY_ORDER = '/payOrder/get', // 订单查询
|
GET_PAY_ORDER = '/payOrder/get', // 订单查询
|
||||||
@ -85,4 +87,15 @@ export enum API {
|
|||||||
GET_PROFIT_STAT = '/user/profits',
|
GET_PROFIT_STAT = '/user/profits',
|
||||||
WITHDRAW = '/user/withdraw',
|
WITHDRAW = '/user/withdraw',
|
||||||
GET_WITHDRAW_LIST = '/user/withdraw/records',
|
GET_WITHDRAW_LIST = '/user/withdraw/records',
|
||||||
|
GENERATE_MEMBERSHIP_COUPON = '/coupon/membership/generate',
|
||||||
|
CLAIM_MEMBERSHIP_COUPON = '/coupon/membership/claim',
|
||||||
|
GET_VIP_QRCODE = '/user/getVipQrCode',
|
||||||
|
// 群认证
|
||||||
|
GENERATE_GROUP_AUTH_CODE = '/partner/generateGroupAuthCode',
|
||||||
|
DECRYPT_OPEN_GID = '/partner/decryptOpenGid',
|
||||||
|
GET_USER_PROFIT_LIST = '/partner/getLatestUserProfitList',
|
||||||
|
GET_AUTHED_GROUP_LIST = '/partner/getAuthedGroupList',
|
||||||
|
GET_STAFF_CODE = '/partner/staff/{cityCode}',
|
||||||
|
// 所有城市运营
|
||||||
|
GET_ALL_CITY_CONFIGS = '/group/getAllGroup',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,7 +107,7 @@ class Http {
|
|||||||
url: BASE_URL + url,
|
url: BASE_URL + url,
|
||||||
data,
|
data,
|
||||||
method: method,
|
method: method,
|
||||||
header: { 'content-type': contentType /*'user-Id': '588002047871053824' */ },
|
header: { 'content-type': contentType /*,'user-Id': '588002047871053824'*/ },
|
||||||
};
|
};
|
||||||
return this.request(option);
|
return this.request(option);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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,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>({
|
||||||
@ -96,7 +115,6 @@ export default function AnchorPage() {
|
|||||||
const handleChangeSelectJob = useCallback((select?: JobManageInfo) => {
|
const handleChangeSelectJob = useCallback((select?: JobManageInfo) => {
|
||||||
log('select job change', select);
|
log('select job change', select);
|
||||||
setSelectJob(select);
|
setSelectJob(select);
|
||||||
console.log('哈哈哈', !select);
|
|
||||||
setOpenPopup(!select);
|
setOpenPopup(!select);
|
||||||
setLastSelectMyJobId(select?.id || '');
|
setLastSelectMyJobId(select?.id || '');
|
||||||
}, []);
|
}, []);
|
||||||
@ -106,20 +124,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(
|
||||||
@ -199,12 +232,25 @@ export default function AnchorPage() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return getCommonShareMessage({ inviteCode, title: '数万名优质主播等你来挑', path: PageUrl.Anchor });
|
return getCommonShareMessage({ inviteCode, title: '数万名优质主播等你来挑', path: PageUrl.Anchor });
|
||||||
});
|
});
|
||||||
|
|
||||||
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,13 +270,27 @@ 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`}>
|
||||||
<PartnerBanner />
|
<PartnerBanner isBoss />
|
||||||
</div>
|
</div>
|
||||||
<ListWrapper
|
<ListWrapper
|
||||||
filters={filters}
|
filters={filters}
|
||||||
@ -243,12 +303,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
|
||||||
|
|||||||
@ -1 +1,130 @@
|
|||||||
.give-vip {}
|
@import '@/styles/variables.less';
|
||||||
|
@import '@/styles/common.less';
|
||||||
|
|
||||||
|
.give-vip {
|
||||||
|
padding: 40px 24px 200px 24px;
|
||||||
|
&__hint {
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 48px;
|
||||||
|
color: @blColorG2;
|
||||||
|
gap: 12px;
|
||||||
|
.flex-row();
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
&__icon {
|
||||||
|
width: 65px;
|
||||||
|
height: 65px;
|
||||||
|
}
|
||||||
|
&__title {
|
||||||
|
margin-top: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 40px;
|
||||||
|
line-height: 48px;
|
||||||
|
color: @blColor;
|
||||||
|
text-align: center;
|
||||||
|
flex: 0 1 auto;
|
||||||
|
gap: 12px;
|
||||||
|
.flex-row();
|
||||||
|
justify-content: center;
|
||||||
|
.highlight {
|
||||||
|
margin-left: -12px;
|
||||||
|
display: inline-block;
|
||||||
|
color: @blHighlightColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&__bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
&__info {
|
||||||
|
&-block {
|
||||||
|
margin-top: 48px;
|
||||||
|
}
|
||||||
|
&-title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
color: #1d2129;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
&-card {
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 32px;
|
||||||
|
}
|
||||||
|
&-body {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #333333;
|
||||||
|
margin-bottom: 32px;
|
||||||
|
}
|
||||||
|
&-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 614px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&__footer {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px 32px;
|
||||||
|
box-shadow: 0px -4px 20px 0px #00000014;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__footer-body {
|
||||||
|
.flex-row();
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
&__button {
|
||||||
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px;);
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
&__coupon {
|
||||||
|
&-info {
|
||||||
|
position: relative;
|
||||||
|
margin-top: 32px;
|
||||||
|
padding: 24px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 24px;
|
||||||
|
|
||||||
|
.flex-column();
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 48px;
|
||||||
|
color: @blHighlightColor;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
&-intro {
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
color: @blColor;
|
||||||
|
gap: 4px;
|
||||||
|
.flex-row();
|
||||||
|
.highlight {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 56px;
|
||||||
|
color: @blHighlightColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-valid {
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
|
||||||
|
color: @blColorG2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,12 +1,103 @@
|
|||||||
import { Button } from '@taroify/core';
|
import { Image, Button } from '@tarojs/components';
|
||||||
|
import { useLoad } from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Fragment, useCallback, useState } from 'react';
|
||||||
|
|
||||||
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
|
import { claimMembershipCoupon, getCouponCodeFromQuery } from '@/utils/coupon';
|
||||||
|
import { getPageQuery, switchTab } from '@/utils/route';
|
||||||
|
import { formatTime } from '@/utils/time';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'give-vip';
|
const PREFIX = 'give-vip';
|
||||||
const log = logWithPrefix(PREFIX);
|
const log = logWithPrefix(PREFIX);
|
||||||
|
|
||||||
export default function GiveVip() {
|
enum State {
|
||||||
return <div className={PREFIX}></div>;
|
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>{usedBefore ? '宝子,你已经领过了,下周再来' : '宝子,播络会员领取成功'}</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__coupon-info`}>
|
||||||
|
<Image src="https://publiccdn.neighbourhood.com.cn/img/parnet-share-bg.png" className={`${PREFIX}__bg`} />
|
||||||
|
<div className={`${PREFIX}__coupon-title`}>播络日会员</div>
|
||||||
|
<div className={`${PREFIX}__coupon-intro`}>
|
||||||
|
会员有效期内可增加<div className="highlight">10次</div>报单机会
|
||||||
|
</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
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/link-invalid.svg"
|
||||||
|
mode="aspectFit"
|
||||||
|
className={`${PREFIX}__icon`}
|
||||||
|
/>
|
||||||
|
<div className={`${PREFIX}__hint-title`}>宝子,链接已失效</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__title`}>
|
||||||
|
请联系分享人<div className="highlight">再次分享</div>
|
||||||
|
</div>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
<div className={`${PREFIX}__info-block`}>
|
||||||
|
<div className={`${PREFIX}__info-title`}>播络简介</div>
|
||||||
|
<div className={`${PREFIX}__info-card`}>
|
||||||
|
<div className={`${PREFIX}__info-body`}>
|
||||||
|
播络通告整理汇集了本地每日新增带货主播通告,方便大家及时找到高薪工作
|
||||||
|
</div>
|
||||||
|
<Image
|
||||||
|
className={`${PREFIX}__info-img`}
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/partner-share-coupon-img.png"
|
||||||
|
mode="heightFix"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__footer`}>
|
||||||
|
<div className={`${PREFIX}__footer-body`}>
|
||||||
|
<Button className={`${PREFIX}__button`} onClick={handleNavigate}>
|
||||||
|
立即使用
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<SafeBottomPadding />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: '群代发',
|
navigationBarTitleText: '加速招聘',
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,12 +1,25 @@
|
|||||||
|
import { useLoad } from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
import UserBatchPublish from '@/components/user-batch-publish';
|
import UserBatchPublish from '@/components/user-batch-publish';
|
||||||
|
import { getPageQuery } from '@/utils/route';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'group-delegate-publish';
|
const PREFIX = 'group-delegate-publish';
|
||||||
|
|
||||||
export default function Partner() {
|
export default function Partner() {
|
||||||
|
const [cityCode, setCityCode] = useState('');
|
||||||
|
const [jobId, setJobId] = useState('');
|
||||||
|
|
||||||
|
useLoad(() => {
|
||||||
|
const query = getPageQuery<{ cityCode: string; jobId: string }>();
|
||||||
|
setCityCode(query.cityCode);
|
||||||
|
setJobId(query.jobId);
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<UserBatchPublish />
|
<UserBatchPublish cityCode={cityCode} jobId={jobId} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
4
src/pages/group-owner-certification/index.config.ts
Normal file
4
src/pages/group-owner-certification/index.config.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '群主认证',
|
||||||
|
enableShareAppMessage: true,
|
||||||
|
});
|
||||||
129
src/pages/group-owner-certification/index.less
Normal file
129
src/pages/group-owner-certification/index.less
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
@import '@/styles/common.less';
|
||||||
|
@import '@/styles/variables.less';
|
||||||
|
|
||||||
|
.group-owner-certification {
|
||||||
|
&__tabs {
|
||||||
|
--tabs-active-color: @blHighlightColor;
|
||||||
|
--tabs-nav-background-color: #fff;
|
||||||
|
--tabs-wrap-height: 98px;
|
||||||
|
|
||||||
|
> .taroify-tabs__wrap {
|
||||||
|
position: fixed;
|
||||||
|
width: 100vw;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .taroify-tabs__content {
|
||||||
|
padding-top: var(--tabs-wrap-height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__main {
|
||||||
|
padding-left: 24px;
|
||||||
|
padding-right: 24px;
|
||||||
|
padding-top: 48px;
|
||||||
|
padding-bottom: calc(48px + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(48px + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
&__block {
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 24px 32px;
|
||||||
|
margin-bottom: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__bold {
|
||||||
|
font-weight: 500;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__body {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: @blColor;
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
color: @blHighlightColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
|
||||||
|
color: #1d2129;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__share {
|
||||||
|
.button(@height: 72px; @width: 384px; @fontSize: 28px; @fontWeight: 400; @borderRadius: 44px; @highlight: 0);
|
||||||
|
margin-top: 32px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
&__lined-wrapper {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 48px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
&__lined-title {
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #333333;
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: -68px;
|
||||||
|
width: 56px;
|
||||||
|
height: 1px;
|
||||||
|
background: #ccc;
|
||||||
|
top: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
right: -68px;
|
||||||
|
width: 56px;
|
||||||
|
height: 1px;
|
||||||
|
background: #ccc;
|
||||||
|
top: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&__city-select {
|
||||||
|
background: #F7F7F7;
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 34px 32px;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
color: #333333;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
&__qrcode {
|
||||||
|
width: 280px;
|
||||||
|
height: 280px;
|
||||||
|
background: #6F7686;
|
||||||
|
display: block;
|
||||||
|
margin: auto auto 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
126
src/pages/group-owner-certification/index.tsx
Normal file
126
src/pages/group-owner-certification/index.tsx
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
import { Button, Image } from '@tarojs/components';
|
||||||
|
import Taro, { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Tabs } from '@taroify/core';
|
||||||
|
import { Arrow } from '@taroify/icons';
|
||||||
|
import { Fragment, useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
import GroupCertificationList from '@/components/group-certification-list';
|
||||||
|
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
||||||
|
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||||
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import useLocation from '@/hooks/use-location';
|
||||||
|
import { StaffInfo } from '@/types/partner';
|
||||||
|
import { generateGroupAuthCode, getStaffInfo } from '@/utils/partner';
|
||||||
|
import { navigateTo } from '@/utils/route';
|
||||||
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const PREFIX = 'group-owner-certification';
|
||||||
|
|
||||||
|
export default function GroupOwnerCertification() {
|
||||||
|
const location = useLocation();
|
||||||
|
const inviteCode = useInviteCode();
|
||||||
|
const [cityCode, setCityCode] = useState<string>();
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
useShareAppMessage(async () => {
|
||||||
|
const { authCode } = await generateGroupAuthCode();
|
||||||
|
return getCommonShareMessage({
|
||||||
|
useCapture: false,
|
||||||
|
title: `我在认证群主,宝子帮我点击下 ${authCode}`,
|
||||||
|
inviteCode,
|
||||||
|
params: { authCode },
|
||||||
|
path: PageUrl.Job,
|
||||||
|
imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-group-owner-certificate.png',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleClickCityMenu = useCallback(() => {
|
||||||
|
navigateTo(PageUrl.CitySearch, { city: cityCode || location.cityCode, source: OpenSource.GroupOwnerCertificate });
|
||||||
|
}, [cityCode, location.cityCode]);
|
||||||
|
|
||||||
|
const handleCityChange = useCallback(data => {
|
||||||
|
console.log('handleCityChange', data);
|
||||||
|
const { openSource, cityCode: cCode } = data;
|
||||||
|
if (openSource !== OpenSource.GroupOwnerCertificate) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setCityCode(cCode);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
|
||||||
|
return () => {
|
||||||
|
Taro.eventCenter.off(EventName.SELECT_CITY, handleCityChange);
|
||||||
|
};
|
||||||
|
}, [handleCityChange]);
|
||||||
|
|
||||||
|
const [staffInfo, setStaffInfo] = useState<StaffInfo | null>(null);
|
||||||
|
useEffect(() => {
|
||||||
|
if (!cityCode) return;
|
||||||
|
|
||||||
|
getStaffInfo(cityCode)
|
||||||
|
.then(data => {
|
||||||
|
setStaffInfo(data);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setStaffInfo(null);
|
||||||
|
});
|
||||||
|
}, [cityCode]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<Tabs className={`${PREFIX}__tabs`}>
|
||||||
|
<Tabs.TabPane value={0} title="认证方法">
|
||||||
|
<div className={`${PREFIX}__main`}>
|
||||||
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>第一步:拉运营入群</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div>拉播络城市运营进入你的带货主播群,</div>
|
||||||
|
<div>请确认你是群主且是带货主播群,不然不要拉</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__lined-wrapper`}>
|
||||||
|
<div className={`${PREFIX}__lined-title`}>选择城市,添加运营</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__city-select`} onClick={handleClickCityMenu}>
|
||||||
|
{cityCode ? CITY_CODE_TO_NAME_MAP.get(cityCode) : '请选择城市'}
|
||||||
|
<Arrow size={16} />
|
||||||
|
</div>
|
||||||
|
{staffInfo && (
|
||||||
|
<Fragment>
|
||||||
|
<div className={`${PREFIX}__lined-wrapper`}>
|
||||||
|
<div className={`${PREFIX}__lined-title`}>长按并识别二维码添加运营</div>
|
||||||
|
</div>
|
||||||
|
<Image
|
||||||
|
className={`${PREFIX}__qrcode`}
|
||||||
|
src={staffInfo.staffQrCode}
|
||||||
|
showMenuByLongpress
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__title`}>第二步</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__h1 ${PREFIX}__bold`}>点击以下按钮分享小程序到群,并在群里打开小程序</div>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div className="highlight">1次分享只能认证一个群,有多个群请分享多次,不可在微信聊天里直接转发;</div>
|
||||||
|
<div>一般1天内完成,超时未完成认证请重新分享或者咨询运营</div>
|
||||||
|
</div>
|
||||||
|
<Button className={`${PREFIX}__share`} openType="share">
|
||||||
|
分享小程序
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Tabs.TabPane>
|
||||||
|
<Tabs.TabPane value={1} title="已认证的群">
|
||||||
|
<GroupCertificationList />
|
||||||
|
</Tabs.TabPane>
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -5,7 +5,7 @@ import { useCallback } from 'react';
|
|||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import SearchCity from '@/components/search-city';
|
import SearchCity from '@/components/search-city';
|
||||||
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { GROUPS } from '@/constants/group';
|
import useCityOperators from '@/hooks/use-city-operators';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import { switchRoleType } from '@/utils/app';
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
@ -20,6 +20,7 @@ const PREFIX = 'group-v2-page';
|
|||||||
|
|
||||||
export default function GroupV2() {
|
export default function GroupV2() {
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
|
const cityOperators = useCityOperators();
|
||||||
|
|
||||||
useLoad(() => {
|
useLoad(() => {
|
||||||
switchRoleType(RoleType.Anchor);
|
switchRoleType(RoleType.Anchor);
|
||||||
@ -32,15 +33,18 @@ export default function GroupV2() {
|
|||||||
getCommonShareMessage({ inviteCode, title: '邀请你加入本地主播求职招聘群', path: PageUrl.GroupV2 })
|
getCommonShareMessage({ inviteCode, title: '邀请你加入本地主播求职招聘群', path: PageUrl.GroupV2 })
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleSelectCity = useCallback(cityCode => {
|
const handleSelectCity = useCallback(
|
||||||
if (!checkCityCode(cityCode)) {
|
cityCode => {
|
||||||
return;
|
if (!checkCityCode(cityCode)) {
|
||||||
}
|
return;
|
||||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
}
|
||||||
if (group) {
|
const group = cityOperators.find(g => String(g.cityCode) === cityCode);
|
||||||
openCustomerServiceChat(group.serviceUrl);
|
if (group) {
|
||||||
}
|
openCustomerServiceChat(group.groupLink);
|
||||||
}, []);
|
}
|
||||||
|
},
|
||||||
|
[cityOperators]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage type={PageType.GroupV2}>
|
<HomePage type={PageType.GroupV2}>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { Tabs } from '@taroify/core';
|
import { Tabs } from '@taroify/core';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
@ -20,6 +20,10 @@ export default function Group() {
|
|||||||
|
|
||||||
const handleTypeChange = useCallback(value => setTabType(value), []);
|
const handleTypeChange = useCallback(value => setTabType(value), []);
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => getCommonShareMessage());
|
useShareAppMessage(() => getCommonShareMessage());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -269,6 +269,21 @@
|
|||||||
flex: 2 2;
|
flex: 2 2;
|
||||||
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px;);
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px;);
|
||||||
margin-left: 32px;
|
margin-left: 32px;
|
||||||
|
position: relative;
|
||||||
|
overflow: visible;
|
||||||
|
|
||||||
|
&-tag {
|
||||||
|
position: absolute;
|
||||||
|
right: 8px;
|
||||||
|
top: -12px;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 32px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 2px 8px;
|
||||||
|
background: #FF5051;
|
||||||
|
border-radius: 20px 24px 24px 0px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,26 +12,26 @@ import { JoinGroupHint } from '@/components/join-group-hint';
|
|||||||
import LoginButton from '@/components/login-button';
|
import LoginButton from '@/components/login-button';
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
import { PrejobPopup } from '@/components/prejob-popup';
|
import { PrejobPopup } from '@/components/prejob-popup';
|
||||||
import ProductJobDialog from '@/components/product-dialog/job';
|
import ProductJobContactDialog from '@/components/product-dialog/job-contact';
|
||||||
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 { EventName, PageUrl, RoleType } from '@/constants/app';
|
import { EventName, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { CertificationStatusType } from '@/constants/company';
|
import { CertificationStatusType } from '@/constants/company';
|
||||||
import { CollectEventName, ReportEventId } from '@/constants/event';
|
import { ReportEventId } from '@/constants/event';
|
||||||
import { EMPLOY_TYPE_TITLE_MAP, GET_CONTACT_TYPE, JobManageStatus } from '@/constants/job';
|
import { EMPLOY_TYPE_TITLE_MAP, GET_CONTACT_TYPE, JobManageStatus } from '@/constants/job';
|
||||||
import { ProductType } from '@/constants/product';
|
import { ProductType } from '@/constants/product';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import { usePublishJob } from '@/hooks/use-publish-job';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import useRoleType from '@/hooks/user-role-type';
|
import useRoleType from '@/hooks/user-role-type';
|
||||||
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 { JobDetails } from '@/types/job';
|
import { JobDetails } from '@/types/job';
|
||||||
import { IMaterialMessage } from '@/types/message';
|
import { IMaterialMessage } from '@/types/message';
|
||||||
|
import { GetProductIsUnlockResponse, ProductInfo } from '@/types/product';
|
||||||
import { switchRoleType } from '@/utils/app';
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { copy, logWithPrefix } from '@/utils/common';
|
import { copy, logWithPrefix } from '@/utils/common';
|
||||||
import { collectEvent, reportEvent } from '@/utils/event';
|
import { reportEvent } from '@/utils/event';
|
||||||
import { getJobSalary, getJobTitle, postPublishJob, requestJobDetail } from '@/utils/job';
|
import { getJobSalary, getJobTitle, requestJobDetail } from '@/utils/job';
|
||||||
import { calcDistance, isValidLocation } from '@/utils/location';
|
import { calcDistance, isValidLocation } from '@/utils/location';
|
||||||
import { requestProfileDetail } from '@/utils/material';
|
import { requestProfileDetail } from '@/utils/material';
|
||||||
import { isChatWithSelf, postCreateChat } from '@/utils/message';
|
import { isChatWithSelf, postCreateChat } from '@/utils/message';
|
||||||
@ -41,8 +41,7 @@ import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
|||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import { formatDate } from '@/utils/time';
|
import { formatDate } from '@/utils/time';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
import { isNeedCreateMaterial } from '@/utils/user';
|
import { isNeedPhone } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'job-detail';
|
const PREFIX = 'job-detail';
|
||||||
@ -71,8 +70,23 @@ const getMapCallout = (data: JobDetails): MapProps.callout | undefined => {
|
|||||||
const AnchorFooter = (props: { data: JobDetails }) => {
|
const AnchorFooter = (props: { data: JobDetails }) => {
|
||||||
const { data } = props;
|
const { data } = props;
|
||||||
const [errorTips, setErrorTips] = useState<string>('');
|
const [errorTips, setErrorTips] = useState<string>('');
|
||||||
const [dialogVisible, setDialogVisible] = useState(false);
|
const [showJobContactDialog, setShowJobContactDialog] = useState(false);
|
||||||
const [showMaterialGuide, setShowMaterialGuide] = useState(false);
|
const [showMaterialGuide, setShowMaterialGuide] = useState(false);
|
||||||
|
const [productInfo, setProductInfo] = useState<undefined | ProductInfo>();
|
||||||
|
const [productRecord, setProductRecord] = useState<undefined | GetProductIsUnlockResponse>();
|
||||||
|
const userInfo = useUserInfo();
|
||||||
|
const needPhone = isNeedPhone(userInfo);
|
||||||
|
|
||||||
|
const getProductRecord = useCallback(async () => {
|
||||||
|
const result = await requestProductUseRecord(ProductType.VIP, { jobId: data.id });
|
||||||
|
setProductRecord(result);
|
||||||
|
}, [data.id]);
|
||||||
|
|
||||||
|
const getProductBalance = useCallback(async () => {
|
||||||
|
const [, resp] = await requestProductBalance(ProductType.VIP);
|
||||||
|
setProductInfo(resp);
|
||||||
|
return resp;
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleClickContact = useCallback(async () => {
|
const handleClickContact = useCallback(async () => {
|
||||||
log('handleClickContact');
|
log('handleClickContact');
|
||||||
@ -80,21 +94,8 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
reportEvent(ReportEventId.CLICK_JOB_CONTACT);
|
reportEvent(ReportEventId.CLICK_JOB_CONTACT);
|
||||||
try {
|
|
||||||
const needCreateMaterial = await isNeedCreateMaterial();
|
|
||||||
|
|
||||||
if (data.sourcePlat !== 'bl') {
|
try {
|
||||||
if (needCreateMaterial) {
|
|
||||||
const result = await requestProductUseRecord(ProductType.VIP, { jobId: data.id });
|
|
||||||
if (!result) {
|
|
||||||
const [time, isPaidVip] = await requestProductBalance(ProductType.VIP);
|
|
||||||
if (time <= 0 || !isPaidVip) {
|
|
||||||
setShowMaterialGuide(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (data.isAuthed) {
|
if (data.isAuthed) {
|
||||||
const toUserId = data.userId;
|
const toUserId = data.userId;
|
||||||
if (isChatWithSelf(toUserId)) {
|
if (isChatWithSelf(toUserId)) {
|
||||||
@ -103,7 +104,7 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
}
|
}
|
||||||
const chat = await postCreateChat(toUserId);
|
const chat = await postCreateChat(toUserId);
|
||||||
let materialMessage: null | IMaterialMessage = null;
|
let materialMessage: null | IMaterialMessage = null;
|
||||||
if (!needCreateMaterial) {
|
if (!!productInfo?.isCreateResume) {
|
||||||
const profile = await requestProfileDetail();
|
const profile = await requestProfileDetail();
|
||||||
if (profile) {
|
if (profile) {
|
||||||
materialMessage = {
|
materialMessage = {
|
||||||
@ -125,7 +126,13 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
jobId: data.id,
|
jobId: data.id,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setDialogVisible(true);
|
// Show material guide if no resume and no VIP and no free balance
|
||||||
|
if (!productInfo?.isCreateResume && !productInfo?.isPaidVip && !productInfo?.freeBalance) {
|
||||||
|
setShowMaterialGuide(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Open integrated dialog - it handles buy + contact internally
|
||||||
|
setShowJobContactDialog(true);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const e = error as HttpError;
|
const e = error as HttpError;
|
||||||
@ -136,31 +143,90 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
Toast.error('请求失败请重试');
|
Toast.error('请求失败请重试');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [data]);
|
}, [data, productInfo?.freeBalance, productInfo?.isCreateResume, productInfo?.isPaidVip]);
|
||||||
|
|
||||||
|
const handleDialogClose = useCallback(() => {
|
||||||
|
setShowJobContactDialog(false);
|
||||||
|
// Refresh data after dialog closes
|
||||||
|
getProductRecord();
|
||||||
|
}, [getProductRecord]);
|
||||||
|
|
||||||
|
const handleConfirmPrejob = useCallback(
|
||||||
|
(type: GET_CONTACT_TYPE) => {
|
||||||
|
setShowMaterialGuide(false);
|
||||||
|
if (GET_CONTACT_TYPE.VIP === type) {
|
||||||
|
getProductBalance().then(() => {
|
||||||
|
setShowJobContactDialog(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[getProductBalance]
|
||||||
|
);
|
||||||
|
|
||||||
|
// const unAuthedButtonText = useMemo(() => {
|
||||||
|
// if (haveSeen) {
|
||||||
|
// return '查看联系方式';
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (productInfo?.isPaidVip) {
|
||||||
|
// return '您是会员,可直接查看';
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (productInfo?.freeBalance) {
|
||||||
|
// return `还剩${productInfo.freeBalance}次查看次数`;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return productInfo?.isCreateResume? '升级会员即可查看': '创建模卡,免费查看';
|
||||||
|
// }, [productInfo, haveSeen]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
Taro.eventCenter.on(EventName.CREATE_PROFILE, getProductBalance);
|
||||||
|
return () => {
|
||||||
|
Taro.eventCenter.off(EventName.CREATE_PROFILE);
|
||||||
|
};
|
||||||
|
}, [getProductBalance]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getProductBalance();
|
||||||
|
}, [getProductBalance]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getProductRecord();
|
||||||
|
}, [getProductRecord]);
|
||||||
|
|
||||||
const handleDialogHidden = useCallback(() => {
|
|
||||||
setDialogVisible(false);
|
|
||||||
}, []);
|
|
||||||
const handleConfirmPrejob = useCallback((type: GET_CONTACT_TYPE) => {
|
|
||||||
setShowMaterialGuide(false);
|
|
||||||
if (GET_CONTACT_TYPE.VIP === type) {
|
|
||||||
setDialogVisible(true);
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`${PREFIX}__footer`}>
|
<div className={`${PREFIX}__footer`}>
|
||||||
<Button className={`${PREFIX}__share-button`} openType="share">
|
<Button className={`${PREFIX}__share-button`} openType="share">
|
||||||
分享
|
分享
|
||||||
</Button>
|
</Button>
|
||||||
<LoginButton className={`${PREFIX}__contact-publisher`} onClick={handleClickContact}>
|
<LoginButton needRefresh className={`${PREFIX}__contact-publisher`} onClick={handleClickContact}>
|
||||||
{data.isAuthed ? '在线沟通' : '立即联系'}
|
{data.isAuthed ? '在线沟通' : '查看联系方式'}
|
||||||
|
{needPhone ? (
|
||||||
|
<div className={`${PREFIX}__contact-publisher-tag`}>登录后可免费报单</div>
|
||||||
|
) : !productRecord && (data.isAuthed || productInfo?.content) ? (
|
||||||
|
<div className={`${PREFIX}__contact-publisher-tag`}>
|
||||||
|
{data.isAuthed ? '急招岗位可免费查看' : productInfo?.content}
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
</LoginButton>
|
</LoginButton>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{dialogVisible && <ProductJobDialog data={data} onClose={handleDialogHidden} />}
|
{showJobContactDialog && (
|
||||||
|
<ProductJobContactDialog
|
||||||
|
data={data}
|
||||||
|
productRecord={productRecord}
|
||||||
|
productInfo={productInfo}
|
||||||
|
onRefreshBalance={getProductBalance}
|
||||||
|
onClose={handleDialogClose}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{showMaterialGuide && (
|
{showMaterialGuide && (
|
||||||
<PrejobPopup onCancel={() => setShowMaterialGuide(false)} onConfirm={handleConfirmPrejob} />
|
<PrejobPopup
|
||||||
|
isCreateResume={productInfo?.isCreateResume}
|
||||||
|
onCancel={() => setShowMaterialGuide(false)}
|
||||||
|
onConfirm={handleConfirmPrejob}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
<CommonDialog
|
<CommonDialog
|
||||||
content={errorTips}
|
content={errorTips}
|
||||||
@ -176,42 +242,10 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
|
|
||||||
const CompanyFooter = (props: { data: JobDetails }) => {
|
const CompanyFooter = (props: { data: JobDetails }) => {
|
||||||
const { data } = props;
|
const { data } = props;
|
||||||
const [showBuy, setShowBuy] = useState(false);
|
const [showBuy, setShowBuy, handlePublishJob] = usePublishJob(data.id);
|
||||||
const userInfo = useUserInfo();
|
|
||||||
|
|
||||||
const handleClickEdit = useCallback(() => navigateTo(PageUrl.JobPublish, { jobId: data.id }), [data]);
|
const handleClickEdit = useCallback(() => navigateTo(PageUrl.JobPublish, { jobId: data.id }), [data]);
|
||||||
|
|
||||||
const handlePublishJob = useCallback(async () => {
|
|
||||||
try {
|
|
||||||
if (userInfo.bossAuthStatus !== CertificationStatusType.Success) {
|
|
||||||
store.dispatch(cacheJobId(data.id));
|
|
||||||
navigateTo(PageUrl.CertificationStart);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Taro.showLoading();
|
|
||||||
await postPublishJob(data.id);
|
|
||||||
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
|
||||||
setShowBuy(false);
|
|
||||||
Toast.success('发布成功');
|
|
||||||
Taro.hideLoading();
|
|
||||||
} catch (error) {
|
|
||||||
Taro.hideLoading();
|
|
||||||
const e = error as HttpError;
|
|
||||||
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) {
|
|
||||||
Toast.info('您购买的产品已耗尽使用次数');
|
|
||||||
setShowBuy(true);
|
|
||||||
} else if (errorCode === RESPONSE_ERROR_CODE.BOSS_VIP_EXPIRED) {
|
|
||||||
Toast.info('该通告已到期,请创建新通告', 3000);
|
|
||||||
} else {
|
|
||||||
Toast.error(errorMsg || '发布失败请重试', 3000);
|
|
||||||
}
|
|
||||||
console.error(e);
|
|
||||||
}
|
|
||||||
}, [data]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`${PREFIX}__footer`}>
|
<div className={`${PREFIX}__footer`}>
|
||||||
@ -295,7 +329,9 @@ export default function JobDetail() {
|
|||||||
Toast.error('出错了,请重试');
|
Toast.error('出错了,请重试');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return getCommonShareMessage({ inviteCode });
|
return getCommonShareMessage({ inviteCode });
|
||||||
|
|||||||
@ -23,5 +23,24 @@
|
|||||||
background-color: @blTabLineColor;
|
background-color: @blTabLineColor;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.taroify-dialog.taroify-popup {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
&__tab-icon {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(255, 80, 81, 0.16);
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 8px;
|
||||||
|
> image {
|
||||||
|
width: 14.4px;
|
||||||
|
height: 19.2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { Image } from '@tarojs/components';
|
||||||
import Taro, { useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { Tabs } from '@taroify/core';
|
import { Tabs } from '@taroify/core';
|
||||||
@ -132,6 +133,10 @@ export default function Job() {
|
|||||||
|
|
||||||
useDidShow(() => requestUnreadMessageCount());
|
useDidShow(() => requestUnreadMessageCount());
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
if (sortType === SortType.CREATE_TIME) {
|
if (sortType === SortType.CREATE_TIME) {
|
||||||
return {
|
return {
|
||||||
@ -152,7 +157,20 @@ export default function Job() {
|
|||||||
style={{ height: barHeight.current, paddingTop: statusBarHeight.current }}
|
style={{ height: barHeight.current, paddingTop: statusBarHeight.current }}
|
||||||
>
|
>
|
||||||
{JOB_PAGE_TABS.map(tab => (
|
{JOB_PAGE_TABS.map(tab => (
|
||||||
<Tabs.TabPane value={tab.type} title={tab.title} key={tab.type}>
|
<Tabs.TabPane
|
||||||
|
value={tab.type}
|
||||||
|
title={
|
||||||
|
<>
|
||||||
|
{tab.type === JobSourceType.BL ? (
|
||||||
|
<div className={`${PREFIX}__tab-icon`}>
|
||||||
|
<Image src="https://publiccdn.neighbourhood.com.cn/img/lightning.svg" />
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
{tab.title}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
key={tab.type}
|
||||||
|
>
|
||||||
<JobFragment
|
<JobFragment
|
||||||
cityCode={cityCode}
|
cityCode={cityCode}
|
||||||
sortType={sortType}
|
sortType={sortType}
|
||||||
|
|||||||
@ -10,11 +10,27 @@
|
|||||||
left: 24px;
|
left: 24px;
|
||||||
right: 24px;
|
right: 24px;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: #F5F6FA;
|
background: #f5f6fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__submit-btn {
|
&__submit-btn {
|
||||||
.button(@width: 100%, @height: 80px, @fontSize: 32px, @fontWeight: 400, @borderRadius: 48px);
|
.button(@width: 100%, @height: 80px, @fontSize: 32px, @fontWeight: 400, @borderRadius: 48px);
|
||||||
bottom: 40px;
|
bottom: 40px;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
&__skip-btn-wrapper {
|
||||||
|
text-align: center;
|
||||||
|
bottom: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__skip-btn {
|
||||||
|
color: @blHighlightColor;
|
||||||
|
width: 161px;
|
||||||
|
height: 40px;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -21,25 +21,28 @@ import { navigateBack } from '@/utils/route';
|
|||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
import ProfileOthersFragment from '@/fragments/profile/others';
|
||||||
|
|
||||||
const PREFIX = 'page-material-create-profile';
|
const PREFIX = 'page-material-create-profile';
|
||||||
const log = logWithPrefix(PREFIX);
|
const log = logWithPrefix(PREFIX);
|
||||||
|
|
||||||
const REQUIRE_KEYS = {
|
const REQUIRE_KEYS = {
|
||||||
[ProfileGroupType.Basic]: ['name', 'gender', 'age', 'height', 'weight'],
|
[ProfileGroupType.Basic]: ['name', 'gender', 'age'],
|
||||||
[ProfileGroupType.Intention]: [
|
[ProfileGroupType.Intention]: [
|
||||||
'cityCodes',
|
'cityCodes',
|
||||||
'employType',
|
'employType',
|
||||||
'acceptWorkForSit',
|
|
||||||
'fullTimeMinPrice',
|
'fullTimeMinPrice',
|
||||||
'fullTimeMaxPrice',
|
'fullTimeMaxPrice',
|
||||||
'partyTimeMinPrice',
|
'partyTimeMinPrice',
|
||||||
'partyTimeMaxPrice',
|
'partyTimeMaxPrice',
|
||||||
],
|
],
|
||||||
[ProfileGroupType.Experience]: ['workedYear'],
|
[ProfileGroupType.Experience]: [],
|
||||||
[ProfileGroupType.Advantages]: [],
|
[ProfileGroupType.Advantages]: [],
|
||||||
|
[ProfileGroupType.Others]: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const COULD_SKIP = [ProfileGroupType.Experience, ProfileGroupType.Others];
|
||||||
|
|
||||||
const CONDITIONAL_REQUIRED_KEYS = {
|
const CONDITIONAL_REQUIRED_KEYS = {
|
||||||
[ProfileGroupType.Intention]: [
|
[ProfileGroupType.Intention]: [
|
||||||
['fullTimeMinPrice', data => isFullTimePriceRequired(data.employType)],
|
['fullTimeMinPrice', data => isFullTimePriceRequired(data.employType)],
|
||||||
@ -52,11 +55,13 @@ const CONDITIONAL_REQUIRED_KEYS = {
|
|||||||
const getNextStepGroupType = (curType: ProfileGroupType) => {
|
const getNextStepGroupType = (curType: ProfileGroupType) => {
|
||||||
switch (curType) {
|
switch (curType) {
|
||||||
case ProfileGroupType.Basic:
|
case ProfileGroupType.Basic:
|
||||||
return ProfileGroupType.Advantages;
|
|
||||||
case ProfileGroupType.Intention:
|
|
||||||
return ProfileGroupType.Experience;
|
return ProfileGroupType.Experience;
|
||||||
case ProfileGroupType.Experience:
|
case ProfileGroupType.Intention:
|
||||||
return ProfileGroupType.Basic;
|
return ProfileGroupType.Basic;
|
||||||
|
case ProfileGroupType.Experience:
|
||||||
|
return ProfileGroupType.Others;
|
||||||
|
case ProfileGroupType.Others:
|
||||||
|
return ProfileGroupType.Advantages;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -88,7 +93,16 @@ export default function MaterialCreateProfile() {
|
|||||||
? ProfileExperienceFragment
|
? ProfileExperienceFragment
|
||||||
: groupType === ProfileGroupType.Advantages
|
: groupType === ProfileGroupType.Advantages
|
||||||
? ProfileAdvantagesFragment
|
? ProfileAdvantagesFragment
|
||||||
: Fragment;
|
: groupType === ProfileGroupType.Others
|
||||||
|
? ProfileOthersFragment
|
||||||
|
: Fragment;
|
||||||
|
|
||||||
|
const handleSkip = useCallback(() => {
|
||||||
|
const nextType = getNextStepGroupType(groupType);
|
||||||
|
if (nextType) {
|
||||||
|
setGroupType(nextType);
|
||||||
|
}
|
||||||
|
}, [groupType]);
|
||||||
|
|
||||||
const handleSubmit = useCallback(async () => {
|
const handleSubmit = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
@ -123,14 +137,23 @@ export default function MaterialCreateProfile() {
|
|||||||
Taro.setNavigationBarTitle({ title });
|
Taro.setNavigationBarTitle({ title });
|
||||||
}, [groupType]);
|
}, [groupType]);
|
||||||
|
|
||||||
|
const couldSkip = COULD_SKIP.includes(groupType);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<ProfileFragment ref={ref} profile={{ cityCodes: location.cityCode || '' }} />
|
<ProfileFragment ref={ref} profile={{ cityCodes: location.cityCode || '' }} />
|
||||||
<SafeBottomPadding />
|
<SafeBottomPadding />
|
||||||
<div className={`${PREFIX}__footer`}>
|
<div className={`${PREFIX}__footer`}>
|
||||||
<Button className={`${PREFIX}__submit-btn`} onClick={handleSubmit}>
|
<Button className={`${PREFIX}__submit-btn ${couldSkip ? 'up' : ''}`} onClick={handleSubmit}>
|
||||||
{groupType === ProfileGroupType.Advantages ? '完成' : '下一步'}
|
{groupType === ProfileGroupType.Advantages ? '完成' : '下一步'}
|
||||||
</Button>
|
</Button>
|
||||||
|
{couldSkip && (
|
||||||
|
<div className={`${PREFIX}__skip-btn-wrapper`}>
|
||||||
|
<div className={`${PREFIX}__skip-btn`} onClick={handleSkip}>
|
||||||
|
跳过
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<SafeBottomPadding />
|
<SafeBottomPadding />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import ProfileAdvantagesFragment from '@/fragments/profile/advantages';
|
|||||||
import ProfileBasicFragment from '@/fragments/profile/basic';
|
import ProfileBasicFragment from '@/fragments/profile/basic';
|
||||||
import ProfileExperienceFragment from '@/fragments/profile/experience';
|
import ProfileExperienceFragment from '@/fragments/profile/experience';
|
||||||
import ProfileIntentionFragment from '@/fragments/profile/intention';
|
import ProfileIntentionFragment from '@/fragments/profile/intention';
|
||||||
|
import ProfileOthersFragment from '@/fragments/profile/others';
|
||||||
import { MaterialProfile } from '@/types/material';
|
import { MaterialProfile } from '@/types/material';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { collectEvent } from '@/utils/event';
|
import { collectEvent } from '@/utils/event';
|
||||||
@ -37,7 +38,9 @@ export default function MaterialEdit() {
|
|||||||
? ProfileExperienceFragment
|
? ProfileExperienceFragment
|
||||||
: groupType === ProfileGroupType.Advantages
|
: groupType === ProfileGroupType.Advantages
|
||||||
? ProfileAdvantagesFragment
|
? ProfileAdvantagesFragment
|
||||||
: Fragment;
|
: groupType === ProfileGroupType.Others
|
||||||
|
? ProfileOthersFragment
|
||||||
|
: Fragment;
|
||||||
log('MaterialEdit', groupType, ref);
|
log('MaterialEdit', groupType, ref);
|
||||||
|
|
||||||
const handleSubmit = useCallback(async () => {
|
const handleSubmit = useCallback(async () => {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|||||||
import MaterialManagePopup from '@/components/material-manage-popup';
|
import MaterialManagePopup from '@/components/material-manage-popup';
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
import { EventName, RoleType } from '@/constants/app';
|
import { EventName } from '@/constants/app';
|
||||||
import { CollectEventName } from '@/constants/event';
|
import { CollectEventName } from '@/constants/event';
|
||||||
import { MaterialStatus } from '@/constants/material';
|
import { MaterialStatus } from '@/constants/material';
|
||||||
import ProfileViewFragment from '@/fragments/profile/view';
|
import ProfileViewFragment from '@/fragments/profile/view';
|
||||||
@ -15,9 +15,7 @@ import { collectEvent } from '@/utils/event';
|
|||||||
import { getMaterialShareMessage, requestProfileDetail, updateProfileStatus } from '@/utils/material';
|
import { getMaterialShareMessage, requestProfileDetail, updateProfileStatus } from '@/utils/material';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
import { switchRoleType } from '@/utils/app';
|
|
||||||
|
|
||||||
const PREFIX = 'page-material-profile';
|
const PREFIX = 'page-material-profile';
|
||||||
|
|
||||||
|
|||||||
@ -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';
|
||||||
|
|
||||||
@ -199,6 +199,10 @@ export default function MaterialViewPage() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
useShareAppMessage(async () => {
|
useShareAppMessage(async () => {
|
||||||
const shareMessage = await getMaterialShareMessage(profile, true, inviteCode, jobId);
|
const shareMessage = await getMaterialShareMessage(profile, true, inviteCode, jobId);
|
||||||
return shareMessage as BL.Anything;
|
return shareMessage as BL.Anything;
|
||||||
|
|||||||
3
src/pages/partner-share-vip/index.config.ts
Normal file
3
src/pages/partner-share-vip/index.config.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '赠送会员',
|
||||||
|
});
|
||||||
182
src/pages/partner-share-vip/index.less
Normal file
182
src/pages/partner-share-vip/index.less
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
@import '@/styles/variables.less';
|
||||||
|
@import '@/styles/common.less';
|
||||||
|
|
||||||
|
.share-vip {
|
||||||
|
background: #eae5fb;
|
||||||
|
padding-top: 200px;
|
||||||
|
position: relative;
|
||||||
|
padding-bottom: calc(142px + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(142px + env(safe-area-inset-bottom));
|
||||||
|
|
||||||
|
&__bg {
|
||||||
|
width: 100%;
|
||||||
|
height: 705px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__slogan {
|
||||||
|
top: 66px;
|
||||||
|
left: 44px;
|
||||||
|
position: absolute;
|
||||||
|
font-family: 'Alimama ShuHeiTi';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 44px;
|
||||||
|
line-height: 62px;
|
||||||
|
color: #333333;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-highlight {
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 12px;
|
||||||
|
padding-right: 9px;
|
||||||
|
font-size: 64px;
|
||||||
|
line-height: 62px;
|
||||||
|
background: linear-gradient(87.53deg, #683DE3 0.4%, #39227D 84.55%);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-clip: text;
|
||||||
|
text-fill-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__main {
|
||||||
|
padding-left: 24px;
|
||||||
|
padding-right: 24px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__highlight {
|
||||||
|
color: @blHighlightColor;
|
||||||
|
font-family: 'DIN Alternate';
|
||||||
|
padding: 0 8px;
|
||||||
|
font-weight: 700;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__block {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 68px 32px 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__h1 {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #1d2129;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
margin-top: 32px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
background: #ffd236;
|
||||||
|
border-radius: 50%;
|
||||||
|
position: absolute;
|
||||||
|
left: -6px;
|
||||||
|
top: -3px;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__body {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: @blColor;
|
||||||
|
|
||||||
|
&.grey {
|
||||||
|
color: @blColorG2;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
margin-left: 48px;
|
||||||
|
margin-right: 48px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 80px;
|
||||||
|
height: 80px;
|
||||||
|
transform: translateY(50%);
|
||||||
|
background: #ffd236;
|
||||||
|
box-shadow: 0px 12px 0px #ffa35d;
|
||||||
|
border-radius: 60px;
|
||||||
|
color: #1d2129;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__service {
|
||||||
|
.button(@height: 72px; @width: 384px; @fontSize: 28px; @fontWeight: 400; @borderRadius: 44px; @highlight: 0);
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__tip {
|
||||||
|
margin-top: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__footer {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 2;
|
||||||
|
width: 100vw;
|
||||||
|
background: #ffffff;
|
||||||
|
padding: 12px 32px;
|
||||||
|
padding-bottom: calc(constant(safe-area-inset-bottom) + 12px);
|
||||||
|
/* 兼容 iOS < 11.2 */
|
||||||
|
padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
|
||||||
|
/* 兼容 iOS >= 11.2 */
|
||||||
|
box-shadow: 0px -4px 20px 0px #00000014;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
box-sizing: border-box;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__download-button {
|
||||||
|
flex: 1 1;
|
||||||
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px; @highlight: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
&__share-button {
|
||||||
|
flex: 2 2;
|
||||||
|
width: 406px;
|
||||||
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px;);
|
||||||
|
margin-left: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#posterCanvas {
|
||||||
|
position: fixed;
|
||||||
|
bottom: -99999px;
|
||||||
|
left: -99999px;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
191
src/pages/partner-share-vip/index.tsx
Normal file
191
src/pages/partner-share-vip/index.tsx
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
import { Button, Canvas, Image } from '@tarojs/components';
|
||||||
|
import Taro, { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import { generateMembershipCoupon, getCouponQrCode } from '@/utils/coupon';
|
||||||
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
|
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const PREFIX = 'share-vip';
|
||||||
|
|
||||||
|
export default function PartnerShareVip() {
|
||||||
|
const inviteCode = useInviteCode();
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
useShareAppMessage(async () => {
|
||||||
|
console.log('Partner inviteCode', inviteCode);
|
||||||
|
const { code } = await generateMembershipCoupon();
|
||||||
|
return getCommonShareMessage({
|
||||||
|
useCapture: false,
|
||||||
|
inviteCode,
|
||||||
|
title: '宝子,送你个播络会员,免费找主播工作',
|
||||||
|
path: PageUrl.GiveVip,
|
||||||
|
params: { d: code },
|
||||||
|
imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-coupon1.png',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const getQrcode = async () => {
|
||||||
|
try {
|
||||||
|
const { code } = await generateMembershipCoupon();
|
||||||
|
const data = await getCouponQrCode(code);
|
||||||
|
const base64 = Taro.arrayBufferToBase64(data);
|
||||||
|
return `data:image/png;base64,${base64}`;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取二维码失败', error);
|
||||||
|
Taro.showToast({ title: '获取二维码失败', icon: 'none' });
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const saveCanvasToTempFile = (): Promise<string> => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
try {
|
||||||
|
const query = Taro.createSelectorQuery().select('#posterCanvas');
|
||||||
|
query.fields({ node: true }).exec(async res => {
|
||||||
|
const canvas = res[0].node;
|
||||||
|
const tempFilePath = await Taro.canvasToTempFilePath({
|
||||||
|
canvas,
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 1500, // 实际绘制宽度
|
||||||
|
height: 2668, // 实际绘制高度
|
||||||
|
destWidth: 750, // 目标显示宽度
|
||||||
|
destHeight: 1334, // 目标显示高度
|
||||||
|
fileType: 'png',
|
||||||
|
});
|
||||||
|
|
||||||
|
resolve(tempFilePath.tempFilePath);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error('保存 Canvas 到临时文件失败', error);
|
||||||
|
Taro.showToast({ title: '保存 Canvas 失败', icon: 'none' });
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const drawCanvas = (qrCode: string): Promise<string> => {
|
||||||
|
const query = Taro.createSelectorQuery().select('#posterCanvas');
|
||||||
|
return new Promise(resolve => {
|
||||||
|
query.fields({ node: true, size: true }).exec(async res => {
|
||||||
|
const canvas = res[0].node;
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
|
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-poster2.png';
|
||||||
|
bgImage.src = poster;
|
||||||
|
bgImage.onload = () => {
|
||||||
|
ctx.drawImage(bgImage, 0, 0, 550, 918);
|
||||||
|
|
||||||
|
const qrCodeImage = canvas.createImage();
|
||||||
|
qrCodeImage.src = qrCode; // 假设 getQrcode() 返回的是二维码图片的路径
|
||||||
|
qrCodeImage.onload = () => {
|
||||||
|
ctx.drawImage(qrCodeImage, 196, 600, 180, 160); // 绘制二维码,位置和大小
|
||||||
|
saveCanvasToTempFile().then(tempPath => {
|
||||||
|
resolve(tempPath);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
bgImage.onerror = err => {
|
||||||
|
console.error(err);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const savePoster = async () => {
|
||||||
|
Taro.showLoading({ title: '正在生成海报' });
|
||||||
|
const qrCode = await getQrcode();
|
||||||
|
const filePath = await drawCanvas(qrCode);
|
||||||
|
Taro.hideLoading();
|
||||||
|
|
||||||
|
const res = await Taro.getSetting();
|
||||||
|
const hasPermission = res.authSetting['scope.writePhotosAlbum'];
|
||||||
|
if (hasPermission === false) {
|
||||||
|
Taro.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '需要访问相册权限才能保存图片,请前往设置开启权限',
|
||||||
|
showCancel: false,
|
||||||
|
success() {
|
||||||
|
Taro.openSetting();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
await Taro.authorize({ scope: 'scope.writePhotosAlbum' });
|
||||||
|
await Taro.saveImageToPhotosAlbum({ filePath });
|
||||||
|
Taro.showToast({ title: '保存成功', icon: 'success' });
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
Taro.showToast({ title: '保存失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<Image
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/partner-share-vip-bg.png"
|
||||||
|
className={`${PREFIX}__bg`}
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<div className={`${PREFIX}__slogan`}>
|
||||||
|
<div>
|
||||||
|
会员可每日<div className={`${PREFIX}__slogan-highlight`}>免费查看</div>
|
||||||
|
</div>
|
||||||
|
<div>通告联系方式</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__main`}>
|
||||||
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>赠送会员</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__h1`}>方法一:</div>
|
||||||
|
<div className={`${PREFIX}__body`}>点击下方"立即赠送"即可分享赠送卡片,对方点击卡片即可领取</div>
|
||||||
|
<div className={`${PREFIX}__h1`}>方法二:</div>
|
||||||
|
<div className={`${PREFIX}__body`}>点击"朋友圈海报"获得图片,分享到朋友圈,对方扫码即可领取</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>赠送规则</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div className={`${PREFIX}__h1`}>规则一:</div>
|
||||||
|
<div>每次分享的赠送链接或者图片在7天内有效</div>
|
||||||
|
<div className={`${PREFIX}__h1`}>规则二:</div>
|
||||||
|
<div>每个用户一周最多只能领取一次会员</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>分享建议</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div className={`${PREFIX}__h1`}>建议一:</div>
|
||||||
|
<div>每周在朋友圈或者群中分享一次,效果最佳 可以写明:新会员来啦</div>
|
||||||
|
<div className={`${PREFIX}__h1`}>建议二:</div>
|
||||||
|
<div>分享得越多,邀请的人会越多,也会更活跃,更容易获得分成</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Canvas id="posterCanvas" canvas-id="posterCanvas" type="2d" style="width: 750px; height: 1334px;" />
|
||||||
|
|
||||||
|
<div className={`${PREFIX}__footer`}>
|
||||||
|
<Button className={`${PREFIX}__download-button`} onClick={savePoster}>
|
||||||
|
朋友圈海报
|
||||||
|
</Button>
|
||||||
|
<Button className={`${PREFIX}__share-button`} openType="share">
|
||||||
|
立即赠送
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { Tabs } from '@taroify/core';
|
import { Tabs } from '@taroify/core';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
@ -6,6 +6,7 @@ import { useState } from 'react';
|
|||||||
import PartnerIntro from '@/components/partner-intro';
|
import PartnerIntro from '@/components/partner-intro';
|
||||||
import PartnerInviteList from '@/components/partner-invite-list';
|
import PartnerInviteList from '@/components/partner-invite-list';
|
||||||
import PartnerProfit from '@/components/partner-profit';
|
import PartnerProfit from '@/components/partner-profit';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
@ -18,9 +19,29 @@ export default function Partner() {
|
|||||||
const handleChange = v => {
|
const handleChange = v => {
|
||||||
setTab(v);
|
setTab(v);
|
||||||
};
|
};
|
||||||
useShareAppMessage(() => {
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
useShareAppMessage(async () => {
|
||||||
console.log('Partner inviteCode', inviteCode);
|
console.log('Partner inviteCode', inviteCode);
|
||||||
return getCommonShareMessage({ useCapture: false, inviteCode });
|
// const { code } = await generateMembershipCoupon();
|
||||||
|
// return getCommonShareMessage({
|
||||||
|
// useCapture: false,
|
||||||
|
// inviteCode,
|
||||||
|
// title: '宝子,送你个播络会员,免费找主播工作',
|
||||||
|
// path: PageUrl.GiveVip,
|
||||||
|
// params: { d: code },
|
||||||
|
// imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-coupon1.png',
|
||||||
|
// });
|
||||||
|
return getCommonShareMessage({
|
||||||
|
useCapture: false,
|
||||||
|
inviteCode,
|
||||||
|
title: '播络专业主播招聘平台招募合伙人',
|
||||||
|
path: PageUrl.Partner,
|
||||||
|
imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-partner.png',
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -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('加载失败请重试')} />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Image } from '@tarojs/components';
|
// import { Image } from '@tarojs/components';
|
||||||
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { Button, Tabs } from '@taroify/core';
|
import { Button, Tabs } from '@taroify/core';
|
||||||
@ -7,45 +7,49 @@ import { useCallback, useState } from 'react';
|
|||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import SearchCity from '@/components/search-city';
|
import SearchCity from '@/components/search-city';
|
||||||
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { GROUPS } from '@/constants/group';
|
import useCityOperators from '@/hooks/use-city-operators';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import { switchRoleType } from '@/utils/app';
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { getCurrentCityCode } from '@/utils/location';
|
import { getCurrentCityCode } from '@/utils/location';
|
||||||
import { getPageQuery, navigateTo } from '@/utils/route';
|
import { getPageQuery } from '@/utils/route';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import { checkCityCode } from '@/utils/user';
|
import { checkCityCode } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'page-biz-service';
|
const PREFIX = 'page-biz-service';
|
||||||
const EXAMPLE_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-example.png';
|
// const EXAMPLE_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-example.png';
|
||||||
const COMMENT_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-comments.png';
|
// const COMMENT_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-comments.png';
|
||||||
export default function BizService() {
|
export default function BizService() {
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
const [value, setValue] = useState('0');
|
const cityOperators = useCityOperators();
|
||||||
|
const [value, setValue] = useState('2');
|
||||||
|
|
||||||
const handleClickDelegate = useCallback(() => {
|
// const handleClickDelegate = useCallback(() => {
|
||||||
navigateTo(PageUrl.GroupDelegatePublish);
|
// navigateTo(PageUrl.GroupDelegatePublish);
|
||||||
}, []);
|
// }, []);
|
||||||
const handlePreview = (current: string) => {
|
// const handlePreview = (current: string) => {
|
||||||
Taro.previewImage({
|
// Taro.previewImage({
|
||||||
current,
|
// current,
|
||||||
urls: [EXAMPLE_IMAGE, COMMENT_IMAGE],
|
// urls: [EXAMPLE_IMAGE, COMMENT_IMAGE],
|
||||||
});
|
// });
|
||||||
};
|
// };
|
||||||
const handleOpenService = useCallback(() => {
|
const handleOpenService = useCallback(() => {
|
||||||
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d');
|
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d');
|
||||||
}, []);
|
}, []);
|
||||||
const handleSelectCity = useCallback(cityCode => {
|
const handleSelectCity = useCallback(
|
||||||
if (!checkCityCode(cityCode)) {
|
cityCode => {
|
||||||
return;
|
if (!checkCityCode(cityCode)) {
|
||||||
}
|
return;
|
||||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
}
|
||||||
if (group) {
|
const group = cityOperators.find(g => String(g.cityCode) === cityCode);
|
||||||
openCustomerServiceChat(group.serviceUrl);
|
if (group) {
|
||||||
}
|
openCustomerServiceChat(group.groupLink);
|
||||||
}, []);
|
}
|
||||||
|
},
|
||||||
|
[cityOperators]
|
||||||
|
);
|
||||||
const handleChange = useCallback(v => {
|
const handleChange = useCallback(v => {
|
||||||
setValue(v);
|
setValue(v);
|
||||||
}, []);
|
}, []);
|
||||||
@ -59,6 +63,10 @@ export default function BizService() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
useShareAppMessage(() =>
|
useShareAppMessage(() =>
|
||||||
getCommonShareMessage({
|
getCommonShareMessage({
|
||||||
inviteCode,
|
inviteCode,
|
||||||
@ -72,35 +80,35 @@ export default function BizService() {
|
|||||||
<HomePage type={PageType.BatchPublish}>
|
<HomePage type={PageType.BatchPublish}>
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<Tabs className={`${PREFIX}__tabs`} value={value} onChange={handleChange}>
|
<Tabs className={`${PREFIX}__tabs`} value={value} onChange={handleChange}>
|
||||||
<Tabs.TabPane value="0" title="群代发">
|
{/*<Tabs.TabPane value="0" title="群代发">*/}
|
||||||
<div className={`${PREFIX}__delegate`}>
|
{/* <div className={`${PREFIX}__delegate`}>*/}
|
||||||
<Image
|
{/* <Image*/}
|
||||||
mode="widthFix"
|
{/* mode="widthFix"*/}
|
||||||
className={`${PREFIX}__header-image`}
|
{/* className={`${PREFIX}__header-image`}*/}
|
||||||
src="https://publiccdn.neighbourhood.com.cn/img/pub-job.png"
|
{/* src="https://publiccdn.neighbourhood.com.cn/img/pub-job.png"*/}
|
||||||
/>
|
{/* />*/}
|
||||||
<div className={`${PREFIX}__delegate-h5`}>服务说明</div>
|
{/* <div className={`${PREFIX}__delegate-h5`}>服务说明</div>*/}
|
||||||
<div className={`${PREFIX}__delegate-card`}>
|
{/* <div className={`${PREFIX}__delegate-card`}>*/}
|
||||||
<div className={`${PREFIX}__delegate-body`}>服务方式:帮您把招聘需求发到众多同城合作主播群</div>
|
{/* <div className={`${PREFIX}__delegate-body`}>服务方式:帮您把招聘需求发到众多同城合作主播群</div>*/}
|
||||||
<div className={`${PREFIX}__delegate-body`}>群发次数:杭州、广州发3次,其他城市1次</div>
|
{/* <div className={`${PREFIX}__delegate-body`}>群发次数:杭州、广州发3次,其他城市1次</div>*/}
|
||||||
<div className={`${PREFIX}__delegate-body`}>内容要求:仅限带货主播招聘需求,其他不发</div>
|
{/* <div className={`${PREFIX}__delegate-body`}>内容要求:仅限带货主播招聘需求,其他不发</div>*/}
|
||||||
<div className={`${PREFIX}__delegate-body`}>主播联系:内容中留招聘方联系方式,主播直接联系</div>
|
{/* <div className={`${PREFIX}__delegate-body`}>主播联系:内容中留招聘方联系方式,主播直接联系</div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div className={`${PREFIX}__delegate-h5`}>代发示例</div>
|
{/* <div className={`${PREFIX}__delegate-h5`}>代发示例</div>*/}
|
||||||
<div className={`${PREFIX}__delegate-card image`} onClick={() => handlePreview(EXAMPLE_IMAGE)}>
|
{/* <div className={`${PREFIX}__delegate-card image`} onClick={() => handlePreview(EXAMPLE_IMAGE)}>*/}
|
||||||
<Image className={`${PREFIX}__delegate-image`} src={EXAMPLE_IMAGE} mode="heightFix" />
|
{/* <Image className={`${PREFIX}__delegate-image`} src={EXAMPLE_IMAGE} mode="heightFix" />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div className={`${PREFIX}__delegate-h5`}>部分客户评价</div>
|
{/* <div className={`${PREFIX}__delegate-h5`}>部分客户评价</div>*/}
|
||||||
<div className={`${PREFIX}__delegate-card image`} onClick={() => handlePreview(COMMENT_IMAGE)}>
|
{/* <div className={`${PREFIX}__delegate-card image`} onClick={() => handlePreview(COMMENT_IMAGE)}>*/}
|
||||||
<Image className={`${PREFIX}__delegate-image`} src={COMMENT_IMAGE} mode="heightFix" />
|
{/* <Image className={`${PREFIX}__delegate-image`} src={COMMENT_IMAGE} mode="heightFix" />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div className={`${PREFIX}__delegate-fix`}>
|
{/* <div className={`${PREFIX}__delegate-fix`}>*/}
|
||||||
<Button className={`${PREFIX}__delegate-btn`} onClick={handleClickDelegate}>
|
{/* <Button className={`${PREFIX}__delegate-btn`} onClick={handleClickDelegate}>*/}
|
||||||
我要代发
|
{/* 我要代发*/}
|
||||||
</Button>
|
{/* </Button>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</Tabs.TabPane>
|
{/*</Tabs.TabPane>*/}
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
value="1"
|
value="1"
|
||||||
title={
|
title={
|
||||||
|
|||||||
@ -69,19 +69,27 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__header__contact {
|
&__header__contact {
|
||||||
width: 60px;
|
width: 76px;
|
||||||
height: 60px;
|
height: 81px;
|
||||||
border-radius: 50%;
|
|
||||||
background: #0000004D;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__header__contact-icon {
|
&__header__contact-icon {
|
||||||
width: 36px;
|
width: 76px;
|
||||||
height: 36px;
|
height: 81px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.taroify-cell__right-icon {
|
||||||
|
line-height: 48px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,7 @@ export default function User() {
|
|||||||
<Image
|
<Image
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
className={`${PREFIX}__header__contact-icon`}
|
className={`${PREFIX}__header__contact-icon`}
|
||||||
src={require('@/statics/svg/contact.svg')}
|
src="https://publiccdn.neighbourhood.com.cn/img/kefu.svg"
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { List, PullRefresh } from '@taroify/core';
|
import { List, PullRefresh } from '@taroify/core';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
@ -90,6 +90,11 @@ export default function WithdrawRecords() {
|
|||||||
};
|
};
|
||||||
refresh();
|
refresh();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return getCommonShareMessage({ useCapture: false, inviteCode });
|
return getCommonShareMessage({ useCapture: false, inviteCode });
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
import { RoleType, PageType } from '@/constants/app';
|
import { RoleType, PageType } from '@/constants/app';
|
||||||
import { LocationInfo } from '@/types/location';
|
import { LocationInfo } from '@/types/location';
|
||||||
|
import { AppState } from '@/types/store';
|
||||||
|
|
||||||
import { CHANGE_ROLE_TYPE, CHANGE_HOME_PAGE, SET_LOCATION_INFO } from '../constants';
|
import { CHANGE_ROLE_TYPE, CHANGE_HOME_PAGE, SET_LOCATION_INFO, SET_CITY_CONFIGS } from '../constants';
|
||||||
|
|
||||||
export const changeRoleType = (value: RoleType) => ({ type: CHANGE_ROLE_TYPE, value });
|
export const changeRoleType = (value: RoleType) => ({ type: CHANGE_ROLE_TYPE, value });
|
||||||
|
|
||||||
export const changeHomePage = (value: PageType) => ({ type: CHANGE_HOME_PAGE, value });
|
export const changeHomePage = (value: PageType) => ({ type: CHANGE_HOME_PAGE, value });
|
||||||
|
|
||||||
export const setLocationInfo = (value: LocationInfo) => ({ type: SET_LOCATION_INFO, value });
|
export const setLocationInfo = (value: LocationInfo) => ({ type: SET_LOCATION_INFO, value });
|
||||||
|
|
||||||
|
export const setCityConfigs = (value: AppState['cityConfigs']) => ({ type: SET_CITY_CONFIGS, value });
|
||||||
|
|||||||
@ -6,3 +6,4 @@ export const SET_BIND_PHONE = 'SET_BIND_PHONE';
|
|||||||
export const SET_USER_MESSAGE = 'SET_USER_MESSAGE';
|
export const SET_USER_MESSAGE = 'SET_USER_MESSAGE';
|
||||||
export const SET_INVITE_CODE = 'SET_INVITE_CODE';
|
export const SET_INVITE_CODE = 'SET_INVITE_CODE';
|
||||||
export const SET_JOB_ID = 'SET_JOB_ID';
|
export const SET_JOB_ID = 'SET_JOB_ID';
|
||||||
|
export const SET_CITY_CONFIGS = 'SET_CITY_CONFIGS';
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { CacheKey } from '@/constants/cache-key';
|
|||||||
import { LocationInfo } from '@/types/location';
|
import { LocationInfo } from '@/types/location';
|
||||||
import { AppState } from '@/types/store';
|
import { AppState } from '@/types/store';
|
||||||
|
|
||||||
import { CHANGE_ROLE_TYPE, CHANGE_HOME_PAGE, SET_LOCATION_INFO } from '../constants';
|
import { CHANGE_ROLE_TYPE, CHANGE_HOME_PAGE, SET_LOCATION_INFO, SET_CITY_CONFIGS } from '../constants';
|
||||||
|
|
||||||
const DEFAULT_LOCATION: LocationInfo = {
|
const DEFAULT_LOCATION: LocationInfo = {
|
||||||
provinceCode: '440000',
|
provinceCode: '440000',
|
||||||
@ -23,6 +23,7 @@ const INIT_STATE: AppState = {
|
|||||||
roleType: defaultAppMode,
|
roleType: defaultAppMode,
|
||||||
homePageType: defaultAppMode === RoleType.Company ? PageType.Anchor : PageType.JOB,
|
homePageType: defaultAppMode === RoleType.Company ? PageType.Anchor : PageType.JOB,
|
||||||
location: Taro.getStorageSync<LocationInfo>(CacheKey.CACHE_LOCATION_INFO) || DEFAULT_LOCATION,
|
location: Taro.getStorageSync<LocationInfo>(CacheKey.CACHE_LOCATION_INFO) || DEFAULT_LOCATION,
|
||||||
|
cityConfigs: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
|
const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
|
||||||
@ -33,6 +34,8 @@ const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
|
|||||||
return { ...state, roleType: value };
|
return { ...state, roleType: value };
|
||||||
case CHANGE_HOME_PAGE:
|
case CHANGE_HOME_PAGE:
|
||||||
return { ...state, homePageType: value };
|
return { ...state, homePageType: value };
|
||||||
|
case SET_CITY_CONFIGS:
|
||||||
|
return { ...state, cityConfigs: value };
|
||||||
case SET_LOCATION_INFO:
|
case SET_LOCATION_INFO:
|
||||||
Taro.setStorageSync(CacheKey.CACHE_LOCATION_INFO, value);
|
Taro.setStorageSync(CacheKey.CACHE_LOCATION_INFO, value);
|
||||||
return { ...state, location: value };
|
return { ...state, location: value };
|
||||||
|
|||||||
@ -5,3 +5,5 @@ export const selectRoleType = (state: IState) => state.appState.roleType;
|
|||||||
export const selectHomePageType = (state: IState) => state.appState.homePageType;
|
export const selectHomePageType = (state: IState) => state.appState.homePageType;
|
||||||
|
|
||||||
export const selectLocation = (state: IState) => state.appState.location;
|
export const selectLocation = (state: IState) => state.appState.location;
|
||||||
|
|
||||||
|
export const selectCityConfigs = (state: IState) => state.appState.cityConfigs || [];
|
||||||
|
|||||||
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;
|
||||||
|
};
|
||||||
@ -51,7 +51,7 @@ export type JobDetails = JobInfo &
|
|||||||
userId: string; // 发布人的 userId
|
userId: string; // 发布人的 userId
|
||||||
verifyFailReason?: string; // 审核不通过的原因
|
verifyFailReason?: string; // 审核不通过的原因
|
||||||
sourcePlat?: string;
|
sourcePlat?: string;
|
||||||
status: JobManageStatus
|
status: JobManageStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface JobManageInfo {
|
export interface JobManageInfo {
|
||||||
|
|||||||
@ -20,3 +20,16 @@ export interface GetCityCodeRequest {
|
|||||||
latitude: number; // 纬度,浮点数,范围为-90~90,负数表示南纬
|
latitude: number; // 纬度,浮点数,范围为-90~90,负数表示南纬
|
||||||
longitude: number; // 经度,范围为-180~180,负数表示西经
|
longitude: number; // 经度,范围为-180~180,负数表示西经
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CityConfigListItem {
|
||||||
|
id: number;
|
||||||
|
staffId: number;
|
||||||
|
staffName: string;
|
||||||
|
cityName: string;
|
||||||
|
cityCode: string;
|
||||||
|
groupLink: string;
|
||||||
|
created: string;
|
||||||
|
updated: string;
|
||||||
|
price: number | null;
|
||||||
|
sendCount: number | null;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,5 +1,12 @@
|
|||||||
import { EmployType } from '@/constants/job';
|
import { EmployType } from '@/constants/job';
|
||||||
import { AnchorReadType, AnchorSortType, GenderType, ProfileCreateSource, WorkedYears } from '@/constants/material';
|
import {
|
||||||
|
AnchorReadType,
|
||||||
|
AnchorSortType,
|
||||||
|
EducationType,
|
||||||
|
GenderType,
|
||||||
|
ProfileCreateSource,
|
||||||
|
WorkedYears,
|
||||||
|
} from '@/constants/material';
|
||||||
import { IPaginationRequest, IPaginationResponse } from '@/types/common';
|
import { IPaginationRequest, IPaginationResponse } from '@/types/common';
|
||||||
|
|
||||||
export interface MaterialVideoInfo {
|
export interface MaterialVideoInfo {
|
||||||
@ -51,6 +58,7 @@ export interface MaterialProfile {
|
|||||||
filledItems: number; // 已填资料项数
|
filledItems: number; // 已填资料项数
|
||||||
created: number; // 时间戳
|
created: number; // 时间戳
|
||||||
updated: number; // 时间戳
|
updated: number; // 时间戳
|
||||||
|
educationType: EducationType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AnchorInfo {
|
export interface AnchorInfo {
|
||||||
@ -101,6 +109,7 @@ export interface IAnchorFilters {
|
|||||||
lowPriceForPartyTime?: number;
|
lowPriceForPartyTime?: number;
|
||||||
highPriceForPartyTime?: number;
|
highPriceForPartyTime?: number;
|
||||||
category?: string;
|
category?: string;
|
||||||
|
topCategory?: string;
|
||||||
readType?: AnchorReadType;
|
readType?: AnchorReadType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -87,3 +87,41 @@ export interface PartnerPagination<T> {
|
|||||||
content: T[];
|
content: T[];
|
||||||
totalPages: number;
|
totalPages: number;
|
||||||
}
|
}
|
||||||
|
export enum EarnType {
|
||||||
|
ORDER_PAYMENT_SHARE_L1 = 'ORDER_PAYMENT_SHARE_L1',
|
||||||
|
ORDER_PAYMENT_SHARE_L2 = 'ORDER_PAYMENT_SHARE_L2',
|
||||||
|
CHAT_ACTIVITY_SHARE_L1 = 'CHAT_ACTIVITY_SHARE_L1',
|
||||||
|
CHAT_ACTIVITY_SHARE_L2 = 'CHAT_ACTIVITY_SHARE_L2',
|
||||||
|
OTHER = 'OTHER',
|
||||||
|
}
|
||||||
|
export interface UserProfitListItem {
|
||||||
|
userId: string;
|
||||||
|
total: number;
|
||||||
|
earnType: EarnType;
|
||||||
|
amount: number;
|
||||||
|
updatedAt: string;
|
||||||
|
}
|
||||||
|
export interface GroupAuthCode {
|
||||||
|
shareUserId: string;
|
||||||
|
authCode: string;
|
||||||
|
}
|
||||||
|
export interface AuthedGroupInfo {
|
||||||
|
userId: string;
|
||||||
|
openGid: string;
|
||||||
|
groupId: string;
|
||||||
|
groupName: string;
|
||||||
|
groupAvatar: string;
|
||||||
|
authDate: string;
|
||||||
|
}
|
||||||
|
export interface DecryptOpenGidBody {
|
||||||
|
authCode?: string;
|
||||||
|
inviteCode?: string;
|
||||||
|
encryptedData: string;
|
||||||
|
iv: string;
|
||||||
|
}
|
||||||
|
export interface StaffInfo {
|
||||||
|
id: number;
|
||||||
|
staffName: string;
|
||||||
|
staffQrCode: string;
|
||||||
|
isDefault: 0 | 1;
|
||||||
|
}
|
||||||
|
|||||||
@ -8,13 +8,18 @@ export interface DeclarationTypeResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ProductInfo {
|
export interface ProductInfo {
|
||||||
productCode: ProductType;
|
// productCode: ProductType;
|
||||||
productId: ProductType;
|
// productId: ProductType;
|
||||||
|
|
||||||
balance: number;
|
balance: number;
|
||||||
created: number;
|
plaidBalance: number;
|
||||||
updated: number;
|
freeBalance: number;
|
||||||
isPaidVip?: boolean;
|
content: string;
|
||||||
// 报单类型信息,只有 use 接口返回值才有
|
created: string;
|
||||||
|
updated: string;
|
||||||
|
isPaidVip: boolean;
|
||||||
|
isCreateResume: boolean;
|
||||||
|
allowBuyProduct: boolean;
|
||||||
declarationTypeResult?: DeclarationTypeResult;
|
declarationTypeResult?: DeclarationTypeResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,3 +112,21 @@ export interface GetOrderInfoRequest {
|
|||||||
payOrderNo: string;
|
payOrderNo: string;
|
||||||
userId: string;
|
userId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ProductSpecResult {
|
||||||
|
productId: string;
|
||||||
|
productSpecId: ProductSpecId;
|
||||||
|
productType: ProductType;
|
||||||
|
productName: string;
|
||||||
|
title: string;
|
||||||
|
priceText: string;
|
||||||
|
expire: number;
|
||||||
|
payPrice: number; // 分
|
||||||
|
showPrice: number;
|
||||||
|
originalPrice: number;
|
||||||
|
badge: string;
|
||||||
|
contentSingle: string;
|
||||||
|
contentsJson: string;
|
||||||
|
sort: number;
|
||||||
|
createTime: string;
|
||||||
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { RoleType, PageType } from '@/constants/app';
|
|||||||
import { UserMessage } from '@/types/message';
|
import { UserMessage } from '@/types/message';
|
||||||
import { PartnerInfo } from '@/types/partner';
|
import { PartnerInfo } from '@/types/partner';
|
||||||
|
|
||||||
import { LocationInfo } from './location';
|
import { CityConfigListItem, LocationInfo } from './location';
|
||||||
import { UserInfo } from './user';
|
import { UserInfo } from './user';
|
||||||
|
|
||||||
export interface IState {
|
export interface IState {
|
||||||
@ -17,4 +17,5 @@ export interface AppState {
|
|||||||
roleType: RoleType;
|
roleType: RoleType;
|
||||||
homePageType: PageType;
|
homePageType: PageType;
|
||||||
location: LocationInfo;
|
location: LocationInfo;
|
||||||
|
cityConfigs: CityConfigListItem[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { API } from '@/http/api';
|
||||||
|
|
||||||
export const isDev = () => process.env.NODE_ENV === 'development';
|
export const isDev = () => process.env.NODE_ENV === 'development';
|
||||||
// export const isDev = () => true;
|
// export const isDev = () => true;
|
||||||
|
|
||||||
@ -13,13 +15,10 @@ export const isDesktop = (() => {
|
|||||||
return info.platform === 'windows' || info.platform === 'mac';
|
return info.platform === 'windows' || info.platform === 'mac';
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
export const logWithPrefix =
|
||||||
export const logWithPrefix = isDev()
|
(prefix: string) =>
|
||||||
? (prefix: string) =>
|
(...args: BL.Anything[]) =>
|
||||||
(...args: BL.Anything[]) =>
|
console.log(`[${prefix}]`, ...args);
|
||||||
console.log(`[${prefix}]`, ...args)
|
|
||||||
: (_prefix: string) =>
|
|
||||||
(..._args: BL.Anything[]) => {};
|
|
||||||
|
|
||||||
export const safeJsonParse = <T = BL.Anything>(str: string, defaultValue: BL.Anything = {}): T => {
|
export const safeJsonParse = <T = BL.Anything>(str: string, defaultValue: BL.Anything = {}): T => {
|
||||||
try {
|
try {
|
||||||
@ -87,3 +86,9 @@ export const isValidIdCard = (idCard: string) =>
|
|||||||
export const isValidPhone = (phone: string) => /^1[3-9]\d{9}$/.test(phone);
|
export const isValidPhone = (phone: string) => /^1[3-9]\d{9}$/.test(phone);
|
||||||
|
|
||||||
export const getScrollItemId = (id?: string) => (id ? `sid-${id}` : id);
|
export const getScrollItemId = (id?: string) => (id ? `sid-${id}` : id);
|
||||||
|
|
||||||
|
export function buildUrl(url: API, params: Record<string, string | number>): API {
|
||||||
|
return Object.entries(params).reduce((result, [key, value]) => {
|
||||||
|
return result.replace(new RegExp(`\\{${key}\\}`, 'g'), String(value));
|
||||||
|
}, url) as API;
|
||||||
|
}
|
||||||
|
|||||||
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;
|
||||||
|
};
|
||||||
@ -6,9 +6,9 @@ import { CITY_CODE_TO_NAME_MAP, COUNTY_CODE_TO_NAME_MAP, PROVINCE_CODE_TO_NAME_M
|
|||||||
import http from '@/http';
|
import http from '@/http';
|
||||||
import { API } from '@/http/api';
|
import { API } from '@/http/api';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
import { setLocationInfo } from '@/store/actions';
|
import { setLocationInfo, setCityConfigs } from '@/store/actions';
|
||||||
import { selectLocation } from '@/store/selector';
|
import { selectLocation } from '@/store/selector';
|
||||||
import { GetCityCodeRequest, LocationInfo } from '@/types/location';
|
import { CityConfigListItem, GetCityCodeRequest, LocationInfo } from '@/types/location';
|
||||||
|
|
||||||
import { authorize, getWxSetting } from './wx';
|
import { authorize, getWxSetting } from './wx';
|
||||||
|
|
||||||
@ -134,3 +134,8 @@ export async function requestLocation(force: boolean = false) {
|
|||||||
store.dispatch(setLocationInfo(location));
|
store.dispatch(setLocationInfo(location));
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function requestCityConfigs() {
|
||||||
|
const list = await http.get<CityConfigListItem[]>(API.GET_ALL_CITY_CONFIGS);
|
||||||
|
store.dispatch(setCityConfigs(list));
|
||||||
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import Taro from '@tarojs/taro';
|
|||||||
|
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageUrl } from '@/constants/app';
|
||||||
import { CollectEventName } from '@/constants/event';
|
import { CollectEventName } from '@/constants/event';
|
||||||
import { GenderType, MaterialViewSource } from '@/constants/material';
|
import { EDUCATION_TYPE_LABELS, GenderType, MaterialViewSource } from '@/constants/material';
|
||||||
import { MessageSubscribeIds } from '@/constants/subscribe';
|
import { MessageSubscribeIds } from '@/constants/subscribe';
|
||||||
import http from '@/http';
|
import http from '@/http';
|
||||||
import { API } from '@/http/api';
|
import { API } from '@/http/api';
|
||||||
@ -44,7 +44,9 @@ const updateUserIfNeed = async () => {
|
|||||||
await requestUserInfo();
|
await requestUserInfo();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getBasicInfo = (profile: Pick<MaterialProfile, 'age' | 'height' | 'weight' | 'shoeSize' | 'gender'>) => {
|
export const getBasicInfo = (
|
||||||
|
profile: Pick<MaterialProfile, 'age' | 'height' | 'weight' | 'shoeSize' | 'gender' | 'educationType'>
|
||||||
|
) => {
|
||||||
const result: string[] = [];
|
const result: string[] = [];
|
||||||
if (typeof profile.age !== 'undefined' && profile.age !== null) {
|
if (typeof profile.age !== 'undefined' && profile.age !== null) {
|
||||||
result.push(`${profile.age}岁`);
|
result.push(`${profile.age}岁`);
|
||||||
@ -59,9 +61,34 @@ export const getBasicInfo = (profile: Pick<MaterialProfile, 'age' | 'height' | '
|
|||||||
result.push(`${profile.shoeSize}码`);
|
result.push(`${profile.shoeSize}码`);
|
||||||
}
|
}
|
||||||
result.push(profile.gender === GenderType.MEN ? '男' : '女');
|
result.push(profile.gender === GenderType.MEN ? '男' : '女');
|
||||||
|
if (typeof profile.educationType !== 'undefined' && profile.educationType !== null) {
|
||||||
|
result.push(EDUCATION_TYPE_LABELS[profile.educationType]);
|
||||||
|
}
|
||||||
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({
|
||||||
|
|||||||
@ -7,15 +7,21 @@ import store from '@/store';
|
|||||||
import { setInviteCode } from '@/store/actions/partner';
|
import { setInviteCode } from '@/store/actions/partner';
|
||||||
import { IPaginationRequest } from '@/types/common';
|
import { IPaginationRequest } from '@/types/common';
|
||||||
import {
|
import {
|
||||||
|
AuthedGroupInfo,
|
||||||
|
DecryptOpenGidBody,
|
||||||
GetProfitRequest,
|
GetProfitRequest,
|
||||||
|
GroupAuthCode,
|
||||||
InviteUserInfo,
|
InviteUserInfo,
|
||||||
PartnerInviteCode,
|
PartnerInviteCode,
|
||||||
PartnerPagination,
|
PartnerPagination,
|
||||||
PartnerProfitItem,
|
PartnerProfitItem,
|
||||||
PartnerProfitsState,
|
PartnerProfitsState,
|
||||||
|
StaffInfo,
|
||||||
|
UserProfitListItem,
|
||||||
WithdrawRecord,
|
WithdrawRecord,
|
||||||
WithdrawResponse,
|
WithdrawResponse,
|
||||||
} from '@/types/partner';
|
} from '@/types/partner';
|
||||||
|
import { buildUrl } from '@/utils/common';
|
||||||
import { requestUserInfo } from '@/utils/user';
|
import { requestUserInfo } from '@/utils/user';
|
||||||
|
|
||||||
export const getInviteCodeFromQuery = (query: Record<string, string>): string | undefined => {
|
export const getInviteCodeFromQuery = (query: Record<string, string>): string | undefined => {
|
||||||
@ -75,14 +81,14 @@ export const getProfitList = async (data: GetProfitRequest) => {
|
|||||||
return Array.isArray(result) ? result : [];
|
return Array.isArray(result) ? result : [];
|
||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
export const formatMoney = (cents: number) => {
|
export const formatMoney = (cents: number, fraction = 2) => {
|
||||||
if (!cents) {
|
if (!cents) {
|
||||||
return '0';
|
return '0';
|
||||||
}
|
}
|
||||||
const yuan = cents / 100;
|
const yuan = cents / 100;
|
||||||
return yuan.toFixed(2);
|
return yuan.toFixed(fraction);
|
||||||
};
|
};
|
||||||
export function formatTimestamp(timestamp: string): string {
|
export function formatTimestamp(timestamp: string, dateOnly?: boolean): string {
|
||||||
// 创建 Date 对象
|
// 创建 Date 对象
|
||||||
const date = new Date(/^\d+$/.test(timestamp) ? Number(timestamp) : timestamp);
|
const date = new Date(/^\d+$/.test(timestamp) ? Number(timestamp) : timestamp);
|
||||||
|
|
||||||
@ -94,7 +100,7 @@ export function formatTimestamp(timestamp: string): string {
|
|||||||
const mm = String(date.getMinutes()).padStart(2, '0');
|
const mm = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
|
||||||
// 拼接成所需的格式
|
// 拼接成所需的格式
|
||||||
return `${YYYY}.${MM}.${DD} ${HH}:${mm}`;
|
return dateOnly ? `${YYYY}.${MM}.${DD}` : `${YYYY}.${MM}.${DD} ${HH}:${mm}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatUserId(input: string): string {
|
export function formatUserId(input: string): string {
|
||||||
@ -127,3 +133,26 @@ export async function getWithdrawList(data: IPaginationRequest) {
|
|||||||
contentType: 'application/x-www-form-urlencoded',
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
export async function getLastProfitList() {
|
||||||
|
const result = await http.get<UserProfitListItem[]>(API.GET_USER_PROFIT_LIST, {
|
||||||
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
|
});
|
||||||
|
return Array.isArray(result) ? result : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function generateGroupAuthCode() {
|
||||||
|
return await http.get<GroupAuthCode>(API.GENERATE_GROUP_AUTH_CODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getAuthedGroupList() {
|
||||||
|
return await http.get<AuthedGroupInfo[]>(API.GET_AUTHED_GROUP_LIST);
|
||||||
|
}
|
||||||
|
export async function decryptOpenGid(data: DecryptOpenGidBody) {
|
||||||
|
return await http.post(API.DECRYPT_OPEN_GID, {
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export async function getStaffInfo(cityCode: string) {
|
||||||
|
const result = await http.get<StaffInfo[]>(buildUrl(API.GET_STAFF_CODE, { cityCode }));
|
||||||
|
return Array.isArray(result) && result.length ? result[0] : null;
|
||||||
|
}
|
||||||
|
|||||||
@ -15,7 +15,9 @@ import {
|
|||||||
CreatePayOrderParams,
|
CreatePayOrderParams,
|
||||||
GetOrderInfoRequest,
|
GetOrderInfoRequest,
|
||||||
OrderInfo,
|
OrderInfo,
|
||||||
|
ProductSpecResult,
|
||||||
} from '@/types/product';
|
} from '@/types/product';
|
||||||
|
import { buildUrl } from '@/utils/common';
|
||||||
import { getUserId } from '@/utils/user';
|
import { getUserId } from '@/utils/user';
|
||||||
|
|
||||||
export const isCancelPay = err => err?.errMsg === 'requestPayment:fail cancel';
|
export const isCancelPay = err => err?.errMsg === 'requestPayment:fail cancel';
|
||||||
@ -44,6 +46,11 @@ export async function requestProductUseRecord(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function requestProductTypeList(productType: ProductType) {
|
||||||
|
const list = await http.get<ProductSpecResult[]>(buildUrl(API.LIST_PRODUCT_TYPE, { productType }));
|
||||||
|
return list.sort((a, b) => a.sort - b.sort);
|
||||||
|
}
|
||||||
|
|
||||||
// 使用某一个产品
|
// 使用某一个产品
|
||||||
export async function requestUseProduct(
|
export async function requestUseProduct(
|
||||||
productCode: ProductType,
|
productCode: ProductType,
|
||||||
@ -54,13 +61,14 @@ export async function requestUseProduct(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取某个产品的剩余解锁次数
|
// 获取某个产品的剩余解锁次数
|
||||||
export async function requestProductBalance(productCode: ProductType): Promise<[number, boolean | undefined]> {
|
export async function requestProductBalance(productCode: ProductType): Promise<[number, ProductInfo]> {
|
||||||
const data: GetProductDetailRequest = { productCode, userId: getUserId() };
|
const data: GetProductDetailRequest = { productCode, userId: getUserId() };
|
||||||
const { balance, isPaidVip } = await http.post<ProductInfo>(API.GET_PRODUCT_DETAIL, {
|
const result = await http.post<ProductInfo>(API.GET_PRODUCT_DETAIL, {
|
||||||
data,
|
data,
|
||||||
contentType: 'application/x-www-form-urlencoded',
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
});
|
});
|
||||||
return [balance, isPaidVip];
|
|
||||||
|
return [result.balance, result];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否可以购买某一个产品
|
// 是否可以购买某一个产品
|
||||||
|
|||||||
@ -20,6 +20,7 @@ interface ShareAppProps {
|
|||||||
inviteCode?: string;
|
inviteCode?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
path?: PageUrl;
|
path?: PageUrl;
|
||||||
|
imageUrl?: string;
|
||||||
params?: Record<string, BL.Anything>;
|
params?: Record<string, BL.Anything>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,6 +29,7 @@ export const getCommonShareMessage = ({
|
|||||||
inviteCode,
|
inviteCode,
|
||||||
title,
|
title,
|
||||||
path,
|
path,
|
||||||
|
imageUrl: _imageUrl,
|
||||||
params = {},
|
params = {},
|
||||||
}: ShareAppProps = {}): ShareAppMessageReturn => {
|
}: ShareAppProps = {}): ShareAppMessageReturn => {
|
||||||
const inviteParams = inviteCode ? { c: inviteCode } : undefined;
|
const inviteParams = inviteCode ? { c: inviteCode } : undefined;
|
||||||
@ -36,6 +38,6 @@ export const getCommonShareMessage = ({
|
|||||||
return {
|
return {
|
||||||
title: title || `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
|
title: title || `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
|
||||||
path: sharePath,
|
path: sharePath,
|
||||||
imageUrl: useCapture ? undefined : imageUrl,
|
imageUrl: useCapture ? undefined : _imageUrl || imageUrl,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
import dayjs from 'dayjs';
|
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) {
|
if (!time) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
time = Number(time);
|
if (toNum) {
|
||||||
|
time = Number(time);
|
||||||
|
}
|
||||||
return dayjs(time).format(template);
|
return dayjs(time).format(template);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user