feat: update of partner
This commit is contained in:
@ -57,7 +57,9 @@
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
&__banner {
|
||||
padding: 0 24px;
|
||||
}
|
||||
&__overlay-outer {
|
||||
top: 82px;
|
||||
}
|
||||
@ -79,7 +81,7 @@
|
||||
&__empty-box {
|
||||
width: 386px;
|
||||
height: 278px;
|
||||
}
|
||||
}
|
||||
|
||||
&__tips-title {
|
||||
font-size: 28px;
|
||||
@ -88,4 +90,4 @@
|
||||
color: @blColor;
|
||||
margin-top: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Image } from '@tarojs/components';
|
||||
import Taro, { NodesRef, useDidShow, useLoad } from '@tarojs/taro';
|
||||
import Taro, { NodesRef, useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||
|
||||
import { ArrowUp, ArrowDown } from '@taroify/icons';
|
||||
import classNames from 'classnames';
|
||||
@ -12,10 +12,12 @@ import CustomNavigationBar from '@/components/custom-navigation-bar';
|
||||
import HomePage from '@/components/home-page';
|
||||
import Overlay from '@/components/overlay';
|
||||
import PageLoading from '@/components/page-loading';
|
||||
import PartnerBanner from '@/components/partner-banner';
|
||||
import SwitchBar from '@/components/switch-bar';
|
||||
import { APP_TAB_BAR_ID, EventName, OpenSource, PageUrl } from '@/constants/app';
|
||||
import { EmployType, JobManageStatus } from '@/constants/job';
|
||||
import { ALL_ANCHOR_SORT_TYPES, ANCHOR_SORT_TYPE_TITLE_MAP, AnchorSortType } from '@/constants/material';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||
import useLocation from '@/hooks/use-location';
|
||||
import { JobManageInfo } from '@/types/job';
|
||||
@ -25,9 +27,10 @@ import { logWithPrefix } from '@/utils/common';
|
||||
import { getLastSelectMyJobId, requestJobManageList, setLastSelectMyJobId } from '@/utils/job';
|
||||
import { getWxLocation } from '@/utils/location';
|
||||
import { requestUnreadMessageCount } from '@/utils/message';
|
||||
import { navigateTo } from '@/utils/route';
|
||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||
import { getPageQuery, navigateTo } from '@/utils/route';
|
||||
import { getCommonShareMessage } from '@/utils/share';
|
||||
import Toast from '@/utils/toast';
|
||||
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'page-anchor';
|
||||
@ -82,6 +85,7 @@ export default function AnchorPage() {
|
||||
latitude: location.latitude,
|
||||
longitude: location.longitude,
|
||||
});
|
||||
const inviteCode = useInviteCode();
|
||||
log('jobId', selectJob);
|
||||
|
||||
const handleChangeSelectJob = useCallback((select?: JobManageInfo) => {
|
||||
@ -161,6 +165,9 @@ export default function AnchorPage() {
|
||||
}, [location]);
|
||||
|
||||
useLoad(async () => {
|
||||
const query = getPageQuery();
|
||||
getInviteCodeFromQueryAndUpdate(query);
|
||||
|
||||
try {
|
||||
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
||||
if (!jobResults.length) {
|
||||
@ -178,6 +185,10 @@ export default function AnchorPage() {
|
||||
}
|
||||
});
|
||||
|
||||
useShareAppMessage(() => {
|
||||
return getCommonShareMessage(true, inviteCode);
|
||||
});
|
||||
|
||||
useDidShow(() => requestUnreadMessageCount());
|
||||
|
||||
return (
|
||||
@ -204,6 +215,9 @@ export default function AnchorPage() {
|
||||
{showFilter ? <ArrowUp /> : <ArrowDown />}
|
||||
</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__banner`}>
|
||||
<PartnerBanner />
|
||||
</div>
|
||||
<ListWrapper
|
||||
filters={filters}
|
||||
ready={!loading}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Image } from '@tarojs/components';
|
||||
import { NodesRef, useShareAppMessage } from '@tarojs/taro';
|
||||
import { NodesRef, useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||
|
||||
import { List } from '@taroify/core';
|
||||
import { useCallback } from 'react';
|
||||
@ -7,8 +7,11 @@ import { useCallback } from 'react';
|
||||
import HomePage from '@/components/home-page';
|
||||
import LoginButton from '@/components/login-button';
|
||||
import { APP_TAB_BAR_ID } from '@/constants/app';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||
import { openCustomerServiceChat } from '@/utils/common';
|
||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||
import { getPageQuery } from '@/utils/route';
|
||||
import { getCommonShareMessage } from '@/utils/share';
|
||||
|
||||
import './index.less';
|
||||
@ -56,10 +59,16 @@ const GROUPS: GroupItem[] = [
|
||||
|
||||
export default function GroupV2() {
|
||||
const listHeight = useListHeight(CALC_LIST_PROPS);
|
||||
const inviteCode = useInviteCode();
|
||||
|
||||
const handleClick = useCallback((group: GroupItem) => openCustomerServiceChat(group.serviceUrl), []);
|
||||
|
||||
useShareAppMessage(() => getCommonShareMessage());
|
||||
useLoad(() => {
|
||||
const query = getPageQuery();
|
||||
getInviteCodeFromQueryAndUpdate(query);
|
||||
});
|
||||
|
||||
useShareAppMessage(() => getCommonShareMessage(true, inviteCode));
|
||||
|
||||
return (
|
||||
<HomePage>
|
||||
|
@ -15,6 +15,7 @@ import { RoleType, EventName, PageUrl } from '@/constants/app';
|
||||
import { CertificationStatusType } from '@/constants/company';
|
||||
import { CollectEventName, ReportEventId } from '@/constants/event';
|
||||
import { EMPLOY_TYPE_TITLE_MAP } from '@/constants/job';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import useUserInfo from '@/hooks/use-user-info';
|
||||
import useRoleType from '@/hooks/user-role-type';
|
||||
import { RESPONSE_ERROR_CODE } from '@/http/constant';
|
||||
@ -27,6 +28,7 @@ import { getJobTitle, getJobSalary, postPublishJob, requestJobDetail } from '@/u
|
||||
import { calcDistance, isValidLocation } from '@/utils/location';
|
||||
import { requestProfileDetail } from '@/utils/material';
|
||||
import { isChatWithSelf, postCreateChat } from '@/utils/message';
|
||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
||||
import { getCommonShareMessage } from '@/utils/share';
|
||||
import { formatDate } from '@/utils/time';
|
||||
@ -181,6 +183,7 @@ export default function JobDetail() {
|
||||
const userInfo = useUserInfo();
|
||||
const [data, setData] = useState<JobDetails | null>(null);
|
||||
const isOwner = roleType === RoleType.Company && userInfo.userId === data?.userId;
|
||||
const inviteCode = useInviteCode();
|
||||
|
||||
const onDev = useCallback(async () => data && copy(data.id), [data]);
|
||||
|
||||
@ -216,7 +219,8 @@ export default function JobDetail() {
|
||||
}, []);
|
||||
|
||||
useLoad(async () => {
|
||||
const query = getPageQuery<Pick<JobDetails, 'id'>>();
|
||||
const query = getPageQuery<Pick<JobDetails, 'id'> & { c: string }>();
|
||||
getInviteCodeFromQueryAndUpdate(query);
|
||||
const jobId = query?.id;
|
||||
if (!jobId) {
|
||||
return;
|
||||
@ -232,11 +236,11 @@ export default function JobDetail() {
|
||||
|
||||
useShareAppMessage(() => {
|
||||
if (!data) {
|
||||
return getCommonShareMessage();
|
||||
return getCommonShareMessage(true, inviteCode);
|
||||
}
|
||||
return {
|
||||
title: getJobTitle(data) || '',
|
||||
path: getJumpUrl(PageUrl.JobDetail, { id: data.id, share: true }),
|
||||
path: getJumpUrl(PageUrl.JobDetail, { id: data.id, share: true, c: inviteCode }),
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -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 (
|
||||
|
@ -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;
|
||||
});
|
||||
|
||||
|
@ -6,5 +6,17 @@
|
||||
--tabs-active-color: @blHighlightColor;
|
||||
--tabs-nav-background-color: #fff;
|
||||
--tabs-wrap-height: 98px;
|
||||
|
||||
> .taroify-tabs__wrap {
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
> .taroify-tabs__content {
|
||||
padding-top: var(--tabs-wrap-height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,35 +1,38 @@
|
||||
import { useShareAppMessage } from '@tarojs/taro';
|
||||
|
||||
import { Tabs } from '@taroify/core';
|
||||
import { useState } from 'react';
|
||||
|
||||
import PartnerIntro, { PartnerIntroFooter } from '@/components/partner-intro';
|
||||
import PartnerIntro from '@/components/partner-intro';
|
||||
import PartnerInviteList from '@/components/partner-invite-list';
|
||||
import PartnerProfit from '@/components/partner-profit';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import { getCommonShareMessage } from '@/utils/share';
|
||||
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'partner';
|
||||
|
||||
export default function Partner() {
|
||||
const [tab, setTab] = useState(0);
|
||||
const inviteCode = useInviteCode();
|
||||
|
||||
useShareAppMessage(() => {
|
||||
return getCommonShareMessage(false);
|
||||
console.log('Partner inviteCode', inviteCode);
|
||||
return getCommonShareMessage(false, inviteCode);
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={PREFIX}>
|
||||
<Tabs swipeable className={`${PREFIX}__tabs`} value={tab} onChange={setTab}>
|
||||
<Tabs className={`${PREFIX}__tabs`}>
|
||||
<Tabs.TabPane value={0} title="简介">
|
||||
<PartnerIntro />
|
||||
</Tabs.TabPane>
|
||||
<Tabs.TabPane value={1} title="邀请名单">
|
||||
邀请名单
|
||||
<PartnerInviteList />
|
||||
</Tabs.TabPane>
|
||||
<Tabs.TabPane value={2} title="我的收益">
|
||||
我的收益
|
||||
<PartnerProfit />
|
||||
</Tabs.TabPane>
|
||||
</Tabs>
|
||||
{tab === 0 && <PartnerIntroFooter />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -84,4 +84,4 @@
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ export default function User() {
|
||||
<CustomNavigationBar className={`${PREFIX}__navigation-bar`}>
|
||||
<SwitchBar title={roleType === RoleType.Anchor ? '切换为企业' : '切换为主播'} onClick={handleSwitchRoleType} />
|
||||
</CustomNavigationBar>
|
||||
<div className={PREFIX}>
|
||||
<div className={`${PREFIX} ${PREFIX}--${roleType}`}>
|
||||
<div className={`${PREFIX}__header`}>
|
||||
<Image
|
||||
mode="aspectFill"
|
||||
|
3
src/pages/withdraw-record/index.config.ts
Normal file
3
src/pages/withdraw-record/index.config.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '提现记录',
|
||||
});
|
5
src/pages/withdraw-record/index.less
Normal file
5
src/pages/withdraw-record/index.less
Normal file
@ -0,0 +1,5 @@
|
||||
@import '@/styles/common.less';
|
||||
@import '@/styles/variables.less';
|
||||
|
||||
.withdraw-record {
|
||||
}
|
14
src/pages/withdraw-record/index.tsx
Normal file
14
src/pages/withdraw-record/index.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
import { useShareAppMessage } from '@tarojs/taro';
|
||||
|
||||
import { getCommonShareMessage } from '@/utils/share';
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'withdraw-record';
|
||||
|
||||
export default function WithdrawRecord() {
|
||||
useShareAppMessage(() => {
|
||||
return getCommonShareMessage(false);
|
||||
});
|
||||
|
||||
return <div className={PREFIX}></div>;
|
||||
}
|
Reference in New Issue
Block a user