Compare commits
1 Commits
feat/updat
...
451add0e7d
| Author | SHA1 | Date | |
|---|---|---|---|
| 451add0e7d |
@ -109,6 +109,5 @@
|
|||||||
"ignoredBuiltDependencies": [
|
"ignoredBuiltDependencies": [
|
||||||
"@tarojs/binding"
|
"@tarojs/binding"
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,19 +16,7 @@
|
|||||||
"coverView": false,
|
"coverView": false,
|
||||||
"showShadowRootInWxmlPanel": false,
|
"showShadowRootInWxmlPanel": false,
|
||||||
"packNpmRelationList": [],
|
"packNpmRelationList": [],
|
||||||
"ignoreUploadUnusedFiles": true,
|
"ignoreUploadUnusedFiles": true
|
||||||
"compileWorklet": false,
|
|
||||||
"uglifyFileName": false,
|
|
||||||
"uploadWithSourceMap": true,
|
|
||||||
"packNpmManually": false,
|
|
||||||
"minifyWXSS": true,
|
|
||||||
"minifyWXML": true,
|
|
||||||
"localPlugins": false,
|
|
||||||
"disableUseStrict": false,
|
|
||||||
"useCompilerPlugins": false,
|
|
||||||
"condition": false,
|
|
||||||
"swc": false,
|
|
||||||
"disableSWC": true
|
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"srcMiniprogramRoot": "dist/",
|
"srcMiniprogramRoot": "dist/",
|
||||||
@ -42,6 +30,5 @@
|
|||||||
"ignore": [],
|
"ignore": [],
|
||||||
"include": []
|
"include": []
|
||||||
},
|
},
|
||||||
"appid": "wxf0724a83f8e377d2",
|
"appid": "wxf0724a83f8e377d2"
|
||||||
"simulatorPluginLibVersion": {}
|
}
|
||||||
}
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
@import '@/styles/common.less';
|
|
||||||
@import '@/styles/variables.less';
|
|
||||||
|
|
||||||
.agreement-popup {
|
|
||||||
&__content {
|
|
||||||
.flex-column();
|
|
||||||
padding: 40px 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__title {
|
|
||||||
font-size: 32px;
|
|
||||||
font-weight: 500;
|
|
||||||
line-height: 48px;
|
|
||||||
color: @blColor;;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__body {
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28px;
|
|
||||||
line-height: 40px;
|
|
||||||
color: @blColor;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
align-self: flex-start;
|
|
||||||
};
|
|
||||||
|
|
||||||
&__btn-group {
|
|
||||||
margin-top: 32px;
|
|
||||||
.flex-row();
|
|
||||||
gap: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__confirm-button {
|
|
||||||
.button(@width: 230px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
&__cancel-button {
|
|
||||||
.button(@width: 230px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px, @highlight: 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
import { Button, ITouchEvent } from '@tarojs/components';
|
|
||||||
|
|
||||||
import { Popup } from '@taroify/core';
|
|
||||||
import { useCallback } from 'react';
|
|
||||||
|
|
||||||
import { BindPhoneStatus } from '@/components/login-button';
|
|
||||||
import PhoneButton from '@/components/phone-button';
|
|
||||||
import { ProtocolPrivacy } from '@/components/protocol-privacy';
|
|
||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
|
||||||
|
|
||||||
import './index.less';
|
|
||||||
|
|
||||||
interface IProps {
|
|
||||||
open: boolean;
|
|
||||||
onCancel: () => void;
|
|
||||||
onConfirm: (e: ITouchEvent) => void;
|
|
||||||
needPhone?: boolean;
|
|
||||||
needBindPhone?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const PREFIX = 'agreement-popup';
|
|
||||||
|
|
||||||
export function AgreementPopup({ open, onCancel, onConfirm, needPhone, needBindPhone }: IProps) {
|
|
||||||
const handleBindPhone = useCallback(
|
|
||||||
(status: BindPhoneStatus, e: ITouchEvent) => {
|
|
||||||
if (status === BindPhoneStatus.Success) {
|
|
||||||
onConfirm(e);
|
|
||||||
} else {
|
|
||||||
onCancel();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[onCancel, onConfirm]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!open) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Popup rounded className={PREFIX} placement="bottom" open={open} onClose={onCancel}>
|
|
||||||
<div className={`${PREFIX}__content`}>
|
|
||||||
<div className={`${PREFIX}__title`}>提示</div>
|
|
||||||
<div className={`${PREFIX}__body`}>
|
|
||||||
<div>你好,以下是播络隐私协议与用户协议</div>
|
|
||||||
<div>同意后可使用全部功能,不同意你也可以浏览</div>
|
|
||||||
</div>
|
|
||||||
<ProtocolPrivacy divider />
|
|
||||||
<div className={`${PREFIX}__btn-group`}>
|
|
||||||
<Button className={`${PREFIX}__cancel-button`} onClick={onCancel}>
|
|
||||||
拒绝
|
|
||||||
</Button>
|
|
||||||
{needBindPhone ? (
|
|
||||||
<PhoneButton className={`${PREFIX}__confirm-button`} needPhone={needPhone} onBindPhone={handleBindPhone}>
|
|
||||||
同意
|
|
||||||
</PhoneButton>
|
|
||||||
) : (
|
|
||||||
<Button className={`${PREFIX}__confirm-button`} onClick={onConfirm}>
|
|
||||||
同意
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<SafeBottomPadding />
|
|
||||||
</Popup>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -18,7 +18,6 @@ import './index.less';
|
|||||||
interface IProps {
|
interface IProps {
|
||||||
data: AnchorInfo;
|
data: AnchorInfo;
|
||||||
jobId?: string;
|
jobId?: string;
|
||||||
validator: (onSuccess: () => void) => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const PREFIX = 'anchor-card';
|
const PREFIX = 'anchor-card';
|
||||||
@ -35,17 +34,14 @@ const getSalary = (data: AnchorInfo) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function AnchorCard(props: IProps) {
|
function AnchorCard(props: IProps) {
|
||||||
const { data, jobId, validator } = props;
|
const { data, jobId } = props;
|
||||||
const style = data.isRead ? ({ '--read-color': '#999999' } as React.CSSProperties) : {};
|
const style = data.isRead ? ({ '--read-color': '#999999' } as React.CSSProperties) : {};
|
||||||
const cover = (data.materialVideoInfoList.find(video => video.isDefault) || data.materialVideoInfoList[0])?.coverUrl;
|
const cover = (data.materialVideoInfoList.find(video => video.isDefault) || data.materialVideoInfoList[0])?.coverUrl;
|
||||||
|
|
||||||
const handleNavTo = useCallback(() => {
|
const handleClick = useCallback(
|
||||||
navigateTo(PageUrl.MaterialView, { jobId, resumeId: data.id, source: MaterialViewSource.AnchorList });
|
() => navigateTo(PageUrl.MaterialView, { jobId, resumeId: data.id, source: MaterialViewSource.AnchorList }),
|
||||||
}, [data, jobId]);
|
[data, jobId]
|
||||||
|
);
|
||||||
const handleClick = useCallback(() => {
|
|
||||||
validator(handleNavTo);
|
|
||||||
}, [handleNavTo, validator]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={PREFIX} style={style} onClick={handleClick}>
|
<div className={PREFIX} style={style} onClick={handleClick}>
|
||||||
|
|||||||
@ -7,16 +7,11 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|||||||
|
|
||||||
import AnchorCard from '@/components/anchor-card';
|
import AnchorCard from '@/components/anchor-card';
|
||||||
import ListPlaceholder from '@/components/list-placeholder';
|
import ListPlaceholder from '@/components/list-placeholder';
|
||||||
import LoginDialog from '@/components/login-dialog';
|
|
||||||
import { EventName } from '@/constants/app';
|
import { EventName } from '@/constants/app';
|
||||||
import { AnchorSortType } from '@/constants/material';
|
import { AnchorSortType } from '@/constants/material';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
|
||||||
import { AnchorInfo, GetAnchorListRequest, IAnchorFilters } from '@/types/material';
|
import { AnchorInfo, GetAnchorListRequest, IAnchorFilters } from '@/types/material';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { requestAnchorList as requestData } from '@/utils/material';
|
import { requestAnchorList as requestData } from '@/utils/material';
|
||||||
import { getAgreementSigned, isNeedLogin, setAgreementSigned } from '@/utils/user';
|
|
||||||
|
|
||||||
import { AgreementPopup } from '../agreement-popup';
|
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
@ -60,11 +55,6 @@ function AnchorList(props: IAnchorListProps) {
|
|||||||
const requestProps = useRef<IRequestProps>({});
|
const requestProps = useRef<IRequestProps>({});
|
||||||
const prevRequestProps = useRef<IRequestProps>({});
|
const prevRequestProps = useRef<IRequestProps>({});
|
||||||
const onListEmptyRef = useRef(onListEmpty);
|
const onListEmptyRef = useRef(onListEmpty);
|
||||||
const [openLogin, setLoginOpen] = useState(false);
|
|
||||||
const [openAssignment, setAssignmentOpen] = useState(false);
|
|
||||||
const successCallback = useRef<() => void>(() => {});
|
|
||||||
const userInfo = useUserInfo();
|
|
||||||
const needLogin = isNeedLogin(userInfo);
|
|
||||||
|
|
||||||
const handleRefresh = useCallback(async () => {
|
const handleRefresh = useCallback(async () => {
|
||||||
log('start pull refresh');
|
log('start pull refresh');
|
||||||
@ -130,37 +120,6 @@ function AnchorList(props: IAnchorListProps) {
|
|||||||
[dataList]
|
[dataList]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleCancel = useCallback(() => {
|
|
||||||
setAssignmentOpen(false);
|
|
||||||
setAgreementSigned(false);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleConfirm = useCallback(() => {
|
|
||||||
setAssignmentOpen(false);
|
|
||||||
setAgreementSigned(true);
|
|
||||||
successCallback.current();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleLoginSuccess = useCallback(() => {
|
|
||||||
setLoginOpen(false);
|
|
||||||
successCallback.current();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleLoginCancel = useCallback(() => {
|
|
||||||
setLoginOpen(false);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const validator = (onSuccess: () => void) => {
|
|
||||||
successCallback.current = onSuccess;
|
|
||||||
if (!getAgreementSigned()) {
|
|
||||||
setAssignmentOpen(true);
|
|
||||||
} else if (needLogin) {
|
|
||||||
setLoginOpen(true);
|
|
||||||
} else {
|
|
||||||
onSuccess();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
onListEmptyRef.current = onListEmpty;
|
onListEmptyRef.current = onListEmpty;
|
||||||
}, [onListEmpty]);
|
}, [onListEmpty]);
|
||||||
@ -224,35 +183,26 @@ function AnchorList(props: IAnchorListProps) {
|
|||||||
}, [jobId, ready, filters, cityCode, sortType]);
|
}, [jobId, ready, filters, cityCode, sortType]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<PullRefresh
|
||||||
<PullRefresh
|
className={classNames(`${PREFIX}__pull-refresh`, className)}
|
||||||
className={classNames(`${PREFIX}__pull-refresh`, className)}
|
loading={refreshing}
|
||||||
loading={refreshing}
|
onRefresh={handleRefresh}
|
||||||
onRefresh={handleRefresh}
|
disabled={refreshDisabled || !ready}
|
||||||
disabled={refreshDisabled || !ready}
|
>
|
||||||
|
<List
|
||||||
|
hasMore={hasMore}
|
||||||
|
onLoad={handleLoadMore}
|
||||||
|
loading={loadingMore || refreshing}
|
||||||
|
disabled={loadMoreError || !ready}
|
||||||
|
fixedHeight={typeof listHeight !== 'undefined'}
|
||||||
|
style={listHeight ? { height: `${listHeight}px` } : undefined}
|
||||||
>
|
>
|
||||||
<List
|
{dataList.map(item => (
|
||||||
hasMore={hasMore}
|
<AnchorCard data={item} jobId={jobId} key={item.id} />
|
||||||
onLoad={handleLoadMore}
|
))}
|
||||||
loading={loadingMore || refreshing}
|
<ListPlaceholder hasMore={hasMore} loadingMore={loadingMore} loadMoreError={loadMoreError} />
|
||||||
disabled={loadMoreError || !ready}
|
</List>
|
||||||
fixedHeight={typeof listHeight !== 'undefined'}
|
</PullRefresh>
|
||||||
style={listHeight ? { height: `${listHeight}px` } : undefined}
|
|
||||||
>
|
|
||||||
{dataList.map(item => (
|
|
||||||
<AnchorCard data={item} jobId={jobId} key={item.id} validator={validator} />
|
|
||||||
))}
|
|
||||||
<ListPlaceholder hasMore={hasMore} loadingMore={loadingMore} loadMoreError={loadMoreError} />
|
|
||||||
</List>
|
|
||||||
</PullRefresh>
|
|
||||||
<AgreementPopup
|
|
||||||
open={openAssignment}
|
|
||||||
onCancel={handleCancel}
|
|
||||||
onConfirm={handleConfirm}
|
|
||||||
needBindPhone={needLogin}
|
|
||||||
/>
|
|
||||||
{openLogin && <LoginDialog onCancel={handleLoginCancel} onSuccess={handleLoginSuccess} />}
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,8 +46,8 @@ function JobRecommendList(props: IJobListProps) {
|
|||||||
setDataList([]);
|
setDataList([]);
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setLoadError(false);
|
setLoadError(false);
|
||||||
const { jobResults } = await requestMyRecommendJobList({ ...requestProps.current });
|
const { jobResults = [] } = await requestMyRecommendJobList({ ...requestProps.current });
|
||||||
setDataList(jobResults || []);
|
setDataList(jobResults);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setDataList([]);
|
setDataList([]);
|
||||||
setLoadError(true);
|
setLoadError(true);
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
import { Button, ButtonProps, ITouchEvent } from '@tarojs/components';
|
import { Button, ButtonProps } from '@tarojs/components';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
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 { isNeedLogin } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
@ -18,7 +17,6 @@ export enum BindPhoneStatus {
|
|||||||
|
|
||||||
export interface ILoginButtonProps extends ButtonProps {
|
export interface ILoginButtonProps extends ButtonProps {
|
||||||
needPhone?: boolean;
|
needPhone?: boolean;
|
||||||
needAssignment?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const PREFIX = 'login-button';
|
const PREFIX = 'login-button';
|
||||||
@ -26,50 +24,12 @@ const PREFIX = 'login-button';
|
|||||||
function LoginButton(props: ILoginButtonProps) {
|
function LoginButton(props: ILoginButtonProps) {
|
||||||
const { className, children, needPhone, onClick, ...otherProps } = props;
|
const { className, children, needPhone, onClick, ...otherProps } = props;
|
||||||
const userInfo = useUserInfo();
|
const userInfo = useUserInfo();
|
||||||
const [loginVisible, setLoginVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [assignVisible, setAssignVisible] = useState(false);
|
|
||||||
const needLogin = isNeedLogin(userInfo);
|
const needLogin = isNeedLogin(userInfo);
|
||||||
// 点击按钮时,协议同意也手机也授权了 -> 下一步
|
|
||||||
//
|
|
||||||
// 点击按钮时,协议同意但是手机授权没给 -> 弹登录
|
|
||||||
// -> 如果授权了手机号就进行下一步
|
|
||||||
// -> 不给授权没下一步
|
|
||||||
//
|
|
||||||
// 点击按钮时,协议不同意 -> 弹协议窗口
|
|
||||||
// -> 如果同意就进行下一步
|
|
||||||
// -> 不同意没下一步
|
|
||||||
const handleClick = useCallback(
|
|
||||||
(e: ITouchEvent) => {
|
|
||||||
if (!getAgreementSigned()) {
|
|
||||||
setAssignVisible(true);
|
|
||||||
} else if (needLogin) {
|
|
||||||
setLoginVisible(true);
|
|
||||||
} else if (onClick) {
|
|
||||||
onClick(e);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[needLogin, onClick]
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleConfirm = useCallback(
|
const onSuccess = useCallback(
|
||||||
(e: ITouchEvent) => {
|
|
||||||
setAssignVisible(false);
|
|
||||||
setAgreementSigned(true);
|
|
||||||
if (onClick) {
|
|
||||||
onClick(e);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[onClick]
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleCancel = useCallback(() => {
|
|
||||||
setAgreementSigned(false);
|
|
||||||
setAssignVisible(false);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleLoginSuccess = useCallback(
|
|
||||||
e => {
|
e => {
|
||||||
setLoginVisible(false);
|
setVisible(false);
|
||||||
onClick?.(e);
|
onClick?.(e);
|
||||||
},
|
},
|
||||||
[onClick]
|
[onClick]
|
||||||
@ -77,18 +37,14 @@ function LoginButton(props: ILoginButtonProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button {...otherProps} className={classNames(PREFIX, className)} onClick={handleClick}>
|
<Button
|
||||||
|
{...otherProps}
|
||||||
|
className={classNames(PREFIX, className)}
|
||||||
|
onClick={needLogin ? () => setVisible(true) : onClick}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</Button>
|
</Button>
|
||||||
<AgreementPopup
|
{visible && <LoginDialog onCancel={() => setVisible(false)} onSuccess={onSuccess} needPhone={needPhone} />}
|
||||||
open={assignVisible}
|
|
||||||
onCancel={handleCancel}
|
|
||||||
onConfirm={handleConfirm}
|
|
||||||
needBindPhone={needLogin}
|
|
||||||
/>
|
|
||||||
{loginVisible && (
|
|
||||||
<LoginDialog onCancel={() => setLoginVisible(false)} onSuccess={handleLoginSuccess} needPhone={needPhone} />
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,4 +17,22 @@
|
|||||||
.button(@width: 360px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px);
|
.button(@width: 360px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px);
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__cancel-button {
|
||||||
|
min-width: fit-content;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 32px;
|
||||||
|
color: @blHighlightColor;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
margin-top: 40px;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border-color: transparent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__checkbox {
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
|
import { Button } from '@tarojs/components';
|
||||||
|
|
||||||
import { Dialog } from '@taroify/core';
|
import { Dialog } from '@taroify/core';
|
||||||
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import PhoneButton, { IPhoneButtonProps } from '@/components/phone-button';
|
import PhoneButton, { IPhoneButtonProps } from '@/components/phone-button';
|
||||||
|
import { ProtocolPrivacyCheckbox } from '@/components/protocol-privacy';
|
||||||
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
@ -16,20 +21,36 @@ const PREFIX = 'login-dialog';
|
|||||||
|
|
||||||
export default function LoginDialog(props: IProps) {
|
export default function LoginDialog(props: IProps) {
|
||||||
const { title = '使用播络服务前,请先登录', needPhone, onSuccess, onCancel, onBindPhone } = props;
|
const { title = '使用播络服务前,请先登录', needPhone, onSuccess, onCancel, onBindPhone } = props;
|
||||||
|
const [checked, setChecked] = useState(false);
|
||||||
|
|
||||||
|
const handleTipCheck = useCallback(() => {
|
||||||
|
Toast.info('请先阅读并同意协议');
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open onClose={onCancel}>
|
<Dialog open onClose={onCancel}>
|
||||||
<Dialog.Content>
|
<Dialog.Content>
|
||||||
<div className={`${PREFIX}__container`}>
|
<div className={`${PREFIX}__container`}>
|
||||||
<div className={`${PREFIX}__title`}>{title}</div>
|
<div className={`${PREFIX}__title`}>{title}</div>
|
||||||
<PhoneButton
|
{!checked && (
|
||||||
className={`${PREFIX}__confirm-button`}
|
<Button className={`${PREFIX}__confirm-button`} onClick={handleTipCheck}>
|
||||||
onSuccess={onSuccess}
|
登录
|
||||||
onBindPhone={onBindPhone}
|
</Button>
|
||||||
needPhone={needPhone}
|
)}
|
||||||
>
|
{checked && (
|
||||||
登录
|
<PhoneButton
|
||||||
</PhoneButton>
|
className={`${PREFIX}__confirm-button`}
|
||||||
|
onSuccess={onSuccess}
|
||||||
|
onBindPhone={onBindPhone}
|
||||||
|
needPhone={needPhone}
|
||||||
|
>
|
||||||
|
登录
|
||||||
|
</PhoneButton>
|
||||||
|
)}
|
||||||
|
<Button className={`${PREFIX}__cancel-button`} onClick={onCancel}>
|
||||||
|
跳过,暂不登录
|
||||||
|
</Button>
|
||||||
|
<ProtocolPrivacyCheckbox checked={checked} onChange={setChecked} className={`${PREFIX}__checkbox`} />
|
||||||
</div>
|
</div>
|
||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|||||||
@ -2,13 +2,13 @@ import { Image } from '@tarojs/components';
|
|||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { PropsWithChildren, useEffect, useState, useCallback } from 'react';
|
import { PropsWithChildren, useEffect, useState, useCallback } from 'react';
|
||||||
|
|
||||||
import { PageUrl } from '@/constants/app';
|
|
||||||
import { MaterialViewSource } from '@/constants/material';
|
import { MaterialViewSource } from '@/constants/material';
|
||||||
|
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import { IChatMessage } from '@/types/message';
|
import { IChatMessage } from '@/types/message';
|
||||||
import { getScrollItemId } from '@/utils/common';
|
import { getScrollItemId } from '@/utils/common';
|
||||||
import { navigateTo } from '@/utils/route';
|
import { navigateTo } from '@/utils/route';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
@ -19,13 +19,12 @@ export interface IBaseMessageProps {
|
|||||||
|
|
||||||
export interface IUserMessageProps extends PropsWithChildren, IBaseMessageProps {
|
export interface IUserMessageProps extends PropsWithChildren, IBaseMessageProps {
|
||||||
isRead?: boolean;
|
isRead?: boolean;
|
||||||
resumeId?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const PREFIX = 'base-message';
|
const PREFIX = 'base-message';
|
||||||
|
|
||||||
function BaseMessage(props: IUserMessageProps) {
|
function BaseMessage(props: IUserMessageProps) {
|
||||||
const { id, message, isRead: isReadProps, children, resumeId } = props;
|
const { id, message, isRead: isReadProps, children } = props;
|
||||||
const { userId } = useUserInfo();
|
const { userId } = useUserInfo();
|
||||||
const [isRead, setIsRead] = useState(message.isRead);
|
const [isRead, setIsRead] = useState(message.isRead);
|
||||||
const isSender = message.senderUserId === userId;
|
const isSender = message.senderUserId === userId;
|
||||||
@ -38,12 +37,10 @@ function BaseMessage(props: IUserMessageProps) {
|
|||||||
// const timer = setTimeout(() => setIsRead(true), 1200);
|
// const timer = setTimeout(() => setIsRead(true), 1200);
|
||||||
// return () => clearTimeout(timer);
|
// return () => clearTimeout(timer);
|
||||||
// }, [isSender]);
|
// }, [isSender]);
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(
|
||||||
if (!resumeId || isSender) {
|
() => navigateTo(PageUrl.MaterialView, { resumeId: message.jobId, source: MaterialViewSource.Chat }),
|
||||||
return;
|
[message.jobId]
|
||||||
}
|
);
|
||||||
navigateTo(PageUrl.MaterialView, { resumeId: resumeId, source: MaterialViewSource.Chat });
|
|
||||||
}, [resumeId, isSender]);
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isRead) {
|
if (isRead) {
|
||||||
return;
|
return;
|
||||||
@ -56,7 +53,6 @@ function BaseMessage(props: IUserMessageProps) {
|
|||||||
<Image
|
<Image
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
className={`${PREFIX}__avatar`}
|
className={`${PREFIX}__avatar`}
|
||||||
onClick={handleClick}
|
|
||||||
src={message.senderAvatarUrl || require('@/statics/png/default_avatar.png')}
|
src={message.senderAvatarUrl || require('@/statics/png/default_avatar.png')}
|
||||||
/>
|
/>
|
||||||
<div className={`${PREFIX}__content-container`}>
|
<div className={`${PREFIX}__content-container`}>
|
||||||
|
|||||||
@ -60,9 +60,7 @@ export default function PartnerBanner() {
|
|||||||
)}
|
)}
|
||||||
<div className={`${PREFIX}__close`} onClick={handlePartnerBannerClose} />
|
<div className={`${PREFIX}__close`} onClick={handlePartnerBannerClose} />
|
||||||
</div>
|
</div>
|
||||||
{visible && (
|
{visible && <LoginDialog onCancel={() => setVisible(false)} onSuccess={handleBind} needPhone={needPhone} />}
|
||||||
<LoginDialog disableCheck onCancel={() => setVisible(false)} onSuccess={handleBind} needPhone={needPhone} />
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,9 +39,7 @@ function JoinEntry({ onBindSuccess }: JoinEntryProps) {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{visible && (
|
{visible && <LoginDialog onCancel={() => setVisible(false)} onSuccess={onBindSuccess} needPhone={needPhone} />}
|
||||||
<LoginDialog disableCheck onCancel={() => setVisible(false)} onSuccess={onBindSuccess} needPhone={needPhone} />
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,7 +125,7 @@ function PartnerList(props: {
|
|||||||
hasMore={hasMore}
|
hasMore={hasMore}
|
||||||
onLoad={handleLoadMore}
|
onLoad={handleLoadMore}
|
||||||
loading={loadingMore || refreshing}
|
loading={loadingMore || refreshing}
|
||||||
disabled={loadMoreError || !visible}
|
disabled={loadMoreError}
|
||||||
fixedHeight={typeof listHeight !== 'undefined'}
|
fixedHeight={typeof listHeight !== 'undefined'}
|
||||||
style={listHeight ? { height: `${listHeight}px` } : undefined}
|
style={listHeight ? { height: `${listHeight}px` } : undefined}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -1,16 +1,14 @@
|
|||||||
import { Button, Image } from '@tarojs/components';
|
import { Button, Image } from '@tarojs/components';
|
||||||
import Taro, { useDidShow } from '@tarojs/taro';
|
|
||||||
|
|
||||||
import { Dialog } from '@taroify/core';
|
import { Dialog } from '@taroify/core';
|
||||||
import { Question } from '@taroify/icons';
|
import { Question } from '@taroify/icons';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useState, useEffect } from 'react';
|
||||||
|
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageUrl } from '@/constants/app';
|
||||||
import { PartnerProfitsState } from '@/types/partner';
|
import { PartnerProfitsState } from '@/types/partner';
|
||||||
import { formatMoney, getPartnerProfitStat, withdrawMoney } from '@/utils/partner';
|
import { formatMoney, getPartnerProfitStat } from '@/utils/partner';
|
||||||
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';
|
||||||
|
|
||||||
const PREFIX = 'partner-kanban';
|
const PREFIX = 'partner-kanban';
|
||||||
@ -33,48 +31,17 @@ function TipDialog(props: { open: boolean; onClose: () => void }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function WithdrawDialog(props: { open: boolean; onClose: () => void; count: number }) {
|
function WithdrawDialog(props: { open: boolean; onClose: () => void; count: number }) {
|
||||||
const handleWithdraw = useCallback(async () => {
|
const handleWithdraw = useCallback(() => {}, []);
|
||||||
if (Taro.canIUse('requestMerchantTransfer')) {
|
|
||||||
try {
|
|
||||||
const result = await withdrawMoney();
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-expect-error
|
|
||||||
wx.requestMerchantTransfer({
|
|
||||||
mchId: '1642470088',
|
|
||||||
appId: 'wxf0724a83f8e377d2',
|
|
||||||
package: result.packageInfo,
|
|
||||||
success: (res: never) => {
|
|
||||||
// res.err_msg将在页面展示成功后返回应用时返回ok,并不代表付款成功
|
|
||||||
console.log('success:', res);
|
|
||||||
Toast.success('提现成功');
|
|
||||||
props.onClose();
|
|
||||||
},
|
|
||||||
fail: (res: never) => {
|
|
||||||
Toast.error('提现失败');
|
|
||||||
console.log('fail:', res);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
Toast.error('提现订单创建失败');
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
await Taro.showModal({
|
|
||||||
content: '你的微信版本过低,请更新至最新版本。',
|
|
||||||
showCancel: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [props]);
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={props.open} onClose={props.onClose}>
|
<Dialog open={props.open} onClose={props.onClose}>
|
||||||
<Dialog.Content>
|
<Dialog.Content>
|
||||||
<div className={`${PREFIX}-withdraw-dialog__container`}>
|
<div className={`${PREFIX}-withdraw-dialog__container`}>
|
||||||
<div className={`${PREFIX}-withdraw-dialog__title`}>本次申请提现金额为</div>
|
<div className={`${PREFIX}-withdraw-dialog__title`}>本次申请提现金额为</div>
|
||||||
<div className={`${PREFIX}-withdraw-dialog__count`}>
|
<div className={`${PREFIX}-withdraw-dialog__count`}>
|
||||||
{+props.count}
|
{props.count}
|
||||||
<div className="yuan">元</div>
|
<div className="yuan">元</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}-withdraw-dialog__hint`}>单日提现最大200元</div>
|
<div className={`${PREFIX}-withdraw-dialog__hint`}>单笔最大500元</div>
|
||||||
<Button className={`${PREFIX}-withdraw-dialog__confirm-button`} onClick={handleWithdraw}>
|
<Button className={`${PREFIX}-withdraw-dialog__confirm-button`} onClick={handleWithdraw}>
|
||||||
提现
|
提现
|
||||||
</Button>
|
</Button>
|
||||||
@ -119,28 +86,20 @@ export default function PartnerKanban({ simple }: PartnerKanbanProps) {
|
|||||||
const handleTipClose = useCallback(() => {
|
const handleTipClose = useCallback(() => {
|
||||||
setTipOpen(false);
|
setTipOpen(false);
|
||||||
}, []);
|
}, []);
|
||||||
|
const handleViewWithdraw = useCallback(() => {
|
||||||
|
if (stats.availableBalance < 10 * 1000) {
|
||||||
|
Toast.info('提现金额需大于等于10元');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setWithdrawOpen(true);
|
||||||
|
}, []);
|
||||||
|
const handleWithdrawClose = useCallback(() => {
|
||||||
|
setWithdrawOpen(false);
|
||||||
|
}, []);
|
||||||
const getProfitStats = useCallback(async () => {
|
const getProfitStats = useCallback(async () => {
|
||||||
const data = await getPartnerProfitStat();
|
const data = await getPartnerProfitStat();
|
||||||
setStats(data);
|
setStats(data);
|
||||||
}, []);
|
}, []);
|
||||||
const handleViewWithdraw = useCallback(() => {
|
|
||||||
if (stats.availableBalance < 0) {
|
|
||||||
Toast.info('提现金额需大于等于0元');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// if (stats.availableBalance < 10 * 1000) {
|
|
||||||
// Toast.error('提现金额需大于等于10元');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
setWithdrawOpen(true);
|
|
||||||
}, [stats.availableBalance]);
|
|
||||||
const handleWithdrawClose = useCallback(() => {
|
|
||||||
setWithdrawOpen(false);
|
|
||||||
getProfitStats();
|
|
||||||
}, [getProfitStats]);
|
|
||||||
useDidShow(() => {
|
|
||||||
getProfitStats();
|
|
||||||
});
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getProfitStats();
|
getProfitStats();
|
||||||
}, []);
|
}, []);
|
||||||
@ -195,13 +154,7 @@ export default function PartnerKanban({ simple }: PartnerKanbanProps) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{!simple && <TipDialog open={tipOpen} onClose={handleTipClose} />}
|
{!simple && <TipDialog open={tipOpen} onClose={handleTipClose} />}
|
||||||
{!simple && (
|
{!simple && <WithdrawDialog count={350} open={withdrawOpen} onClose={handleWithdrawClose} />}
|
||||||
<WithdrawDialog
|
|
||||||
count={Math.min(Number(formatMoney(stats.availableBalance)), 200)}
|
|
||||||
open={withdrawOpen}
|
|
||||||
onClose={handleWithdrawClose}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,8 +96,7 @@ function ProfitList(props: IPartnerProfitListProps) {
|
|||||||
style={listHeight ? { height: `${listHeight}px` } : undefined}
|
style={listHeight ? { height: `${listHeight}px` } : undefined}
|
||||||
>
|
>
|
||||||
{dataList.map(item => {
|
{dataList.map(item => {
|
||||||
const isChat =
|
const isChat = type === ProfitType.CHAT_SHARE || item.earnType.toString().toLowerCase().indexOf('chat') > -1;
|
||||||
type === ProfitType.CHAT_SHARE || item.earnType.toString().toLowerCase().indexOf('chat') > -1;
|
|
||||||
return (
|
return (
|
||||||
<div className={`${PREFIX}__row`} key={item.id}>
|
<div className={`${PREFIX}__row`} key={item.id}>
|
||||||
<div className={`${PREFIX}__row-content`}>
|
<div className={`${PREFIX}__row-content`}>
|
||||||
|
|||||||
@ -78,12 +78,9 @@
|
|||||||
&:last-child {
|
&:last-child {
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
}
|
}
|
||||||
&.time {
|
&.time,
|
||||||
flex: 2;
|
|
||||||
}
|
|
||||||
&.project {
|
&.project {
|
||||||
width: 150px;
|
flex: 2;
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
}
|
||||||
&.status {
|
&.status {
|
||||||
width: 96px;
|
width: 96px;
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export interface IPhoneButtonProps extends ButtonProps {
|
|||||||
message?: string;
|
message?: string;
|
||||||
// 绑定后是否需要刷新接口获取手机号
|
// 绑定后是否需要刷新接口获取手机号
|
||||||
needPhone?: boolean;
|
needPhone?: boolean;
|
||||||
onBindPhone?: (status: BindPhoneStatus, e: ITouchEvent) => void;
|
onBindPhone?: (status: BindPhoneStatus) => void;
|
||||||
onSuccess?: (e: ITouchEvent) => void;
|
onSuccess?: (e: ITouchEvent) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,17 +44,17 @@ export default function PhoneButton(props: IPhoneButtonProps) {
|
|||||||
const encryptedData = e.detail.encryptedData;
|
const encryptedData = e.detail.encryptedData;
|
||||||
const iv = e.detail.iv;
|
const iv = e.detail.iv;
|
||||||
if (!encryptedData || !iv) {
|
if (!encryptedData || !iv) {
|
||||||
onBindPhone?.(BindPhoneStatus.Cancel, e as ITouchEvent);
|
onBindPhone?.(BindPhoneStatus.Cancel);
|
||||||
return Toast.error('取消授权');
|
return Toast.error('取消授权');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await setPhoneNumber({ encryptedData, iv });
|
await setPhoneNumber({ encryptedData, iv });
|
||||||
needPhone && (await requestUserInfo());
|
needPhone && (await requestUserInfo());
|
||||||
Toast.success(message);
|
Toast.success(message);
|
||||||
onBindPhone?.(BindPhoneStatus.Success, e as ITouchEvent);
|
onBindPhone?.(BindPhoneStatus.Success);
|
||||||
onSuccess?.(e as ITouchEvent);
|
onSuccess?.(e as ITouchEvent);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
onBindPhone?.(BindPhoneStatus.Error, e as ITouchEvent);
|
onBindPhone?.(BindPhoneStatus.Error);
|
||||||
Toast.error('绑定失败');
|
Toast.error('绑定失败');
|
||||||
log('bind phone fail', err);
|
log('bind phone fail', err);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,4 @@ export enum CacheKey {
|
|||||||
LAST_SELECT_MY_JOB = '__last_select_my_job__',
|
LAST_SELECT_MY_JOB = '__last_select_my_job__',
|
||||||
CLOSE_PARTNER_BANNER = '__close_partner_banner__',
|
CLOSE_PARTNER_BANNER = '__close_partner_banner__',
|
||||||
INVITE_CODE = '__invite_code__',
|
INVITE_CODE = '__invite_code__',
|
||||||
AGREEMENT_SIGNED = '__agreement_signed__',
|
|
||||||
CITY_CODES = '__city_codes__',
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5861,16 +5861,6 @@ export const CITY_INDEXES_LIST = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const GROUP_CITY_INDEXES_LIST = [
|
export const GROUP_CITY_INDEXES_LIST = [
|
||||||
{
|
|
||||||
letter: 'B',
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
cityCode: '110100',
|
|
||||||
cityName: '北京',
|
|
||||||
keyword: 'BEIJING北京',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
letter: 'C',
|
letter: 'C',
|
||||||
data: [
|
data: [
|
||||||
@ -5884,11 +5874,6 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
cityName: '成都',
|
cityName: '成都',
|
||||||
keyword: 'CHENGDOU成都',
|
keyword: 'CHENGDOU成都',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
cityCode: '430100',
|
|
||||||
cityName: '长沙',
|
|
||||||
keyword: 'CHANGSHA长沙',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -5929,11 +5914,6 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
{
|
{
|
||||||
letter: 'H',
|
letter: 'H',
|
||||||
data: [
|
data: [
|
||||||
{
|
|
||||||
cityCode: '330100',
|
|
||||||
cityName: '杭州',
|
|
||||||
keyword: 'HANGZHOU杭州',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
cityCode: '340100',
|
cityCode: '340100',
|
||||||
cityName: '合肥',
|
cityName: '合肥',
|
||||||
@ -5941,16 +5921,6 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
letter: 'K',
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
cityCode: '530100',
|
|
||||||
cityName: '昆明',
|
|
||||||
keyword: 'KUNMING昆明',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
letter: 'N',
|
letter: 'N',
|
||||||
data: [
|
data: [
|
||||||
@ -5969,11 +5939,6 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
cityName: '青岛',
|
cityName: '青岛',
|
||||||
keyword: 'QINGDAO青岛',
|
keyword: 'QINGDAO青岛',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
cityCode: '350500',
|
|
||||||
cityName: '泉州',
|
|
||||||
keyword: 'QUANZHOU泉州',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -5994,6 +5959,11 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
cityName: '苏州',
|
cityName: '苏州',
|
||||||
keyword: 'SUZHOU苏州',
|
keyword: 'SUZHOU苏州',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cityCode: '330300',
|
||||||
|
cityName: '温州',
|
||||||
|
keyword: 'WENZHOU温州',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -6009,11 +5979,6 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
{
|
{
|
||||||
letter: 'W',
|
letter: 'W',
|
||||||
data: [
|
data: [
|
||||||
{
|
|
||||||
cityCode: '330300',
|
|
||||||
cityName: '温州',
|
|
||||||
keyword: 'WENZHOU温州',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
cityCode: '420100',
|
cityCode: '420100',
|
||||||
cityName: '武汉',
|
cityName: '武汉',
|
||||||
@ -6029,11 +5994,6 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
cityName: '西安',
|
cityName: '西安',
|
||||||
keyword: 'XIAN西安',
|
keyword: 'XIAN西安',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
cityCode: '350200',
|
|
||||||
cityName: '厦门',
|
|
||||||
keyword: 'XIAMEN厦门',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -52,9 +52,3 @@ export const ProfitStatusDescriptions = {
|
|||||||
OTHER: '',
|
OTHER: '',
|
||||||
FINISHED: '已分账',
|
FINISHED: '已分账',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const WithdrawStatusDescriptions = {
|
|
||||||
0: '提现中',
|
|
||||||
1: '已提现',
|
|
||||||
2: '失败',
|
|
||||||
};
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ const getSalaryPrice = (fullSalary?: SalaryRange, partSalary?: SalaryRange) => {
|
|||||||
|
|
||||||
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));
|
||||||
const [employType, setEmployType] = useState(profile.employType);
|
const [employType, setEmployType] = useState(profile.employType);
|
||||||
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));
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
import { RoleType } from '@/constants/app';
|
|
||||||
import { selectRoleType } from '@/store/selector';
|
import { selectRoleType } from '@/store/selector';
|
||||||
|
|
||||||
function useRoleType() {
|
function useRoleType() {
|
||||||
return useSelector(selectRoleType) || RoleType.Anchor;
|
return useSelector(selectRoleType);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default useRoleType;
|
export default useRoleType;
|
||||||
|
|||||||
@ -78,10 +78,8 @@ export enum API {
|
|||||||
// partner
|
// partner
|
||||||
PARTNER_QRCODE = '/user/getInviteQrCode',
|
PARTNER_QRCODE = '/user/getInviteQrCode',
|
||||||
GET_INVITE_CODE = '/user/getUserInviteCode',
|
GET_INVITE_CODE = '/user/getUserInviteCode',
|
||||||
GET_INVITE_LIST = '/user/inviteUsers/list',
|
GET_INVITE_LIST = '/user/inviteUsers',
|
||||||
BECOME_PARTNER = '/user/becomePartner',
|
BECOME_PARTNER = '/user/becomePartner',
|
||||||
GET_PROFIT_LIST = '/user/profit/list',
|
GET_PROFIT_LIST = '/user/profit/list',
|
||||||
GET_PROFIT_STAT = '/user/profits',
|
GET_PROFIT_STAT = '/user/profits',
|
||||||
WITHDRAW = '/user/withdraw',
|
|
||||||
GET_WITHDRAW_LIST = '/user/withdraw/records',
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,8 +27,7 @@ import { logWithPrefix } from '@/utils/common';
|
|||||||
import { getLastSelectMyJobId, requestJobManageList, setLastSelectMyJobId } from '@/utils/job';
|
import { getLastSelectMyJobId, requestJobManageList, setLastSelectMyJobId } from '@/utils/job';
|
||||||
import { getWxLocation } from '@/utils/location';
|
import { getWxLocation } from '@/utils/location';
|
||||||
import { requestUnreadMessageCount } from '@/utils/message';
|
import { requestUnreadMessageCount } from '@/utils/message';
|
||||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
import { navigateTo } from '@/utils/route';
|
||||||
import { getPageQuery, navigateTo } from '@/utils/route';
|
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
@ -165,9 +164,6 @@ export default function AnchorPage() {
|
|||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
const query = getPageQuery();
|
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
||||||
if (!jobResults.length) {
|
if (!jobResults.length) {
|
||||||
@ -186,7 +182,7 @@ export default function AnchorPage() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return getCommonShareMessage(true, inviteCode, '数万名优质主播等你来挑');
|
return getCommonShareMessage(true, inviteCode);
|
||||||
});
|
});
|
||||||
|
|
||||||
useDidShow(() => requestUnreadMessageCount());
|
useDidShow(() => requestUnreadMessageCount());
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useLoad, useShareAppMessage } from '@tarojs/taro';
|
import { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
@ -8,10 +8,7 @@ import { GROUPS } from '@/constants/group';
|
|||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { getCurrentCityCode } from '@/utils/location';
|
import { getCurrentCityCode } from '@/utils/location';
|
||||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
|
||||||
import { getPageQuery } from '@/utils/route';
|
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import { checkCityCode } from '@/utils/user';
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'group-v2-page';
|
const PREFIX = 'group-v2-page';
|
||||||
@ -19,17 +16,9 @@ const PREFIX = 'group-v2-page';
|
|||||||
export default function GroupV2() {
|
export default function GroupV2() {
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
|
|
||||||
useLoad(() => {
|
|
||||||
const query = getPageQuery();
|
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
|
||||||
});
|
|
||||||
|
|
||||||
useShareAppMessage(() => getCommonShareMessage(true, inviteCode));
|
useShareAppMessage(() => getCommonShareMessage(true, inviteCode));
|
||||||
|
|
||||||
const handleSelectCity = useCallback(cityCode => {
|
const handleSelectCity = useCallback(cityCode => {
|
||||||
if (!checkCityCode(cityCode)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
||||||
if (group) {
|
if (group) {
|
||||||
openCustomerServiceChat(group.serviceUrl);
|
openCustomerServiceChat(group.serviceUrl);
|
||||||
|
|||||||
@ -28,7 +28,6 @@ import { getJobTitle, getJobSalary, postPublishJob, requestJobDetail } from '@/u
|
|||||||
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';
|
||||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
|
||||||
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
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';
|
||||||
@ -112,6 +111,7 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
const handleDialogHidden = useCallback(() => setDialogVisible(false), []);
|
const handleDialogHidden = useCallback(() => setDialogVisible(false), []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`${PREFIX}__footer`}>
|
<div className={`${PREFIX}__footer`}>
|
||||||
@ -218,8 +218,7 @@ export default function JobDetail() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
const query = getPageQuery<Pick<JobDetails, 'id'> & { c: string }>();
|
const query = getPageQuery<Pick<JobDetails, 'id'>>();
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
|
||||||
const jobId = query?.id;
|
const jobId = query?.id;
|
||||||
if (!jobId) {
|
if (!jobId) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { Tabs } from '@taroify/core';
|
|||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
|
import LocationDialog from '@/components/location-dialog';
|
||||||
import { LoginGuide } from '@/components/login-guide';
|
import { LoginGuide } from '@/components/login-guide';
|
||||||
import MaterialGuide from '@/components/material-guide';
|
import MaterialGuide from '@/components/material-guide';
|
||||||
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
||||||
@ -16,7 +17,6 @@ import { Coordinate } from '@/types/location';
|
|||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { getWxLocation, isNotNeedAuthorizeLocation, requestLocation } from '@/utils/location';
|
import { getWxLocation, isNotNeedAuthorizeLocation, requestLocation } from '@/utils/location';
|
||||||
import { requestUnreadMessageCount } from '@/utils/message';
|
import { requestUnreadMessageCount } from '@/utils/message';
|
||||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
|
||||||
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
@ -81,6 +81,13 @@ export default function Job() {
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleCloseAuthorize = useCallback(() => setShowAuthorize(false), []);
|
||||||
|
|
||||||
|
const handleClickAuthorize = useCallback(() => {
|
||||||
|
requestLocation(true);
|
||||||
|
setShowAuthorize(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
|
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
|
||||||
return () => {
|
return () => {
|
||||||
@ -101,14 +108,12 @@ export default function Job() {
|
|||||||
if (type === SortType.CREATE_TIME) {
|
if (type === SortType.CREATE_TIME) {
|
||||||
setSortType(type);
|
setSortType(type);
|
||||||
}
|
}
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
|
||||||
if (await isNotNeedAuthorizeLocation()) {
|
if (await isNotNeedAuthorizeLocation()) {
|
||||||
log('not need authorize location');
|
log('not need authorize location');
|
||||||
requestLocation();
|
requestLocation();
|
||||||
} else {
|
} else {
|
||||||
log('show authorize location dialog');
|
log('show authorize location dialog');
|
||||||
setShowAuthorize(true);
|
setShowAuthorize(true);
|
||||||
requestLocation(true);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -147,6 +152,7 @@ export default function Job() {
|
|||||||
))}
|
))}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
<div>
|
<div>
|
||||||
|
<LocationDialog open={showAuthorize} onClose={handleCloseAuthorize} onClick={handleClickAuthorize} />
|
||||||
<LoginGuide disabled={showAuthorize} onAfterBind={handleAfterBindPhone} />
|
<LoginGuide disabled={showAuthorize} onAfterBind={handleAfterBindPhone} />
|
||||||
{showMaterialGuide && <MaterialGuide onClose={() => setShowMaterialGuide(false)} />}
|
{showMaterialGuide && <MaterialGuide onClose={() => setShowMaterialGuide(false)} />}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -21,7 +21,6 @@ import { collectEvent } from '@/utils/event';
|
|||||||
import { requestHasPublishedJob, requestJobDetail } from '@/utils/job';
|
import { requestHasPublishedJob, requestJobDetail } from '@/utils/job';
|
||||||
import { getMaterialShareMessage, requestReadProfile, requestShareProfile } from '@/utils/material';
|
import { getMaterialShareMessage, requestReadProfile, requestShareProfile } from '@/utils/material';
|
||||||
import { isChatWithSelf, postCreateChat } from '@/utils/message';
|
import { isChatWithSelf, postCreateChat } from '@/utils/message';
|
||||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
|
||||||
import { getPageQuery, navigateBack, navigateTo, redirectTo } from '@/utils/route';
|
import { getPageQuery, navigateBack, navigateTo, redirectTo } from '@/utils/route';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
@ -142,7 +141,6 @@ export default function MaterialViewPage() {
|
|||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
const context = getPageQuery<IViewContext | IShareContext>();
|
const context = getPageQuery<IViewContext | IShareContext>();
|
||||||
getInviteCodeFromQueryAndUpdate(context as BL.Anything);
|
|
||||||
try {
|
try {
|
||||||
const profileDetail = await requestProfile(context);
|
const profileDetail = await requestProfile(context);
|
||||||
setProfile(profileDetail);
|
setProfile(profileDetail);
|
||||||
|
|||||||
@ -95,7 +95,6 @@ export default function MessageChat() {
|
|||||||
const [messages, setMessages] = useState<IChatMessage[]>([]);
|
const [messages, setMessages] = useState<IChatMessage[]>([]);
|
||||||
const [messageStatusList, setMessageStatusList] = useState<IMessageStatus[]>([]);
|
const [messageStatusList, setMessageStatusList] = useState<IMessageStatus[]>([]);
|
||||||
const [jobId, setJobId] = useState<string>();
|
const [jobId, setJobId] = useState<string>();
|
||||||
const [resumeId, setResumeId] = useState<string>();
|
|
||||||
const [job, setJob] = useState<IJobMessage>();
|
const [job, setJob] = useState<IJobMessage>();
|
||||||
const [material, setMaterial] = useState<IMaterialMessage>();
|
const [material, setMaterial] = useState<IMaterialMessage>();
|
||||||
const [scrollItemId, setScrollItemId] = useState<string>();
|
const [scrollItemId, setScrollItemId] = useState<string>();
|
||||||
@ -299,7 +298,6 @@ export default function MessageChat() {
|
|||||||
const parseMaterial = query.material ? parseQuery<IMaterialMessage>(query.material) : null;
|
const parseMaterial = query.material ? parseQuery<IMaterialMessage>(query.material) : null;
|
||||||
// log('requestChatDetail', chatDetail, parseJob, parseMaterial);
|
// log('requestChatDetail', chatDetail, parseJob, parseMaterial);
|
||||||
setChat(chatDetail);
|
setChat(chatDetail);
|
||||||
setResumeId(chatDetail.participants.find(u => u.userId !== currentUserId)?.resumeId);
|
|
||||||
setJobId(query.jobId);
|
setJobId(query.jobId);
|
||||||
setMessages(chatDetail.messages);
|
setMessages(chatDetail.messages);
|
||||||
setScrollItemId(getScrollItemId(last(chatDetail.messages)?.msgId));
|
setScrollItemId(getScrollItemId(last(chatDetail.messages)?.msgId));
|
||||||
@ -355,7 +353,6 @@ export default function MessageChat() {
|
|||||||
id={message.msgId}
|
id={message.msgId}
|
||||||
key={message.msgId}
|
key={message.msgId}
|
||||||
message={message}
|
message={message}
|
||||||
resumeId={resumeId}
|
|
||||||
isRead={messageStatusList.some(m => m.msgId === message.msgId && !!m.isRead)}
|
isRead={messageStatusList.some(m => m.msgId === message.msgId && !!m.isRead)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,23 +1,20 @@
|
|||||||
import { useShareAppMessage } from '@tarojs/taro';
|
import { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { Tabs } from '@taroify/core';
|
import { Tabs } from '@taroify/core';
|
||||||
import { useState } from 'react';
|
|
||||||
|
|
||||||
import PartnerIntro from '@/components/partner-intro';
|
import PartnerIntro from '@/components/partner-intro';
|
||||||
import PartnerInviteList from '@/components/partner-invite-list';
|
import PartnerInviteList from '@/components/partner-invite-list';
|
||||||
import PartnerProfit from '@/components/partner-profit';
|
import PartnerProfit from '@/components/partner-profit';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'partner';
|
const PREFIX = 'partner';
|
||||||
|
|
||||||
export default function Partner() {
|
export default function Partner() {
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
const [tab, setTab] = useState<number>(0);
|
|
||||||
const handleChange = v => {
|
|
||||||
setTab(v);
|
|
||||||
};
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
console.log('Partner inviteCode', inviteCode);
|
console.log('Partner inviteCode', inviteCode);
|
||||||
return getCommonShareMessage(false, inviteCode);
|
return getCommonShareMessage(false, inviteCode);
|
||||||
@ -25,12 +22,12 @@ export default function Partner() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<Tabs className={`${PREFIX}__tabs`} value={tab} onChange={handleChange}>
|
<Tabs className={`${PREFIX}__tabs`}>
|
||||||
<Tabs.TabPane value={0} title="简介">
|
<Tabs.TabPane value={0} title="简介">
|
||||||
<PartnerIntro />
|
<PartnerIntro />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane value={1} title="邀请名单">
|
<Tabs.TabPane value={1} title="邀请名单">
|
||||||
<PartnerInviteList refreshDisabled={tab !== 1} visible={tab === 1} />
|
<PartnerInviteList />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane value={2} title="我的收益">
|
<Tabs.TabPane value={2} title="我的收益">
|
||||||
<PartnerProfit />
|
<PartnerProfit />
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
import { Image } from '@tarojs/components';
|
import { Image } from '@tarojs/components';
|
||||||
|
|
||||||
import { useLoad } from '@tarojs/taro';
|
import { useLoad } from '@tarojs/taro';
|
||||||
|
|
||||||
import { useState } from 'react';
|
|
||||||
|
|
||||||
import { AgreementPopup } from '@/components/agreement-popup';
|
|
||||||
import Slogan from '@/components/slogan';
|
import Slogan from '@/components/slogan';
|
||||||
import { PageUrl, RoleType } from '@/constants/app';
|
import { PageUrl, RoleType } from '@/constants/app';
|
||||||
import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST } from '@/hooks/use-config';
|
import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST } from '@/hooks/use-config';
|
||||||
@ -11,13 +8,12 @@ import store from '@/store';
|
|||||||
import { changeHomePage } from '@/store/actions';
|
import { changeHomePage } from '@/store/actions';
|
||||||
import { getRoleType, switchDefaultTab, switchRoleType } from '@/utils/app';
|
import { getRoleType, switchDefaultTab, switchRoleType } from '@/utils/app';
|
||||||
import { switchTab } from '@/utils/route';
|
import { switchTab } from '@/utils/route';
|
||||||
import { getAgreementSigned, setAgreementSigned } from '@/utils/user';
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'page-start';
|
const PREFIX = 'page-start';
|
||||||
|
|
||||||
export default function Start() {
|
export default function Start() {
|
||||||
const [open, setOpen] = useState(typeof getAgreementSigned() !== 'boolean');
|
|
||||||
const mode = getRoleType();
|
const mode = getRoleType();
|
||||||
useLoad(() => {
|
useLoad(() => {
|
||||||
switchDefaultTab();
|
switchDefaultTab();
|
||||||
@ -34,15 +30,6 @@ export default function Start() {
|
|||||||
await switchTab(COMPANY_TAB_LIST[0].pagePath as PageUrl);
|
await switchTab(COMPANY_TAB_LIST[0].pagePath as PageUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCancel = () => {
|
|
||||||
setOpen(false);
|
|
||||||
setAgreementSigned(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleConfirm = () => {
|
|
||||||
setOpen(false);
|
|
||||||
setAgreementSigned(true);
|
|
||||||
};
|
|
||||||
return (
|
return (
|
||||||
<div className={`${PREFIX} ${mode ? '' : 'color-bg'}`}>
|
<div className={`${PREFIX} ${mode ? '' : 'color-bg'}`}>
|
||||||
{mode && (
|
{mode && (
|
||||||
@ -82,7 +69,6 @@ export default function Start() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Slogan />
|
<Slogan />
|
||||||
<AgreementPopup open={open} onCancel={handleCancel} onConfirm={handleConfirm} />
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import useInviteCode from '@/hooks/use-invite-code';
|
|||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { getCurrentCityCode } from '@/utils/location';
|
import { getCurrentCityCode } from '@/utils/location';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import { checkCityCode } from '@/utils/user';
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'page-biz-service';
|
const PREFIX = 'page-biz-service';
|
||||||
@ -23,9 +22,6 @@ export default function BizService() {
|
|||||||
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d');
|
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d');
|
||||||
}, []);
|
}, []);
|
||||||
const handleSelectCity = useCallback(cityCode => {
|
const handleSelectCity = useCallback(cityCode => {
|
||||||
if (!checkCityCode(cityCode)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
||||||
if (group) {
|
if (group) {
|
||||||
openCustomerServiceChat(group.serviceUrl);
|
openCustomerServiceChat(group.serviceUrl);
|
||||||
|
|||||||
@ -2,52 +2,4 @@
|
|||||||
@import '@/styles/variables.less';
|
@import '@/styles/variables.less';
|
||||||
|
|
||||||
.withdraw-record {
|
.withdraw-record {
|
||||||
&__item {
|
|
||||||
height: 131px;
|
|
||||||
width: 100%;
|
|
||||||
background: #fff;
|
|
||||||
padding: 24px 32px 0 32px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
font-size: 28px;
|
|
||||||
|
|
||||||
&-border {
|
|
||||||
border-bottom: 1px solid #e6e7e8;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-content {
|
|
||||||
.flex-row();
|
|
||||||
width: 100%;
|
|
||||||
padding-bottom: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-time {
|
|
||||||
padding-right: 8px;
|
|
||||||
line-height: 40px;
|
|
||||||
flex: 1;
|
|
||||||
.noWrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
&-withdraw {
|
|
||||||
width: 200px;
|
|
||||||
text-align: right;
|
|
||||||
padding-left: 8px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-money {
|
|
||||||
line-height: 40px;
|
|
||||||
padding-bottom: 8px;
|
|
||||||
.noWrap();
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 30px;
|
|
||||||
color: #ff5051;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-status {
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 36px;
|
|
||||||
color: #999999;
|
|
||||||
.noWrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,119 +1,14 @@
|
|||||||
import { useShareAppMessage } from '@tarojs/taro';
|
import { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { List, PullRefresh } from '@taroify/core';
|
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
||||||
|
|
||||||
import ListPlaceholder from '@/components/list-placeholder';
|
|
||||||
import { WithdrawStatusDescriptions } from '@/constants/partner';
|
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
|
||||||
import { WithdrawRecord } from '@/types/partner';
|
|
||||||
import { logWithPrefix } from '@/utils/common';
|
|
||||||
import { formatMoney, formatTimestamp, getWithdrawList as requestData } from '@/utils/partner';
|
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'withdraw-record';
|
const PREFIX = 'withdraw-record';
|
||||||
const log = logWithPrefix(PREFIX);
|
|
||||||
const FIRST_PAGE = 0;
|
|
||||||
|
|
||||||
export default function WithdrawRecords() {
|
export default function WithdrawRecord() {
|
||||||
const inviteCode = useInviteCode();
|
|
||||||
const [hasMore, setHasMore] = useState(true);
|
|
||||||
const [refreshing, setRefreshing] = useState(false);
|
|
||||||
const [loadingMore, setLoadingMore] = useState(false);
|
|
||||||
const [loadMoreError, setLoadMoreError] = useState(false);
|
|
||||||
const [dataList, setDataList] = useState<WithdrawRecord[]>([]);
|
|
||||||
const currentPage = useRef<number>(FIRST_PAGE);
|
|
||||||
|
|
||||||
const handleRefresh = useCallback(async () => {
|
|
||||||
log('start pull refresh');
|
|
||||||
try {
|
|
||||||
setRefreshing(true);
|
|
||||||
setLoadMoreError(false);
|
|
||||||
const { content, totalPages } = await requestData({ page: 1 });
|
|
||||||
setDataList(content);
|
|
||||||
currentPage.current = 1;
|
|
||||||
setHasMore(currentPage.current < totalPages);
|
|
||||||
log('pull refresh success');
|
|
||||||
} catch (e) {
|
|
||||||
setDataList([]);
|
|
||||||
setHasMore(false);
|
|
||||||
setLoadMoreError(true);
|
|
||||||
currentPage.current = FIRST_PAGE;
|
|
||||||
log('pull refresh failed');
|
|
||||||
} finally {
|
|
||||||
setRefreshing(false);
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleLoadMore = useCallback(async () => {
|
|
||||||
log('start load more', hasMore);
|
|
||||||
if (!hasMore) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setLoadMoreError(false);
|
|
||||||
setLoadingMore(true);
|
|
||||||
try {
|
|
||||||
const { totalPages, content } = await requestData({ page: currentPage.current + 1 });
|
|
||||||
setDataList([...dataList, ...content]);
|
|
||||||
currentPage.current = currentPage.current + 1;
|
|
||||||
setHasMore(currentPage.current < totalPages);
|
|
||||||
log('load more success');
|
|
||||||
} catch (e) {
|
|
||||||
setLoadMoreError(true);
|
|
||||||
log('load more failed');
|
|
||||||
} finally {
|
|
||||||
setLoadingMore(false);
|
|
||||||
}
|
|
||||||
}, [dataList, hasMore]);
|
|
||||||
// 初始化数据&配置变更后刷新数据
|
|
||||||
useEffect(() => {
|
|
||||||
const refresh = async () => {
|
|
||||||
log('visible changed, start refresh list data');
|
|
||||||
try {
|
|
||||||
setDataList([]);
|
|
||||||
setLoadingMore(true);
|
|
||||||
setLoadMoreError(false);
|
|
||||||
const { totalPages, content } = await requestData({ page: 1 });
|
|
||||||
setDataList(content);
|
|
||||||
currentPage.current = 1;
|
|
||||||
setHasMore(currentPage.current < totalPages);
|
|
||||||
} catch (e) {
|
|
||||||
setDataList([]);
|
|
||||||
setHasMore(false);
|
|
||||||
setLoadMoreError(true);
|
|
||||||
} finally {
|
|
||||||
log('visible changed, refresh list data end');
|
|
||||||
setLoadingMore(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
refresh();
|
|
||||||
}, []);
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return getCommonShareMessage(false, inviteCode);
|
return getCommonShareMessage(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return <div className={PREFIX}></div>;
|
||||||
<div className={PREFIX}>
|
|
||||||
<PullRefresh className={`${PREFIX}__pull-refresh`} loading={refreshing} onRefresh={handleRefresh}>
|
|
||||||
<List hasMore={hasMore} onLoad={handleLoadMore} loading={loadingMore || refreshing} disabled={loadMoreError}>
|
|
||||||
{dataList.map(item => (
|
|
||||||
<div className={`${PREFIX}__item`} key={item.id || item.userId}>
|
|
||||||
<div className={`${PREFIX}__item-border`}>
|
|
||||||
<div className={`${PREFIX}__item-content`}>
|
|
||||||
<div className={`${PREFIX}__item-time`}>{formatTimestamp(item.created)}</div>
|
|
||||||
<div className={`${PREFIX}__item-withdraw`}>
|
|
||||||
<div className={`${PREFIX}__item-money`}>{formatMoney(item.amt)}</div>
|
|
||||||
<div className={`${PREFIX}__item-status`}>{WithdrawStatusDescriptions[item.status]}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
<ListPlaceholder hasMore={false} loadingMore={loadingMore} loadMoreError={loadMoreError} />
|
|
||||||
</List>
|
|
||||||
</PullRefresh>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,9 +43,7 @@ export interface ILocationMessage {
|
|||||||
longitude: number;
|
longitude: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IChatUser extends Pick<UserInfo, 'userId' | 'nickName'> {
|
export interface IChatUser extends Pick<UserInfo, 'userId' | 'nickName'> {}
|
||||||
resumeId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IChatMessage {
|
export interface IChatMessage {
|
||||||
msgId: string;
|
msgId: string;
|
||||||
|
|||||||
@ -64,26 +64,3 @@ export interface PartnerProfitItem {
|
|||||||
expectedSettlementDate: string;
|
expectedSettlementDate: string;
|
||||||
actualSettlementDate: string;
|
actualSettlementDate: string;
|
||||||
}
|
}
|
||||||
export interface WithdrawResponse {
|
|
||||||
outBillNo: string;
|
|
||||||
transferBillNo: string;
|
|
||||||
createTime: string;
|
|
||||||
state: string;
|
|
||||||
packageInfo: string;
|
|
||||||
}
|
|
||||||
export interface WithdrawRecord {
|
|
||||||
id: number;
|
|
||||||
userId: string;
|
|
||||||
orderNo: string;
|
|
||||||
outTradeId: string;
|
|
||||||
amt: number;
|
|
||||||
status: number;
|
|
||||||
remark: string;
|
|
||||||
created: string;
|
|
||||||
updated: string;
|
|
||||||
finishedTime: string;
|
|
||||||
}
|
|
||||||
export interface PartnerPagination<T> {
|
|
||||||
content: T[];
|
|
||||||
totalPages: number;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -41,8 +41,6 @@ export const switchRoleType = async (appMode?: RoleType) => {
|
|||||||
const curMode = getRoleType();
|
const curMode = getRoleType();
|
||||||
appMode = curMode === RoleType.Anchor ? RoleType.Company : RoleType.Anchor;
|
appMode = curMode === RoleType.Anchor ? RoleType.Company : RoleType.Anchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('switchRoleType', appMode);
|
|
||||||
try {
|
try {
|
||||||
await postSwitchRoleType(appMode);
|
await postSwitchRoleType(appMode);
|
||||||
store.dispatch(changeRoleType(appMode));
|
store.dispatch(changeRoleType(appMode));
|
||||||
|
|||||||
@ -10,11 +10,8 @@ import {
|
|||||||
GetProfitRequest,
|
GetProfitRequest,
|
||||||
InviteUserInfo,
|
InviteUserInfo,
|
||||||
PartnerInviteCode,
|
PartnerInviteCode,
|
||||||
PartnerPagination,
|
|
||||||
PartnerProfitItem,
|
PartnerProfitItem,
|
||||||
PartnerProfitsState,
|
PartnerProfitsState,
|
||||||
WithdrawRecord,
|
|
||||||
WithdrawResponse,
|
|
||||||
} from '@/types/partner';
|
} from '@/types/partner';
|
||||||
import { requestUserInfo } from '@/utils/user';
|
import { requestUserInfo } from '@/utils/user';
|
||||||
|
|
||||||
@ -56,7 +53,7 @@ export const getPartnerProfitStat = async () => {
|
|||||||
return await http.post<PartnerProfitsState>(API.GET_PROFIT_STAT);
|
return await http.post<PartnerProfitsState>(API.GET_PROFIT_STAT);
|
||||||
};
|
};
|
||||||
export const getPartnerInviteList = async (data: IPaginationRequest) => {
|
export const getPartnerInviteList = async (data: IPaginationRequest) => {
|
||||||
return await http.post<PartnerPagination<InviteUserInfo>>(API.GET_INVITE_LIST, {
|
return await http.post<{ content: InviteUserInfo[]; totalPages: number }>(API.GET_INVITE_LIST, {
|
||||||
data,
|
data,
|
||||||
contentType: 'application/x-www-form-urlencoded',
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
});
|
});
|
||||||
@ -116,14 +113,3 @@ export function formatUserId(input: string): string {
|
|||||||
// 拼接结果
|
// 拼接结果
|
||||||
return beforeMask + maskedPart + afterMask;
|
return beforeMask + maskedPart + afterMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function withdrawMoney() {
|
|
||||||
return await http.post<WithdrawResponse>(API.WITHDRAW);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getWithdrawList(data: IPaginationRequest) {
|
|
||||||
return await http.post<PartnerPagination<WithdrawRecord>>(API.GET_WITHDRAW_LIST, {
|
|
||||||
data,
|
|
||||||
contentType: 'application/x-www-form-urlencoded',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
@ -15,14 +15,10 @@ const getRandomCount = () => {
|
|||||||
return (seed % 300) + 500;
|
return (seed % 300) + 500;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCommonShareMessage = (
|
export const getCommonShareMessage = (useCapture: boolean = true, inviteCode?: string): ShareAppMessageReturn => {
|
||||||
useCapture: boolean = true,
|
|
||||||
inviteCode?: string,
|
|
||||||
title?: string
|
|
||||||
): ShareAppMessageReturn => {
|
|
||||||
console.log('share share message', getJumpUrl(PageUrl.Job, inviteCode ? { c: inviteCode } : undefined));
|
console.log('share share message', getJumpUrl(PageUrl.Job, inviteCode ? { c: inviteCode } : undefined));
|
||||||
return {
|
return {
|
||||||
title: title || `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
|
title: `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
|
||||||
path: getJumpUrl(PageUrl.Job, inviteCode ? { c: inviteCode } : undefined),
|
path: getJumpUrl(PageUrl.Job, inviteCode ? { c: inviteCode } : undefined),
|
||||||
imageUrl: useCapture ? undefined : imageUrl,
|
imageUrl: useCapture ? undefined : imageUrl,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -148,23 +148,3 @@ export async function followGroup(blGroupId: FollowGroupRequest['blGroupId']) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getAgreementSigned = (): boolean | '' => Taro.getStorageSync(CacheKey.AGREEMENT_SIGNED);
|
|
||||||
export const setAgreementSigned = (signed: boolean) => Taro.setStorageSync(CacheKey.AGREEMENT_SIGNED, signed);
|
|
||||||
export const getCityCodes = (): string[] => {
|
|
||||||
const cachedValue = Taro.getStorageSync(CacheKey.CITY_CODES);
|
|
||||||
return !cachedValue || !Array.isArray(cachedValue) ? [] : cachedValue;
|
|
||||||
};
|
|
||||||
export const setCityCodes = (cityCode: string[]) => Taro.setStorageSync(CacheKey.CITY_CODES, cityCode);
|
|
||||||
export const checkCityCode = (cityCode: string): boolean => {
|
|
||||||
const cachedCityCodes = getCityCodes();
|
|
||||||
const isNewCityCode = cachedCityCodes.indexOf(cityCode) === -1;
|
|
||||||
if (cachedCityCodes.length === 2 && isNewCityCode) {
|
|
||||||
Toast.info('最多只能进入2个城市');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (isNewCityCode) {
|
|
||||||
setCityCodes([...cachedCityCodes, cityCode]);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user