Compare commits
5 Commits
feat/updat
...
e8cf28b6e9
| Author | SHA1 | Date | |
|---|---|---|---|
| e8cf28b6e9 | |||
| de7f0e14fe | |||
| de2f380cd9 | |||
| 0020eb8dbe | |||
| b0dd660dde |
@ -1,18 +1,21 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import BaseTabBar from '@/components/tab-bar';
|
import BaseTabBar from '@/components/tab-bar';
|
||||||
|
import { PageType } from '@/constants/app';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
interface IProps extends React.PropsWithChildren {}
|
interface IProps extends React.PropsWithChildren {
|
||||||
|
type: PageType;
|
||||||
|
}
|
||||||
|
|
||||||
export default function HomePage(props: IProps) {
|
export default function HomePage(props: IProps) {
|
||||||
const { children } = props;
|
const { children, type } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{children}
|
{children}
|
||||||
<BaseTabBar />
|
<BaseTabBar type={type} />
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
41
src/components/join-group-hint/index.less
Normal file
41
src/components/join-group-hint/index.less
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
@import '@/styles/common.less';
|
||||||
|
@import '@/styles/variables.less';
|
||||||
|
|
||||||
|
.join-group-hint {
|
||||||
|
.flex-row();
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 32px 24px;
|
||||||
|
margin-top: 24px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
|
||||||
|
&__icon {
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
margin-right: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__left {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 8px;
|
||||||
|
&-title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 40px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
&-desc {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__right {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__button {
|
||||||
|
.button(@width: 186px, @height: 64px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 32px, @highlight: 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
58
src/components/join-group-hint/index.tsx
Normal file
58
src/components/join-group-hint/index.tsx
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import { Button, Image } from '@tarojs/components';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Plus } from '@taroify/icons';
|
||||||
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
|
import { RoleType } from '@/constants/app';
|
||||||
|
import { CacheKey } from '@/constants/cache-key';
|
||||||
|
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||||
|
import { GROUPS } from '@/constants/group';
|
||||||
|
import { getRoleTypeWithDefault } from '@/utils/app';
|
||||||
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
|
import { getCurrentCityCode } from '@/utils/location';
|
||||||
|
import { checkCityCode, validCityCode } from '@/utils/user';
|
||||||
|
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const PREFIX = 'join-group-hint';
|
||||||
|
|
||||||
|
export function JoinGroupHint() {
|
||||||
|
const cityCode = getCurrentCityCode();
|
||||||
|
const roleType = getRoleTypeWithDefault();
|
||||||
|
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
||||||
|
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED));
|
||||||
|
const handleClick = useCallback(() => {
|
||||||
|
if (!checkCityCode(cityCode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (group) {
|
||||||
|
openCustomerServiceChat(group.serviceUrl);
|
||||||
|
Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true);
|
||||||
|
setClicked(true);
|
||||||
|
}
|
||||||
|
}, [cityCode, group]);
|
||||||
|
if (!group || !validCityCode(cityCode) || clicked) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<Image
|
||||||
|
className={`${PREFIX}__icon`}
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/group-avatar.png"
|
||||||
|
mode="aspectFit"
|
||||||
|
/>
|
||||||
|
<div className={`${PREFIX}__left`}>
|
||||||
|
<div className={`${PREFIX}__left-title`}>{CITY_CODE_TO_NAME_MAP.get(cityCode)}主播招聘群</div>
|
||||||
|
<div className={`${PREFIX}__left-desc`}>{roleType === RoleType.Anchor ? '高薪工作早知道' : '免费招主播'}</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__right`}>
|
||||||
|
<Button className={`${PREFIX}__button`} onClick={handleClick}>
|
||||||
|
<Plus />
|
||||||
|
加入该群
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -80,4 +80,8 @@
|
|||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
&__no-subscription {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -57,7 +57,9 @@ export function MessageNoTimesDialog(props: INoTimesProps) {
|
|||||||
<Dialog className={NO_TIMES} onClose={onClose} open={open}>
|
<Dialog className={NO_TIMES} onClose={onClose} open={open}>
|
||||||
<Dialog.Content>
|
<Dialog.Content>
|
||||||
<div className={`${NO_TIMES}__title`}>未读消息提醒次数不够了!</div>
|
<div className={`${NO_TIMES}__title`}>未读消息提醒次数不够了!</div>
|
||||||
<div className={`${NO_TIMES}__tips`}>有通知次数才能<span className="highlight">及时收到</span>招聘邀请,快点击“点我增加”吧~</div>
|
<div className={`${NO_TIMES}__tips`}>
|
||||||
|
有通知次数才能<span className="highlight">及时收到</span>招聘邀请,快点击“点我增加”吧~
|
||||||
|
</div>
|
||||||
<div className={`${NO_TIMES}__body`}>
|
<div className={`${NO_TIMES}__body`}>
|
||||||
<div className={`${NO_TIMES}__times`}>{`未读消息提醒剩余:${times}次`}</div>
|
<div className={`${NO_TIMES}__times`}>{`未读消息提醒剩余:${times}次`}</div>
|
||||||
<Button className={`${NO_TIMES}__btn`} onClick={onClick}>
|
<Button className={`${NO_TIMES}__btn`} onClick={onClick}>
|
||||||
|
|||||||
82
src/components/prejob-popup/index.less
Normal file
82
src/components/prejob-popup/index.less
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
@import '@/styles/common.less';
|
||||||
|
@import '@/styles/variables.less';
|
||||||
|
|
||||||
|
.prejob-popup {
|
||||||
|
&__content {
|
||||||
|
padding: 40px 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 48px;
|
||||||
|
margin-bottom: 31px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__body {
|
||||||
|
}
|
||||||
|
|
||||||
|
&__item {
|
||||||
|
.flex-row();
|
||||||
|
margin-bottom: 40px;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
width: 88px;
|
||||||
|
height: 88px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
&.share {
|
||||||
|
background: #feba00;
|
||||||
|
> image {
|
||||||
|
width: 40px;
|
||||||
|
height: 46px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.vip {
|
||||||
|
background: #b094ff;
|
||||||
|
> image {
|
||||||
|
width: 48px;
|
||||||
|
height: 42px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.video {
|
||||||
|
background: #34a853;
|
||||||
|
> image {
|
||||||
|
width: 46px;
|
||||||
|
height: 44px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-main {
|
||||||
|
padding: 0 24px;
|
||||||
|
flex: 1;
|
||||||
|
.title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.desc {
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 36px;
|
||||||
|
color: @blColorG1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-action {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__btn {
|
||||||
|
.button(@width: 136px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 43px, @highlight: 0);
|
||||||
|
background: #f2f2f2;
|
||||||
|
}
|
||||||
|
}
|
||||||
86
src/components/prejob-popup/index.tsx
Normal file
86
src/components/prejob-popup/index.tsx
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
import { Button, Image } from '@tarojs/components';
|
||||||
|
|
||||||
|
import { Popup } from '@taroify/core';
|
||||||
|
|
||||||
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
|
import { GET_CONTACT_TYPE } from '@/constants/job';
|
||||||
|
import { hasShareToGetContact } from '@/utils/job';
|
||||||
|
import { navigateTo } from '@/utils/route';
|
||||||
|
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
open: boolean;
|
||||||
|
onCancel: () => void;
|
||||||
|
onConfirm: (type: GET_CONTACT_TYPE) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const PREFIX = 'prejob-popup';
|
||||||
|
|
||||||
|
const GET_CONTACT_TYPE_OPTIONS = [
|
||||||
|
{
|
||||||
|
type: GET_CONTACT_TYPE.SHARE,
|
||||||
|
icon: 'https://publiccdn.neighbourhood.com.cn/img/file.svg',
|
||||||
|
title: '完善资料',
|
||||||
|
desc: '转发给朋友可享推荐奖励',
|
||||||
|
btnText: '分享',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: GET_CONTACT_TYPE.VIP,
|
||||||
|
icon: 'https://publiccdn.neighbourhood.com.cn/img/diamond.svg',
|
||||||
|
title: '播络会员',
|
||||||
|
desc: '开通会员每天可查看10个',
|
||||||
|
btnText: '开通',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: GET_CONTACT_TYPE.VIDEO,
|
||||||
|
icon: 'https://publiccdn.neighbourhood.com.cn/img/video.svg',
|
||||||
|
title: '观看视频',
|
||||||
|
desc: '观看6-30s广告即可免费查看',
|
||||||
|
btnText: '观看',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export function PrejobPopup({ open, onCancel, onConfirm }: IProps) {
|
||||||
|
const handleClick = (type: GET_CONTACT_TYPE) => () => {
|
||||||
|
if (type === GET_CONTACT_TYPE.SHARE) {
|
||||||
|
navigateTo(PageUrl.PartnerShare);
|
||||||
|
} else {
|
||||||
|
onConfirm(type);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<Popup rounded className={PREFIX} placement="bottom" open={open} onClose={onCancel}>
|
||||||
|
<div className={`${PREFIX}__content`}>
|
||||||
|
<div className={`${PREFIX}__title`}>以下方式任选其一均可获取联系方式</div>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
{GET_CONTACT_TYPE_OPTIONS.map(option => {
|
||||||
|
// 该方式只能用一次, 以后不再出现在选项中
|
||||||
|
if (option.type === GET_CONTACT_TYPE.SHARE && !hasShareToGetContact()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={`${PREFIX}__item`} key={option.type}>
|
||||||
|
<div className={`${PREFIX}__item-icon ${option.type}`}>
|
||||||
|
<Image mode="aspectFit" src={option.icon} />
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__item-main`}>
|
||||||
|
<div className="title">{option.title}</div>
|
||||||
|
<div className="desc">{option.desc}</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__item-action`}>
|
||||||
|
<Button className={`${PREFIX}__btn`} onClick={handleClick(option.type)}>
|
||||||
|
{option.btnText}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<SafeBottomPadding />
|
||||||
|
</Popup>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ export const PREFIX = 'product-dialog';
|
|||||||
export enum DialogStatus {
|
export enum DialogStatus {
|
||||||
// 加载中
|
// 加载中
|
||||||
LOADING = 'loading',
|
LOADING = 'loading',
|
||||||
|
PRE_ACTION = 'pre_action',
|
||||||
// 直接联系通告主
|
// 直接联系通告主
|
||||||
JOB_CONTACT_DIRECT = 'job_contact_direct',
|
JOB_CONTACT_DIRECT = 'job_contact_direct',
|
||||||
// 联系客服去联系通告主 -> 订阅通知
|
// 联系客服去联系通告主 -> 订阅通知
|
||||||
@ -13,6 +14,7 @@ export enum DialogStatus {
|
|||||||
JOB_UNABLE_UNLOCK = 'job_unable_unlock',
|
JOB_UNABLE_UNLOCK = 'job_unable_unlock',
|
||||||
// 通告解锁次数用完,购买界面
|
// 通告解锁次数用完,购买界面
|
||||||
JOB_BUY = 'job_buy',
|
JOB_BUY = 'job_buy',
|
||||||
|
PREACTION_JOB_BUY = 'preaction_job_buy',
|
||||||
// 加群二维码
|
// 加群二维码
|
||||||
GROUP_QR_CODE = 'group_qr_code',
|
GROUP_QR_CODE = 'group_qr_code',
|
||||||
// 确定加群
|
// 确定加群
|
||||||
|
|||||||
@ -133,6 +133,7 @@
|
|||||||
&__header {
|
&__header {
|
||||||
.flex-row();
|
.flex-row();
|
||||||
.header-font();
|
.header-font();
|
||||||
|
font-size: 32px;
|
||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
color: @blHighlightColor;
|
color: @blHighlightColor;
|
||||||
@ -143,7 +144,8 @@
|
|||||||
&__describe {
|
&__describe {
|
||||||
.flex-row();
|
.flex-row();
|
||||||
.describe-font();
|
.describe-font();
|
||||||
margin-top: 24px;
|
margin-top: 18px;
|
||||||
|
line-height: 40px;
|
||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
color: @blHighlightColor;
|
color: @blHighlightColor;
|
||||||
@ -158,13 +160,13 @@
|
|||||||
|
|
||||||
&__item {
|
&__item {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 170px;
|
width: 182px;
|
||||||
height: 192px;
|
height: 192px;
|
||||||
.flex-column();
|
.flex-column();
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
border: 2px solid @blHighlightColor;
|
border: 2px solid @blHighlightColor;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
margin-right: 24px;
|
margin-right: 15px;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
@ -660,4 +662,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,20 +3,24 @@ import Taro from '@tarojs/taro';
|
|||||||
import { Dialog } from '@taroify/core';
|
import { Dialog } from '@taroify/core';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import { PrejobPopup } from '@/components/prejob-popup';
|
||||||
import { DialogStatus, PREFIX } from '@/components/product-dialog/const';
|
import { DialogStatus, PREFIX } from '@/components/product-dialog/const';
|
||||||
import JobBuy from '@/components/product-dialog/steps-ui/job-buy';
|
import JobBuy from '@/components/product-dialog/steps-ui/job-buy';
|
||||||
import ContactCustomerService from '@/components/product-dialog/steps-ui/job-contact-customer';
|
import ContactCustomerService from '@/components/product-dialog/steps-ui/job-contact-customer';
|
||||||
import ContactDirect from '@/components/product-dialog/steps-ui/job-contact-direct';
|
import ContactDirect from '@/components/product-dialog/steps-ui/job-contact-direct';
|
||||||
import UnableUnlockContent from '@/components/product-dialog/steps-ui/job-unable';
|
import UnableUnlockContent from '@/components/product-dialog/steps-ui/job-unable';
|
||||||
|
import { EventName } from '@/constants/app';
|
||||||
|
import { GET_CONTACT_TYPE } from '@/constants/job';
|
||||||
import { DeclarationType, ProductType } from '@/constants/product';
|
import { DeclarationType, ProductType } from '@/constants/product';
|
||||||
import { JobDetails } from '@/types/job';
|
import { JobDetails } from '@/types/job';
|
||||||
import { ProductInfo } from '@/types/product';
|
import { ProductInfo } from '@/types/product';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
|
import { getSkipPrejobAction, setSkipPrejobAction } from '@/utils/job';
|
||||||
import {
|
import {
|
||||||
requestProductUseRecord,
|
|
||||||
requestProductBalance,
|
|
||||||
requestUseProduct,
|
|
||||||
requestAllBuyProduct,
|
requestAllBuyProduct,
|
||||||
|
requestProductBalance,
|
||||||
|
requestProductUseRecord,
|
||||||
|
requestUseProduct,
|
||||||
} from '@/utils/product';
|
} from '@/utils/product';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
@ -33,13 +37,31 @@ const log = logWithPrefix('product-job-dialog');
|
|||||||
function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||||
const { data, onClose } = props;
|
const { data, onClose } = props;
|
||||||
const [status, setStatus] = useState<DialogStatus>(DialogStatus.LOADING);
|
const [status, setStatus] = useState<DialogStatus>(DialogStatus.LOADING);
|
||||||
|
const [showContact, setShowContact] = useState(false);
|
||||||
|
const [showPrejob, setShowPrejob] = useState(false);
|
||||||
const [publisherAcctNo, setPublisherAcctNo] = useState<string>('');
|
const [publisherAcctNo, setPublisherAcctNo] = useState<string>('');
|
||||||
const initRef = useRef(() => {});
|
const initRef = useRef<(skipPreAction?: boolean, skipRecordGet?: boolean) => void | Promise<void>>(() => {});
|
||||||
|
|
||||||
const handleCloseDialog = useCallback(() => {
|
const handleCloseDialog = useCallback(() => {
|
||||||
|
setShowContact(false);
|
||||||
onClose();
|
onClose();
|
||||||
}, [onClose]);
|
}, [onClose]);
|
||||||
|
|
||||||
|
const handleClosePrejob = useCallback(() => {
|
||||||
|
setShowPrejob(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleConfirmPrejob = useCallback(async (type: GET_CONTACT_TYPE) => {
|
||||||
|
if (type === GET_CONTACT_TYPE.VIP) {
|
||||||
|
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
||||||
|
setShowContact(true);
|
||||||
|
setShowPrejob(false);
|
||||||
|
setStatus(allowBuy ? DialogStatus.PREACTION_JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
||||||
|
} else if (type === GET_CONTACT_TYPE.VIDEO) {
|
||||||
|
Taro.eventCenter.trigger(EventName.SHOW_VIDEO_REWARD);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleAfterBuy = useCallback(async () => {
|
const handleAfterBuy = useCallback(async () => {
|
||||||
const time = await requestProductBalance(PRODUCT_CODE);
|
const time = await requestProductBalance(PRODUCT_CODE);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
@ -49,6 +71,8 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
}
|
}
|
||||||
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||||
const declarationTypeResult = productInfo.declarationTypeResult;
|
const declarationTypeResult = productInfo.declarationTypeResult;
|
||||||
|
setShowContact(true);
|
||||||
|
setShowPrejob(false);
|
||||||
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
||||||
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
||||||
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
||||||
@ -62,8 +86,9 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initRef.current = async () => {
|
initRef.current = async (skipPreAction?: boolean, skipRecordGet?: boolean) => {
|
||||||
const handleContact = (declarationTypeResult?: ProductInfo['declarationTypeResult']) => {
|
const handleContact = (declarationTypeResult?: ProductInfo['declarationTypeResult']) => {
|
||||||
|
setShowContact(true);
|
||||||
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
||||||
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
||||||
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
||||||
@ -77,19 +102,34 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
// setStatus(DialogStatus.JOB_CONTACT_CS);
|
// setStatus(DialogStatus.JOB_CONTACT_CS);
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
const result = await requestProductUseRecord(PRODUCT_CODE, { jobId: data.id });
|
if (!skipRecordGet) {
|
||||||
log('requestProductUseRecord result', result);
|
const result = await requestProductUseRecord(PRODUCT_CODE, { jobId: data.id });
|
||||||
if (result) {
|
log('requestProductUseRecord result', result);
|
||||||
handleContact(result.declarationTypeResult);
|
if (result) {
|
||||||
return;
|
handleContact(result.declarationTypeResult);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const time = await requestProductBalance(PRODUCT_CODE);
|
const time = await requestProductBalance(PRODUCT_CODE);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
||||||
|
setShowContact(true);
|
||||||
setStatus(allowBuy ? DialogStatus.JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
setStatus(allowBuy ? DialogStatus.JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
||||||
} else {
|
}
|
||||||
|
// 创建模卡之后可以直接解锁一次, 分享后解锁一次
|
||||||
|
else if (getSkipPrejobAction() || skipPreAction) {
|
||||||
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||||
|
setShowPrejob(false);
|
||||||
|
if (!skipPreAction) {
|
||||||
|
setSkipPrejobAction(false);
|
||||||
|
}
|
||||||
handleContact(productInfo.declarationTypeResult);
|
handleContact(productInfo.declarationTypeResult);
|
||||||
|
} else {
|
||||||
|
setShowPrejob(true);
|
||||||
|
setStatus(DialogStatus.PRE_ACTION);
|
||||||
|
|
||||||
|
// const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||||
|
// handleContact(productInfo.declarationTypeResult);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Toast.error('出错了,请重试');
|
Toast.error('出错了,请重试');
|
||||||
@ -104,21 +144,44 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
initRef.current();
|
initRef.current();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
Taro.eventCenter.once(EventName.PRE_ACTION_SHARE_SUCCESS, () => {
|
||||||
|
initRef.current(true, true);
|
||||||
|
});
|
||||||
|
Taro.eventCenter.on(EventName.PRE_ACTION_VIDEO_SUCCESS, () => {
|
||||||
|
initRef.current(true, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
Taro.eventCenter.off(EventName.PRE_ACTION_SHARE_SUCCESS);
|
||||||
|
Taro.eventCenter.off(EventName.PRE_ACTION_VIDEO_SUCCESS);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
if (status === DialogStatus.LOADING) {
|
if (status === DialogStatus.LOADING) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog className={PREFIX} onClose={onClose} open>
|
<div>
|
||||||
<Dialog.Content>
|
<PrejobPopup open={showPrejob} onCancel={handleClosePrejob} onConfirm={handleConfirmPrejob} />
|
||||||
{status === DialogStatus.JOB_CONTACT_CS && <ContactCustomerService onAfterConfirm={handleCloseDialog} />}
|
<Dialog className={PREFIX} onClose={onClose} open={showContact}>
|
||||||
{status === DialogStatus.JOB_CONTACT_DIRECT && (
|
<Dialog.Content>
|
||||||
<ContactDirect publisherAcctNo={publisherAcctNo} onAfterConfirm={handleCloseDialog} onReport={handleReport} />
|
{status === DialogStatus.JOB_CONTACT_CS && <ContactCustomerService onAfterConfirm={handleCloseDialog} />}
|
||||||
)}
|
{status === DialogStatus.JOB_CONTACT_DIRECT && (
|
||||||
{status === DialogStatus.JOB_BUY && <JobBuy onConfirm={handleAfterBuy} />}
|
<ContactDirect
|
||||||
{status === DialogStatus.JOB_UNABLE_UNLOCK && <UnableUnlockContent onConfirm={handleCloseDialog} />}
|
publisherAcctNo={publisherAcctNo}
|
||||||
</Dialog.Content>
|
onAfterConfirm={handleCloseDialog}
|
||||||
</Dialog>
|
onReport={handleReport}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{(status === DialogStatus.JOB_BUY || status === DialogStatus.PREACTION_JOB_BUY) && (
|
||||||
|
<JobBuy onConfirm={handleAfterBuy} justBuy={status === DialogStatus.PREACTION_JOB_BUY} />
|
||||||
|
)}
|
||||||
|
{status === DialogStatus.JOB_UNABLE_UNLOCK && <UnableUnlockContent onConfirm={handleCloseDialog} />}
|
||||||
|
</Dialog.Content>
|
||||||
|
</Dialog>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import Taro from '@tarojs/taro';
|
|||||||
|
|
||||||
import { Button } from '@taroify/core';
|
import { Button } from '@taroify/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { Fragment, useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import Badge from '@/components/badge';
|
import Badge from '@/components/badge';
|
||||||
import { PREFIX } from '@/components/product-dialog/const';
|
import { PREFIX } from '@/components/product-dialog/const';
|
||||||
@ -16,6 +16,7 @@ import { postSubscribe, subscribeMessage } from '@/utils/subscribe';
|
|||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
|
justBuy?: boolean;
|
||||||
onConfirm: () => void;
|
onConfirm: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,22 +30,22 @@ interface Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const LIST: Item[] = [
|
const LIST: Item[] = [
|
||||||
{ id: ProductSpecId.WeeklyVIP, title: '非会员', content: '每日2次', price: '免费', amt: 0 },
|
{ id: ProductSpecId.WeeklyVIP, title: '日会员', content: '1天内免广告', price: '60播豆', amt: 6, badge: '限时体验' },
|
||||||
{
|
{
|
||||||
id: ProductSpecId.WeeklyVIP,
|
id: ProductSpecId.WeeklyVIP,
|
||||||
title: '周会员',
|
title: '周会员',
|
||||||
content: '每日5次',
|
content: '7天内免广告',
|
||||||
price: '60播豆',
|
price: '180播豆',
|
||||||
amt: 6,
|
amt: 18,
|
||||||
badge: '限时体验',
|
badge: '4.2折',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: ProductSpecId.NewMonthlyVIP,
|
id: ProductSpecId.NewMonthlyVIP,
|
||||||
title: '月会员',
|
title: '月会员',
|
||||||
content: '每日5次',
|
content: '30天内免广告',
|
||||||
price: '180播豆',
|
price: '300播豆',
|
||||||
amt: 18,
|
amt: 30,
|
||||||
badge: ' 超值',
|
badge: '1.6折',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -75,6 +76,7 @@ export default function JobBuy(props: IProps) {
|
|||||||
type: OrderType.VIP,
|
type: OrderType.VIP,
|
||||||
amt: getOrderPrice(selectItem.amt),
|
amt: getOrderPrice(selectItem.amt),
|
||||||
productCode: ProductType.VIP,
|
productCode: ProductType.VIP,
|
||||||
|
// todo: 日会员的 productSpectId 是什么?
|
||||||
productSpecId: selectItem.id,
|
productSpecId: selectItem.id,
|
||||||
});
|
});
|
||||||
log('handleBuy payInfo', payOrderNo, createPayInfo);
|
log('handleBuy payInfo', payOrderNo, createPayInfo);
|
||||||
@ -107,14 +109,26 @@ export default function JobBuy(props: IProps) {
|
|||||||
return (
|
return (
|
||||||
<div className={`${PREFIX}__job-buy`}>
|
<div className={`${PREFIX}__job-buy`}>
|
||||||
<div className={`${PREFIX}__job-buy__header`}>
|
<div className={`${PREFIX}__job-buy__header`}>
|
||||||
<div>今日通告对接次数</div>
|
{props.justBuy ? (
|
||||||
<div className="highlight">已用完</div>
|
<div>开通播络会员即可直接查看联系方式</div>
|
||||||
|
) : (
|
||||||
|
<Fragment>
|
||||||
|
<div>今日通告对接次数</div>
|
||||||
|
<div className="highlight">已用完</div>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__job-buy__describe`}>
|
<div className={`${PREFIX}__job-buy__describe`}>
|
||||||
<div>请</div>
|
{props.justBuy ? (
|
||||||
<div className="highlight">明日</div>
|
<div>每天可查看10个联系方式</div>
|
||||||
<div>再来 或 </div>
|
) : (
|
||||||
<div className="highlight">升级会员</div>
|
<Fragment>
|
||||||
|
<div>请</div>
|
||||||
|
<div className="highlight">明日</div>
|
||||||
|
<div>再来 或 </div>
|
||||||
|
<div className="highlight">升级会员</div>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__job-buy__container`}>
|
<div className={`${PREFIX}__job-buy__container`}>
|
||||||
{LIST.map(item => (
|
{LIST.map(item => (
|
||||||
|
|||||||
@ -1,14 +1,11 @@
|
|||||||
import { Tabbar } from '@taroify/core';
|
import { Tabbar } from '@taroify/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
|
||||||
|
|
||||||
import { APP_TAB_BAR_ID, RoleType, PageType, PageUrl } from '@/constants/app';
|
import { APP_TAB_BAR_ID, RoleType, PageType, PageUrl } from '@/constants/app';
|
||||||
import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST, TabItemType } from '@/hooks/use-config';
|
import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST, TabItemType } from '@/hooks/use-config';
|
||||||
import useMessage from '@/hooks/use-message';
|
import useMessage from '@/hooks/use-message';
|
||||||
import useRoleType from '@/hooks/user-role-type';
|
import useRoleType from '@/hooks/user-role-type';
|
||||||
import { changeHomePage } from '@/store/actions';
|
|
||||||
import { selectHomePageType } from '@/store/selector';
|
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { switchTab } from '@/utils/route';
|
import { switchTab } from '@/utils/route';
|
||||||
|
|
||||||
@ -16,6 +13,7 @@ import './index.less';
|
|||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
type: PageType;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PREFIX = 'base-tab-bar';
|
const PREFIX = 'base-tab-bar';
|
||||||
@ -40,25 +38,21 @@ const TabItem = (props: { item: TabItemType }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function BaseTabBar(props: IProps) {
|
function BaseTabBar({ className, type }: IProps) {
|
||||||
const { className } = props;
|
|
||||||
const roleType = useRoleType();
|
const roleType = useRoleType();
|
||||||
const currentPage = useSelector(selectHomePageType);
|
|
||||||
const dispatch = useDispatch();
|
|
||||||
|
|
||||||
const tabs = roleType === RoleType.Anchor ? ANCHOR_TAB_LIST : COMPANY_TAB_LIST;
|
const tabs = roleType === RoleType.Anchor ? ANCHOR_TAB_LIST : COMPANY_TAB_LIST;
|
||||||
|
|
||||||
const handleTabClick = useCallback(
|
const handleTabClick = useCallback(
|
||||||
(value: PageType) => {
|
(value: PageType) => {
|
||||||
if (value === currentPage) {
|
if (value === type) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dispatch(changeHomePage(value));
|
|
||||||
const item = tabs.find((i: TabItemType) => i.type === value);
|
const item = tabs.find((i: TabItemType) => i.type === value);
|
||||||
log('tab bar changed', value, item?.pagePath);
|
log('tab bar changed', value, item?.pagePath);
|
||||||
item && switchTab(item.pagePath as PageUrl);
|
item && switchTab(item.pagePath as PageUrl);
|
||||||
},
|
},
|
||||||
[tabs, currentPage, dispatch]
|
[tabs, type]
|
||||||
);
|
);
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
@ -72,14 +66,14 @@ function BaseTabBar(props: IProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(`${PREFIX}__wrapper`, className)} id={APP_TAB_BAR_ID}>
|
<div className={classNames(`${PREFIX}__wrapper`, className)} id={APP_TAB_BAR_ID}>
|
||||||
<Tabbar className={PREFIX} defaultValue={currentPage}>
|
<Tabbar className={PREFIX} value={type}>
|
||||||
{tabs.map((item: TabItemType) => {
|
{tabs.map((item: TabItemType) => {
|
||||||
return (
|
return (
|
||||||
<Tabbar.TabItem
|
<Tabbar.TabItem
|
||||||
key={item.pagePath}
|
key={item.pagePath}
|
||||||
value={item.type}
|
value={item.type}
|
||||||
onClick={() => handleTabClick(item.type)}
|
onClick={() => handleTabClick(item.type)}
|
||||||
className={classNames(`${PREFIX}__item`, { selected: item.type === currentPage })}
|
className={classNames(`${PREFIX}__item`, { selected: item.type === type })}
|
||||||
>
|
>
|
||||||
<TabItem item={item} />
|
<TabItem item={item} />
|
||||||
</Tabbar.TabItem>
|
</Tabbar.TabItem>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Button, Image, Text } from '@tarojs/components';
|
import { Button, Text } from '@tarojs/components';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
import { Cell } from '@taroify/core';
|
import { Cell } from '@taroify/core';
|
||||||
@ -35,29 +35,36 @@ interface CityOption extends ISelectOption<CityValue> {
|
|||||||
|
|
||||||
const PREFIX = 'user-batch-publish';
|
const PREFIX = 'user-batch-publish';
|
||||||
const log = logWithPrefix(PREFIX);
|
const log = logWithPrefix(PREFIX);
|
||||||
const SERVICE_ILLUSTRATE = `群发次数:每日一次,连发3天
|
const SERVICE_ILLUSTRATE = `服务方式:帮您把招聘需求发到众多同城合作主播群
|
||||||
群发内容:仅限主播招聘通告,违规内容不发
|
群发次数:每日1次,连发3天
|
||||||
联系方法:通告中留通告主联系方式,主播直接联系`;
|
内容要求:仅限带货主播招聘需求,其他不发
|
||||||
|
主播联系:内容中留招聘方联系方式,主播直接联系`;
|
||||||
const cityValues: CityValue[] = [
|
const cityValues: CityValue[] = [
|
||||||
{ cityCode: '440100', cityName: '广州', count: 300 },
|
{ cityCode: '440100', cityName: '广州', count: 800 },
|
||||||
{ cityCode: '440300', cityName: '深圳', count: 100 },
|
{ cityCode: '440300', cityName: '深圳', count: 100 },
|
||||||
{ cityCode: '330100', cityName: '杭州', count: 300 },
|
{ cityCode: '330100', cityName: '杭州', count: 750 },
|
||||||
{ cityCode: '110100', cityName: '北京', count: 100 },
|
{ cityCode: '110100', cityName: '北京', count: 150 },
|
||||||
{ cityCode: '510100', cityName: '成都', count: 50 },
|
{ cityCode: '510100', cityName: '成都', count: 100 },
|
||||||
|
{ cityCode: '500100', cityName: '重庆', count: 50 },
|
||||||
{ cityCode: '430100', cityName: '长沙', count: 50 },
|
{ cityCode: '430100', cityName: '长沙', count: 50 },
|
||||||
{ cityCode: '350200', cityName: '厦门', count: 50 },
|
{ cityCode: '350200', cityName: '厦门', count: 50 },
|
||||||
{ cityCode: '310100', cityName: '上海', count: 100 },
|
{ cityCode: '310100', cityName: '上海', count: 150 },
|
||||||
{ cityCode: '420100', cityName: '武汉', count: 50 },
|
{ cityCode: '420100', cityName: '武汉', count: 80 },
|
||||||
{ cityCode: '610100', cityName: '西安', count: 50 },
|
{ cityCode: '610100', cityName: '西安', count: 60 },
|
||||||
{ cityCode: '410100', cityName: '郑州', count: 100 },
|
{ cityCode: '410100', cityName: '郑州', count: 150 },
|
||||||
].sort((a, b) => b.count - a.count);
|
].sort((a, b) => b.count - a.count);
|
||||||
const MIN_GROUP_SIZE = 20;
|
const MIN_GROUP_SIZE = 20;
|
||||||
const GROUP_OPTIONS = [
|
const GROUP_OPTIONS = [
|
||||||
{ value: MIN_GROUP_SIZE, productSpecId: ProductSpecId.GroupBatchPublish20, label: '20', price: 18 },
|
{ value: MIN_GROUP_SIZE, productSpecId: ProductSpecId.GroupBatchPublish20, label: '20', price: 18 },
|
||||||
{ value: 50, productSpecId: ProductSpecId.GroupBatchPublish50, label: '50', price: 40 },
|
{ value: 50, productSpecId: ProductSpecId.GroupBatchPublish50, label: '50', price: 40 },
|
||||||
|
{ value: 60, productSpecId: ProductSpecId.GroupBatchPublish60, label: '60', price: 48 },
|
||||||
|
{ value: 80, productSpecId: ProductSpecId.GroupBatchPublish80, label: '80', price: 58 },
|
||||||
{ value: 100, productSpecId: ProductSpecId.GroupBatchPublish100, label: '100', price: 68 },
|
{ value: 100, productSpecId: ProductSpecId.GroupBatchPublish100, label: '100', price: 68 },
|
||||||
|
{ value: 150, productSpecId: ProductSpecId.GroupBatchPublish150, label: '150', price: 98 },
|
||||||
{ value: 300, productSpecId: ProductSpecId.GroupBatchPublish300, label: '300', price: 128 },
|
{ value: 300, productSpecId: ProductSpecId.GroupBatchPublish300, label: '300', price: 128 },
|
||||||
{ value: 500, productSpecId: ProductSpecId.GroupBatchPublish500, label: '500', price: 188 },
|
{ value: 500, productSpecId: ProductSpecId.GroupBatchPublish500, label: '500', price: 168 },
|
||||||
|
{ value: 750, productSpecId: ProductSpecId.GroupBatchPublish750, label: '750', price: 188 },
|
||||||
|
{ value: 800, productSpecId: ProductSpecId.GroupBatchPublish800, label: '800', price: 198 },
|
||||||
{ value: 1000, productSpecId: ProductSpecId.GroupBatchPublish1000, label: '1000', price: 288 },
|
{ value: 1000, productSpecId: ProductSpecId.GroupBatchPublish1000, label: '1000', price: 288 },
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -139,7 +146,7 @@ export default function UserBatchPublish() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
const cOptions: CityOption[] = cityValues.map(value => ({ value, label: value.cityName }));
|
const cOptions: CityOption[] = cityValues.map(value => ({ value, label: value.cityName }));
|
||||||
const initCity = cOptions[0].value;
|
const initCity = (cOptions.find(o => o.label === '重庆') || cOptions[0]).value;
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setCity(initCity);
|
setCity(initCity);
|
||||||
@ -156,7 +163,7 @@ export default function UserBatchPublish() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<Image mode="widthFix" className={`${PREFIX}__header-image`} src="https://neighbourhood.cn/pubJob.png" />
|
{/*<Image mode="widthFix" className={`${PREFIX}__header-image`} src="https://neighbourhood.cn/pubJob.png" />*/}
|
||||||
<div className={`${PREFIX}__title`}>请选择城市</div>
|
<div className={`${PREFIX}__title`}>请选择城市</div>
|
||||||
<Cell isLink align="center" className={`${PREFIX}__cell`} title={city?.cityName} onClick={handleClickCity} />
|
<Cell isLink align="center" className={`${PREFIX}__cell`} title={city?.cityName} onClick={handleClickCity} />
|
||||||
<div className={`${PREFIX}__title`}>可购买群数</div>
|
<div className={`${PREFIX}__title`}>可购买群数</div>
|
||||||
|
|||||||
@ -24,6 +24,10 @@ export enum EventName {
|
|||||||
SELECT_MY_PUBLISH_JOB = 'select_my_publish_job',
|
SELECT_MY_PUBLISH_JOB = 'select_my_publish_job',
|
||||||
EXIT_CHAT_PAGE = 'exit_chat_page',
|
EXIT_CHAT_PAGE = 'exit_chat_page',
|
||||||
VIEW_MATERIAL_SUCCESS = 'view_material_success',
|
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 {
|
export enum OpenSource {
|
||||||
@ -74,6 +78,8 @@ export enum PageUrl {
|
|||||||
PrivacyWebview = 'pages/privacy-webview/index',
|
PrivacyWebview = 'pages/privacy-webview/index',
|
||||||
Partner = 'pages/partner/index',
|
Partner = 'pages/partner/index',
|
||||||
WithdrawRecord = 'pages/withdraw-record/index',
|
WithdrawRecord = 'pages/withdraw-record/index',
|
||||||
|
GroupDelegatePublish = 'pages/group-delegate-publish/index',
|
||||||
|
PartnerShare = 'pages/partner-share/index',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PluginUrl {
|
export enum PluginUrl {
|
||||||
|
|||||||
@ -12,4 +12,8 @@ export enum CacheKey {
|
|||||||
INVITE_CODE = '__invite_code__',
|
INVITE_CODE = '__invite_code__',
|
||||||
AGREEMENT_SIGNED = '__agreement_signed__',
|
AGREEMENT_SIGNED = '__agreement_signed__',
|
||||||
CITY_CODES = '__city_codes__',
|
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__',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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 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 const FULL_PRICE_OPTIONS = FULL_EMPLOY_SALARY_OPTIONS.filter(o => !!o.value);
|
||||||
|
|
||||||
|
export enum GET_CONTACT_TYPE {
|
||||||
|
SHARE = 'share',
|
||||||
|
VIP = 'vip',
|
||||||
|
VIDEO = 'video',
|
||||||
|
}
|
||||||
|
|||||||
@ -27,14 +27,20 @@ export enum ProductSpecId {
|
|||||||
AddGroup2 = 'ADDGROUP_2',
|
AddGroup2 = 'ADDGROUP_2',
|
||||||
AddGroup3 = 'ADDGROUP_3',
|
AddGroup3 = 'ADDGROUP_3',
|
||||||
BossVip = 'BOSSVIP',
|
BossVip = 'BOSSVIP',
|
||||||
|
DaylyVIP = 'VIP_D',
|
||||||
WeeklyVIP = 'VIP_W',
|
WeeklyVIP = 'VIP_W',
|
||||||
MonthlyVIP = 'VIP_M', // 30 每天十次
|
MonthlyVIP = 'VIP_M', // 30 每天十次
|
||||||
NewMonthlyVIP = 'VIP_M_NEW', // 18 每天五次
|
NewMonthlyVIP = 'VIP_M_NEW', // 18 每天五次
|
||||||
GroupBatchPublish20 = 'GROUP_BATCH_PUSH_20',
|
GroupBatchPublish20 = 'GROUP_BATCH_PUSH_20',
|
||||||
GroupBatchPublish50 = 'GROUP_BATCH_PUSH_50',
|
GroupBatchPublish50 = 'GROUP_BATCH_PUSH_50',
|
||||||
|
GroupBatchPublish60 = 'GROUP_BATCH_PUSH_60',
|
||||||
|
GroupBatchPublish80 = 'GROUP_BATCH_PUSH_80',
|
||||||
GroupBatchPublish100 = 'GROUP_BATCH_PUSH_100',
|
GroupBatchPublish100 = 'GROUP_BATCH_PUSH_100',
|
||||||
|
GroupBatchPublish150 = 'GROUP_BATCH_PUSH_150',
|
||||||
GroupBatchPublish300 = 'GROUP_BATCH_PUSH_300',
|
GroupBatchPublish300 = 'GROUP_BATCH_PUSH_300',
|
||||||
GroupBatchPublish500 = 'GROUP_BATCH_PUSH_500',
|
GroupBatchPublish500 = 'GROUP_BATCH_PUSH_500',
|
||||||
|
GroupBatchPublish750 = 'GROUP_BATCH_PUSH_750',
|
||||||
|
GroupBatchPublish800 = 'GROUP_BATCH_PUSH_800',
|
||||||
GroupBatchPublish1000 = 'GROUP_BATCH_PUSH_1000',
|
GroupBatchPublish1000 = 'GROUP_BATCH_PUSH_1000',
|
||||||
BOSS_PUB_JOB_1 = 'BOSS_PUB_JOB_1', // 旧版企业发通告会员
|
BOSS_PUB_JOB_1 = 'BOSS_PUB_JOB_1', // 旧版企业发通告会员
|
||||||
BOSS_VIP_NEW_1 = 'BOSS_VIP_NEW_1', // 新版企业发通告会员 - 周
|
BOSS_VIP_NEW_1 = 'BOSS_VIP_NEW_1', // 新版企业发通告会员 - 周
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
background: #0000005c;
|
background: #6D3DF5B2;
|
||||||
border-radius: 48px;
|
border-radius: 48px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,4 +232,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.join-group-hint {
|
||||||
|
margin: 24px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import { navigateTo } from '@/utils/route';
|
|||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
import onChangeEventDetail = SwiperProps.onChangeEventDetail;
|
import onChangeEventDetail = SwiperProps.onChangeEventDetail;
|
||||||
|
import { JoinGroupHint } from '@/components/join-group-hint';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
editable: boolean;
|
editable: boolean;
|
||||||
@ -207,6 +208,7 @@ export default function ProfileViewFragment(props: IProps) {
|
|||||||
>{`${coverIndex + 1}/${profile.materialVideoInfoList.length}`}</div>
|
>{`${coverIndex + 1}/${profile.materialVideoInfoList.length}`}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{!editable && <JoinGroupHint />}
|
||||||
<div className={`${PREFIX}__body`}>
|
<div className={`${PREFIX}__body`}>
|
||||||
<div className={`${PREFIX}__basic-info`}>
|
<div className={`${PREFIX}__basic-info`}>
|
||||||
<div className={`${PREFIX}__basic-info__name-container`}>
|
<div className={`${PREFIX}__basic-info__name-container`}>
|
||||||
@ -228,7 +230,9 @@ export default function ProfileViewFragment(props: IProps) {
|
|||||||
{index ? (
|
{index ? (
|
||||||
<div className={`${PREFIX}__info-group__header__title`}>{data.title}</div>
|
<div className={`${PREFIX}__info-group__header__title`}>{data.title}</div>
|
||||||
) : (
|
) : (
|
||||||
<DevDiv className={`${PREFIX}__info-group__header__title`} OnDev={onDev}>{data.title}</DevDiv>
|
<DevDiv className={`${PREFIX}__info-group__header__title`} OnDev={onDev}>
|
||||||
|
{data.title}
|
||||||
|
</DevDiv>
|
||||||
)}
|
)}
|
||||||
{editable && (
|
{editable && (
|
||||||
<div className={`${PREFIX}__info-group__header__edit`} onClick={() => handleEditGroupItem(data.type)}>
|
<div className={`${PREFIX}__info-group__header__edit`} onClick={() => handleEditGroupItem(data.type)}>
|
||||||
|
|||||||
@ -35,7 +35,7 @@ const AnchorTabs: TabItemType[] = [
|
|||||||
{
|
{
|
||||||
type: PageType.GroupV2,
|
type: PageType.GroupV2,
|
||||||
pagePath: PageUrl.GroupV2,
|
pagePath: PageUrl.GroupV2,
|
||||||
text: '通告群',
|
text: '主播群',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ const CompanyTabs: TabItemType[] = [
|
|||||||
{
|
{
|
||||||
type: PageType.BatchPublish,
|
type: PageType.BatchPublish,
|
||||||
pagePath: PageUrl.UserBatchPublish,
|
pagePath: PageUrl.UserBatchPublish,
|
||||||
text: '代招代发',
|
text: '免费招',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -97,6 +97,8 @@ export const APP_CONFIG: AppConfigType = {
|
|||||||
PageUrl.PrivacyWebview,
|
PageUrl.PrivacyWebview,
|
||||||
PageUrl.Partner,
|
PageUrl.Partner,
|
||||||
PageUrl.WithdrawRecord,
|
PageUrl.WithdrawRecord,
|
||||||
|
PageUrl.GroupDelegatePublish,
|
||||||
|
PageUrl.PartnerShare,
|
||||||
// PageUrl.DevDebug,
|
// PageUrl.DevDebug,
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
|
|||||||
13
src/hooks/use-previous.ts
Normal file
13
src/hooks/use-previous.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
|
function usePrevious<T>(value: T) {
|
||||||
|
const ref = useRef<T>();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
ref.current = value;
|
||||||
|
}, [value]);
|
||||||
|
|
||||||
|
return ref.current;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default usePrevious;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { Image } from '@tarojs/components';
|
import { Image } from '@tarojs/components';
|
||||||
import Taro, { NodesRef, useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
import Taro, { NodesRef, useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { ArrowUp, ArrowDown } from '@taroify/icons';
|
import { ArrowDown, ArrowUp } from '@taroify/icons';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { isEqual } from 'lodash-es';
|
import { isEqual } from 'lodash-es';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
@ -14,7 +14,7 @@ import Overlay from '@/components/overlay';
|
|||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
import PartnerBanner from '@/components/partner-banner';
|
import PartnerBanner from '@/components/partner-banner';
|
||||||
import SwitchBar from '@/components/switch-bar';
|
import SwitchBar from '@/components/switch-bar';
|
||||||
import { APP_TAB_BAR_ID, EventName, OpenSource, PageUrl } from '@/constants/app';
|
import { APP_TAB_BAR_ID, EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { EmployType, JobManageStatus } from '@/constants/job';
|
import { EmployType, JobManageStatus } from '@/constants/job';
|
||||||
import { ALL_ANCHOR_SORT_TYPES, ANCHOR_SORT_TYPE_TITLE_MAP, AnchorSortType } from '@/constants/material';
|
import { ALL_ANCHOR_SORT_TYPES, ANCHOR_SORT_TYPE_TITLE_MAP, AnchorSortType } from '@/constants/material';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
@ -23,6 +23,7 @@ import useLocation from '@/hooks/use-location';
|
|||||||
import { JobManageInfo } from '@/types/job';
|
import { JobManageInfo } from '@/types/job';
|
||||||
import { Coordinate } from '@/types/location';
|
import { Coordinate } from '@/types/location';
|
||||||
import { IAnchorFilters } from '@/types/material';
|
import { IAnchorFilters } from '@/types/material';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
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';
|
||||||
@ -165,8 +166,11 @@ export default function AnchorPage() {
|
|||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
|
switchRoleType(RoleType.Company);
|
||||||
|
|
||||||
const query = getPageQuery();
|
const query = getPageQuery();
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
getInviteCodeFromQueryAndUpdate(query);
|
||||||
|
console.log('哈哈哈 useLoad');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
||||||
@ -186,13 +190,13 @@ export default function AnchorPage() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return getCommonShareMessage(true, inviteCode, '数万名优质主播等你来挑');
|
return getCommonShareMessage({ inviteCode, title: '数万名优质主播等你来挑', path: PageUrl.Anchor });
|
||||||
});
|
});
|
||||||
|
|
||||||
useDidShow(() => requestUnreadMessageCount());
|
useDidShow(() => requestUnreadMessageCount());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.Anchor}>
|
||||||
{!!loading && <PageLoading className={`${PREFIX}__loading`} />}
|
{!!loading && <PageLoading className={`${PREFIX}__loading`} />}
|
||||||
<CustomNavigationBar className={`${PREFIX}__navigation-bar`}>
|
<CustomNavigationBar className={`${PREFIX}__navigation-bar`}>
|
||||||
{selectJob && <SwitchBar title={selectJob.title.substring(0, 4)} onClick={handleClickSwitch} />}
|
{selectJob && <SwitchBar title={selectJob.title.substring(0, 4)} onClick={handleClickSwitch} />}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { Button } from '@taroify/core';
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageType, PageUrl } from '@/constants/app';
|
||||||
import { copy, logWithPrefix } from '@/utils/common';
|
import { copy, logWithPrefix } from '@/utils/common';
|
||||||
import { navigateTo } from '@/utils/route';
|
import { navigateTo } from '@/utils/route';
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ export default function DevDebug() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.DEV}>
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
{/* <div>{`最近一次的订单 ID: ${lastOrderNo}`}</div>
|
{/* <div>{`最近一次的订单 ID: ${lastOrderNo}`}</div>
|
||||||
<Button onClick={() => handleCreateOrder(OrderType.Group)} style={marginTopStyle} color="primary">
|
<Button onClick={() => handleCreateOrder(OrderType.Group)} style={marginTopStyle} color="primary">
|
||||||
|
|||||||
3
src/pages/group-delegate-publish/index.config.ts
Normal file
3
src/pages/group-delegate-publish/index.config.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '群代发',
|
||||||
|
});
|
||||||
0
src/pages/group-delegate-publish/index.less
Normal file
0
src/pages/group-delegate-publish/index.less
Normal file
12
src/pages/group-delegate-publish/index.tsx
Normal file
12
src/pages/group-delegate-publish/index.tsx
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import UserBatchPublish from '@/components/user-batch-publish';
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const PREFIX = 'group-delegate-publish';
|
||||||
|
|
||||||
|
export default function Partner() {
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<UserBatchPublish />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -4,8 +4,10 @@ import { useCallback } from 'react';
|
|||||||
|
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import SearchCity from '@/components/search-city';
|
import SearchCity from '@/components/search-city';
|
||||||
|
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { GROUPS } from '@/constants/group';
|
import { GROUPS } from '@/constants/group';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
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 { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||||
@ -20,11 +22,15 @@ export default function GroupV2() {
|
|||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
|
|
||||||
useLoad(() => {
|
useLoad(() => {
|
||||||
|
switchRoleType(RoleType.Anchor);
|
||||||
|
|
||||||
const query = getPageQuery();
|
const query = getPageQuery();
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
getInviteCodeFromQueryAndUpdate(query);
|
||||||
});
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => getCommonShareMessage(true, inviteCode));
|
useShareAppMessage(() =>
|
||||||
|
getCommonShareMessage({ inviteCode, title: '邀请你加入本地主播求职招聘群', path: PageUrl.GroupV2 })
|
||||||
|
);
|
||||||
|
|
||||||
const handleSelectCity = useCallback(cityCode => {
|
const handleSelectCity = useCallback(cityCode => {
|
||||||
if (!checkCityCode(cityCode)) {
|
if (!checkCityCode(cityCode)) {
|
||||||
@ -37,14 +43,14 @@ export default function GroupV2() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.GroupV2}>
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<SearchCity
|
<SearchCity
|
||||||
onSelectCity={handleSelectCity}
|
onSelectCity={handleSelectCity}
|
||||||
currentCity={getCurrentCityCode()}
|
currentCity={getCurrentCityCode()}
|
||||||
forGroup
|
forGroup
|
||||||
offset={72}
|
offset={72}
|
||||||
banner="点击城市加入本地通告群,高薪工作早知道"
|
banner="点击城市加入本地主播招聘群,高薪职位早知道"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</HomePage>
|
</HomePage>
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { Tabs } from '@taroify/core';
|
|||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
|
import { PageType } from '@/constants/app';
|
||||||
import { GroupType, GROUP_PAGE_TABS } from '@/constants/group';
|
import { GroupType, GROUP_PAGE_TABS } from '@/constants/group';
|
||||||
import GroupFragment from '@/fragments/group';
|
import GroupFragment from '@/fragments/group';
|
||||||
import useNavigation from '@/hooks/use-navigation';
|
import useNavigation from '@/hooks/use-navigation';
|
||||||
@ -22,7 +23,7 @@ export default function Group() {
|
|||||||
useShareAppMessage(() => getCommonShareMessage());
|
useShareAppMessage(() => getCommonShareMessage());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.Group}>
|
||||||
<Tabs
|
<Tabs
|
||||||
swipeable
|
swipeable
|
||||||
value={tabType}
|
value={tabType}
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
import { Map, MapProps, Text, Image, Button } from '@tarojs/components';
|
import { Map, MapProps, Text, Image, Button } from '@tarojs/components';
|
||||||
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
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 { CertificationStatusIcon } from '@/components/certification-status';
|
||||||
import CommonDialog from '@/components/common-dialog';
|
import CommonDialog from '@/components/common-dialog';
|
||||||
import DevDiv from '@/components/dev-div';
|
import DevDiv from '@/components/dev-div';
|
||||||
import JobRecommendList from '@/components/job-recommend-list';
|
import JobRecommendList from '@/components/job-recommend-list';
|
||||||
|
import { JoinGroupHint } from '@/components/join-group-hint';
|
||||||
import LoginButton from '@/components/login-button';
|
import LoginButton from '@/components/login-button';
|
||||||
import MaterialGuide from '@/components/material-guide';
|
import MaterialGuide from '@/components/material-guide';
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
@ -22,6 +23,7 @@ import { RESPONSE_ERROR_CODE } from '@/http/constant';
|
|||||||
import { HttpError } from '@/http/error';
|
import { HttpError } from '@/http/error';
|
||||||
import { JobDetails } from '@/types/job';
|
import { JobDetails } from '@/types/job';
|
||||||
import { IMaterialMessage } from '@/types/message';
|
import { IMaterialMessage } from '@/types/message';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { copy, logWithPrefix } from '@/utils/common';
|
import { copy, logWithPrefix } from '@/utils/common';
|
||||||
import { collectEvent, reportEvent } from '@/utils/event';
|
import { collectEvent, reportEvent } from '@/utils/event';
|
||||||
import { getJobTitle, getJobSalary, postPublishJob, requestJobDetail } from '@/utils/job';
|
import { getJobTitle, getJobSalary, postPublishJob, requestJobDetail } from '@/utils/job';
|
||||||
@ -181,6 +183,7 @@ export default function JobDetail() {
|
|||||||
const roleType = useRoleType();
|
const roleType = useRoleType();
|
||||||
const userInfo = useUserInfo();
|
const userInfo = useUserInfo();
|
||||||
const [data, setData] = useState<JobDetails | null>(null);
|
const [data, setData] = useState<JobDetails | null>(null);
|
||||||
|
const videoRef = useRef<Taro.RewardedVideoAd | null>(null);
|
||||||
const isOwner = roleType === RoleType.Company && userInfo.userId === data?.userId;
|
const isOwner = roleType === RoleType.Company && userInfo.userId === data?.userId;
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
|
|
||||||
@ -217,7 +220,59 @@ 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 () => {
|
useLoad(async () => {
|
||||||
|
switchRoleType(RoleType.Anchor);
|
||||||
|
|
||||||
const query = getPageQuery<Pick<JobDetails, 'id'> & { c: string }>();
|
const query = getPageQuery<Pick<JobDetails, 'id'> & { c: string }>();
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
getInviteCodeFromQueryAndUpdate(query);
|
||||||
const jobId = query?.id;
|
const jobId = query?.id;
|
||||||
@ -235,8 +290,9 @@ export default function JobDetail() {
|
|||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return getCommonShareMessage(true, inviteCode);
|
return getCommonShareMessage({ inviteCode });
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: getJobTitle(data) || '',
|
title: getJobTitle(data) || '',
|
||||||
path: getJumpUrl(PageUrl.JobDetail, { id: data.id, share: true, c: inviteCode }),
|
path: getJumpUrl(PageUrl.JobDetail, { id: data.id, share: true, c: inviteCode }),
|
||||||
@ -278,6 +334,8 @@ export default function JobDetail() {
|
|||||||
{data.companyName && <div className={`${PREFIX}__company`}>{`公司:${data.companyName}`}</div>}
|
{data.companyName && <div className={`${PREFIX}__company`}>{`公司:${data.companyName}`}</div>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{!isOwner && <JoinGroupHint />}
|
||||||
|
|
||||||
<div className={`${PREFIX}__content`}>
|
<div className={`${PREFIX}__content`}>
|
||||||
<div className={`${PREFIX}__content-title`}>职位描述</div>
|
<div className={`${PREFIX}__content-title`}>职位描述</div>
|
||||||
<div className={`${PREFIX}__tags`}>
|
<div className={`${PREFIX}__tags`}>
|
||||||
|
|||||||
@ -6,13 +6,14 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
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, PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { EmployType, JOB_PAGE_TABS, SortType } from '@/constants/job';
|
import { EmployType, JOB_PAGE_TABS, SortType } from '@/constants/job';
|
||||||
import JobFragment from '@/fragments/job/base';
|
import JobFragment from '@/fragments/job/base';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import useLocation from '@/hooks/use-location';
|
import useLocation from '@/hooks/use-location';
|
||||||
import useNavigation from '@/hooks/use-navigation';
|
import useNavigation from '@/hooks/use-navigation';
|
||||||
import { Coordinate } from '@/types/location';
|
import { Coordinate } from '@/types/location';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
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';
|
||||||
@ -96,6 +97,7 @@ export default function Job() {
|
|||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
|
switchRoleType(RoleType.Anchor);
|
||||||
const query = getPageQuery<{ sortType: SortType; c?: string; scene?: string }>();
|
const query = getPageQuery<{ sortType: SortType; c?: string; scene?: string }>();
|
||||||
const type = query.sortType;
|
const type = query.sortType;
|
||||||
if (type === SortType.CREATE_TIME) {
|
if (type === SortType.CREATE_TIME) {
|
||||||
@ -121,11 +123,11 @@ export default function Job() {
|
|||||||
path: getJumpUrl(PageUrl.Job, { sortType, c: inviteCode }),
|
path: getJumpUrl(PageUrl.Job, { sortType, c: inviteCode }),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return getCommonShareMessage(true, inviteCode);
|
return getCommonShareMessage({ inviteCode, path: PageUrl.Job });
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.JOB}>
|
||||||
<Tabs
|
<Tabs
|
||||||
swipeable
|
swipeable
|
||||||
value={tabType}
|
value={tabType}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import useLocation from '@/hooks/use-location';
|
|||||||
import { MaterialProfile } from '@/types/material';
|
import { MaterialProfile } from '@/types/material';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { collectEvent } from '@/utils/event';
|
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 { updateProfile, subscribeMaterialMessage } from '@/utils/material';
|
||||||
import { navigateBack } from '@/utils/route';
|
import { navigateBack } from '@/utils/route';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
@ -110,6 +110,7 @@ export default function MaterialCreateProfile() {
|
|||||||
// 发起订阅不能在异步任务中,保证是第一个
|
// 发起订阅不能在异步任务中,保证是第一个
|
||||||
await Promise.all([subscribeMaterialMessage(), updateProfile(data)]);
|
await Promise.all([subscribeMaterialMessage(), updateProfile(data)]);
|
||||||
}
|
}
|
||||||
|
setSkipPrejobAction();
|
||||||
Taro.eventCenter.trigger(EventName.CREATE_PROFILE);
|
Taro.eventCenter.trigger(EventName.CREATE_PROFILE);
|
||||||
nextType ? setGroupType(nextType) : navigateBack(2);
|
nextType ? setGroupType(nextType) : navigateBack(2);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|||||||
import MaterialManagePopup from '@/components/material-manage-popup';
|
import MaterialManagePopup from '@/components/material-manage-popup';
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
import { EventName } from '@/constants/app';
|
import { EventName, RoleType } from '@/constants/app';
|
||||||
import { CollectEventName } from '@/constants/event';
|
import { CollectEventName } from '@/constants/event';
|
||||||
import { MaterialStatus } from '@/constants/material';
|
import { MaterialStatus } from '@/constants/material';
|
||||||
import ProfileViewFragment from '@/fragments/profile/view';
|
import ProfileViewFragment from '@/fragments/profile/view';
|
||||||
@ -17,6 +17,7 @@ import { getCommonShareMessage } from '@/utils/share';
|
|||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
|
|
||||||
const PREFIX = 'page-material-profile';
|
const PREFIX = 'page-material-profile';
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ export default function MaterialProfilePage() {
|
|||||||
|
|
||||||
useShareAppMessage(async () => {
|
useShareAppMessage(async () => {
|
||||||
const shareMessage = await getMaterialShareMessage(profile, false);
|
const shareMessage = await getMaterialShareMessage(profile, false);
|
||||||
return shareMessage || getCommonShareMessage(false);
|
return shareMessage || getCommonShareMessage({ useCapture: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|||||||
import CommonDialog from '@/components/common-dialog';
|
import CommonDialog from '@/components/common-dialog';
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
import { EventName, OpenSource, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { CollectEventName } from '@/constants/event';
|
import { CollectEventName } from '@/constants/event';
|
||||||
import { MaterialViewSource } from '@/constants/material';
|
import { MaterialViewSource } from '@/constants/material';
|
||||||
import ProfileViewFragment from '@/fragments/profile/view';
|
import ProfileViewFragment from '@/fragments/profile/view';
|
||||||
@ -16,6 +16,7 @@ import { HttpError } from '@/http/error';
|
|||||||
import { JobManageInfo } from '@/types/job';
|
import { JobManageInfo } from '@/types/job';
|
||||||
import { MaterialProfile } from '@/types/material';
|
import { MaterialProfile } from '@/types/material';
|
||||||
import { IJobMessage } from '@/types/message';
|
import { IJobMessage } from '@/types/message';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { copy } from '@/utils/common';
|
import { copy } from '@/utils/common';
|
||||||
import { collectEvent } from '@/utils/event';
|
import { collectEvent } from '@/utils/event';
|
||||||
import { requestHasPublishedJob, requestJobDetail } from '@/utils/job';
|
import { requestHasPublishedJob, requestJobDetail } from '@/utils/job';
|
||||||
@ -141,6 +142,8 @@ export default function MaterialViewPage() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
|
switchRoleType(RoleType.Company);
|
||||||
|
|
||||||
const context = getPageQuery<IViewContext | IShareContext>();
|
const context = getPageQuery<IViewContext | IShareContext>();
|
||||||
getInviteCodeFromQueryAndUpdate(context as BL.Anything);
|
getInviteCodeFromQueryAndUpdate(context as BL.Anything);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -175,6 +175,7 @@ export default function MessageChat() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleClickReject = useCallback(async () => {
|
const handleClickReject = useCallback(async () => {
|
||||||
|
await postAddMessageTimes('message_chat_page');
|
||||||
if (!chat || !receiver || reject) {
|
if (!chat || !receiver || reject) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,8 +7,9 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import MessageCard from '@/components/message-card';
|
import MessageCard from '@/components/message-card';
|
||||||
import { MessageHelpDialog, MessageNoTimesDialog } from '@/components/message-dialog';
|
import { MessageHelpDialog, MessageNoTimesDialog } from '@/components/message-dialog';
|
||||||
import { APP_TAB_BAR_ID, EventName } from '@/constants/app';
|
import { APP_TAB_BAR_ID, EventName, PageType } from '@/constants/app';
|
||||||
import { REFRESH_CHAT_LIST_TIME } from '@/constants/message';
|
import { REFRESH_CHAT_LIST_TIME } from '@/constants/message';
|
||||||
|
import { MessageSubscribeIds, SubscribeTempId } from '@/constants/subscribe';
|
||||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||||
import useRoleType from '@/hooks/user-role-type';
|
import useRoleType from '@/hooks/user-role-type';
|
||||||
import { MainMessage } from '@/types/message';
|
import { MainMessage } from '@/types/message';
|
||||||
@ -20,7 +21,10 @@ import {
|
|||||||
requestUnreadMessageCount,
|
requestUnreadMessageCount,
|
||||||
} from '@/utils/message';
|
} from '@/utils/message';
|
||||||
|
|
||||||
|
import { isSubscribeRefused, postSubscribe } from '@/utils/subscribe';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
import { collectEvent } from '@/utils/event';
|
||||||
|
import { CollectEventName } from '@/constants/event';
|
||||||
|
|
||||||
const PREFIX = 'page-message';
|
const PREFIX = 'page-message';
|
||||||
const HEADER_CLASS = `${PREFIX}__header`;
|
const HEADER_CLASS = `${PREFIX}__header`;
|
||||||
@ -58,12 +62,52 @@ export default function Message() {
|
|||||||
|
|
||||||
const handleClickHelp = useCallback(() => setShowHelp(true), []);
|
const handleClickHelp = useCallback(() => setShowHelp(true), []);
|
||||||
|
|
||||||
const handleClickAddMessageTimes = useCallback(async () => {
|
const addMessageTimes = useCallback(async () => {
|
||||||
await postAddMessageTimes('message_page');
|
await postAddMessageTimes('message_page');
|
||||||
const remain = await requestRemainPushTime();
|
const remain = await requestRemainPushTime();
|
||||||
setTimes(remain);
|
setTimes(remain);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleClickAddMessageTimes = useCallback(async () => {
|
||||||
|
const [hasRefused, acceptIds] = await isSubscribeRefused(MessageSubscribeIds);
|
||||||
|
if (hasRefused) {
|
||||||
|
await Taro.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content:
|
||||||
|
'您未订阅消息提醒,不能及时获得招聘消息,请前往“设置”,将“新聊天消息”、“未读消息”“面试邀请”均设置为“接收”',
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: '打开设置',
|
||||||
|
});
|
||||||
|
await Taro.openSetting({
|
||||||
|
withSubscriptions: true,
|
||||||
|
});
|
||||||
|
const { subscriptionsSetting: { mainSwitch, itemSettings = {} } = {} } = await Taro.getSetting({
|
||||||
|
withSubscriptions: true,
|
||||||
|
});
|
||||||
|
console.log('subscriptionsSetting:', mainSwitch, itemSettings);
|
||||||
|
const successIds = mainSwitch
|
||||||
|
? MessageSubscribeIds.reduce<SubscribeTempId[]>((acc, id) => {
|
||||||
|
if ((!itemSettings[id] || itemSettings[id] === 'accept') && !acceptIds.includes(id)) {
|
||||||
|
acc.push(id);
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, [])
|
||||||
|
: [];
|
||||||
|
if (!successIds.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log('successIds:', successIds);
|
||||||
|
collectEvent(CollectEventName.MESSAGE_DEV_LOG, {
|
||||||
|
action: 'subscribe_new_message_reminder',
|
||||||
|
source: 'message_page',
|
||||||
|
successIds,
|
||||||
|
});
|
||||||
|
await postSubscribe(MessageSubscribeIds, successIds);
|
||||||
|
} else {
|
||||||
|
await addMessageTimes();
|
||||||
|
}
|
||||||
|
}, [addMessageTimes]);
|
||||||
|
|
||||||
useDidHide(() => (pageVisibleRef.current = false));
|
useDidHide(() => (pageVisibleRef.current = false));
|
||||||
|
|
||||||
useDidShow(() => {
|
useDidShow(() => {
|
||||||
@ -101,7 +145,7 @@ export default function Message() {
|
|||||||
}, [roleType]);
|
}, [roleType]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.Message}>
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<div className={HEADER_CLASS}>
|
<div className={HEADER_CLASS}>
|
||||||
<div className={`${HEADER_CLASS}__times`}>
|
<div className={`${HEADER_CLASS}__times`}>
|
||||||
|
|||||||
3
src/pages/partner-share/index.config.ts
Normal file
3
src/pages/partner-share/index.config.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '分享',
|
||||||
|
});
|
||||||
57
src/pages/partner-share/index.less
Normal file
57
src/pages/partner-share/index.less
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
61
src/pages/partner-share/index.tsx
Normal file
61
src/pages/partner-share/index.tsx
Normal file
@ -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 (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<div className={`${PREFIX}__header`}>
|
||||||
|
<Image
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/money.png"
|
||||||
|
mode="aspectFit"
|
||||||
|
className={`${PREFIX}__money`}
|
||||||
|
/>
|
||||||
|
<div>分享可获3重收益</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div className={`${PREFIX}__item`}>
|
||||||
|
<Image src="https://publiccdn.neighbourhood.com.cn/img/01.svg" mode="aspectFit" className={`${PREFIX}__no`} />
|
||||||
|
<div>
|
||||||
|
直接获得被邀请人支付金额<div className="highlight">20%</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__item`}>
|
||||||
|
<Image src="https://publiccdn.neighbourhood.com.cn/img/02.svg" mode="aspectFit" className={`${PREFIX}__no`} />
|
||||||
|
<div>邀请的主播被企业开聊,即可获得分润</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__item`}>
|
||||||
|
<Image src="https://publiccdn.neighbourhood.com.cn/img/03.svg" mode="aspectFit" className={`${PREFIX}__no`} />
|
||||||
|
<div>
|
||||||
|
获得被邀请人再邀请他人收益的<div className="highlight">5%</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Button className={`${PREFIX}__btn`} openType="share">
|
||||||
|
立即分享
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -20,7 +20,7 @@ export default function Partner() {
|
|||||||
};
|
};
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
console.log('Partner inviteCode', inviteCode);
|
console.log('Partner inviteCode', inviteCode);
|
||||||
return getCommonShareMessage(false, inviteCode);
|
return getCommonShareMessage({ useCapture: false, inviteCode });
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -20,6 +20,81 @@
|
|||||||
> .taroify-tabs__content {
|
> .taroify-tabs__content {
|
||||||
padding-top: var(--tabs-wrap-height);
|
padding-top: var(--tabs-wrap-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.taroify-tabs__nav .taroify-tabs__tab:nth-child(2) .taroify-badge-wrapper {
|
||||||
|
left: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__star {
|
||||||
|
width: 33px;
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
&__header-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 120px;
|
||||||
|
}
|
||||||
|
&__delegate {
|
||||||
|
& {
|
||||||
|
padding: 24px;
|
||||||
|
padding-bottom: calc(120px + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
&-fix {
|
||||||
|
width: 100%;
|
||||||
|
background: #f5f6fa;
|
||||||
|
padding-left: 24px;
|
||||||
|
padding-right: 24px;
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 110px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-bottom: calc(24px + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
&-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 298px;
|
||||||
|
}
|
||||||
|
&-card {
|
||||||
|
background: #fff;
|
||||||
|
padding: 24px;
|
||||||
|
border-radius: 24px;
|
||||||
|
&.image {
|
||||||
|
padding: 1px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-h5 {
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 32px;
|
||||||
|
color: @blColor;
|
||||||
|
padding-top: 40px;
|
||||||
|
padding-bottom: 24px;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-body {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 48px;
|
||||||
|
color: @blColorG2;
|
||||||
|
&.link {
|
||||||
|
margin-top: 16px;
|
||||||
|
color: @blHighlightColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-btn {
|
||||||
|
.button(@width: 100%; @height: 80px; @fontSize: 32px);
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__recruitment {
|
&__recruitment {
|
||||||
|
|||||||
@ -1,24 +1,40 @@
|
|||||||
import { useShareAppMessage } from '@tarojs/taro';
|
import { Image } from '@tarojs/components';
|
||||||
|
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { Button, Tabs } from '@taroify/core';
|
import { Button, Tabs } from '@taroify/core';
|
||||||
import { useCallback } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import SearchCity from '@/components/search-city';
|
import SearchCity from '@/components/search-city';
|
||||||
import UserBatchPublish from '@/components/user-batch-publish';
|
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { GROUPS } from '@/constants/group';
|
import { GROUPS } from '@/constants/group';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { getCurrentCityCode } from '@/utils/location';
|
import { getCurrentCityCode } from '@/utils/location';
|
||||||
|
import { getPageQuery, navigateTo } from '@/utils/route';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import { checkCityCode } from '@/utils/user';
|
import { checkCityCode } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
import { SortType } from '@/constants/job';
|
||||||
|
|
||||||
const PREFIX = 'page-biz-service';
|
const PREFIX = 'page-biz-service';
|
||||||
|
const EXAMPLE_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-example.png';
|
||||||
|
const COMMENT_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-comments.png';
|
||||||
export default function BizService() {
|
export default function BizService() {
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
|
const [value, setValue] = useState('0');
|
||||||
|
|
||||||
|
const handleClickDelegate = useCallback(() => {
|
||||||
|
navigateTo(PageUrl.GroupDelegatePublish);
|
||||||
|
}, []);
|
||||||
|
const handlePreview = (current: string) => {
|
||||||
|
Taro.previewImage({
|
||||||
|
current,
|
||||||
|
urls: [EXAMPLE_IMAGE, COMMENT_IMAGE],
|
||||||
|
});
|
||||||
|
};
|
||||||
const handleOpenService = useCallback(() => {
|
const handleOpenService = useCallback(() => {
|
||||||
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d');
|
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d');
|
||||||
}, []);
|
}, []);
|
||||||
@ -31,13 +47,70 @@ export default function BizService() {
|
|||||||
openCustomerServiceChat(group.serviceUrl);
|
openCustomerServiceChat(group.serviceUrl);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
useShareAppMessage(() => getCommonShareMessage(true, inviteCode));
|
const handleChange = useCallback(v => {
|
||||||
|
setValue(v);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useLoad(() => {
|
||||||
|
switchRoleType(RoleType.Company);
|
||||||
|
|
||||||
|
const query = getPageQuery<{ tab?: string }>();
|
||||||
|
if (query.tab) {
|
||||||
|
handleChange(query.tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
useShareAppMessage(() =>
|
||||||
|
getCommonShareMessage({
|
||||||
|
inviteCode,
|
||||||
|
path: PageUrl.UserBatchPublish,
|
||||||
|
title: '邀请你加入本地主播求职招聘群',
|
||||||
|
params: { tab: '1' },
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.BatchPublish}>
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<Tabs className={`${PREFIX}__tabs`} defaultValue={0}>
|
<Tabs className={`${PREFIX}__tabs`} value={value} onChange={handleChange}>
|
||||||
<Tabs.TabPane value={0} title="主播群">
|
<Tabs.TabPane value="0" title="群代发">
|
||||||
|
<div className={`${PREFIX}__delegate`}>
|
||||||
|
<Image
|
||||||
|
mode="widthFix"
|
||||||
|
className={`${PREFIX}__header-image`}
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/pub-job.png"
|
||||||
|
/>
|
||||||
|
<div className={`${PREFIX}__delegate-h5`}>服务说明</div>
|
||||||
|
<div className={`${PREFIX}__delegate-card`}>
|
||||||
|
<div className={`${PREFIX}__delegate-body`}>服务方式:帮您把招聘需求发到众多同城合作主播群</div>
|
||||||
|
<div className={`${PREFIX}__delegate-body`}>群发次数:每日1次,连发3天</div>
|
||||||
|
<div className={`${PREFIX}__delegate-body`}>内容要求:仅限带货主播招聘需求,其他不发</div>
|
||||||
|
<div className={`${PREFIX}__delegate-body`}>主播联系:内容中留招聘方联系方式,主播直接联系</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__delegate-h5`}>代发示例</div>
|
||||||
|
<div className={`${PREFIX}__delegate-card image`} onClick={() => handlePreview(EXAMPLE_IMAGE)}>
|
||||||
|
<Image className={`${PREFIX}__delegate-image`} src={EXAMPLE_IMAGE} mode="heightFix" />
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__delegate-h5`}>部分客户评价</div>
|
||||||
|
<div className={`${PREFIX}__delegate-card image`} onClick={() => handlePreview(COMMENT_IMAGE)}>
|
||||||
|
<Image className={`${PREFIX}__delegate-image`} src={COMMENT_IMAGE} mode="heightFix" />
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__delegate-fix`}>
|
||||||
|
<Button className={`${PREFIX}__delegate-btn`} onClick={handleClickDelegate}>
|
||||||
|
我要代发
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Tabs.TabPane>
|
||||||
|
<Tabs.TabPane
|
||||||
|
value="1"
|
||||||
|
title={
|
||||||
|
<>
|
||||||
|
免费招
|
||||||
|
<Image src={require('@/statics/svg/star.svg')} className={`${PREFIX}__star`} />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
>
|
||||||
<SearchCity
|
<SearchCity
|
||||||
onSelectCity={handleSelectCity}
|
onSelectCity={handleSelectCity}
|
||||||
currentCity={getCurrentCityCode()}
|
currentCity={getCurrentCityCode()}
|
||||||
@ -46,10 +119,7 @@ export default function BizService() {
|
|||||||
banner="点击城市名称,进本地通告群,免费招主播"
|
banner="点击城市名称,进本地通告群,免费招主播"
|
||||||
/>
|
/>
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane value={1} title="群代发">
|
<Tabs.TabPane value="2" title="代招">
|
||||||
<UserBatchPublish />
|
|
||||||
</Tabs.TabPane>
|
|
||||||
<Tabs.TabPane value={2} title="代招">
|
|
||||||
<div className={`${PREFIX}__recruitment`}>
|
<div className={`${PREFIX}__recruitment`}>
|
||||||
<div className={`${PREFIX}__recruitment-card`}>
|
<div className={`${PREFIX}__recruitment-card`}>
|
||||||
<div className={`${PREFIX}__recruitment-h5`}>服务城市</div>
|
<div className={`${PREFIX}__recruitment-h5`}>服务城市</div>
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import LoginButton from '@/components/login-button';
|
|||||||
import PartnerEntry from '@/components/partner-entry';
|
import PartnerEntry from '@/components/partner-entry';
|
||||||
import Slogan from '@/components/slogan';
|
import Slogan from '@/components/slogan';
|
||||||
import SwitchBar from '@/components/switch-bar';
|
import SwitchBar from '@/components/switch-bar';
|
||||||
import { RoleType, PageUrl } from '@/constants/app';
|
import { RoleType, PageUrl, PageType } from '@/constants/app';
|
||||||
import AnchorFragment from '@/fragments/user/anchor';
|
import AnchorFragment from '@/fragments/user/anchor';
|
||||||
import CompanyFragment from '@/fragments/user/company';
|
import CompanyFragment from '@/fragments/user/company';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
@ -38,10 +38,10 @@ export default function User() {
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
useShareAppMessage(() => getCommonShareMessage(false));
|
useShareAppMessage(() => getCommonShareMessage({ useCapture: false }));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.User}>
|
||||||
<CustomNavigationBar className={`${PREFIX}__navigation-bar`}>
|
<CustomNavigationBar className={`${PREFIX}__navigation-bar`}>
|
||||||
<SwitchBar title={roleType === RoleType.Anchor ? '切换为企业' : '切换为主播'} onClick={handleSwitchRoleType} />
|
<SwitchBar title={roleType === RoleType.Anchor ? '切换为企业' : '切换为主播'} onClick={handleSwitchRoleType} />
|
||||||
</CustomNavigationBar>
|
</CustomNavigationBar>
|
||||||
|
|||||||
@ -91,7 +91,7 @@ export default function WithdrawRecords() {
|
|||||||
refresh();
|
refresh();
|
||||||
}, []);
|
}, []);
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return getCommonShareMessage(false, inviteCode);
|
return getCommonShareMessage({ useCapture: false, inviteCode });
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
4
src/statics/svg/star.svg
Normal file
4
src/statics/svg/star.svg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<svg width="33" height="36" viewBox="0 0 33 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M8.57143 8.57143L12 0L15.4286 8.57143L24 12L15.4286 15.4286L12 24L8.57143 15.4286L0 12L8.57143 8.57143Z" fill="#FF5051"/>
|
||||||
|
<path opacity="0.24" d="M24.6429 27.6429L26.5 23L28.3571 27.6429L33 29.5L28.3571 31.3571L26.5 36L24.6429 31.3571L20 29.5L24.6429 27.6429Z" fill="#FF5051"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 390 B |
@ -37,12 +37,19 @@ export const switchDefaultTab = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const switchRoleType = async (appMode?: RoleType) => {
|
export const switchRoleType = async (appMode?: RoleType) => {
|
||||||
|
const curMode = getRoleType();
|
||||||
|
|
||||||
|
if (curMode && appMode === curMode) {
|
||||||
|
console.log('[utils:app] skip switch role because of role type is equal to that of local');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!appMode) {
|
if (!appMode) {
|
||||||
const curMode = getRoleType();
|
console.log('[utils:app] no app mode from arguments');
|
||||||
appMode = curMode === RoleType.Anchor ? RoleType.Company : RoleType.Anchor;
|
appMode = curMode === RoleType.Anchor ? RoleType.Company : RoleType.Anchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('switchRoleType', appMode);
|
console.log('[utils:app] switchRoleType', appMode);
|
||||||
try {
|
try {
|
||||||
await postSwitchRoleType(appMode);
|
await postSwitchRoleType(appMode);
|
||||||
store.dispatch(changeRoleType(appMode));
|
store.dispatch(changeRoleType(appMode));
|
||||||
|
|||||||
@ -4,12 +4,12 @@ export const isDev = () => process.env.NODE_ENV === 'development';
|
|||||||
// export const isDev = () => true;
|
// export const isDev = () => true;
|
||||||
|
|
||||||
export const isIPhone = (() => {
|
export const isIPhone = (() => {
|
||||||
const info = Taro.getSystemInfoSync();
|
const info = Taro.getDeviceInfo();
|
||||||
return info.platform === 'ios';
|
return info.platform === 'ios';
|
||||||
})();
|
})();
|
||||||
|
|
||||||
export const isDesktop = (() => {
|
export const isDesktop = (() => {
|
||||||
const info = Taro.getSystemInfoSync();
|
const info = Taro.getDeviceInfo();
|
||||||
return info.platform === 'windows' || info.platform === 'mac';
|
return info.platform === 'windows' || info.platform === 'mac';
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
@ -8,20 +8,20 @@ import { API } from '@/http/api';
|
|||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
import { selectLocation } from '@/store/selector';
|
import { selectLocation } from '@/store/selector';
|
||||||
import {
|
import {
|
||||||
JobDetails,
|
CreateJobInfo,
|
||||||
|
GetJobManagesRequest,
|
||||||
|
GetJobManagesResponse,
|
||||||
GetJobsDetailsRequest,
|
GetJobsDetailsRequest,
|
||||||
GetJobsRequest,
|
GetJobsRequest,
|
||||||
GetJobsResponse,
|
GetJobsResponse,
|
||||||
JobInfo,
|
GetMyRecommendJobRequest,
|
||||||
GetUserJobRequest,
|
GetUserJobRequest,
|
||||||
GetUserJobResponse,
|
GetUserJobResponse,
|
||||||
MyDeclaredJobInfo,
|
JobDetails,
|
||||||
MyBrowsedJobInfo,
|
JobInfo,
|
||||||
GetMyRecommendJobRequest,
|
|
||||||
GetJobManagesRequest,
|
|
||||||
GetJobManagesResponse,
|
|
||||||
CreateJobInfo,
|
|
||||||
JobManageInfo,
|
JobManageInfo,
|
||||||
|
MyBrowsedJobInfo,
|
||||||
|
MyDeclaredJobInfo,
|
||||||
} from '@/types/job';
|
} from '@/types/job';
|
||||||
import { collectEvent } from '@/utils/event';
|
import { collectEvent } from '@/utils/event';
|
||||||
import { getCityValues } from '@/utils/location';
|
import { getCityValues } from '@/utils/location';
|
||||||
@ -131,3 +131,19 @@ export function postPublishJob(jobId: string) {
|
|||||||
export function postCloseJob(jobId: string) {
|
export function postCloseJob(jobId: string) {
|
||||||
return http.post(API.CLOSE_JOB, { data: { jobId }, contentType: 'application/x-www-form-urlencoded' });
|
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);
|
||||||
|
}
|
||||||
|
|||||||
@ -101,6 +101,7 @@ export const postAddMessageTimes = async (source: string) => {
|
|||||||
await postSubscribe(MessageSubscribeIds, successIds);
|
await postSubscribe(MessageSubscribeIds, successIds);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const postCreateChat = (toUserId: string) => {
|
export const postCreateChat = (toUserId: string) => {
|
||||||
return http.post<IChatInfo>(API.MESSAGE_CREATE_CHAT, { data: { toUserId } });
|
return http.post<IChatInfo>(API.MESSAGE_CREATE_CHAT, { data: { toUserId } });
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,15 +15,27 @@ const getRandomCount = () => {
|
|||||||
return (seed % 300) + 500;
|
return (seed % 300) + 500;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCommonShareMessage = (
|
interface ShareAppProps {
|
||||||
useCapture: boolean = true,
|
useCapture?: boolean;
|
||||||
inviteCode?: string,
|
inviteCode?: string;
|
||||||
title?: string
|
title?: string;
|
||||||
): ShareAppMessageReturn => {
|
path?: PageUrl;
|
||||||
console.log('share share message', getJumpUrl(PageUrl.Job, inviteCode ? { c: inviteCode } : undefined));
|
params?: Record<string, BL.Anything>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getCommonShareMessage = ({
|
||||||
|
useCapture = true,
|
||||||
|
inviteCode,
|
||||||
|
title,
|
||||||
|
path,
|
||||||
|
params = {},
|
||||||
|
}: ShareAppProps = {}): ShareAppMessageReturn => {
|
||||||
|
const inviteParams = inviteCode ? { c: inviteCode } : undefined;
|
||||||
|
const sharePath = path ? getJumpUrl(path, { ...params, ...inviteParams }) : getJumpUrl(PageUrl.Job, inviteParams);
|
||||||
|
console.log('share share message', sharePath);
|
||||||
return {
|
return {
|
||||||
title: title || `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
|
title: title || `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
|
||||||
path: getJumpUrl(PageUrl.Job, inviteCode ? { c: inviteCode } : undefined),
|
path: sharePath,
|
||||||
imageUrl: useCapture ? undefined : imageUrl,
|
imageUrl: useCapture ? undefined : imageUrl,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -7,24 +7,35 @@ import { logWithPrefix } from '@/utils/common';
|
|||||||
|
|
||||||
const log = logWithPrefix('subscribe-utils');
|
const log = logWithPrefix('subscribe-utils');
|
||||||
|
|
||||||
export const isSubscribeRefused = async (tempId: SubscribeTempId | SubscribeTempId[]) => {
|
export const isSubscribeRefused = async (
|
||||||
|
tempId: SubscribeTempId | SubscribeTempId[]
|
||||||
|
): Promise<[boolean, SubscribeTempId[]]> => {
|
||||||
tempId = Array.isArray(tempId) ? tempId : [tempId];
|
tempId = Array.isArray(tempId) ? tempId : [tempId];
|
||||||
const { subscriptionsSetting } = await Taro.getSetting({ withSubscriptions: true });
|
const { subscriptionsSetting } = await Taro.getSetting({ withSubscriptions: true });
|
||||||
log('isSubscribeRefuse subscriptionsSetting:', subscriptionsSetting);
|
log('isSubscribeRefuse subscriptionsSetting:', subscriptionsSetting);
|
||||||
if (!subscriptionsSetting) {
|
if (!subscriptionsSetting) {
|
||||||
return false;
|
return [false, []];
|
||||||
}
|
}
|
||||||
const { mainSwitch, itemSettings = {} } = subscriptionsSetting;
|
const { mainSwitch, itemSettings = {} } = subscriptionsSetting;
|
||||||
if (!mainSwitch) {
|
if (!mainSwitch) {
|
||||||
return true;
|
return [true, []];
|
||||||
}
|
}
|
||||||
return tempId.some(id => {
|
const acceptedIds: SubscribeTempId[] = [];
|
||||||
|
let refused = false;
|
||||||
|
tempId.some(id => {
|
||||||
const item = itemSettings[id];
|
const item = itemSettings[id];
|
||||||
if (!item) {
|
if (item === 'accept') {
|
||||||
return false;
|
acceptedIds.push(id);
|
||||||
}
|
}
|
||||||
return item === 'reject';
|
|
||||||
|
if (refused) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
refused = item === 'reject';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return [refused || false, acceptedIds];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const subscribeMessage = async (tempIds: SubscribeTempId[]) => {
|
export const subscribeMessage = async (tempIds: SubscribeTempId[]) => {
|
||||||
|
|||||||
@ -156,14 +156,18 @@ export const getCityCodes = (): string[] => {
|
|||||||
return !cachedValue || !Array.isArray(cachedValue) ? [] : cachedValue;
|
return !cachedValue || !Array.isArray(cachedValue) ? [] : cachedValue;
|
||||||
};
|
};
|
||||||
export const setCityCodes = (cityCode: string[]) => Taro.setStorageSync(CacheKey.CITY_CODES, cityCode);
|
export const setCityCodes = (cityCode: string[]) => Taro.setStorageSync(CacheKey.CITY_CODES, cityCode);
|
||||||
export const checkCityCode = (cityCode: string): boolean => {
|
export const validCityCode = (cityCode: string) => {
|
||||||
const cachedCityCodes = getCityCodes();
|
const cachedCityCodes = getCityCodes();
|
||||||
const isNewCityCode = cachedCityCodes.indexOf(cityCode) === -1;
|
const isNewCityCode = cachedCityCodes.indexOf(cityCode) === -1;
|
||||||
if (cachedCityCodes.length === 2 && isNewCityCode) {
|
return !(cachedCityCodes.length === 2 && isNewCityCode);
|
||||||
|
};
|
||||||
|
export const checkCityCode = (cityCode: string): boolean => {
|
||||||
|
if (!validCityCode(cityCode)) {
|
||||||
Toast.info('最多只能进入2个城市');
|
Toast.info('最多只能进入2个城市');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (isNewCityCode) {
|
const cachedCityCodes = getCityCodes();
|
||||||
|
if (cachedCityCodes.indexOf(cityCode) === -1) {
|
||||||
setCityCodes([...cachedCityCodes, cityCode]);
|
setCityCodes([...cachedCityCodes, cityCode]);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user