diff --git a/src/route/proj/ProjEditAll.tsx b/src/route/proj/ProjEditAll.tsx index 2752337..2ea1cdb 100644 --- a/src/route/proj/ProjEditAll.tsx +++ b/src/route/proj/ProjEditAll.tsx @@ -9,6 +9,7 @@ import { // GetProp, UploadProps, } from "antd"; +import { GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts"; import { UploadOutlined } from '@ant-design/icons'; import TextArea from "antd/es/input/TextArea"; import StepProjEdit from "../../components/step/StepProjEdit.tsx"; @@ -18,7 +19,7 @@ import CardProjLoading from "../../components/card/CardProjLoading.tsx"; import CardProjResult from "../../components/card/CardProjResult.tsx"; import CardProjDownload from "../../components/card/CardProjDownload.tsx"; import CardProjJump from "../../components/card/CardProjJump.tsx"; -import { useEffect, useState } from "react"; +import { useEffect, useState, useContext } from "react"; import { Axios, get, put, post, uploadFileUrl, downloadUrl } from "../../util/AjaxUtils.ts"; import { EditStepEnum, IProjEdit } from "../../interfaces/card/ICardProj.ts"; import { MIN_MOD_SIZE } from "./edit/ProjConfigModList.tsx"; @@ -53,7 +54,9 @@ import ING from '../../static/status/ING.gif' // desc: string // } // type FileType = Parameters>[0]; +import { useDispatch } from 'react-redux' export default function ProjEditAll() { + const globalDispatchContext = useContext(GlobalDispatchContext); // 是否显示下载安装包模块 const [showPkg, setShowPkg] = useState(false) // 是否显示下载演示视频 @@ -62,6 +65,29 @@ export default function ProjEditAll() { const [pkgStatus, setPkgStatus] = useState('') // 视频模块生成状态 const [videoStatus, setVideoStatus] = useState('') + const dispath = useDispatch() + // 获取套餐包数量 + const getMyPackNum = () => { + get({ + messageApi, + url: `/api/proj/servicepkg/packageorder/count/self`, + onBefore() { + + }, + onSuccess({ data }) { + dispath({ + type: 'upPackNum', + val: { + ALL: data.ALL, + MATERIAL: data.MATERIAL, + } + }) + }, + onFinally() { + + } + }) + } // 点击刷新页面数据获取安装包状态 const upData = () => { get({ @@ -163,10 +189,10 @@ export default function ProjEditAll() { maxCount: 6,//上传限制最多6个 action: uploadFileUrl(), headers: { - 'Auth': `Bearer ${token}`, + 'Auth': `Bearer ${token}`, }, // headers={{'X-USER-ID': DevUserId}} - + beforeUpload: (file) => { const isPNG = file.type === 'application/pdf'; if (!isPNG) { @@ -437,14 +463,17 @@ export default function ProjEditAll() { setConfigArray(configArray); setIsConfigEdited(isConfig); } - + const [claimer, setClaimer] = useState(); //认领人 + // 退款弹窗显示 + const [refundModal, setRefundModal] = useState(false) const renderData = () => { get({ messageApi: messageApi, // url: `/api/proj/get/${pathParams.projId}`, url: `/api/proj/claim/get/${pathParams.projId}`, onSuccess({ data }) { - // console.log('嘻嘻', data); + // console.log('详情', data); + setClaimer(data.claimer); setcertificate(data.certificates) setprogress(data.progress) // console.log('状态判断', data.pay.chargeAdditionals); @@ -879,6 +908,21 @@ export default function ProjEditAll() {
+
+ < Modal + centered + title="提示" + open={refundModal} + destroyOnClose={true} + + onCancel={() => { + setRefundModal(false); + } + } + // 确定按钮为红色,显示文字为确认 + okButtonProps={{ + style: { + backgroundColor: '#ff4d4f', + borderColor: '#ff4d4f', + color: '#fff', + }, + }} + okText="确认" + onOk={() => { + // refund() + post({ + messageApi, + url: `/api/proj/refund/apply/save-full-proj/${pathParams.projId}`, + // body: { + // projId: refunProjId + // }, + onBefore() { + + }, + onSuccess() { + reloadUser(messageApi, globalDispatchContext).then(() => { + // nav(-1) + // messageApi.success('退款成功'); + message.success('退款成功'); + // setTimeout(() => { + setRefundModal(false); + nav(-1) + getMyPackNum() + // }, 500); + // setShowBuyPicIng(true); + // setBuyModalShow(false); + // setShowBuyPicAgain(false) + }); + + }, + // onError(error) { + // messageApi.error(error.message); + // }, + onFinally() { + setRefundModal(false); + } + }) + }} + cancelText="取消" + > + 确定退款吗? + ) } \ No newline at end of file