feat: first commit
This commit is contained in:
20
src/fragments/user/anchor/index.less
Normal file
20
src/fragments/user/anchor/index.less
Normal file
@ -0,0 +1,20 @@
|
||||
@import '@/styles/common.less';
|
||||
@import '@/styles/variables.less';
|
||||
|
||||
.user-fragment-anchor {
|
||||
|
||||
&__cell {
|
||||
height: 112px;
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
border-radius: 16px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
&__switch-to-company {
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
border-radius: 16px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
}
|
||||
40
src/fragments/user/anchor/index.tsx
Normal file
40
src/fragments/user/anchor/index.tsx
Normal file
@ -0,0 +1,40 @@
|
||||
import { Image } from '@tarojs/components';
|
||||
|
||||
import { Cell } from '@taroify/core';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import MaterialCard from '@/components/material-card';
|
||||
import WechatCell from '@/components/wx-cell';
|
||||
import { RoleType, PageUrl } from '@/constants/app';
|
||||
import { switchRoleType } from '@/utils/app';
|
||||
import { navigateTo } from '@/utils/route';
|
||||
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'user-fragment-anchor';
|
||||
|
||||
export default function AnchorFragment() {
|
||||
const handleClickMyDeclaration = useCallback(() => navigateTo(PageUrl.MyDeclaration), []);
|
||||
|
||||
const handleClickSwitch = useCallback(() => switchRoleType(RoleType.Company), []);
|
||||
|
||||
return (
|
||||
<div className={PREFIX}>
|
||||
<MaterialCard />
|
||||
<WechatCell className={`${PREFIX}__cell`} />
|
||||
<Cell
|
||||
isLink
|
||||
align="center"
|
||||
title="我联系的通告"
|
||||
className={`${PREFIX}__cell`}
|
||||
onClick={handleClickMyDeclaration}
|
||||
/>
|
||||
<Image
|
||||
mode="widthFix"
|
||||
className={`${PREFIX}__switch-to-company`}
|
||||
src="https://neighbourhood.cn/zhao_zhubo_1.png"
|
||||
onClick={handleClickSwitch}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
27
src/fragments/user/company/index.less
Normal file
27
src/fragments/user/company/index.less
Normal file
@ -0,0 +1,27 @@
|
||||
@import '@/styles/common.less';
|
||||
@import '@/styles/variables.less';
|
||||
|
||||
.user-fragment-company {
|
||||
|
||||
&__cell {
|
||||
height: 112px;
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
border-radius: 16px;
|
||||
margin-top: 24px;
|
||||
|
||||
.taroify-cell__value {
|
||||
color: @blColor;
|
||||
}
|
||||
}
|
||||
|
||||
&__go-publish-cell {
|
||||
.taroify-cell__title {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.taroify-cell__value {
|
||||
color: @blHighlightColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/fragments/user/company/index.tsx
Normal file
44
src/fragments/user/company/index.tsx
Normal file
@ -0,0 +1,44 @@
|
||||
import { Cell } from '@taroify/core';
|
||||
import classNames from 'classnames';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import CertificationStatus from '@/components/certification-status';
|
||||
import WechatCell from '@/components/wx-cell';
|
||||
import { PageUrl } from '@/constants/app';
|
||||
import { CertificationStatusType } from '@/constants/company';
|
||||
import useUserInfo from '@/hooks/use-user-info';
|
||||
import { navigateTo } from '@/utils/route';
|
||||
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'user-fragment-company';
|
||||
|
||||
export default function CompanyFragment() {
|
||||
const userInfo = useUserInfo();
|
||||
// const [showPublish, setShowPublish] = useState(false);
|
||||
|
||||
const handlePublishJob = useCallback(async () => {
|
||||
if (userInfo.bossAuthStatus !== CertificationStatusType.Success) {
|
||||
navigateTo(PageUrl.CertificationStart);
|
||||
return;
|
||||
}
|
||||
navigateTo(PageUrl.CertificationManage);
|
||||
}, [userInfo]);
|
||||
|
||||
return (
|
||||
<div className={PREFIX}>
|
||||
<CertificationStatus className={`${PREFIX}__cell`} />
|
||||
<WechatCell className={`${PREFIX}__cell`} />
|
||||
<Cell
|
||||
isLink
|
||||
align="center"
|
||||
title="发通告,让主播主动报单"
|
||||
className={classNames(`${PREFIX}__cell`, `${PREFIX}__go-publish-cell`)}
|
||||
onClick={handlePublishJob}
|
||||
>
|
||||
去发布
|
||||
</Cell>
|
||||
{/* <div>{showPublish && <CompanyPublishJobDialog userInfo={userInfo} onClose={() => setShowPublish(false)} />}</div> */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user