Compare commits
14 Commits
feat/group
...
feat/vip_m
| Author | SHA1 | Date | |
|---|---|---|---|
| c696e93bc5 | |||
| e5facdff6a | |||
| 6c1e1cfd2d | |||
| d4fb682852 | |||
| 587436058a | |||
| 4ed1d45873 | |||
| 6b084b2df2 | |||
| 288521ebd9 | |||
| a07b015d8e | |||
| 3533a0a877 | |||
| 966c0782fc | |||
| 1165e027a7 | |||
| 4d146fb1e4 | |||
| 5e3e6903cb |
@ -6,7 +6,7 @@ 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 { requestCityOperators } from '@/utils/location';
|
import { requestCityConfigs } from '@/utils/location';
|
||||||
import { requestUnreadMessageCount } from '@/utils/message';
|
import { requestUnreadMessageCount } from '@/utils/message';
|
||||||
import { decryptOpenGid, getInviteCode, getInviteCodeFromQuery } from '@/utils/partner';
|
import { decryptOpenGid, getInviteCode, getInviteCodeFromQuery } from '@/utils/partner';
|
||||||
import qiniuUpload from '@/utils/qiniu-upload';
|
import qiniuUpload from '@/utils/qiniu-upload';
|
||||||
@ -30,7 +30,7 @@ function App({ children }: PropsWithChildren<BL.Anything>) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useDidShow(options => {
|
useDidShow(options => {
|
||||||
requestCityOperators();
|
requestCityConfigs();
|
||||||
|
|
||||||
console.log(options);
|
console.log(options);
|
||||||
const inviteCode = getInviteCodeFromQuery(options?.query || {});
|
const inviteCode = getInviteCodeFromQuery(options?.query || {});
|
||||||
@ -48,7 +48,7 @@ function App({ children }: PropsWithChildren<BL.Anything>) {
|
|||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
encryptedData: info.encryptedData,
|
encryptedData: info.encryptedData,
|
||||||
});
|
});
|
||||||
console.log('哈哈哈', info);
|
console.log('getGroupEnterInfo', info);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
console.log('没有解析到群', options?.scene);
|
console.log('没有解析到群', options?.scene);
|
||||||
|
|||||||
@ -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>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -49,7 +49,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__pull-refresh {
|
&__pull-refresh {
|
||||||
margin-top: 72px;
|
margin-top: 204px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__item {
|
&__item {
|
||||||
|
|||||||
@ -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>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -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,15 @@ export enum BindPhoneStatus {
|
|||||||
|
|
||||||
export interface ILoginButtonProps extends ButtonProps {
|
export interface ILoginButtonProps extends ButtonProps {
|
||||||
needPhone?: boolean;
|
needPhone?: boolean;
|
||||||
|
needRefresh?: boolean;
|
||||||
|
onRefresh?: (() => void) | (() => Promise<void>);
|
||||||
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, onRefresh, 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);
|
||||||
@ -68,11 +70,15 @@ function LoginButton(props: ILoginButtonProps) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleLoginSuccess = useCallback(
|
const handleLoginSuccess = useCallback(
|
||||||
e => {
|
async e => {
|
||||||
setLoginVisible(false);
|
setLoginVisible(false);
|
||||||
|
if (needRefresh) {
|
||||||
|
requestUserInfo();
|
||||||
|
onRefresh && (await onRefresh());
|
||||||
|
}
|
||||||
onClick?.(e);
|
onClick?.(e);
|
||||||
},
|
},
|
||||||
[onClick]
|
[needRefresh, onClick]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
padding-right: 9px;
|
padding-right: 9px;
|
||||||
font-size: 64px;
|
font-size: 64px;
|
||||||
line-height: 62px;
|
line-height: 62px;
|
||||||
background: linear-gradient(87.53deg, #683DE3 0.4%, #39227D 84.55%);
|
background: linear-gradient(87.53deg, #683de3 0.4%, #39227d 84.55%);
|
||||||
-webkit-background-clip: text;
|
-webkit-background-clip: text;
|
||||||
-webkit-text-fill-color: transparent;
|
-webkit-text-fill-color: transparent;
|
||||||
background-clip: text;
|
background-clip: text;
|
||||||
@ -87,31 +87,48 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 130px;
|
height: 130px;
|
||||||
padding: 24px 32px;
|
padding: 24px 32px;
|
||||||
&-time {
|
&-top-line {
|
||||||
|
.flex-row();
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
.noWrap();
|
||||||
|
}
|
||||||
|
&-id {
|
||||||
|
.id {
|
||||||
|
color: #999999;
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-time {
|
||||||
|
padding-right: 55px;
|
||||||
}
|
}
|
||||||
&-details {
|
&-details {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
white-space: nowrap;
|
.flex-row();
|
||||||
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
&-id {
|
&-tag {
|
||||||
|
height: 36px;
|
||||||
|
margin-right: 16px;
|
||||||
|
padding: 0 12px;
|
||||||
|
border: 1px solid #6d3df5;
|
||||||
|
border-radius: 4px;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
color: #999999;
|
color: #6d3df5;
|
||||||
padding-right: 22px;
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
&-info {
|
&-info {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
margin-right: 16px;
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
margin-right: 16px;
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
@ -257,7 +274,7 @@
|
|||||||
|
|
||||||
&__share-button {
|
&__share-button {
|
||||||
//flex: 2 2;
|
//flex: 2 2;
|
||||||
flex: 0 0 406px;
|
flex: 0 0 406px;
|
||||||
width: 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;
|
||||||
|
|||||||
@ -4,28 +4,56 @@ import { Swiper } from '@taroify/core';
|
|||||||
import { GoodJob } from '@taroify/icons';
|
import { GoodJob } from '@taroify/icons';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import LoginDialog from '@/components/login-dialog';
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageUrl } from '@/constants/app';
|
||||||
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import { EarnType, UserProfitListItem } from '@/types/partner';
|
import { EarnType, UserProfitListItem } from '@/types/partner';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { formatMoney, formatTimestamp, formatUserId, getLastProfitList } from '@/utils/partner';
|
import { becomePartner, formatMoney, formatTimestamp, formatUserId, getLastProfitList } from '@/utils/partner';
|
||||||
import { navigateTo } from '@/utils/route';
|
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 handleConfirm = useCallback(() => {
|
const userInfo = useUserInfo();
|
||||||
navigateTo(PageUrl.GroupOwnerCertificate);
|
const needPhone = isNeedPhone(userInfo);
|
||||||
}, []);
|
const [loginVisible, setLoginVisible] = useState(false);
|
||||||
|
|
||||||
const handleOpenService = useCallback(() => {
|
const handleOpenService = useCallback(() => {
|
||||||
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfc4fcf6b109b3771d7');
|
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfc4fcf6b109b3771d7');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleJump = useCallback(() => {
|
const handleBindSuccess = useCallback(async () => {
|
||||||
navigateTo(PageUrl.PartnerShareVip);
|
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 timerRef = useRef<NodeJS.Timeout | null>(null);
|
||||||
const [bannerList, setBannerList] = useState<UserProfitListItem[]>([]);
|
const [bannerList, setBannerList] = useState<UserProfitListItem[]>([]);
|
||||||
@ -57,6 +85,19 @@ export default function PartnerIntro() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [getBannerList]);
|
}, [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}>
|
||||||
<Image
|
<Image
|
||||||
@ -80,17 +121,24 @@ export default function PartnerIntro() {
|
|||||||
<Swiper className={`${PREFIX}__swiper`} autoplay={3000} touchable={false}>
|
<Swiper className={`${PREFIX}__swiper`} autoplay={3000} touchable={false}>
|
||||||
{bannerList.map((item, index) => (
|
{bannerList.map((item, index) => (
|
||||||
<Swiper.Item className={`${PREFIX}__swiper-item`} key={`${item.userId}-${index}`}>
|
<Swiper.Item className={`${PREFIX}__swiper-item`} key={`${item.userId}-${index}`}>
|
||||||
<div className={`${PREFIX}__swiper-item-time`}>{formatTimestamp(item.updatedAt)}</div>
|
<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 className={`${PREFIX}__swiper-item-details`}>
|
||||||
<div className={`${PREFIX}__swiper-item-id`}>{formatUserId(item.userId)}</div>
|
<div>
|
||||||
<div className={`${PREFIX}__swiper-item-info`}>
|
<div className={`${PREFIX}__swiper-item-tag`}>分成收入</div>
|
||||||
{[EarnType.CHAT_ACTIVITY_SHARE_L1, EarnType.CHAT_ACTIVITY_SHARE_L2].includes(item.earnType)
|
<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, 1)}</div>
|
: '会员支付'}
|
||||||
|
<div className="money">+{formatMoney(item.amount)}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__swiper-item-info`}>
|
<div className={`${PREFIX}__swiper-item-info`}>
|
||||||
累计<div className="money">{formatMoney(item.total, 1)}</div>
|
累计<div className="money">{formatMoney(item.total)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Swiper.Item>
|
</Swiper.Item>
|
||||||
@ -163,6 +211,10 @@ export default function PartnerIntro() {
|
|||||||
赠送会员给好友
|
赠送会员给好友
|
||||||
</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;
|
||||||
@ -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);
|
||||||
|
|||||||
@ -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',
|
||||||
|
|||||||
@ -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__',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -213,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,
|
||||||
@ -110,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) => (
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
import { selectCityOperators } from '@/store/selector';
|
import { selectCityConfigs } from '@/store/selector';
|
||||||
|
|
||||||
function useCityOperators() {
|
function useCityOperators() {
|
||||||
const data = useSelector(selectCityOperators);
|
const data = useSelector(selectCityConfigs);
|
||||||
return data || [];
|
return data || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ const CompanyTabs: TabItemType[] = [
|
|||||||
{
|
{
|
||||||
type: PageType.BatchPublish,
|
type: PageType.BatchPublish,
|
||||||
pagePath: PageUrl.UserBatchPublish,
|
pagePath: PageUrl.UserBatchPublish,
|
||||||
text: '代招代发',
|
text: '代招',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
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;
|
||||||
|
|||||||
@ -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', // 订单查询
|
||||||
@ -95,5 +97,5 @@ export enum API {
|
|||||||
GET_AUTHED_GROUP_LIST = '/partner/getAuthedGroupList',
|
GET_AUTHED_GROUP_LIST = '/partner/getAuthedGroupList',
|
||||||
GET_STAFF_CODE = '/partner/staff/{cityCode}',
|
GET_STAFF_CODE = '/partner/staff/{cityCode}',
|
||||||
// 所有城市运营
|
// 所有城市运营
|
||||||
GET_ALL_CITY_OPERATOR = '/group/getAllGroup',
|
GET_ALL_CITY_CONFIGS = '/group/getAllGroup',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,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 || '');
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import Taro, { useShareAppMessage } from '@tarojs/taro';
|
|||||||
|
|
||||||
import { Tabs } from '@taroify/core';
|
import { Tabs } from '@taroify/core';
|
||||||
import { Arrow } from '@taroify/icons';
|
import { Arrow } from '@taroify/icons';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { Fragment, useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import GroupCertificationList from '@/components/group-certification-list';
|
import GroupCertificationList from '@/components/group-certification-list';
|
||||||
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
||||||
@ -21,8 +21,7 @@ const PREFIX = 'group-owner-certification';
|
|||||||
export default function GroupOwnerCertification() {
|
export default function GroupOwnerCertification() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
const [cityCode, setCityCode] = useState<string>(location.cityCode);
|
const [cityCode, setCityCode] = useState<string>();
|
||||||
const cityValuesChangedRef = useRef(false);
|
|
||||||
Taro.showShareMenu({
|
Taro.showShareMenu({
|
||||||
withShareTicket: true,
|
withShareTicket: true,
|
||||||
});
|
});
|
||||||
@ -39,8 +38,8 @@ export default function GroupOwnerCertification() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleClickCityMenu = useCallback(() => {
|
const handleClickCityMenu = useCallback(() => {
|
||||||
navigateTo(PageUrl.CitySearch, { city: cityCode, source: OpenSource.GroupOwnerCertificate });
|
navigateTo(PageUrl.CitySearch, { city: cityCode || location.cityCode, source: OpenSource.GroupOwnerCertificate });
|
||||||
}, [cityCode]);
|
}, [cityCode, location.cityCode]);
|
||||||
|
|
||||||
const handleCityChange = useCallback(data => {
|
const handleCityChange = useCallback(data => {
|
||||||
console.log('handleCityChange', data);
|
console.log('handleCityChange', data);
|
||||||
@ -48,16 +47,9 @@ export default function GroupOwnerCertification() {
|
|||||||
if (openSource !== OpenSource.GroupOwnerCertificate) {
|
if (openSource !== OpenSource.GroupOwnerCertificate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cityValuesChangedRef.current = true;
|
|
||||||
setCityCode(cCode);
|
setCityCode(cCode);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (cityValuesChangedRef.current) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setCityCode(location.cityCode);
|
|
||||||
}, [location]);
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
|
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
|
||||||
return () => {
|
return () => {
|
||||||
@ -67,6 +59,8 @@ export default function GroupOwnerCertification() {
|
|||||||
|
|
||||||
const [staffInfo, setStaffInfo] = useState<StaffInfo | null>(null);
|
const [staffInfo, setStaffInfo] = useState<StaffInfo | null>(null);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!cityCode) return;
|
||||||
|
|
||||||
getStaffInfo(cityCode)
|
getStaffInfo(cityCode)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
setStaffInfo(data);
|
setStaffInfo(data);
|
||||||
@ -92,19 +86,21 @@ export default function GroupOwnerCertification() {
|
|||||||
<div className={`${PREFIX}__lined-title`}>选择城市,添加运营</div>
|
<div className={`${PREFIX}__lined-title`}>选择城市,添加运营</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__city-select`} onClick={handleClickCityMenu}>
|
<div className={`${PREFIX}__city-select`} onClick={handleClickCityMenu}>
|
||||||
{CITY_CODE_TO_NAME_MAP.get(cityCode)}
|
{cityCode ? CITY_CODE_TO_NAME_MAP.get(cityCode) : '请选择城市'}
|
||||||
<Arrow size={16} />
|
<Arrow size={16} />
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__lined-wrapper`}>
|
|
||||||
<div className={`${PREFIX}__lined-title`}>长按并识别二维码添加运营</div>
|
|
||||||
</div>
|
|
||||||
{staffInfo && (
|
{staffInfo && (
|
||||||
<Image
|
<Fragment>
|
||||||
className={`${PREFIX}__qrcode`}
|
<div className={`${PREFIX}__lined-wrapper`}>
|
||||||
src={staffInfo.staffQrCode}
|
<div className={`${PREFIX}__lined-title`}>长按并识别二维码添加运营</div>
|
||||||
showMenuByLongpress
|
</div>
|
||||||
mode="aspectFill"
|
<Image
|
||||||
/>
|
className={`${PREFIX}__qrcode`}
|
||||||
|
src={staffInfo.staffQrCode}
|
||||||
|
showMenuByLongpress
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__title`}>第二步</div>
|
<div className={`${PREFIX}__title`}>第二步</div>
|
||||||
|
|||||||
@ -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,30 @@ 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 (loading?: boolean) => {
|
||||||
|
if (loading) {
|
||||||
|
Taro.showLoading();
|
||||||
|
}
|
||||||
|
const [, resp] = await requestProductBalance(ProductType.VIP);
|
||||||
|
setProductInfo(resp);
|
||||||
|
console.log(resp);
|
||||||
|
if (loading) {
|
||||||
|
Taro.hideLoading();
|
||||||
|
}
|
||||||
|
return resp;
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleClickContact = useCallback(async () => {
|
const handleClickContact = useCallback(async () => {
|
||||||
log('handleClickContact');
|
log('handleClickContact');
|
||||||
@ -80,21 +101,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 +111,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 +133,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 +150,99 @@ 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]);
|
||||||
|
|
||||||
|
const handleRefresh = useCallback(async () => {
|
||||||
|
await getProductBalance(true);
|
||||||
|
}, [getProductBalance]);
|
||||||
|
|
||||||
|
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
|
||||||
{data.isAuthed ? '在线沟通' : '立即联系'}
|
needRefresh
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
className={`${PREFIX}__contact-publisher`}
|
||||||
|
onClick={handleClickContact}
|
||||||
|
>
|
||||||
|
{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,44 +258,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_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);
|
|
||||||
}
|
|
||||||
}, [data]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`${PREFIX}__footer`}>
|
<div className={`${PREFIX}__footer`}>
|
||||||
|
|||||||
@ -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 () => {
|
||||||
|
|||||||
@ -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';
|
||||||
@ -12,29 +12,29 @@ 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 cityOperators = useCityOperators();
|
const cityOperators = useCityOperators();
|
||||||
const [value, setValue] = useState('0');
|
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');
|
||||||
}, []);
|
}, []);
|
||||||
@ -80,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={
|
||||||
|
|||||||
@ -88,4 +88,8 @@
|
|||||||
width: 76px;
|
width: 76px;
|
||||||
height: 81px;
|
height: 81px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.taroify-cell__right-icon {
|
||||||
|
line-height: 48px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { RoleType, PageType } from '@/constants/app';
|
|||||||
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, SET_SERVICE_URLS } 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 });
|
||||||
|
|
||||||
@ -10,4 +10,4 @@ export const changeHomePage = (value: PageType) => ({ type: CHANGE_HOME_PAGE, va
|
|||||||
|
|
||||||
export const setLocationInfo = (value: LocationInfo) => ({ type: SET_LOCATION_INFO, value });
|
export const setLocationInfo = (value: LocationInfo) => ({ type: SET_LOCATION_INFO, value });
|
||||||
|
|
||||||
export const setCityOperators = (value: AppState['cityOperators']) => ({ type: SET_SERVICE_URLS, value });
|
export const setCityConfigs = (value: AppState['cityConfigs']) => ({ type: SET_CITY_CONFIGS, value });
|
||||||
|
|||||||
@ -6,4 +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_SERVICE_URLS = 'SET_SERVICE_URLS';
|
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, SET_SERVICE_URLS } 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,7 +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,
|
||||||
cityOperators: [],
|
cityConfigs: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
|
const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
|
||||||
@ -34,8 +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_SERVICE_URLS:
|
case SET_CITY_CONFIGS:
|
||||||
return { ...state, cityOperators: value };
|
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 };
|
||||||
|
|||||||
@ -6,4 +6,4 @@ 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 selectCityOperators = (state: IState) => state.appState.cityOperators || {};
|
export const selectCityConfigs = (state: IState) => state.appState.cityConfigs || [];
|
||||||
|
|||||||
@ -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 {
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export interface GetCityCodeRequest {
|
|||||||
longitude: number; // 经度,范围为-180~180,负数表示西经
|
longitude: number; // 经度,范围为-180~180,负数表示西经
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CityOperatorListItem {
|
export interface CityConfigListItem {
|
||||||
id: number;
|
id: number;
|
||||||
staffId: number;
|
staffId: number;
|
||||||
staffName: string;
|
staffName: string;
|
||||||
@ -30,4 +30,6 @@ export interface CityOperatorListItem {
|
|||||||
groupLink: string;
|
groupLink: string;
|
||||||
created: string;
|
created: string;
|
||||||
updated: 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 {
|
||||||
|
|||||||
@ -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,8 +17,5 @@ export interface AppState {
|
|||||||
roleType: RoleType;
|
roleType: RoleType;
|
||||||
homePageType: PageType;
|
homePageType: PageType;
|
||||||
location: LocationInfo;
|
location: LocationInfo;
|
||||||
cityOperators: Array<{
|
cityConfigs: CityConfigListItem[];
|
||||||
cityCode: string;
|
|
||||||
groupLink: string;
|
|
||||||
}>;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,12 +15,10 @@ export const isDesktop = (() => {
|
|||||||
return info.platform === 'windows' || info.platform === 'mac';
|
return info.platform === 'windows' || info.platform === 'mac';
|
||||||
})();
|
})();
|
||||||
|
|
||||||
export const logWithPrefix = isDev()
|
export const logWithPrefix =
|
||||||
? (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 {
|
||||||
|
|||||||
@ -51,5 +51,8 @@ export const requestBatchPublishGroups = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const requestSimpleGroupList = async (cityCode?: string) => {
|
export const requestSimpleGroupList = async (cityCode?: string) => {
|
||||||
return http.post<SimpleGroupInfo[]>(API.SIMPLE_GROUP_LIST, { data: { cityCode } });
|
return http.post<SimpleGroupInfo[]>(API.SIMPLE_GROUP_LIST, {
|
||||||
|
data: { cityCode },
|
||||||
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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, setCityOperators } from '@/store/actions';
|
import { setLocationInfo, setCityConfigs } from '@/store/actions';
|
||||||
import { selectLocation } from '@/store/selector';
|
import { selectLocation } from '@/store/selector';
|
||||||
import { CityOperatorListItem, GetCityCodeRequest, LocationInfo } from '@/types/location';
|
import { CityConfigListItem, GetCityCodeRequest, LocationInfo } from '@/types/location';
|
||||||
|
|
||||||
import { authorize, getWxSetting } from './wx';
|
import { authorize, getWxSetting } from './wx';
|
||||||
|
|
||||||
@ -135,14 +135,7 @@ export async function requestLocation(force: boolean = false) {
|
|||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function requestCityOperators() {
|
export async function requestCityConfigs() {
|
||||||
const list = await http.get<CityOperatorListItem[]>(API.GET_ALL_CITY_OPERATOR);
|
const list = await http.get<CityConfigListItem[]>(API.GET_ALL_CITY_CONFIGS);
|
||||||
store.dispatch(
|
store.dispatch(setCityConfigs(list));
|
||||||
setCityOperators(
|
|
||||||
(list || []).map(it => ({
|
|
||||||
cityCode: it.cityCode,
|
|
||||||
groupLink: it.groupLink,
|
|
||||||
}))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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,6 +61,9 @@ 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('·');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否可以购买某一个产品
|
// 是否可以购买某一个产品
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export const getUserId = () => getUserInfo().userId;
|
|||||||
export const isValidUserInfo = (info: UserInfo) => !!info.userId;
|
export const isValidUserInfo = (info: UserInfo) => !!info.userId;
|
||||||
|
|
||||||
export const isNeedLogin = (info: UserInfo) => !info.isBindPhone;
|
export const isNeedLogin = (info: UserInfo) => !info.isBindPhone;
|
||||||
// export const isNeedLogin = (info: UserInfo) => !info.isBindPhone || info.userId === '218396277145075712';
|
// export const isNeedLogin = (info: UserInfo) => !info.isBindPhone || info.userId === '171633767918600192';
|
||||||
|
|
||||||
export const isNeedPhone = (info: UserInfo) => isNeedLogin(info) || !info.phone;
|
export const isNeedPhone = (info: UserInfo) => isNeedLogin(info) || !info.phone;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user