import { Image } from '@tarojs/components'; import { useLoad } from '@tarojs/taro'; import { useState } from 'react'; import { AgreementPopup } from '@/components/agreement-popup'; import Slogan from '@/components/slogan'; import { PageUrl, RoleType } from '@/constants/app'; import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST } from '@/hooks/use-config'; import store from '@/store'; import { changeHomePage } from '@/store/actions'; import { getRoleType, switchDefaultTab, switchRoleType } from '@/utils/app'; import { switchTab } from '@/utils/route'; import { getAgreementSigned, setAgreementSigned } from '@/utils/user'; import './index.less'; const PREFIX = 'page-start'; export default function Start() { const [open, setOpen] = useState(typeof getAgreementSigned() !== 'boolean'); const mode = getRoleType(); useLoad(() => { switchDefaultTab(); }); const handleAnchor = async () => { await switchRoleType(RoleType.Anchor); store.dispatch(changeHomePage(ANCHOR_TAB_LIST[0].type)); await switchTab(ANCHOR_TAB_LIST[0].pagePath as PageUrl); }; const handleCompany = async () => { await switchRoleType(RoleType.Company); store.dispatch(changeHomePage(COMPANY_TAB_LIST[0].type)); await switchTab(COMPANY_TAB_LIST[0].pagePath as PageUrl); }; const handleCancel = () => { setOpen(false); setAgreementSigned(false); }; const handleConfirm = () => { setOpen(false); setAgreementSigned(true); }; return (