{LIST.map(item => (
diff --git a/src/constants/app.ts b/src/constants/app.ts
index d35b869..aa68073 100644
--- a/src/constants/app.ts
+++ b/src/constants/app.ts
@@ -24,6 +24,10 @@ export enum EventName {
SELECT_MY_PUBLISH_JOB = 'select_my_publish_job',
EXIT_CHAT_PAGE = 'exit_chat_page',
VIEW_MATERIAL_SUCCESS = 'view_material_success',
+ PRE_ACTION_SHARE_SUCCESS = 'pre_action_share_success',
+ PRE_ACTION_VIDEO_SUCCESS = 'pre_action_video_success',
+ PRE_ACTION_VIDEO_ERROR = 'pre_action_video_error',
+ SHOW_VIDEO_REWARD = 'show_video_reward',
}
export enum OpenSource {
@@ -75,6 +79,7 @@ export enum PageUrl {
Partner = 'pages/partner/index',
WithdrawRecord = 'pages/withdraw-record/index',
GroupDelegatePublish = 'pages/group-delegate-publish/index',
+ PartnerShare = 'pages/partner-share/index',
}
export enum PluginUrl {
diff --git a/src/constants/cache-key.ts b/src/constants/cache-key.ts
index f45331f..ed7eb19 100644
--- a/src/constants/cache-key.ts
+++ b/src/constants/cache-key.ts
@@ -13,4 +13,7 @@ export enum CacheKey {
AGREEMENT_SIGNED = '__agreement_signed__',
CITY_CODES = '__city_codes__',
JOIN_GROUP_CARD_CLICKED = '__join_group_card_clicked__',
+ SHARE_TO_GET_JOB_CONTACT = '__share_to_get_job_contract__',
+ SHARE_TO_GET_ANCHOR_CONTACT = '__share_to_get_anchor_contract__',
+ SKIP_PREACTION = '__skip_preaction__',
}
diff --git a/src/constants/job.ts b/src/constants/job.ts
index 2f702fe..5cf8e0f 100644
--- a/src/constants/job.ts
+++ b/src/constants/job.ts
@@ -174,3 +174,9 @@ export const FULL_EMPLOY_SALARY_OPTIONS = [
export const PART_PRICE_OPTIONS = PART_EMPLOY_SALARY_OPTIONS.filter(o => !!o.value);
export const FULL_PRICE_OPTIONS = FULL_EMPLOY_SALARY_OPTIONS.filter(o => !!o.value);
+
+export enum GET_CONTACT_TYPE {
+ SHARE = 'share',
+ VIP = 'vip',
+ VIDEO = 'video',
+}
diff --git a/src/constants/product.ts b/src/constants/product.ts
index b699334..daadbc9 100644
--- a/src/constants/product.ts
+++ b/src/constants/product.ts
@@ -27,6 +27,7 @@ export enum ProductSpecId {
AddGroup2 = 'ADDGROUP_2',
AddGroup3 = 'ADDGROUP_3',
BossVip = 'BOSSVIP',
+ DaylyVIP = 'VIP_D',
WeeklyVIP = 'VIP_W',
MonthlyVIP = 'VIP_M', // 30 每天十次
NewMonthlyVIP = 'VIP_M_NEW', // 18 每天五次
diff --git a/src/fragments/profile/view/index.less b/src/fragments/profile/view/index.less
index 80b024f..fc27b5f 100644
--- a/src/fragments/profile/view/index.less
+++ b/src/fragments/profile/view/index.less
@@ -44,7 +44,7 @@
font-size: 28px;
font-weight: 400;
color: #ffffff;
- background: #0000005c;
+ background: #6D3DF5B2;
border-radius: 48px;
}
diff --git a/src/hooks/use-config.tsx b/src/hooks/use-config.tsx
index 4c3e409..dacf608 100644
--- a/src/hooks/use-config.tsx
+++ b/src/hooks/use-config.tsx
@@ -98,6 +98,7 @@ export const APP_CONFIG: AppConfigType = {
PageUrl.Partner,
PageUrl.WithdrawRecord,
PageUrl.GroupDelegatePublish,
+ PageUrl.PartnerShare,
// PageUrl.DevDebug,
],
window: {
diff --git a/src/pages/job-detail/index.tsx b/src/pages/job-detail/index.tsx
index 738548d..ab60e0c 100644
--- a/src/pages/job-detail/index.tsx
+++ b/src/pages/job-detail/index.tsx
@@ -1,12 +1,13 @@
import { Map, MapProps, Text, Image, Button } from '@tarojs/components';
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
-import React, { useCallback, useEffect, useState } from 'react';
+import React, { useCallback, useEffect, useRef, useState } from 'react';
import { CertificationStatusIcon } from '@/components/certification-status';
import CommonDialog from '@/components/common-dialog';
import DevDiv from '@/components/dev-div';
import JobRecommendList from '@/components/job-recommend-list';
+import { JoinGroupHint } from '@/components/join-group-hint';
import LoginButton from '@/components/login-button';
import MaterialGuide from '@/components/material-guide';
import PageLoading from '@/components/page-loading';
@@ -37,7 +38,6 @@ import Toast from '@/utils/toast';
import { isNeedCreateMaterial } from '@/utils/user';
import './index.less';
-import { JoinGroupHint } from '@/components/join-group-hint';
const PREFIX = 'job-detail';
const log = logWithPrefix(PREFIX);
@@ -183,6 +183,7 @@ export default function JobDetail() {
const roleType = useRoleType();
const userInfo = useUserInfo();
const [data, setData] = useState
(null);
+ const videoRef = useRef(null);
const isOwner = roleType === RoleType.Company && userInfo.userId === data?.userId;
const inviteCode = useInviteCode();
@@ -219,6 +220,56 @@ export default function JobDetail() {
};
}, []);
+ useEffect(() => {
+ const handleLoad = () => {
+ log('视频奖励加载成功');
+ };
+ const handleError = err => {
+ Taro.eventCenter.trigger(EventName.PRE_ACTION_VIDEO_ERROR);
+ log('视频奖励加载失败', err);
+ };
+ const handleClose = res => {
+ if (res.isEnded) {
+ Taro.eventCenter.trigger(EventName.PRE_ACTION_VIDEO_SUCCESS);
+ } else {
+ Toast.info('请完整观看广告以获得奖励');
+ }
+ };
+ const handleShowVideo = async () => {
+ if (videoRef.current) {
+ try {
+ await videoRef.current.show();
+ } catch (error) {
+ Taro.eventCenter.trigger(EventName.PRE_ACTION_VIDEO_ERROR);
+ Toast.info('广告奖励加载失败,请重试');
+ log('激励视频显示失败');
+ }
+ } else {
+ Taro.eventCenter.trigger(EventName.PRE_ACTION_VIDEO_ERROR);
+ Toast.info('广告奖励加载失败,请重试');
+ log('激励视频加载&显示失败');
+ }
+ };
+ videoRef.current = Taro.createRewardedVideoAd({
+ adUnitId: 'adunit-ca879f574edfeb33',
+ });
+ videoRef.current.onLoad(handleLoad);
+ videoRef.current.onClose(handleClose);
+ videoRef.current.onError(handleError);
+
+ videoRef.current.load();
+ Taro.eventCenter.on(EventName.SHOW_VIDEO_REWARD, handleShowVideo);
+
+ return () => {
+ if (videoRef.current) {
+ videoRef.current.offLoad(handleLoad);
+ videoRef.current.offError(handleError);
+ videoRef.current.offClose(handleClose);
+ }
+ Taro.eventCenter.off(EventName.SHOW_VIDEO_REWARD);
+ };
+ }, []);
+
useLoad(async () => {
switchRoleType(RoleType.Anchor);
diff --git a/src/pages/material-create-profile/index.tsx b/src/pages/material-create-profile/index.tsx
index 57bbce3..5b67cfe 100644
--- a/src/pages/material-create-profile/index.tsx
+++ b/src/pages/material-create-profile/index.tsx
@@ -15,7 +15,7 @@ import useLocation from '@/hooks/use-location';
import { MaterialProfile } from '@/types/material';
import { logWithPrefix } from '@/utils/common';
import { collectEvent } from '@/utils/event';
-import { isFullTimePriceRequired, isPartTimePriceRequired } from '@/utils/job';
+import { isFullTimePriceRequired, isPartTimePriceRequired, setSkipPrejobAction } from '@/utils/job';
import { updateProfile, subscribeMaterialMessage } from '@/utils/material';
import { navigateBack } from '@/utils/route';
import Toast from '@/utils/toast';
@@ -110,6 +110,7 @@ export default function MaterialCreateProfile() {
// 发起订阅不能在异步任务中,保证是第一个
await Promise.all([subscribeMaterialMessage(), updateProfile(data)]);
}
+ setSkipPrejobAction();
Taro.eventCenter.trigger(EventName.CREATE_PROFILE);
nextType ? setGroupType(nextType) : navigateBack(2);
} catch (e) {
diff --git a/src/pages/partner-share/index.config.ts b/src/pages/partner-share/index.config.ts
new file mode 100644
index 0000000..8f9ba0f
--- /dev/null
+++ b/src/pages/partner-share/index.config.ts
@@ -0,0 +1,3 @@
+export default definePageConfig({
+ navigationBarTitleText: '分享',
+});
diff --git a/src/pages/partner-share/index.less b/src/pages/partner-share/index.less
new file mode 100644
index 0000000..45001e3
--- /dev/null
+++ b/src/pages/partner-share/index.less
@@ -0,0 +1,57 @@
+@import '@/styles/common.less';
+@import '@/styles/variables.less';
+
+page {
+ background: #fff;
+}
+
+.partner-share {
+ padding-top: 175px;
+ &__money {
+ width: 140px;
+ height: 140px;
+ margin-bottom: 35px;
+ }
+ &__header {
+ .flex-column();
+ justify-content: center;
+ font-weight: 500;
+ font-size: 48px;
+ line-height: 48px;
+ color: #333333;
+ }
+
+ &__body {
+ padding-top: 86px;
+ .flex-column();
+ }
+
+ &__item {
+ .flex-row();
+ margin-top: 72px;
+ font-weight: 500;
+ font-size: 32px;
+ line-height: 48px;
+ width: 640px;
+
+ color: #000000;
+ .highlight {
+ color: @blHighlightColor;
+ font-weight: 400;
+ padding-left: 8px;
+ display: inline-block;
+ }
+
+
+ }
+ &__no {
+ width: 74px;
+ height: 46px;
+ margin-right: 21px;
+ vertical-align: middle;
+ }
+ &__btn {
+ .button(@width: 360px; @height: 72px;);
+ margin-top: 150px;
+ }
+}
diff --git a/src/pages/partner-share/index.tsx b/src/pages/partner-share/index.tsx
new file mode 100644
index 0000000..aa03488
--- /dev/null
+++ b/src/pages/partner-share/index.tsx
@@ -0,0 +1,61 @@
+import { Button, Image } from '@tarojs/components';
+import Taro, { useDidShow, useShareAppMessage } from '@tarojs/taro';
+
+import { EventName } from '@/constants/app';
+import useInviteCode from '@/hooks/use-invite-code';
+import { hasShareToGetContact, setShareToGetContact } from '@/utils/job';
+import { navigateBack } from '@/utils/route';
+import { getCommonShareMessage } from '@/utils/share';
+
+import './index.less';
+
+const PREFIX = 'partner-share';
+
+export default function Partner() {
+ const inviteCode = useInviteCode();
+ useDidShow(() => {
+ if (!hasShareToGetContact()) {
+ Taro.eventCenter.trigger(EventName.PRE_ACTION_SHARE_SUCCESS);
+ navigateBack(-1);
+ }
+ });
+ useShareAppMessage(() => {
+ setShareToGetContact();
+ console.log('Partner inviteCode', inviteCode);
+ return getCommonShareMessage({ useCapture: false, inviteCode });
+ });
+
+ return (
+
+ );
+}
diff --git a/src/utils/job.ts b/src/utils/job.ts
index c167a95..9e5b812 100644
--- a/src/utils/job.ts
+++ b/src/utils/job.ts
@@ -8,20 +8,20 @@ import { API } from '@/http/api';
import store from '@/store';
import { selectLocation } from '@/store/selector';
import {
- JobDetails,
+ CreateJobInfo,
+ GetJobManagesRequest,
+ GetJobManagesResponse,
GetJobsDetailsRequest,
GetJobsRequest,
GetJobsResponse,
- JobInfo,
+ GetMyRecommendJobRequest,
GetUserJobRequest,
GetUserJobResponse,
- MyDeclaredJobInfo,
- MyBrowsedJobInfo,
- GetMyRecommendJobRequest,
- GetJobManagesRequest,
- GetJobManagesResponse,
- CreateJobInfo,
+ JobDetails,
+ JobInfo,
JobManageInfo,
+ MyBrowsedJobInfo,
+ MyDeclaredJobInfo,
} from '@/types/job';
import { collectEvent } from '@/utils/event';
import { getCityValues } from '@/utils/location';
@@ -131,3 +131,19 @@ export function postPublishJob(jobId: string) {
export function postCloseJob(jobId: string) {
return http.post(API.CLOSE_JOB, { data: { jobId }, contentType: 'application/x-www-form-urlencoded' });
}
+
+export function setSkipPrejobAction(skip = true) {
+ Taro.setStorageSync(CacheKey.SKIP_PREACTION, skip);
+}
+
+export function getSkipPrejobAction() {
+ return !!Taro.getStorageSync(CacheKey.SKIP_PREACTION);
+}
+
+export function setShareToGetContact(job = true) {
+ Taro.setStorageSync(job ? CacheKey.SHARE_TO_GET_JOB_CONTACT : CacheKey.SHARE_TO_GET_ANCHOR_CONTACT, true);
+}
+
+export function hasShareToGetContact(job = true) {
+ return !Taro.getStorageSync(job ? CacheKey.SHARE_TO_GET_JOB_CONTACT : CacheKey.SHARE_TO_GET_ANCHOR_CONTACT);
+}