feat: update of partner

This commit is contained in:
eleanor.mao
2025-05-15 01:02:00 +08:00
parent 7aafc3a789
commit d2ac64f20c
52 changed files with 1435 additions and 265 deletions

View File

@ -10,6 +10,7 @@ import { EventName, OpenSource, PageUrl } from '@/constants/app';
import { CollectEventName } from '@/constants/event';
import { MaterialViewSource } from '@/constants/material';
import ProfileViewFragment from '@/fragments/profile/view';
import useInviteCode from '@/hooks/use-invite-code';
import { RESPONSE_ERROR_CODE } from '@/http/constant';
import { HttpError } from '@/http/error';
import { JobManageInfo } from '@/types/job';
@ -20,9 +21,9 @@ import { collectEvent } from '@/utils/event';
import { requestHasPublishedJob, requestJobDetail } from '@/utils/job';
import { getMaterialShareMessage, requestReadProfile, requestShareProfile } from '@/utils/material';
import { isChatWithSelf, postCreateChat } from '@/utils/message';
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
import { getPageQuery, navigateBack, navigateTo, redirectTo } from '@/utils/route';
import Toast from '@/utils/toast';
import './index.less';
const PREFIX = 'page-material-view';
@ -37,6 +38,7 @@ interface IShareContext {
resumeId: string;
source: MaterialViewSource.Share;
shareCode: string;
c?: string;
}
const isShareContext = (context: IViewContext | IShareContext): context is IShareContext => {
@ -68,6 +70,7 @@ export default function MaterialViewPage() {
const [noTimeDialogVisible, setNoTimeDialogVisible] = useState(false);
const [noVipLimitVisible, setNoVipLimitVisible] = useState(false);
const [vipExpiredVisible, setVipExpiredVisible] = useState(false);
const inviteCode = useInviteCode();
const onDev = useCallback(async () => profile && copy(profile.userId), [profile]);
@ -139,6 +142,7 @@ export default function MaterialViewPage() {
useLoad(async () => {
const context = getPageQuery<IViewContext | IShareContext>();
getInviteCodeFromQueryAndUpdate(context as BL.Anything);
try {
const profileDetail = await requestProfile(context);
setProfile(profileDetail);
@ -172,7 +176,7 @@ export default function MaterialViewPage() {
});
useShareAppMessage(async () => {
const shareMessage = await getMaterialShareMessage(profile);
const shareMessage = await getMaterialShareMessage(profile, true, inviteCode);
return shareMessage as BL.Anything;
});