system-copyright-react/src/route/proj/ProjCreate.tsx

211 lines
8.9 KiB
TypeScript
Raw Normal View History

2024-03-14 18:33:58 +08:00
import './proj-create.css'
import {Link, useNavigate} from "react-router-dom";
2024-03-20 18:30:39 +08:00
import {Breadcrumb, message} from "antd";
2024-03-14 18:33:58 +08:00
import CardProjType from "../../components/card/CardProjType.tsx";
2024-03-20 18:30:39 +08:00
import {IProjCharge, ProjAdditionalType, ProjChargeType} from "../../interfaces/proj/IProj.ts";
import {useEffect, useState} from "react";
import {get} from "../../util/AjaxUtils.ts";
2024-03-14 18:33:58 +08:00
export default function ProjCreate() {
2024-03-20 18:30:39 +08:00
const [messageApi, contextHolder] = message.useMessage();
const [charge, setCharge] = useState<IProjCharge>({
proj: {
all: 0,
materialAgent: 0,
materialAgentUrgent: 0,
material: 0,
free: 0,
},
additional: {
pkg: 0,
videoDemo: 0
}
});
2024-03-14 18:33:58 +08:00
const nav = useNavigate();
2024-03-14 23:34:40 +08:00
const height = window.innerHeight - 150;
2024-03-20 18:30:39 +08:00
useEffect(() => {
get({
messageApi: messageApi,
url: '/api/proj/charge/get',
onSuccess({data}) {
setCharge(data);
}
})
}, [])
2024-03-14 18:33:58 +08:00
return (
<>
2024-03-20 18:30:39 +08:00
{contextHolder}
2024-03-14 18:33:58 +08:00
<Breadcrumb
items={[
{title: <Link to={'/'}></Link>},
2024-03-14 23:34:40 +08:00
{title: '创建项目'},
2024-03-14 18:33:58 +08:00
]}
/>
2024-03-14 23:34:40 +08:00
<div style={{height: `${height}px`, overflow: 'auto'}}>
2024-03-20 18:30:39 +08:00
<div className="proj-create">
2024-03-14 23:34:40 +08:00
<CardProjType
head={'全托管'}
bodyLineArray={[
{
title: '提供的服务:',
contents: [
'提供系统搭建',
'系统可在线运行三年',
'软著材料编写',
'软著申报',
'包下证',
'提供系统演示视频文件',
'提供系统安装包',
]
},
{
title: '使用流程:',
contents: [
'编写软著名称',
'对搭建系统进行核验',
'接受证书',
]
2024-03-14 18:33:58 +08:00
}
2024-03-14 23:34:40 +08:00
]}
buyArray={[
{
2024-03-20 18:30:39 +08:00
id: ProjChargeType.ALL,
price: charge.proj.all,
handleClick: () => {
nav(`/proj-new/${ProjChargeType.ALL}`)
2024-03-14 23:34:40 +08:00
}
2024-03-14 18:33:58 +08:00
}
2024-03-14 23:34:40 +08:00
]}
/>
<CardProjType
head={'写材料+代理'}
bodyLineArray={[
{
title: '提供的服务:',
contents: [
'提供系统搭建平台与客服指导',
'系统可在线运行一年',
'软著材料编写',
'资料补正不限',
'软著申报',
'包下证',
]
},
{
title: '使用流程:',
contents: [
'1、按系统操作手册执行',
]
2024-03-14 18:33:58 +08:00
}
2024-03-14 23:34:40 +08:00
]}
chargeLineArray={[
{
2024-03-20 18:30:39 +08:00
id: ProjAdditionalType.PKG,
price: charge.additional.pkg,
title: `安装包 ${charge.additional.pkg / 100}`
2024-03-14 23:34:40 +08:00
},
{
2024-03-20 18:30:39 +08:00
id: ProjAdditionalType.VIDEO_DEMO,
price: charge.additional.videoDemo,
title: `系统演示视频文件 ${charge.additional.videoDemo / 100}`
2024-03-14 18:33:58 +08:00
}
2024-03-14 23:34:40 +08:00
]}
buyArray={[
{
2024-03-20 18:30:39 +08:00
id: ProjChargeType.MATERIAL_AGENT,
2024-03-14 23:34:40 +08:00
label: '普件:',
2024-03-20 18:30:39 +08:00
price: charge.proj.materialAgent,
handleClick: (_title, additional) => {
nav(`/proj-new/${ProjChargeType.MATERIAL_AGENT}?pkg=${additional.pkg}&videoDemo=${additional.videoDemo}`)
2024-03-14 23:34:40 +08:00
}
},
{
2024-03-20 18:30:39 +08:00
id: ProjChargeType.MATERIAL_AGENT_URGENT,
2024-03-14 23:34:40 +08:00
label: '加急:',
2024-03-20 18:30:39 +08:00
price: charge.proj.materialAgentUrgent,
handleClick: (_title, additional) => {
nav(`/proj-new/${ProjChargeType.MATERIAL_AGENT_URGENT}?pkg=${additional.pkg}&videoDemo=${additional.videoDemo}`)
2024-03-14 23:34:40 +08:00
}
2024-03-14 18:33:58 +08:00
}
2024-03-14 23:34:40 +08:00
]}
/>
<CardProjType
head={'写材料'}
bodyLineArray={[
{
title: '提供的服务:',
contents: [
'提供系统搭建',
'系统可在线运行三年',
'软著材料编写',
'软著申报',
'包下证',
'提供系统演示视频文件',
'提供系统安装包',
]
},
{
title: '使用流程:',
contents: [
'编写软著名称',
'对搭建系统进行核验',
'接受证书',
]
}
]}
chargeLineArray={[
{
2024-03-20 18:30:39 +08:00
id: ProjAdditionalType.PKG,
price: charge.additional.pkg,
title: `安装包 ${charge.additional.pkg / 100}`
2024-03-14 23:34:40 +08:00
},
{
2024-03-20 18:30:39 +08:00
id: ProjAdditionalType.VIDEO_DEMO,
price: charge.additional.videoDemo,
title: `系统演示视频文件 ${charge.additional.videoDemo / 100}`
2024-03-14 23:34:40 +08:00
}
]}
buyArray={[
{
2024-03-20 18:30:39 +08:00
id: ProjChargeType.MATERIAL,
price: charge.proj.material,
handleClick: () => {
nav(`/proj-new/${ProjChargeType.MATERIAL}`)
2024-03-14 23:34:40 +08:00
}
}
]}
/>
<CardProjType
head={'免费试用'}
bodyLineArray={[
{
title: '提供的服务:',
contents: [
'提供系统搭建平台与客服指导',
'系统可在线存储三天',
]
},
{
title: '使用流程:',
contents: [
'按系统操作手册执行',
]
}
]}
buyArray={[
{
2024-03-20 18:30:39 +08:00
id: ProjChargeType.FREE,
price: charge.proj.free,
handleClick: () => {
nav(`/proj-new/${ProjChargeType.FREE}`)
2024-03-14 23:34:40 +08:00
}
}
]}
/>
</div>
2024-03-14 18:33:58 +08:00
</div>
</>
)
}