From 1ddc8b46c9fc5434e4c749c7fec514799d1531c8 Mon Sep 17 00:00:00 2001 From: chashaobao Date: Sat, 12 Jul 2025 19:42:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8E=BB=E6=8E=89login=20guide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/product-dialog/job/index.tsx | 4 +-- src/pages/job/index.tsx | 33 +++++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/components/product-dialog/job/index.tsx b/src/components/product-dialog/job/index.tsx index bd629fa..c1399d8 100644 --- a/src/components/product-dialog/job/index.tsx +++ b/src/components/product-dialog/job/index.tsx @@ -112,9 +112,9 @@ function ProductJobDialog(props: Omit) { } const [time, isPaidVip] = await requestProductBalance(PRODUCT_CODE); 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(DialogStatus.JOB_UNABLE_UNLOCK); } else if (isPaidVip || skipPreAction) { const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id }); setShowPrejob(false); diff --git a/src/pages/job/index.tsx b/src/pages/job/index.tsx index 4e40d20..0752b61 100644 --- a/src/pages/job/index.tsx +++ b/src/pages/job/index.tsx @@ -5,7 +5,6 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { AgreementPopup } from '@/components/agreement-popup'; import HomePage from '@/components/home-page'; -import { LoginGuide } from '@/components/login-guide'; import MaterialGuide from '@/components/material-guide'; import { EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app'; import { EmployType, JOB_PAGE_TABS, SortType } from '@/constants/job'; @@ -22,7 +21,7 @@ import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner'; import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route'; import { getCommonShareMessage } from '@/utils/share'; import Toast from '@/utils/toast'; -import { getAgreementSigned, isNeedCreateMaterial, setAgreementSigned } from '@/utils/user'; +import { getAgreementSigned, setAgreementSigned } from '@/utils/user'; import './index.less'; const PREFIX = 'job'; @@ -40,10 +39,19 @@ export default function Job() { longitude: location.longitude, }); const [showMaterialGuide, setShowMaterialGuide] = useState(false); - const [showAuthorize, setShowAuthorize] = useState(false); const cityValuesChangedRef = useRef(false); const [openAgreementPopup, setAgreementPopupOpen] = useState(typeof getAgreementSigned() !== 'boolean'); + const getLocation = async () => { + if (await isNotNeedAuthorizeLocation()) { + log('not need authorize location'); + requestLocation(); + } else { + log('show authorize location dialog'); + // setShowAuthorize(true); + requestLocation(true); + } + }; const handleTypeChange = useCallback(value => setTabType(value), []); const handleClickCity = useCallback( @@ -77,19 +85,18 @@ export default function Job() { setCityCode(code); }, []); - const handleAfterBindPhone = useCallback(async () => { - if (await isNeedCreateMaterial()) { - setShowMaterialGuide(true); - } - }, []); const handleCancelAgreementPopup = () => { setAgreementPopupOpen(false); setAgreementSigned(false); + + getLocation(); }; const handleConfirmAgreementPopup = () => { setAgreementPopupOpen(false); setAgreementSigned(true); + + getLocation(); }; useEffect(() => { Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange); @@ -113,13 +120,8 @@ export default function Job() { setSortType(type); } getInviteCodeFromQueryAndUpdate(query); - if (await isNotNeedAuthorizeLocation()) { - log('not need authorize location'); - requestLocation(); - } else { - log('show authorize location dialog'); - setShowAuthorize(true); - requestLocation(true); + if (!openAgreementPopup) { + getLocation(); } }); @@ -158,7 +160,6 @@ export default function Job() { ))}
- {showMaterialGuide && setShowMaterialGuide(false)} />}