diff --git a/src/assets/head-right-bg.png b/src/assets/head-right-bg.png new file mode 100644 index 0000000..e884634 Binary files /dev/null and b/src/assets/head-right-bg.png differ diff --git a/src/components/card/CardProj.tsx b/src/components/card/CardProj.tsx index 0d9e782..d1cff45 100644 --- a/src/components/card/CardProj.tsx +++ b/src/components/card/CardProj.tsx @@ -4,23 +4,29 @@ import { ClockCircleOutlined, CloseCircleOutlined, CreditCardOutlined, - DownloadOutlined, + DownloadOutlined, DownOutlined, EditOutlined, EyeOutlined, - FolderOutlined, LoadingOutlined, SearchOutlined, SettingOutlined, WarningOutlined } from '@ant-design/icons'; -import {Button, ConfigProvider, Tag} from 'antd'; +import {Button, ConfigProvider, Dropdown, Tag} from 'antd'; import {GenerateStatus, IProj, PayStatus} from "../../interfaces/proj/IProj.ts"; import {useNavigate} from "react-router-dom"; -import {Axios} from "../../util/AjaxUtils.ts"; +import {Axios, put} from "../../util/AjaxUtils.ts"; +import {useContext, useState} from "react"; +import {IndexListContext} from "../../context/IndexListContext.ts"; +import useMessage from "antd/es/message/useMessage"; export default function CardProj(props: { item: IProj }) { const nav = useNavigate(); const data = props.item; + const [messageApi, messageContext] = useMessage(); + const [projCategoryName, setProjCategoryName] = useState(data.projCategoryName); + const indexListContext = useContext(IndexListContext); + /** * 生成状态 @@ -45,11 +51,11 @@ export default function CardProj(props: { item: IProj }) { } const renderOption = () => { - if(data.pay.payStatus == PayStatus.UNPAID) { + if (data.pay.payStatus == PayStatus.UNPAID) { return ( <>
- +
) @@ -58,21 +64,21 @@ export default function CardProj(props: { item: IProj }) { <>
+
+ ) + } + return ( +
+ + {form.getFieldValue('rechargeMoney')} + +
+ ) + } + + const renderPayBody = () => { + if (thirdParty == '对公转账') { + return ( + <> +
+ 收款方信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
公司名称 + {paySystemBank.bankAccountName} +
开户银行 + {paySystemBank.bankName} +
银行账号 + {paySystemBank.bankNumber} +
银行联行号 + {paySystemBank.bankUnionpayNumber} +
打款备注 +
{paySystemBank.bankRemark}
+
说明 +
请打款时必须按照以上备注填写
+
+
+
+ 付款方信息 + + + + + + + + + + + + + + + + + + + + + + + +
公司名称 * + + + +
开户银行 * + + + +
打款时间 * + + + { + form.setFieldValue('rechargeFinalTime', dateString); + }}/> + + +
打款凭证 * + + { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; + if (!isJpgOrPng) { + message.error('只能上传 JPG/PNG 格式文件!'); + } + return isJpgOrPng; + }} + onChange={(info) => { + if (info.file.status === 'uploading') { + setIsLoading(true); + return; + } + if (info.file.status === 'done') { + setIsLoading(false); + info.file.uid = info.file.response.data.fileId; + rechargeVoucherArray.push(info.file.uid); + setRechargeVoucherArray([...rechargeVoucherArray]); + form.setFieldValue('rechargeVoucher', rechargeVoucherArray.join(',')); + return; + } + }} + onRemove={(info) => { + console.log((info.uid)) + const idArray = rechargeVoucherArray.filter(item => item != info.uid); + setRechargeVoucherArray([...idArray]); + form.setFieldValue('rechargeVoucher', rechargeVoucherArray.join(',')); + }} + > + + + +
+
+ + ) + } + return <> + +
+ + { + isCountdownTimeout ? ( +
{ + getPay() + }}> + + 点击刷新 +
+ ) : <> + } +
+
{countdownTime}
+
+ + } + + return ( + <> + +
{ + + post({ + messageApi, + url: `/api/pay/pay-account-recharge/${accountRechargeId}`, + body: { + thirdParty: form.getFieldValue('thirdParty'), + rechargeMoney: form.getFieldValue('rechargeMoney'), + orgName: thirdParty == ThirdPartyEnum.DGZZ ? form.getFieldValue('orgName') : '', + orgBank: thirdParty == ThirdPartyEnum.DGZZ ? form.getFieldValue('orgBank') : '', + orgNumber: thirdParty == ThirdPartyEnum.DGZZ ? form.getFieldValue('orgNumber') : '', + rechargeFinalTime: thirdParty == ThirdPartyEnum.DGZZ ? form.getFieldValue('rechargeFinalTime') : '', + rechargeVoucher: thirdParty == ThirdPartyEnum.DGZZ ? form.getFieldValue('rechargeVoucher') : '', + }, + onBefore() { + setIsLoading(true); + }, + onSuccess() { + props.handleConfirm(); + }, + onFinally() { + setIsLoading(false); + } + }); + }} + autoComplete="off" + > + + { + form.setFieldValue('thirdParty', e.target.value); + setThirdParty(e.target.value); + getPay(); + }} defaultValue="a"> + 微信 + 支付宝 + {/*银联*/} + 对公转账 + + + + {renderMoney()} + + {renderPayBody()} +
+ + +
+ +
+ {messageApiContext} + + ) +} \ No newline at end of file diff --git a/src/route/payment/payment.css b/src/route/payment/payment.css new file mode 100644 index 0000000..9af4aa0 --- /dev/null +++ b/src/route/payment/payment.css @@ -0,0 +1,46 @@ +.pay-table { + width: 100%; + border: 1px solid var(--color-border); + border-collapse: collapse; +} + +.pay-table tr td { + padding: 10px 10px; + border: 1px solid var(--color-border); +} + +.pay-table tr .table-label { + text-align: center; + background-color: #EEEEEE; +} + +.pay-table tr td .mark { + color: red; +} + +.qr-code { + position: relative; +} + +.qr-timeout { + width: 330px; + height: 330px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background-color: rgba(0,0,0,0.8); + position: absolute; + top: 0; + left: 0; + color: #FFF; + cursor: pointer; +} + +.qr-timeout .anticon { + font-size: 90px; +} + +.qr-timeout .label { + padding: 15px; +} \ No newline at end of file diff --git a/src/route/proj/ProjCreate.tsx b/src/route/proj/ProjCreate.tsx index 2ac2f3e..554454e 100644 --- a/src/route/proj/ProjCreate.tsx +++ b/src/route/proj/ProjCreate.tsx @@ -25,7 +25,7 @@ export default function ProjCreate() { const height = window.innerHeight - 150; useEffect(() => { - get({ + get({ messageApi: messageApi, url: '/api/proj/charge/get', onSuccess({data}) { diff --git a/src/route/proj/ProjNew.tsx b/src/route/proj/ProjNew.tsx index cd1ed1a..9a5e03d 100644 --- a/src/route/proj/ProjNew.tsx +++ b/src/route/proj/ProjNew.tsx @@ -141,7 +141,7 @@ export default function ProjNew() { open={isCreateModalOpen} onOk={() => { setIsCreateModalOpen(false); - post({ + post({ messageApi, url: '/api/proj/create', body: { diff --git a/src/route/proj/edit/ProjConfigLoginpage.tsx b/src/route/proj/edit/ProjConfigLoginpage.tsx index 1d16dcf..4c59285 100644 --- a/src/route/proj/edit/ProjConfigLoginpage.tsx +++ b/src/route/proj/edit/ProjConfigLoginpage.tsx @@ -53,7 +53,7 @@ export default function ProjConfigLoginpage() { }; const preview = () => { - post({ + post({ messageApi, url: '/api/proj/preview', body: { @@ -72,7 +72,7 @@ export default function ProjConfigLoginpage() { } useEffect(() => { - get({ + get({ messageApi, url: `/api/proj/get/config-loginpage/${pathParams.projId}`, onSuccess({data}) { diff --git a/src/route/proj/edit/ProjConfigLoginpageShow.tsx b/src/route/proj/edit/ProjConfigLoginpageShow.tsx index d8e05a4..af71773 100644 --- a/src/route/proj/edit/ProjConfigLoginpageShow.tsx +++ b/src/route/proj/edit/ProjConfigLoginpageShow.tsx @@ -48,7 +48,7 @@ export default function ProjConfigLoginpageShow() { }; const preview = () => { - post({ + post({ messageApi, url: '/api/proj/preview', body: { @@ -67,7 +67,7 @@ export default function ProjConfigLoginpageShow() { } useEffect(() => { - get({ + get({ messageApi, url: `/api/proj/get/config-loginpage/${pathParams.projId}`, onSuccess({data}) { diff --git a/src/route/proj/edit/ProjConfigMenuList.tsx b/src/route/proj/edit/ProjConfigMenuList.tsx index e5be977..d37e5eb 100644 --- a/src/route/proj/edit/ProjConfigMenuList.tsx +++ b/src/route/proj/edit/ProjConfigMenuList.tsx @@ -29,7 +29,7 @@ export default function ProjConfigMenuList() { const height = window.innerHeight - 165; const renderData = () => { - get({ + get({ messageApi, url: '/api/proj-menu/list', config: { diff --git a/src/route/proj/edit/ProjConfigMenuListShow.tsx b/src/route/proj/edit/ProjConfigMenuListShow.tsx index 6087f0d..028dac3 100644 --- a/src/route/proj/edit/ProjConfigMenuListShow.tsx +++ b/src/route/proj/edit/ProjConfigMenuListShow.tsx @@ -25,7 +25,7 @@ export default function ProjConfigMenuListShow() { const height = window.innerHeight - 165; const renderData = () => { - get({ + get({ messageApi, url: '/api/proj-menu/list', config: { diff --git a/src/route/proj/edit/ProjConfigModEdit.tsx b/src/route/proj/edit/ProjConfigModEdit.tsx index eda1389..3da5c71 100644 --- a/src/route/proj/edit/ProjConfigModEdit.tsx +++ b/src/route/proj/edit/ProjConfigModEdit.tsx @@ -32,7 +32,7 @@ export default function ProjConfigModEdit() { const height = window.innerHeight - 180; useEffect(() => { - get({ + get({ messageApi, url: `api/proj-mod/get/${pathParams.projModId}`, onSuccess({data}) { diff --git a/src/route/proj/edit/ProjConfigModList.tsx b/src/route/proj/edit/ProjConfigModList.tsx index 494b01c..e386f78 100644 --- a/src/route/proj/edit/ProjConfigModList.tsx +++ b/src/route/proj/edit/ProjConfigModList.tsx @@ -32,7 +32,7 @@ export default function ProjConfigModList() { const height = window.innerHeight - 165; const renderData = () => { - get({ + get({ messageApi, url: '/api/proj-mod/list', config: { diff --git a/src/route/proj/edit/ProjConfigModListShow.tsx b/src/route/proj/edit/ProjConfigModListShow.tsx index e96d0f1..69e0874 100644 --- a/src/route/proj/edit/ProjConfigModListShow.tsx +++ b/src/route/proj/edit/ProjConfigModListShow.tsx @@ -31,7 +31,7 @@ export default function ProjConfigModListShow() { const height = window.innerHeight - 165; const renderData = () => { - get({ + get({ messageApi, url: '/api/proj-mod/list', config: { diff --git a/src/route/proj/edit/ProjConfigModShow.tsx b/src/route/proj/edit/ProjConfigModShow.tsx index 606db56..6c3646d 100644 --- a/src/route/proj/edit/ProjConfigModShow.tsx +++ b/src/route/proj/edit/ProjConfigModShow.tsx @@ -28,7 +28,7 @@ export default function ProjConfigModShow() { const height = window.innerHeight - 180; useEffect(() => { - get({ + get({ messageApi, url: `api/proj-mod/get/${pathParams.projModId}`, onSuccess({data}) { diff --git a/src/route/proj/edit/ProjEditStep3.tsx b/src/route/proj/edit/ProjEditStep3.tsx index 5a30b14..e5b6f32 100644 --- a/src/route/proj/edit/ProjEditStep3.tsx +++ b/src/route/proj/edit/ProjEditStep3.tsx @@ -46,7 +46,7 @@ export default function ProjEditStep3() { const listEnvHard = () => { return new Promise((resolve) => { - get({ + get({ messageApi, url: '/api/proj-env-hard/list', onSuccess({data}) { @@ -57,7 +57,7 @@ export default function ProjEditStep3() { } const listEnvSoft = () => { return new Promise((resolve) => { - get({ + get({ messageApi, url: '/api/proj-env-soft/list', onSuccess({data}) { @@ -68,7 +68,7 @@ export default function ProjEditStep3() { } const listEnvLang = () => { return new Promise((resolve) => { - get({ + get({ messageApi, url: '/api/proj/env/lang/list', onSuccess({data}) { @@ -79,7 +79,7 @@ export default function ProjEditStep3() { } const listEnvTechnical = () => { return new Promise((resolve) => { - get({ + get({ messageApi, url: '/api/proj/env/technical/list', onSuccess({data}) { diff --git a/src/route/proj/edit/ProjEditStep3Show.tsx b/src/route/proj/edit/ProjEditStep3Show.tsx index a7fc177..5796ded 100644 --- a/src/route/proj/edit/ProjEditStep3Show.tsx +++ b/src/route/proj/edit/ProjEditStep3Show.tsx @@ -43,7 +43,7 @@ export default function ProjEditStep3Show() { const listEnvHard = () => { return new Promise((resolve) => { - get({ + get({ messageApi, url: '/api/proj-env-hard/list', onSuccess({data}) { @@ -54,7 +54,7 @@ export default function ProjEditStep3Show() { } const listEnvSoft = () => { return new Promise((resolve) => { - get({ + get({ messageApi, url: '/api/proj-env-soft/list', onSuccess({data}) { @@ -65,7 +65,7 @@ export default function ProjEditStep3Show() { } const listEnvLang = () => { return new Promise((resolve) => { - get({ + get({ messageApi, url: '/api/proj/env/lang/list', onSuccess({data}) { @@ -76,7 +76,7 @@ export default function ProjEditStep3Show() { } const listEnvTechnical = () => { return new Promise((resolve) => { - get({ + get({ messageApi, url: '/api/proj/env/technical/list', onSuccess({data}) { diff --git a/src/route/proj/edit/ProjEditStep4.tsx b/src/route/proj/edit/ProjEditStep4.tsx index d759e99..48f04b9 100644 --- a/src/route/proj/edit/ProjEditStep4.tsx +++ b/src/route/proj/edit/ProjEditStep4.tsx @@ -40,7 +40,7 @@ export default function ProjEditStep4() { const listArea = (pId: string) => { return new Promise((resolve) => { - get({ + get({ messageApi, url: '/api/area/list-area-ztree', config: { diff --git a/src/route/proj/edit/ProjEditStep4Show.tsx b/src/route/proj/edit/ProjEditStep4Show.tsx index 0371476..c9621c1 100644 --- a/src/route/proj/edit/ProjEditStep4Show.tsx +++ b/src/route/proj/edit/ProjEditStep4Show.tsx @@ -37,7 +37,7 @@ export default function ProjEditStep4Show() { const listArea = (pId: string) => { return new Promise((resolve) => { - get({ + get({ messageApi, url: '/api/area/list-area-ztree', config: { diff --git a/src/route/proj/edit/ProjEditStep6.tsx b/src/route/proj/edit/ProjEditStep6.tsx index 7579646..a13b83e 100644 --- a/src/route/proj/edit/ProjEditStep6.tsx +++ b/src/route/proj/edit/ProjEditStep6.tsx @@ -26,7 +26,7 @@ export default function ProjEditStep6() { const listLoginpage = () => { return new Promise(resolve => { - get({ + get({ messageApi, url: '/api/loginpage/list', onSuccess({data}) { diff --git a/src/route/proj/edit/ProjEditStep6Show.tsx b/src/route/proj/edit/ProjEditStep6Show.tsx index 9a64477..379bcb0 100644 --- a/src/route/proj/edit/ProjEditStep6Show.tsx +++ b/src/route/proj/edit/ProjEditStep6Show.tsx @@ -22,7 +22,7 @@ export default function ProjEditStep6Show() { const listLoginpage = () => { return new Promise(resolve => { - get({ + get({ messageApi, url: '/api/loginpage/list', onSuccess({data}) { diff --git a/src/route/router.tsx b/src/route/router.tsx index 06195f1..3629a69 100644 --- a/src/route/router.tsx +++ b/src/route/router.tsx @@ -1,4 +1,4 @@ -import {createBrowserRouter} from "react-router-dom"; +import {createHashRouter} from "react-router-dom"; import Index from "../route/index/Index.tsx"; import ProjCreate from "./proj/ProjCreate.tsx"; import ProjNew from "./proj/ProjNew.tsx"; @@ -29,7 +29,7 @@ import AgentAgreement from "./agent/AgentAgreement.tsx"; import AgentCorrection from "./agent/AgentCorrection.tsx"; import AgentResult from "./agent/AgentResult.tsx"; -export const router = createBrowserRouter([ +export const router = createHashRouter([ { path: '/', element: @@ -146,4 +146,5 @@ export const router = createBrowserRouter([ path: '/agent-result/:orderId', element: } +// ], {basename: import.meta.env.BASE_URL}) ]) \ No newline at end of file diff --git a/src/util/AjaxUtils.ts b/src/util/AjaxUtils.ts index 1d35610..7d1e129 100644 --- a/src/util/AjaxUtils.ts +++ b/src/util/AjaxUtils.ts @@ -2,7 +2,11 @@ import axios, {AxiosRequestConfig, AxiosResponse} from "axios"; import type {MessageInstance} from "antd/es/message/interface"; export const Axios = axios; + +axios.defaults.baseURL = 'http://127.0.0.1:7025/copyright'; +// axios.defaults.baseURL = '/copyright'; export const DevUserId: string = '80d3365e-0597-4988-979e-18ef1c3ec671'; +// export const DevUserId: string = ''; type Req = { messageApi: MessageInstance; @@ -14,8 +18,6 @@ type Req = { onFinally?(): void; } -axios.defaults.baseURL = 'http://127.0.0.1:7025/copyright'; - axios.interceptors.request.use(config => { if (config.method === 'get') { config.data = {unused: 0} // 这个是关键点,解决get 请求添加不上content_type diff --git a/vite.config.ts b/vite.config.ts index 9042286..8929d1a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,5 +6,6 @@ export default defineConfig({ plugins: [react()], server: { host: '0.0.0.0' - } + }, + base: './' })