feat: update of partner
This commit is contained in:
@ -10,12 +10,14 @@ import MaterialGuide from '@/components/material-guide';
|
||||
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
||||
import { EmployType, JOB_PAGE_TABS, SortType } from '@/constants/job';
|
||||
import JobFragment from '@/fragments/job/base';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import useLocation from '@/hooks/use-location';
|
||||
import useNavigation from '@/hooks/use-navigation';
|
||||
import { Coordinate } from '@/types/location';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
import { getWxLocation, isNotNeedAuthorizeLocation, requestLocation } from '@/utils/location';
|
||||
import { requestUnreadMessageCount } from '@/utils/message';
|
||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
||||
import { getCommonShareMessage } from '@/utils/share';
|
||||
import Toast from '@/utils/toast';
|
||||
@ -29,6 +31,7 @@ const log = logWithPrefix(PREFIX);
|
||||
export default function Job() {
|
||||
const location = useLocation();
|
||||
const { barHeight, statusBarHeight } = useNavigation();
|
||||
const inviteCode = useInviteCode();
|
||||
const [tabType, setTabType] = useState<EmployType>(EmployType.All);
|
||||
const [sortType, setSortType] = useState<SortType>(SortType.RECOMMEND);
|
||||
const [cityCode, setCityCode] = useState<string>(location.cityCode);
|
||||
@ -101,11 +104,12 @@ export default function Job() {
|
||||
}, [location]);
|
||||
|
||||
useLoad(async () => {
|
||||
const query = getPageQuery<{ sortType: SortType }>();
|
||||
const query = getPageQuery<{ sortType: SortType; c?: string; scene?: string }>();
|
||||
const type = query.sortType;
|
||||
if (type === SortType.CREATE_TIME) {
|
||||
setSortType(type);
|
||||
}
|
||||
getInviteCodeFromQueryAndUpdate(query);
|
||||
if (await isNotNeedAuthorizeLocation()) {
|
||||
log('not need authorize location');
|
||||
requestLocation();
|
||||
@ -121,10 +125,10 @@ export default function Job() {
|
||||
if (sortType === SortType.CREATE_TIME) {
|
||||
return {
|
||||
title: '这里有今日全城新增通告,快来看看',
|
||||
path: getJumpUrl(PageUrl.Job, { sortType }),
|
||||
path: getJumpUrl(PageUrl.Job, { sortType, c: inviteCode }),
|
||||
};
|
||||
}
|
||||
return getCommonShareMessage();
|
||||
return getCommonShareMessage(true, inviteCode);
|
||||
});
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user