import './proj-create.css' import { useNavigate } from "react-router-dom"; import { message } from "antd"; import CardProjType from "../../components/card/CardProjType.tsx"; import { // IProjCharge, ProjAdditionalType, ProjChargeType } from "../../interfaces/proj/IProj.ts"; import { useEffect, useState } from "react"; import { get } from "../../util/AjaxUtils.ts"; // import { Link } from "react-router-dom"; export default function ProjCreate() { const [messageApi, contextHolder] = message.useMessage(); // const [charge, setCharge] = useState({ // proj: { // all: 0, // materialAgent: 0, // materialAgentUrgent: 0, // material: 0, // free: 0, // }, // additional: { // pkg: 0, // videoDemo: 0 // }, // projTypes:[ // {} // ] // }); const [charge, setCharge] = useState({}) //安装包信息 const [allInfo, setAllInfo] = useState({}) //全部托管信息 const [materialInfo, setMaterialInfo] = useState({}) //写材料信息 const [freeInfo, setFreeInfo] = useState({}) //免费托管信息 const [ freeCount,setFreeCount] = useState(0) //免费次数 const nav = useNavigate(); const height = window.innerHeight - 170; useEffect(() => { get({ messageApi: messageApi, url: '/api/proj/charge/get', onSuccess({ data }) { setCharge(data.additional); console.log("创建数据", data); // console.log(charge.projTypes[0].price); setAllInfo(data.projTypes[0]) setMaterialInfo(data.projTypes[1]) setFreeInfo(data.projTypes[2]) // console.log('后面的price',data.proj.materialAgent); setFreeCount(data.freeCount) } }) // sessionStorage.setItem('pathArray', JSON.stringify([ { title: 首页 },{ title: '创建项目' }])); // sessionStorage.setItem('now', '创建'); console.log(allInfo); }, []) return ( < > {contextHolder}
{ nav(`/proj-new/${ProjChargeType.ALL}`) } } ]} isShow = {allInfo.isShow} isClickable = {allInfo.isClickable} /> {/* { nav(`/proj-new/${ProjChargeType.MATERIAL_AGENT}?pkg=${additional.pkg}&videoDemo=${additional.videoDemo}`) } }, { id: ProjChargeType.MATERIAL_AGENT_URGENT, label: '加急:', price: charge.proj.materialAgentUrgent, handleClick: (_title, additional) => { nav(`/proj-new/${ProjChargeType.MATERIAL_AGENT_URGENT}?pkg=${additional.pkg}&videoDemo=${additional.videoDemo}`) } } ]} chargeLineArray={[ { id: ProjAdditionalType.PKG, price: charge.additional.pkg, title: `安装包 ${charge.additional.pkg / 100} 元` }, { id: ProjAdditionalType.VIDEO_DEMO, price: charge.additional.videoDemo, title: `系统演示视频文件 ${charge.additional.videoDemo / 100} 元` } ]} /> */} { nav(`/proj-new/${ProjChargeType.MATERIAL}?${additional.pkg ? 'pkg=true' : 'pkg='}&${additional.videoDemo ? 'videoDemo=true' : 'videoDemo='}`); } } ]} isShow = {materialInfo.isShow} isClickable = {materialInfo.isClickable} /> { nav(`/proj-new/${ProjChargeType.FREE}?${additional.pkg ? 'pkg=true' : 'pkg='}&${additional.videoDemo ? 'videoDemo=true' : 'videoDemo='}`) } } ]} isShow = {freeInfo.isShow} isClickable = {freeInfo.isClickable} />
) }