feat: 去掉login guide
This commit is contained in:
@ -112,9 +112,9 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
}
|
||||
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);
|
||||
|
@ -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() {
|
||||
))}
|
||||
</Tabs>
|
||||
<div>
|
||||
<LoginGuide disabled={showAuthorize} onAfterBind={handleAfterBindPhone} />
|
||||
{showMaterialGuide && <MaterialGuide onClose={() => setShowMaterialGuide(false)} />}
|
||||
<AgreementPopup
|
||||
open={openAgreementPopup}
|
||||
|
Reference in New Issue
Block a user