diff --git a/src/components/card/CardProj.tsx b/src/components/card/CardProj.tsx index b2f8478..731a02f 100644 --- a/src/components/card/CardProj.tsx +++ b/src/components/card/CardProj.tsx @@ -26,6 +26,7 @@ export default function CardProj(props: { item: IProj }) { const [messageApi, messageContext] = useMessage(); const [projCategoryId, setProjCategoryId] = useState(data.projCategoryId); const [projCategoryName, setProjCategoryName] = useState(data.projCategoryName); + const [charge, setCharge] = useState(''); const [payCharge, setPayCharge] = useState(''); const indexListContext = useContext(IndexListContext); @@ -109,6 +110,16 @@ export default function CardProj(props: { item: IProj }) { ) } + const goEdit = () => { + if(charge == ProjChargeType.ALL) { + nav(`/proj-eall/${data.projId}`); + } else if(charge == ProjChargeType.FREE) { + nav(`/proj-efree/${data.projId}`); + } else { + nav(`/proj-edit/${data.projId}`); + } + } + useEffect(() => { const charge = props.item.pay.charge.split(':')[0]; let chargeName = ''; @@ -123,6 +134,7 @@ export default function CardProj(props: { item: IProj }) { } else { chargeName = '免费试用'; } + setCharge(charge) setPayCharge(chargeName); }, []) @@ -131,9 +143,7 @@ export default function CardProj(props: { item: IProj }) {