From a1d2f29b9df7b44a5cb0871eeeacfa660f58d006 Mon Sep 17 00:00:00 2001 From: chashaobao Date: Sat, 20 Dec 2025 22:53:00 +0800 Subject: [PATCH] feat: --- src/components/job-manage-card/index.tsx | 2 +- src/components/user-batch-publish/index.tsx | 56 +++++++++--- src/constants/app.ts | 1 + src/hooks/use-config.tsx | 3 +- src/hooks/use-publish-job.ts | 6 +- .../index.config.ts | 3 + .../accelerate-delegate-publish/index.less | 0 .../accelerate-delegate-publish/index.tsx | 25 ++++++ .../group-delegate-publish/index.config.ts | 2 +- src/pages/group-delegate-publish/index.tsx | 15 +--- src/pages/group-owner-certification/index.tsx | 2 +- src/pages/user-batch-publish/index.tsx | 86 +++++++++---------- src/utils/group.ts | 5 +- 13 files changed, 129 insertions(+), 77 deletions(-) create mode 100644 src/pages/accelerate-delegate-publish/index.config.ts create mode 100644 src/pages/accelerate-delegate-publish/index.less create mode 100644 src/pages/accelerate-delegate-publish/index.tsx diff --git a/src/components/job-manage-card/index.tsx b/src/components/job-manage-card/index.tsx index eb36204..b7fa7a7 100644 --- a/src/components/job-manage-card/index.tsx +++ b/src/components/job-manage-card/index.tsx @@ -34,7 +34,7 @@ function GoBatchTag({ cityCode, jobId }: { cityCode: string; jobId: JobManageInf e => { e.preventDefault(); e.stopPropagation(); - navigateTo(PageUrl.GroupDelegatePublish, { cityCode, jobId }); + navigateTo(PageUrl.AccelerateDelegatePublish, { cityCode, jobId }); }, [cityCode, jobId] ); diff --git a/src/components/user-batch-publish/index.tsx b/src/components/user-batch-publish/index.tsx index d37c9a0..eaf5345 100644 --- a/src/components/user-batch-publish/index.tsx +++ b/src/components/user-batch-publish/index.tsx @@ -8,7 +8,7 @@ import PageLoading from '@/components/page-loading'; import { PublishJobQrCodeDialog } from '@/components/product-dialog/publish-job'; import CompanyPublishJobBuy from '@/components/product-dialog/steps-ui/company-publish-job-buy'; import SafeBottomPadding from '@/components/safe-bottom-padding'; -import { ISelectOption } from '@/components/select'; +import { ISelectOption, PopupSelect } from '@/components/select'; import { PageUrl } from '@/constants/app'; import { JobManageStatus } from '@/constants/job'; import { OrderStatus, OrderType, ProductSpecId, ProductType } from '@/constants/product'; @@ -77,16 +77,23 @@ const calcPrice = (city: CityValue | null) => { const productSpecId = GROUP_OPTIONS.find(o => o.value === count)?.productSpecId || ProductSpecId.GroupBatchPublish20; return { price, originalPrice, productSpecId }; }; - -export default function UserBatchPublish({ cityCode, jobId }: { cityCode: string; jobId: string }) { +const cityOptions: CityOption[] = cityValues.map(value => ({ value, label: value.cityName })); +export default function UserBatchPublish({ cityCode, jobId }: { cityCode?: string; jobId?: string }) { const [loading, setLoading] = useState(true); const [showQrCode, setShowQrCode] = useState(false); + const [selectable, setSelectable] = useState(false); + const [showCitySelect, setShowCitySelect] = useState(false); const [city, setCity] = useState(null); const { price, originalPrice, productSpecId } = calcPrice(city); const [showPublishJob, setShowPublishJob] = useState(false); const [showBuy, setShowBuy, handlePublishJob] = usePublishJob(jobId); + const handleClickCity = useCallback(() => setShowCitySelect(true), []); + const handleSelectCity = useCallback(value => { + setCity(value); + setShowCitySelect(false); + }, []); const handleClickViewGroup = useCallback(() => navigateTo(PageUrl.GroupList, { city: city?.cityCode }), [city]); const handleClickBuy = useCallback(async () => { @@ -108,12 +115,14 @@ export default function UserBatchPublish({ cityCode, jobId }: { cityCode: string return; } - const jobDetail = await requestJobDetail(jobId); + if (jobId && cityCode) { + const jobDetail = await requestJobDetail(jobId); - if (jobDetail.status !== JobManageStatus.Open) { - Taro.hideLoading(); - setShowPublishJob(true); - return; + if (jobDetail.status !== JobManageStatus.Open) { + Taro.hideLoading(); + setShowPublishJob(true); + return; + } } const { payOrderNo, createPayInfo } = await requestCreatePayInfo({ @@ -146,11 +155,13 @@ export default function UserBatchPublish({ cityCode, jobId }: { cityCode: string }, [jobId, price, productSpecId]); useEffect(() => { - if (!cityCode) { - return; - } + // if (!cityCode) { + // return; + // } try { - const initCity = cityValues.find(o => o.cityCode === cityCode); + const initCity = cityCode ? cityValues.find(o => o.cityCode === cityCode) : cityValues[0]; + + setSelectable(!cityCode); setLoading(false); if (initCity) { @@ -174,8 +185,18 @@ export default function UserBatchPublish({ cityCode, jobId }: { cityCode: string
服务方式:帮您把招聘需求
发到本地主播群,投递量大幅增加
-
当前通告城市
- + {selectable ? ( + +
请选择城市
+ +
+ ) : ( + +
当前通告城市
+ +
+ )} + {city && (
@@ -196,6 +217,13 @@ export default function UserBatchPublish({ cityCode, jobId }: { cityCode: string )}
+ setShowCitySelect(false)} + /> setShowQrCode(false)} open={showQrCode} /> setShowBuy(false)}> diff --git a/src/constants/app.ts b/src/constants/app.ts index 0b40374..03530fc 100644 --- a/src/constants/app.ts +++ b/src/constants/app.ts @@ -77,6 +77,7 @@ export enum PageUrl { Partner = 'pages/partner/index', WithdrawRecord = 'pages/withdraw-record/index', GroupDelegatePublish = 'pages/group-delegate-publish/index', + AccelerateDelegatePublish = 'pages/accelerate-delegate-publish/index', GiveVip = 'pages/give-vip/index', GroupOwnerCertificate = 'pages/group-owner-certification/index', PartnerShareVip = 'pages/partner-share-vip/index', diff --git a/src/hooks/use-config.tsx b/src/hooks/use-config.tsx index 95a3329..a190aaf 100644 --- a/src/hooks/use-config.tsx +++ b/src/hooks/use-config.tsx @@ -48,7 +48,7 @@ const CompanyTabs: TabItemType[] = [ { type: PageType.BatchPublish, pagePath: PageUrl.UserBatchPublish, - text: '代招', + text: '代发代招', }, ]; @@ -101,6 +101,7 @@ export const APP_CONFIG: AppConfigType = { PageUrl.GiveVip, PageUrl.GroupOwnerCertificate, PageUrl.PartnerShareVip, + PageUrl.AccelerateDelegatePublish, // PageUrl.DevDebug, ], window: { diff --git a/src/hooks/use-publish-job.ts b/src/hooks/use-publish-job.ts index de5806d..9927aba 100644 --- a/src/hooks/use-publish-job.ts +++ b/src/hooks/use-publish-job.ts @@ -15,11 +15,15 @@ import { postPublishJob } from '@/utils/job'; import { navigateTo } from '@/utils/route'; import Toast from '@/utils/toast'; -export const usePublishJob = (jobId: string): [boolean, Dispatch>, () => Promise] => { +export const usePublishJob = (jobId?: string): [boolean, Dispatch>, () => Promise] => { const userInfo = useUserInfo(); const [showBuy, setShowBuy] = useState(false); const handlePublishJob = useCallback(async () => { + if (!jobId) { + return; + } + try { if (userInfo.bossAuthStatus !== CertificationStatusType.Success) { store.dispatch(cacheJobId(jobId)); diff --git a/src/pages/accelerate-delegate-publish/index.config.ts b/src/pages/accelerate-delegate-publish/index.config.ts new file mode 100644 index 0000000..872bdc9 --- /dev/null +++ b/src/pages/accelerate-delegate-publish/index.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '加速招聘', +}); diff --git a/src/pages/accelerate-delegate-publish/index.less b/src/pages/accelerate-delegate-publish/index.less new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/accelerate-delegate-publish/index.tsx b/src/pages/accelerate-delegate-publish/index.tsx new file mode 100644 index 0000000..acc0446 --- /dev/null +++ b/src/pages/accelerate-delegate-publish/index.tsx @@ -0,0 +1,25 @@ +import { useLoad } from '@tarojs/taro'; + +import { useState } from 'react'; + +import UserBatchPublish from '@/components/user-batch-publish'; +import { getPageQuery } from '@/utils/route'; +import './index.less'; + +const PREFIX = 'group-delegate-publish'; + +export default function Partner() { + const [cityCode, setCityCode] = useState(''); + const [jobId, setJobId] = useState(''); + + useLoad(() => { + const query = getPageQuery<{ cityCode: string; jobId: string }>(); + setCityCode(query.cityCode); + setJobId(query.jobId); + }); + return ( +
+ +
+ ); +} diff --git a/src/pages/group-delegate-publish/index.config.ts b/src/pages/group-delegate-publish/index.config.ts index 872bdc9..643b0e4 100644 --- a/src/pages/group-delegate-publish/index.config.ts +++ b/src/pages/group-delegate-publish/index.config.ts @@ -1,3 +1,3 @@ export default definePageConfig({ - navigationBarTitleText: '加速招聘', + navigationBarTitleText: '群代发', }); diff --git a/src/pages/group-delegate-publish/index.tsx b/src/pages/group-delegate-publish/index.tsx index acc0446..58fdbb8 100644 --- a/src/pages/group-delegate-publish/index.tsx +++ b/src/pages/group-delegate-publish/index.tsx @@ -1,25 +1,12 @@ -import { useLoad } from '@tarojs/taro'; - -import { useState } from 'react'; - import UserBatchPublish from '@/components/user-batch-publish'; -import { getPageQuery } from '@/utils/route'; import './index.less'; const PREFIX = 'group-delegate-publish'; export default function Partner() { - const [cityCode, setCityCode] = useState(''); - const [jobId, setJobId] = useState(''); - - useLoad(() => { - const query = getPageQuery<{ cityCode: string; jobId: string }>(); - setCityCode(query.cityCode); - setJobId(query.jobId); - }); return (
- +
); } diff --git a/src/pages/group-owner-certification/index.tsx b/src/pages/group-owner-certification/index.tsx index 0644d5c..2fe8e9f 100644 --- a/src/pages/group-owner-certification/index.tsx +++ b/src/pages/group-owner-certification/index.tsx @@ -111,7 +111,7 @@ export default function GroupOwnerCertification() {
一般1天内完成,超时未完成认证请重新分享或者咨询运营
diff --git a/src/pages/user-batch-publish/index.tsx b/src/pages/user-batch-publish/index.tsx index 9b83330..202fb12 100644 --- a/src/pages/user-batch-publish/index.tsx +++ b/src/pages/user-batch-publish/index.tsx @@ -1,4 +1,4 @@ -// import { Image } from '@tarojs/components'; +import { Image } from '@tarojs/components'; import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro'; import { Button, Tabs } from '@taroify/core'; @@ -12,29 +12,29 @@ import useInviteCode from '@/hooks/use-invite-code'; import { switchRoleType } from '@/utils/app'; import { openCustomerServiceChat } from '@/utils/common'; import { getCurrentCityCode } from '@/utils/location'; -import { getPageQuery } from '@/utils/route'; +import { getPageQuery, navigateTo } from '@/utils/route'; import { getCommonShareMessage } from '@/utils/share'; import { checkCityCode } from '@/utils/user'; import './index.less'; 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'; +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() { const inviteCode = useInviteCode(); const cityOperators = useCityOperators(); const [value, setValue] = useState('2'); - // const handleClickDelegate = useCallback(() => { - // navigateTo(PageUrl.GroupDelegatePublish); - // }, []); - // const handlePreview = (current: string) => { - // Taro.previewImage({ - // current, - // urls: [EXAMPLE_IMAGE, COMMENT_IMAGE], - // }); - // }; + const handleClickDelegate = useCallback(() => { + navigateTo(PageUrl.GroupDelegatePublish); + }, []); + const handlePreview = (current: string) => { + Taro.previewImage({ + current, + urls: [EXAMPLE_IMAGE, COMMENT_IMAGE], + }); + }; const handleOpenService = useCallback(() => { openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d'); }, []); @@ -80,41 +80,41 @@ export default function BizService() {
- {/**/} - {/*
*/} - {/* */} - {/*
服务说明
*/} - {/*
*/} - {/*
服务方式:帮您把招聘需求发到众多同城合作主播群
*/} - {/*
群发次数:杭州、广州发3次,其他城市1次
*/} - {/*
内容要求:仅限带货主播招聘需求,其他不发
*/} - {/*
主播联系:内容中留招聘方联系方式,主播直接联系
*/} - {/*
*/} - {/*
代发示例
*/} - {/*
handlePreview(EXAMPLE_IMAGE)}>*/} - {/* */} - {/*
*/} - {/*
部分客户评价
*/} - {/*
handlePreview(COMMENT_IMAGE)}>*/} - {/* */} - {/*
*/} - {/*
*/} - {/* */} - {/*
*/} - {/*
*/} - {/*
*/} + +
+ +
服务说明
+
+
服务方式:帮您把招聘需求发到众多同城合作主播群
+
群发次数:杭州、广州发3次,其他城市1次
+
内容要求:仅限带货主播招聘需求,其他不发
+
主播联系:内容中留招聘方联系方式,主播直接联系
+
+
代发示例
+
handlePreview(EXAMPLE_IMAGE)}> + +
+
部分客户评价
+
handlePreview(COMMENT_IMAGE)}> + +
+
+ +
+
+
主播群 - {/**/} + } > diff --git a/src/utils/group.ts b/src/utils/group.ts index b9a7db7..c3b5371 100644 --- a/src/utils/group.ts +++ b/src/utils/group.ts @@ -51,5 +51,8 @@ export const requestBatchPublishGroups = async () => { }; export const requestSimpleGroupList = async (cityCode?: string) => { - return http.post(API.SIMPLE_GROUP_LIST, { data: { cityCode } }); + return http.post(API.SIMPLE_GROUP_LIST, { + data: { cityCode }, + contentType: 'application/x-www-form-urlencoded', + }); };