import { Button, Form, Image, Input, Modal, Select, Skeleton, Breadcrumb, message, notification, Tooltip, } from "antd"; import type { BreadcrumbProps } from "antd"; import { useMemo, useState } from "react"; import { useParams, useRequest, history } from "umi"; import { GetAppDetail } from "@/api/appStore"; import { GetTemplateDetail } from "@/api/templateStore"; import styles from "./index.less"; import { LeftOutlined } from "@ant-design/icons"; import { SubmitApply } from "@/api/apply"; export default function detail() { const [showAdvisory, setShowAdvisory] = useState(false); const [form] = Form.useForm(); const { id, type } = useParams(); const { data, loading } = useRequest<{ result: any }>( type === "application" ? GetAppDetail : GetTemplateDetail, { defaultParams: [ { id: id, }, ], } ); const handleToApp = () => { if (data?.result?.trialUrl) { window.open(data?.result?.trialUrl, "_blank"); } }; const handleBack = () => { history.back(); }; // 提交申请 const handleSubmit = () => { form.validateFields().then(async (values) => { await SubmitApply({ ...values, type: type === "application" ? 0 : 1, templateId: id, }); notification.success({ message: "您的申请已提交,后续会有专员与您联系!~", }); setShowAdvisory(false); }); }; const breadcrumbItems: BreadcrumbProps["items"] = useMemo(() => { return [ { key: "all", // title: ( // // // 返回 // // ), title: "全部", }, { key: "current", title: data?.result.name }, ]; }, [data]); return (
{data?.result?.name}
{data?.result?.desc || "暂无描述"}
{/*
{data?.result?.createByName || "易码工坊"}
*/}
{/* */}
浏览量 {data?.result?.viewCount || 0}
·
{(data?.result.tags?.split(",") || []).map( (tag: string) => { return (
# {tag}
); } )}
方案详情
setShowAdvisory(false)} onOk={handleSubmit} >
); }