From f0783a075196d0fd6ea63653d08f2f583427ba93 Mon Sep 17 00:00:00 2001 From: lyp Date: Sun, 2 Mar 2025 11:41:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E9=A4=90=E5=8C=85=E5=8F=8A=E5=85=85?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BelongPeople/BelongPeople.tsx | 36 +- .../ContactPeople/ContactPeople.tsx | 36 +- src/components/ai/AiHelper.tsx | 78 +- src/components/card/CardProj.tsx | 4 +- src/components/card/CardProjType.tsx | 45 +- src/components/card/card-proj-type.css | 16 + src/components/payment/Payment.tsx | 784 ++++++++++--- src/components/payment/payment.css | 60 +- src/components/recharge/RechargeHead.tsx | 10 +- src/interfaces/proj/ICardProj.ts | 3 +- src/route/proj/ProjCreate.tsx | 15 +- src/route/proj/ProjNew.tsx | 1018 ++++++++++++++--- src/route/proj/edit/ProjEditStep2.tsx | 55 +- src/route/proj/proj-new.css | 30 +- src/static/dg.png | Bin 0 -> 5379 bytes src/static/homes.png | Bin 0 -> 1435 bytes src/static/nodate.png | Bin 0 -> 80934 bytes src/static/wx.png | Bin 0 -> 3188 bytes src/static/zfb.png | Bin 0 -> 3363 bytes src/util/AjaxUtils.ts | 1 + 20 files changed, 1820 insertions(+), 371 deletions(-) create mode 100644 src/static/dg.png create mode 100644 src/static/homes.png create mode 100644 src/static/nodate.png create mode 100644 src/static/wx.png create mode 100644 src/static/zfb.png diff --git a/src/components/BelongPeople/BelongPeople.tsx b/src/components/BelongPeople/BelongPeople.tsx index 0ad1e37..0db4892 100644 --- a/src/components/BelongPeople/BelongPeople.tsx +++ b/src/components/BelongPeople/BelongPeople.tsx @@ -505,6 +505,7 @@ export default function BelongPeople(props: propsInfo) {
{/* 表格 */} {props.isShow ? ( + { - // return { - // onClick: (event: React.MouseEvent) => { - // // 阻止默认的行点击事件,以避免选中行时触发其他操作 - // event.stopPropagation(); - // // 更新选中的行 - // belongRowSelection.onChange([record.projOwnerId], [record]); - // }, - // }; - // }} + onRow={(record: any) => { + return { + onClick: (event: React.MouseEvent) => { + // 检查点击的元素是否在操作列内 + const isActionColumn = (event.target as HTMLElement).closest('.ant-table-cell-action'); + if (!isActionColumn) { + // 阻止默认的行点击事件,以避免选中行时触发其他操作 + event.stopPropagation(); + // 更新选中的行 + belongRowSelection.onChange([record.projOwnerId], [record]); + } + }, + style: { cursor: 'pointer' } + }; + }} > ( -
{ +
{ handleRowClick(record) }}> {text} @@ -547,7 +553,7 @@ export default function BelongPeople(props: propsInfo) { title="所属类型" dataIndex="type" render={(_text, record: any) => ( -
{ +
{ handleRowClick(record) }}> {record.type === 'PERSONAL' ? '自然人' : '企业/组织'} @@ -559,7 +565,7 @@ export default function BelongPeople(props: propsInfo) { title="所属证件类型" dataIndex="idCardType" render={(_text, record: any) => ( -
{ +
{ handleRowClick(record) }}> {record.idCardType === 'ID_CARD' ? '身份证' : '营业执照'} @@ -568,7 +574,7 @@ export default function BelongPeople(props: propsInfo) { /> ( -
{ +
{ handleRowClick(record) }}> {text} @@ -579,6 +585,7 @@ export default function BelongPeople(props: propsInfo) { ( { @@ -671,6 +678,7 @@ export default function BelongPeople(props: propsInfo) { )} />
+ ) : ( { - // return { - // onClick: (event: React.MouseEvent) => { - // // 阻止默认的行点击事件,以避免选中行时触发其他操作 - // event.stopPropagation(); - // // 更新选中的行 - // ContantRowSelection.onChange([record.projContactId], [record]); - // }, - // }; - // }} + onRow={(record: any) => { + return { + onClick: (event: React.MouseEvent) => { + // 检查点击的元素是否在操作列内 + const isActionColumn = (event.target as HTMLElement).closest('.ant-table-cell-action'); + if (!isActionColumn) { + // 阻止默认的行点击事件,以避免选中行时触发其他操作 + event.stopPropagation(); + // 更新选中的行 + ContantRowSelection.onChange([record.projContactId], [record]); + } + }, + + style: { cursor: 'pointer' } + }; + + }} dataSource={tableContactData} pagination={{ defaultPageSize: 5, // 设置默认一页显示 5 条数据 @@ -275,7 +282,7 @@ export default function ContactPeople(props: any) { > ( -
{ +
{ handleRowClick(record) }}> {text} @@ -284,7 +291,7 @@ export default function ContactPeople(props: any) { /> ( -
{ +
{ handleRowClick(record) }}> {text} @@ -293,7 +300,7 @@ export default function ContactPeople(props: any) { /> ( -
{ +
{ handleRowClick(record) }}> {text} @@ -303,7 +310,7 @@ export default function ContactPeople(props: any) { (text !== '' ? text : '一')} render={(text, record: any) => ( -
{ +
{ handleRowClick(record) }}> {text !== '' ? text : '一'} @@ -315,6 +322,7 @@ export default function ContactPeople(props: any) { ( { diff --git a/src/components/ai/AiHelper.tsx b/src/components/ai/AiHelper.tsx index 3cbee19..2d5da64 100644 --- a/src/components/ai/AiHelper.tsx +++ b/src/components/ai/AiHelper.tsx @@ -300,33 +300,87 @@ export default function AiHelper(props: PropsType) { // } const xixi = () => { setIsFast(true) - ws.current?.send(JSON.stringify({ - type: 'REFRESH_AI_PROJ', - projId: props.projId - })); + // ws.current?.send(JSON.stringify({ + // type: 'REFRESH_AI_PROJ', + // projId: props.projId + // })); ping(); setIsProjIntroductionLoading(true); setIsProjDescLoading(true); setIsProjModArrayLoading(true); + get({ + messageApi, + url: `/api/proj/auto/get-introduction-desc-mods/${props.projId}`, + config: { + params: { + + } + }, + onBefore() { + + }, + onSuccess() { + + }, + onFinally() { + + }, + }) } const generateProjDesc = () => { - ws.current?.send(JSON.stringify({ - type: 'REFRESH_PROJ_DESC', - projId: props.projId - })); + // ws.current?.send(JSON.stringify({ + // type: 'REFRESH_PROJ_DESC', + // projId: props.projId + // })); ping(); setIsProjDescLoading(true); + get({ + messageApi, + url: `/api/proj/auto/get-desc/${props.projId}`, + config: { + params: { + + } + }, + onBefore() { + + }, + onSuccess() { + + }, + onFinally() { + + }, + }) } const generateProjModArray = () => { - ws.current?.send(JSON.stringify({ - type: 'REFRESH_PROJ_MODS', - projId: props.projId - })); + // ws.current?.send(JSON.stringify({ + // type: 'REFRESH_PROJ_MODS', + // projId: props.projId + // })); ping(); setIsProjModArrayLoading(true); + get({ + messageApi, + url: `/api/proj/auto/get-mods/${props.projId}`, + config: { + params: { + + } + }, + onBefore() { + + }, + onSuccess() { + + }, + onFinally() { + + }, + }) } useEffect(() => { if (isFast && !isProjIntroductionLoading && !isProjDescLoading && !isProjModArrayLoading) { diff --git a/src/components/card/CardProj.tsx b/src/components/card/CardProj.tsx index 141e2ab..8786056 100644 --- a/src/components/card/CardProj.tsx +++ b/src/components/card/CardProj.tsx @@ -631,7 +631,9 @@ export default function CardProj(props: any) { style={{ color: data.projStatus == 'NORMAL' || data.projStatus == 'EXPIRED' ? '#FF5D15' : '#8a8a8a' }} > - {data.pay.payment / 100} + {/* {data.pay.payment / 100} */} + {data.pay.servicePackageId?0: data.pay.payment/ 100} + {/* 2000.00 */}
(已优惠{data.pay.couponAmount / 100}元)
diff --git a/src/components/card/CardProjType.tsx b/src/components/card/CardProjType.tsx index 770855a..d8514d5 100644 --- a/src/components/card/CardProjType.tsx +++ b/src/components/card/CardProjType.tsx @@ -168,23 +168,32 @@ export default function CardProjType(props: ICardProj) { return props.buyArray.map((buy, index) => { return ( -
-
{buy.label}{(buy.price + chargeAmount) / 100} 元
- {/*
*/} -
- -
+ //
+ //
{buy.label}{(buy.price + chargeAmount) / 100} 元
+ // {/*
*/} + //
+ // + //
+ //
+
{ + buy.handleClick(props.head, { + pkg: pkg, + videoDemo: videoDemo, + urgent: urgent, + }); + }}> + 购买
) }) @@ -264,7 +273,7 @@ export default function CardProjType(props: ICardProj) {
{renderLines()}
{renderNew()}
-
{props.text}
+
{props.text}
{renderCharge()}
diff --git a/src/components/card/card-proj-type.css b/src/components/card/card-proj-type.css index 05a1762..d0ec254 100644 --- a/src/components/card/card-proj-type.css +++ b/src/components/card/card-proj-type.css @@ -273,3 +273,19 @@ .notes-text:hover .notes-box{ display: block; } +.buyBtnNew{ + width: 100%; + height: 50px; + padding: 0 10px; + background-color: rgb(255, 255, 255); + box-shadow: 0px 7px 7px 0px rgba(30,30,30,0.18); + border-radius: 13px; + font-size: 18px; + color: rgb(105, 105, 105); + font-weight: 800; + font-family: PingFang SC; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; +} diff --git a/src/components/payment/Payment.tsx b/src/components/payment/Payment.tsx index 7a990aa..09007b4 100644 --- a/src/components/payment/Payment.tsx +++ b/src/components/payment/Payment.tsx @@ -3,7 +3,8 @@ import { Button, ConfigProvider, DatePicker, - Divider, Flex, + // Divider, + Flex, Form, GetProp, Image, Input, InputNumber, @@ -12,7 +13,9 @@ import { Spin, Upload, UploadProps, Tag, - Modal + Modal, + // Select, + Table } from "antd"; import { ReloadOutlined @@ -25,6 +28,23 @@ import { DevUserId, get, post, uploadImageUrl } from "../../util/AjaxUtils.ts"; import { UploadOutlined } from "@ant-design/icons"; import useMessage from "antd/es/message/useMessage"; import { errorImage } from "../../util/CommonUtil.ts"; +import type { + TableColumnsType, + // TableProps +} from 'antd'; +import wx from '../../static/wx.png'; +import zfb from '../../static/zfb.png'; +import dg from '../../static/dg.png'; +import nodate from '../../static/nodate.png'; + +// import { render } from 'react-dom'; +interface DataType { + key: React.Key; + packageName: string; + packageMoney: number; + packageDescription: string; + packageInfoId: string; +} dayjs.locale('zh-cn'); @@ -63,11 +83,189 @@ interface IPaymentProps { handleConfirm(): void; handleCancel(): void; + show: boolean; } export default function Payment(props: IPaymentProps) { + // 服务包相关 + const [packPage, setPackPage] = useState(1); //服务包数据分页页码 + // 开启关闭弹窗时重置页码 + useEffect(() => { + setPackPage(1); + }, [props.show]) + const [packTotal, setPackTotal] = useState(0); //服务包数据分页总条数 + const [value, setValue] = useState('MATERIAL');//单选 服务包类型 + const onChange = (e: any) => { + setValue(e.target.value); + getPackageList(e.target.value, packPage); + // setSelectedRowKeys([]); + }; + const [packList, setPackList] = useState([]); + const [packageInfoId, setPackageInfoId] = useState('');//单选 服务包id + // 获取套餐列表 + const getPackageList = (value: string, page: number) => { + get({ + messageApi, + url: `/api/proj/servicepkg/packageinfo/listpage/${value}/self`, + config: { + params: { + page: page, + rows: 7, + + } + }, + onSuccess({ data }) { + setPackList(data.rows); + setPackTotal(data.total); + } + }) + } + useEffect(() => { + getPackageList(value, packPage); + }, []) + const packColumns: TableColumnsType = [ + { + title: '序号', + dataIndex: 'index', + key: 'packageInfoId', + align: 'center', + // 宽度 + width: 80, + render: (_text: number, _record: any, index: number) => { + return
{(packPage - 1) * 7 + index + 1}
+ } + }, + { + title: '套餐名称', + width: 150, + align: 'center', + dataIndex: 'packageName', + key: 'packageInfoId', + ellipsis: { + showTitle: false, + }, + render: (text: string) => { + return
{text}
+ } + }, + { + title: '套餐说明', + width: 200, + align: 'center', + dataIndex: 'packageDescription', + key: 'packageInfoId', + ellipsis: { + showTitle: false, + }, + render: (text: string) => { + return
{text}
+ } + + }, + { + title: '套餐价格', + width: 100, + align: 'center', + dataIndex: 'packageMoney', + key: 'packageInfoId', + render: (text: number) => { + return
{text / 100}元
+ } + }, + { + title: '可用次数', + width: 100, + align: 'center', + dataIndex: 'packageCount', + key: 'packageInfoId', + // render: (text: number) => { + // return
{text / 100}元
+ // } + }, + { + title: '操作', + align: 'center', + width: 100, + dataIndex: 'operate', + key: 'packageInfoId', + render: (value, record) => { + return ( +
+
{ + if (!packageInfoId) { + setPackageInfoId(record.packageInfoId); + form.setFieldValue('rechargeMoney', (record.packageMoney) / 100); + getPay(record.packageInfoId); + } + }} + >选购
+
{ + setPackageInfoId(''); + form.setFieldValue('rechargeMoney', 280); + getPay(''); + }} + >取消
+
+ ) + } + } + + ]; + + + + + const [thirdParty, setThirdParty] = useState(); + // const [selectedRowKeys, setSelectedRowKeys] = useState([]); + // useEffect(() => { + // if (packageInfoId) { + // setSelectedRowKeys([packageInfoId]); + // } else { + // setSelectedRowKeys([]); + // } + // }, [packageInfoId]); + // const rowSelection: TableProps['rowSelection'] = { + // selectedRowKeys, + // // onChange: (selectedRowKeys: React.Key[], selectedRows: DataType[]) => { + // // setSelectedRowKeys(selectedRowKeys); + // // console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); + // // setPackageInfoId(selectedRows[0].packageInfoId); + // // // form.getFieldValue('rechargeMoney') + // // form.setFieldValue('rechargeMoney', (selectedRows[0].packageMoney) / 100); + + // // // getPay(selectedRows[0].packageInfoId); + // // // console.log(selectedRowKeys, selectedRows); + // // // if(packageInfoId == selectedRows[0].packageInfoId){ + // // // setSelectedRowKeys([]); + // // // }else{ + // // // setSelectedRowKeys(selectedRowKeys); + // // // } + + + // // }, + + + + // }; + + // 是否显示完成付款按钮 - const [showPay ,setshowPay] = useState('unset') + const [showPay, setshowPay] = useState('unset') // 支付完成弹窗 const [paymentModal, setPaymentModal] = useState(false) const [mask, setMask] = useState(false) @@ -76,7 +274,7 @@ export default function Payment(props: IPaymentProps) { const [isRechargeMoneyEdit, setIsRechargeMoneyEdit] = useState(false); const [isLoading, setIsLoading] = useState(false); const [rechargeVoucherArray, setRechargeVoucherArray] = useState([]); - const [thirdParty, setThirdParty] = useState(); + const [accountRechargeId, setAccountRechargeId] = useState(''); const [thirdPartyPayUrl, setThirdPartyPayUrl] = useState(''); const [paySystemBank, setPaySystemBank] = useState({ @@ -128,13 +326,16 @@ export default function Payment(props: IPaymentProps) { }, 1000); } - const getPay = () => { + const getPay = (packageInfoId: string) => { + // console.log('获取订单'); + post({ messageApi, url: '/api/pay/get-pay', body: { rechargeMoney: form.getFieldValue('rechargeMoney'), - thirdParty: form.getFieldValue('thirdParty') + thirdParty: form.getFieldValue('thirdParty'), + packageInfoId: packageInfoId }, onBefore() { setIsLoading(true); @@ -172,7 +373,7 @@ export default function Payment(props: IPaymentProps) { setThirdParty(ThirdPartyEnum.DGZZ) return; } - getPay(); + getPay(packageInfoId); // countdown() }, [thirdParty, refreshQrCodeCount]); @@ -193,7 +394,7 @@ export default function Payment(props: IPaymentProps) { messageApi.error(`金额最大为${moneyRange[1]}`) } setIsRechargeMoneyEdit(false); - getPay() + getPay(packageInfoId) setshowPay('unset') }}>确定 +
- - {form.getFieldValue('rechargeMoney')} + + {form.getFieldValue('rechargeMoney')}
+ {/*
+
+ 购买服务包 +
+ +
*/} +
+ +
) } @@ -251,58 +493,12 @@ export default function Payment(props: IPaymentProps) { const renderPayBody = () => { if (thirdParty == '对公转账') { return ( -
+
-
倒计时:{countdownTime}
- 收款方信息 -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
公司名称 - {paySystemBank.bankAccountName} -
开户银行 - {paySystemBank.bankName} -
银行账号 - {paySystemBank.bankNumber} -
银行联行号 - {paySystemBank.bankUnionpayNumber} -
打款备注 -
{paySystemBank.bankRemark}
-
说明 -
请打款时必须按照以上备注填写
-
-
-
- 付款方信息 +
付款方信息
@@ -402,6 +598,58 @@ export default function Payment(props: IPaymentProps) {
+
+
收款方信息
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
公司名称 + {paySystemBank.bankAccountName} +
开户银行 + {paySystemBank.bankName} +
银行账号 + {paySystemBank.bankNumber} +
银行联行号 + {paySystemBank.bankUnionpayNumber} +
打款备注 +
{paySystemBank.bankRemark}
+
说明 +
请打款时必须按照以上备注填写
+
+
+
倒计时:{countdownTime}
) } @@ -413,7 +661,26 @@ export default function Payment(props: IPaymentProps) { 正在修改,请稍后... - +
+
支付Pay
+
+ + +
{thirdParty}扫码支付
+
{countdownTime}
+
+ +
{/* { isCountdownTimeout ? (
{ @@ -424,8 +691,9 @@ export default function Payment(props: IPaymentProps) {
) : <> } */} + -
{countdownTime}
+ } @@ -443,34 +711,13 @@ export default function Payment(props: IPaymentProps) { - + {/*
{ setPaymentModal(true) - // 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 ? rechargeVoucherArray.join(',') : '', - // }, - // onBefore() { - // setIsLoading(true); - // }, - // onSuccess() { - // props.handleConfirm(); - // }, - // onFinally() { - // setIsLoading(false); - // } - // }); + }} autoComplete="off" > @@ -482,11 +729,16 @@ export default function Payment(props: IPaymentProps) { { form.setFieldValue('thirdParty', e.target.value); setThirdParty(e.target.value); + // console.log(e.target.value); + setPackageInfoId(''); setIsRechargeMoneyEdit(false) + setValue('') + form.setFieldValue('rechargeMoney', 280); + setSelectedRowKeys([]); + }}> 微信 - 支付宝 - {/*银联*/} + 1支付宝 对公转账 @@ -497,14 +749,289 @@ export default function Payment(props: IPaymentProps) { > {renderMoney()} + +
+
购买服务包:
+ + 全托管 + + ), + }, + { + value: 'MATERIAL', + label: ( + + 写材料 + + ), + }, + + ]} + /> + + +
+
+ +
+ { + return { + onClick: (event: React.MouseEvent) => { + event.stopPropagation(); + // 模拟点击单选框 + // + // 判断当前行是否已经被选中 + const isSelected = selectedRowKeys.includes(record.packageInfoId); + if (isSelected) { + // 处理取消选择的情况 + setSelectedRowKeys([]); + setPackageInfoId(''); + form.setFieldValue('rechargeMoney', 280); + getPay(''); + } else { + // 处理选中的情况 + setSelectedRowKeys([record.packageInfoId]); + setPackageInfoId(record.packageInfoId); + form.setFieldValue('rechargeMoney', (record.packageMoney) / 100); + getPay(record.packageInfoId); + } + }, + style: { cursor: 'pointer' } + }; + }} + /> + + {renderPayBody()} -
- - +
+
+ + +
+
+ + */} + +
{ + setPaymentModal(true) + + }} + autoComplete="off" + > +
+
+ + {renderMoney()} + + + { + form.setFieldValue('thirdParty', e.target.value); + setThirdParty(e.target.value); + // console.log(e.target.value); + setPackageInfoId(''); + setIsRechargeMoneyEdit(false) + // setValue('') + form.setFieldValue('rechargeMoney', 280); + // setSelectedRowKeys([]); + + }}> + + + 微信 + + + + 支付宝 + + + + 对公转账 + + + + + +
+
+ 服务包:
+ + 写材料 + + ), + }, + { + value: 'ALL', + label: ( + + 全托管 + + ), + }, + + + ]} + /> + + +
+
+
0 ? 'unset' : 'none', + marginLeft: 90 + }}> + +
+
7 ? 'unset' : 'none', + }}> +
+
{ + if (packPage > 1) { + setPackPage(packPage - 1); + getPackageList(value, packPage - 1); + }else{ + messageApi.error('已经是第一页了'); + } + }} + style={{ + cursor: packPage > 1 ? 'pointer' : 'not-allowed', + background: packPage > 1? '#abc8ff' : '#BAC8DA', + }} + >上一页
+
{ + if (packPage < packTotal / 7) { + setPackPage(packPage + 1); + getPackageList(value, packPage + 1); + }else{ + messageApi.error('已经是最后一页了'); + } + }} + + >下一页
+
+
+ +
+ +
暂无服务包
+
+ + +
+ {renderPayBody()} +
+ +
+
+ + +
@@ -519,34 +1046,35 @@ export default function Payment(props: IPaymentProps) { }, }} onOk={() => { - 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 ? rechargeVoucherArray.join(',') : '', - }, - onBefore() { - setIsLoading(true); - }, - onSuccess() { - props.handleConfirm(); - }, - onFinally() { - setIsLoading(false); - } - }); + 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 ? rechargeVoucherArray.join(',') : '', + packageInfoId: packageInfoId + }, + onBefore() { + setIsLoading(true); + }, + onSuccess() { + props.handleConfirm(); + }, + onFinally() { + setIsLoading(false); + } + }); }} onCancel={() => { setPaymentModal(false); }}> -
-
确定对公转账{form.getFieldValue('rechargeMoney')} 吗?不确定请修改金额。
+
+
确定对公转账{form.getFieldValue('rechargeMoney')} 吗?不确定请修改金额。
diff --git a/src/components/payment/payment.css b/src/components/payment/payment.css index cec7df2..a5a36e6 100644 --- a/src/components/payment/payment.css +++ b/src/components/payment/payment.css @@ -1,17 +1,18 @@ .pay-table { width: 100%; - border: 1px solid var(--color-border); + /* border: 1px solid var(--color-border); */ border-collapse: collapse; + background-color: #FAFCFF; } .pay-table tr td { padding: 10px 10px; - border: 1px solid var(--color-border); + /* border: 1px solid var(--color-border); */ } .pay-table tr .table-label { text-align: center; - background-color: #EEEEEE; + /* background-color: #EEEEEE; */ } .pay-table tr td .mark { @@ -30,7 +31,7 @@ flex-direction: column; justify-content: center; align-items: center; - background-color: rgba(0,0,0,0.8); + background-color: rgba(0, 0, 0, 0.8); position: absolute; top: 0; left: 0; @@ -45,10 +46,53 @@ .qr-timeout .label { padding: 15px; } -.moneyBox{ - display: flex; - margin-top: 10px; -} + .moneyBox { display: flex; + /* margin-top: 10px; */ + margin-left: 30px; } + +.packTable.css-dev-only-do-not-override-11lehqq.ant-table-wrapper .ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr>th { + background: #D9E6FF !important; +} + +/* .packTable.css-dev-only-do-not-override-11lehqq.ant-table-wrapper .ant-table-tbody>tr>th, +.css-dev-only-do-not-override-11lehqq.ant-table-wrapper .ant-table-tbody>tr>td { + background: #edf3ff !important; +} */ + +.payBoxTitle { + background-color: rgba(217, 230, 255, 0.66); + height: 37px; + width: 400px; + font-weight: bold; + font-size: 18px; + line-height: 37px; + padding-left: 20px; + box-sizing: border-box; + /* margin-bottom: 10px; */ +} + +.codeTitle { + background-color: rgba(217, 230, 255, 0.66); + height: 37px; + width: 400px; + font-weight: bold; + font-size: 18px; + line-height: 37px; + text-align: center; +} + +.paytip { + margin-top: 10px; +} + +.clickPage { + width: 91px; + height: 36px; + background: #abc8ff; + text-align: center; + line-height: 36px; + color: #FFFFFF ; +} \ No newline at end of file diff --git a/src/components/recharge/RechargeHead.tsx b/src/components/recharge/RechargeHead.tsx index 0b05b3d..18b3e58 100644 --- a/src/components/recharge/RechargeHead.tsx +++ b/src/components/recharge/RechargeHead.tsx @@ -21,7 +21,7 @@ export default function RechargeHead() { // sse const initSse = () => { let evtSource; - if(DevUserId) { + if (DevUserId) { evtSource = new EventSourcePolyfill(`${Axios.defaults.baseURL}/api/sse/connect`, { headers: { 'X-USER-ID': DevUserId @@ -30,16 +30,16 @@ export default function RechargeHead() { } else { evtSource = new EventSource(`${Axios.defaults.baseURL}/api/sse/connect`); } - evtSource.onmessage = function (event:any) { + evtSource.onmessage = function (event: any) { const msg = JSON.parse(event.data) as SseMsg; - if(msg.type === 'AMOUNT_RECEIVED') { + if (msg.type === 'AMOUNT_RECEIVED') { reloadUser(messageApi, globalDispatchContext).then(() => { setIsPaymentModalOpen(false); }); } }; } - + useEffect(() => { initSse(); }, [globalContext.user]) @@ -57,9 +57,11 @@ export default function RechargeHead() { onCancel={() => { setIsPaymentModalOpen(false); }} + width={1300} footer={false} > { setIsPaymentModalOpen(false); }} diff --git a/src/interfaces/proj/ICardProj.ts b/src/interfaces/proj/ICardProj.ts index 335fc76..5d2d0a0 100644 --- a/src/interfaces/proj/ICardProj.ts +++ b/src/interfaces/proj/ICardProj.ts @@ -18,7 +18,8 @@ export interface ICardProjBuy { handleClick(title: string, additional: { pkg: boolean, videoDemo: boolean, - urgent:boolean + urgent:boolean, + }): void; } diff --git a/src/route/proj/ProjCreate.tsx b/src/route/proj/ProjCreate.tsx index 6f5fbb5..1ccb20e 100644 --- a/src/route/proj/ProjCreate.tsx +++ b/src/route/proj/ProjCreate.tsx @@ -153,7 +153,11 @@ export default function ProjCreate() { id: ProjChargeType.ALL, price: allInfo.price, handleClick: (_title, additional) => { - nav(`/proj-new/${ProjChargeType.ALL}?${additional.urgent ? 'urgent=true' : 'pkg='}`) + nav(`/proj-new/${ProjChargeType.ALL}?${additional.urgent ? 'urgent=true' : 'pkg='}&price=${allInfo.price}`, + { + state: { price:allInfo.price } + } + ) } } ]} @@ -264,7 +268,14 @@ export default function ProjCreate() { id: ProjChargeType.MATERIAL, price: materialInfo.price, handleClick: (_title, additional) => { - nav(`/proj-new/${ProjChargeType.MATERIAL}?${additional.pkg ? 'pkg=true' : 'pkg='}&${additional.videoDemo ? 'videoDemo=true' : 'videoDemo='}`); + // nav(`/proj-new/${ProjChargeType.MATERIAL}?${additional.pkg ? 'pkg=true' : 'pkg='}&${additional.videoDemo ? 'videoDemo=true' : 'videoDemo='}&price=${materialInfo.price}`); + nav( + `/proj-new/${ProjChargeType.MATERIAL}?${additional.pkg ? 'pkg=true' : 'pkg='}&${additional.videoDemo ? 'videoDemo=true' : 'videoDemo='}`, + { + state: { price: materialInfo.price } + } + ); + } } ]} diff --git a/src/route/proj/ProjNew.tsx b/src/route/proj/ProjNew.tsx index 8d895d3..d9fd543 100644 --- a/src/route/proj/ProjNew.tsx +++ b/src/route/proj/ProjNew.tsx @@ -1,7 +1,8 @@ import './proj-new.css'; import { useNavigate, useParams, useSearchParams } from "react-router-dom"; -import { Button, Flex, Form, Input, message, Modal, Spin, Checkbox, DatePicker, Select } from "antd"; -import { useContext, useEffect, useState } from "react"; +import { Table, AutoComplete, Button, Flex, Form, Input, message, Modal, Spin, Checkbox, DatePicker, Select } from "antd"; +import { useContext, useEffect, useState, useRef } from "react"; +import { useLocation } from 'react-router-dom'; import { get, post } from "../../util/AjaxUtils.ts"; // import {GlobalContext} from "../../context/GlobalContext.ts"; import { @@ -14,6 +15,9 @@ import BelongPeople from '../../components/BelongPeople/BelongPeople.tsx' import ContactPeople from '../../components/ContactPeople/ContactPeople.tsx' import dayjs from 'dayjs'; import SelectCouponModal from '../../components/CouponModal/SelectCouponModal.tsx' +// import { key } from 'localforage'; +import homes from '../../static/homes.png' +const { TextArea } = Input; // const { TextArea } = Input; type ProjInfo = { projName: string; @@ -24,9 +28,112 @@ type ProjInfo = { coupon?: string; projVersion: string; backendCodeLang: string; + envIndustry?: string + packageName?: string }; +import type { + TableColumnsType, + TableProps +} from 'antd'; +interface DataType { + key: React.Key; + packageName: string; + packageMoney: number; + packageDescription: string; + packageInfoId: string; + packageOrderId: string; +} + export default function ProjNew() { + const [debounceTimer, setDebounceTimer] = useState(null); + // 创建一个 ref 来引用推荐列表容器 + const recommendListRef = useRef(null); + // const [projNameValue, setProjNameValue] = useState(''); + const [recommendModal, setRecommendModal] = useState(false) //推荐弹窗 + // 土建弹窗输入框内容 + const [recommendInput, setRecommendInput] = useState('') + // 推荐窗口加载中 + // const [ailoading, setAiloading] = useState(false) + const [recommendList, setRecommendList] = useState([ + // '呵呵呵哒系统', + // '坐的我屁股疼系统', + // '坐的腰也非常疼系统', + // '减肥还是不减肥系统系统', + // '我要酷酷吃吃吃吃吃吃系统我要酷酷吃吃吃吃吃吃系统我要酷酷吃吃吃吃吃吃系统我要酷酷吃吃吃吃吃吃系统', + // '晚上吃点啥系统', + // '晚上吃点啥系统', + // '晚上吃点啥系统', + // '晚上吃点啥系统', + // '晚上吃点啥系统', + // '晚上吃点啥系统', + // '晚上吃点啥系统', + + + ]) //推荐系统全称列表 + // 根据输入内容获取标题 + const getRecommendList = () => { + // // setRecommendList([]) + + post({ + messageApi, + url: `/api/proj/recommend/list-proj-name/ai`, + body: { + prompt: recommendInput + }, + onBefore() { + setRecommendLoading(true) + }, + onSuccess({ data }) { + if (recommendListRef.current) { + recommendListRef.current.scrollTop = 0; + } + // console.log(data); + setRecommendList(data) + + }, + onFinally() { + setRecommendLoading(false) + + }, + }) + } + const [recommendLoading, setRecommendLoading] = useState(false) //推荐系统全称列表加载状态 + const [selectList, setSelectList] = useState([]) //联想先择的系统名列表 + // 获取历史项目名称列表 + const getHistoryList = (value: string) => { + // const encodedValue = encodeURIComponent(value); + get({ + messageApi, + url: `/api/proj/recommend/list-proj-name/history`, + config: { + params: { + keywords: value + } + }, + onBefore() { + + }, + onSuccess({ data }: any) { + // console.log(data); + setSelectList(data.map((item: any, index: any) => { + return { + key: index, + value: item + } + })) + }, + onFinally() { + + }, + }) + } + const [packList, setPackList] = useState([]) //服务包列表 + + const location = useLocation(); + // const { price } = location.state || {}; + const [showPrice, setShowPrice] = useState(location.state.price) //显示的价格 + const [selectPack, setSelectPack] = useState(false) //是否选择了服务器套餐 // 是否显示优惠券 const [couponShow, setcouponShow] = useState(true) // const globalContext = useContext(GlobalContext); @@ -53,6 +160,7 @@ export default function ProjNew() { projDevCompleteDate: '', projVersion: '', backendCodeLang: '', + // packageInfoId: '' }); const [form] = Form.useForm(); // 所属者弹窗 @@ -79,6 +187,31 @@ export default function ProjNew() { }) // 优惠券弹窗 const [couponModal, setCouponModal] = useState(false) + // 服务包弹窗 + const [packModal, setPackModal] = useState(false) + + + // 套餐包弹窗表格信息 + + const [total, setTotal] = useState(0) + const [nowPackageName, setNowPackageName] = useState('') //临时选择名字 + const [nowpackageInfoId, setNowpackageInfoId] = useState('') //临时选择包id + const [packageInfoId, setPackageInfoId] = useState('') //确定选择包id + const [nowpackageOrderId, setNowpackageOrderId] = useState('') //临时选择订单id + const [packageOrderId, setPackageOrderId] = useState('') //确定选择订单id + const [selectedRowKeys, setSelectedRowKeys] = useState([packageOrderId]); //被选择的而项目 + const rowSelection: TableProps['rowSelection'] = { + selectedRowKeys, + onChange: (selectedRowKeys: React.Key[], selectedRows: DataType[]) => { + setSelectedRowKeys(selectedRowKeys); + setNowPackageName(selectedRows[0].packageName) + setNowpackageInfoId(selectedRows[0].packageInfoId) + setNowpackageOrderId(selectedRows[0].packageOrderId) + }, + + }; + + const setValue = (value: string) => { form.setFieldsValue({ belongPeople: value @@ -102,6 +235,8 @@ export default function ProjNew() { } // 优惠券id const [couponId, setCouponId] = useState('') + + // 优惠券减的钱数 const [couponNum, setCouponNum] = useState(0) // 查看是否有可用获取优惠券信息 @@ -138,8 +273,89 @@ export default function ProjNew() { } // 提示信息是否显示 const [showTip, setShowTip] = useState(false) + const [page, setPage] = useState(1); + const packColumns: TableColumnsType = [ + { + title: '序号', + dataIndex: 'index', + key: 'packageOrderId', + align: 'center', + render: (_text, _record, index) => (page - 1) * 5 + index + 1, // 显示序号,从1开始 + }, + { + title: '套餐名称', + dataIndex: 'packageName', + key: 'packageOrderId', + // 居中显示 + align: 'center', + }, + { + title: '当前剩余次数', + dataIndex: 'packageTotalSurplusCount', + align: 'center', + key: 'packageOrderId', + render: (text: number) => { + return
{text}
+ } + }, + { + title: '下单时间', + align: 'center', + dataIndex: 'gmtCreate', + key: 'packageOrderId', + // render: (text: string) => { + // return
{text}
+ // } + }, + ]; + // 获取我得服务包信息 + const getPickList = () => { + + get({ + messageApi, + url: `/api/proj/servicepkg/packageorder/listpage/${pathParams.projChargeType}/self`, + config: { + params: { + page: page, + rows: 5, + + } + }, + onBefore() { + + }, + onSuccess({ data }) { + // console.log(data); + // const list = data as any; + // setSelectList(data.rows) + setPackList(data.rows) + setTotal(data.total) + // const newPackList = data.rows.map((item: any) => { + // return { + // value: item.packageInfoId, + // label: item.packageName, + // key: item.packageNo, + // } + // }); + // // + // setPackList(newPackList); + // setHasMore(data.total / 5 > page); + }, + onFinally() { + + } + }) + } + useEffect(() => { + getPickList(); + }, [page]); + // useEffect(() => { + // if(projInfo.packageInfoId == ''){ + // setPage(1) + // } + // },[projInfo.packageInfoId]) useEffect(() => { get({ messageApi: messageApi, @@ -206,6 +422,10 @@ export default function ProjNew() { setcouponShow(false) } getCouponData() + // console.log('价格', showPrice); + getPickList() + // console.log() + }, []); return ( @@ -234,6 +454,9 @@ export default function ProjNew() { wrapperCol={{ span: 24 }} style={{ width: '100%' }} onFinish={(formData) => { + // console.log(formData.projName); + + setIsCreateModalOpen(true); setProjInfo({ projName: formData.projName, @@ -243,10 +466,12 @@ export default function ProjNew() { projDevCompleteDate: formData.projDevCompleteDate, projVersion: formData.projVersion ? formData.projVersion : 'V1.0', backendCodeLang: formData.backendCodeLang, + // packageInfoId: formData.packageInfoId?formData.packageInfoId : '', }) }} autoComplete="off" > +
系统全称*
@@ -256,147 +481,372 @@ export default function ProjNew() { { required: true, message: '请输入系统全称' }, ]} > - { - // 打印值 - // console.log(e.target.value); - if (e.target.value) { - if (isEndsWithKeywords(e.target.value)) { - setShowTip(false) + + {/* { + // 打印值 + // console.log(e.target.value); + if (e.target.value) { + if (isEndsWithKeywords(e.target.value)) { + setShowTip(false) + } else { + setShowTip(true) + } } else { - setShowTip(true) + setShowTip(false) } - } else { - setShowTip(false) - } - }} style={{ background: '#eeeeee', width: '800px', height: '50px', fontSize: '16px' }} placeholder="请输入系统全称 (注:系统全称建议以“软件”、“系统”、“平台”或“APP”结尾)" /> + }} style={{ background: '#eeeeee', width: '800px', height: '50px', fontSize: '16px' }} placeholder="请输入系统全称 (注:系统全称建议以“软件”、“系统”、“平台”或“APP”结尾)" /> */} + + { + // setProjNameValue(value); + if (value) { + if (isEndsWithKeywords(value)) { + setShowTip(false); + } else { + setShowTip(true); + } + } else { + setShowTip(false); + } + }} + onChange={(value) => { + // setProjNameValue(value); + // console.log(value); + + if (value) { + // getHistoryList(value); + if (isEndsWithKeywords(value)) { + setShowTip(false); + } else { + setShowTip(true); + } + // 清除之前的定时器 + if (debounceTimer) { + clearTimeout(debounceTimer); + } + + // 设置新的定时器 + const newTimer = setTimeout(() => { + getHistoryList(value); + }, 1000); + + // 更新定时器 ID + setDebounceTimer(newTimer); + } else { + setShowTip(false); + setSelectList([]) + } + }} + + />
+ { + // form.setFieldsValue({ + // projName: '嘻嘻' + // }); + setRecommendModal(true) + setRecommendList([]) + }} + style={{ + position: 'absolute', + right: -35, + top: 15, + }}>推荐
系统全称建议以“软件”、“系统”、“平台”或“APP”结尾
-
-
系统版本*
- - name="projVersion" - - > - - - - -
-
-
系统语言*
- - name="backendCodeLang" - rules={[ - { required: true, message: '请选择系统语言' }, - ]} - > - - -
- -
-
- 知识产权所属者* -
- - name="belongPeople" - rules={[{ required: true, message: '请选择/创建知识产权所属者' }]} - > - - - -
{ - setBelongModal(true) - }}>选择
-
-
-
- 知识产权联系人* -
- - name="contacts" - rules={[{ required: true, message: '请选择/创建知识产权联系人' }]} - > - - - -
{ - setConcatModal(true) - }}>选择
-
-
-
- 开发完成时间 -
- - // label="开发完成时间" - name="projDevCompleteDate" - // rules={[{ required: true, message: '请输入开发完成时间' }]} - > - current && current > dayjs().endOf('day')} - - /> - -
- -
-
-
- 优惠券 -
+
+
+
系统版本*
- name="coupon" - // rules={[{ required: true, message: '请选择优惠券' }]} + name="projVersion" + > - + -
{ - if (hasCoupon) { - setCouponModal(true) - // #1F79FF - } else { - messageApi.error('无可用优惠券') - } + +
+
+
系统语言*
+ + name="backendCodeLang" + rules={[ + { required: true, message: '请选择系统语言' }, + ]} + > + + +
+
+ +
+ + {/*
+
面向行业/领域*
+ + name="envIndustry" + rules={[ + { required: true, message: '请选面向行业/领域' }, + ]} + > + + +
*/} +
+
+ 开发完成时间 +
+ + // label="开发完成时间" + name="projDevCompleteDate" + // rules={[{ required: true, message: '请输入开发完成时间' }]} + > + current && current > dayjs().endOf('day')} + + /> + +
+ {/* 服务包 */} +
+
+
+
套餐包
+ + name="packageName" + rules={[ + // { required: true, message: '请选择系统语言' }, + ]} + > + {/* */} + 0 ? '请选择套餐包' : '暂无套餐包'} disabled /> + + +
{ + if (packList.length > 0) { + setPackModal(true) + setPage(1) + setSelectedRowKeys([]) + // #1F79FF + } else { + messageApi.error('无可用套餐包') + } + + }}>选择
+
{ + setPackageInfoId('') + setPackageOrderId('') + form.setFieldsValue({ + packageName: '' + }) + setSelectPack(false) + // setcouponShow(true) + setcouponShow(true) + setShowPrice(location.state.price) + }}>取消
+
+
+
+
+
+ +
+
+
+ 优惠券 +
+ + name="coupon" + // rules={[{ required: true, message: '请选择优惠券' }]} + > + + + +
{ + if (hasCoupon) { + setCouponModal(true) + // #1F79FF + } else { + messageApi.error('无可用优惠券') + } + // if (!selectPack) { + // if (hasCoupon) { + // setCouponModal(true); + // } else { + // messageApi.error('暂无可用优惠券'); + // } + // } else { + // messageApi.error('服务包已选择,不可使用优惠券'); + // } + }}>选择
+
{ + setCouponTitle('') + setCouponId('') + setCouponNum(0) + }}>取消
+
+
+
+ {/*
知识产权选择 :
*/} +
+
+ +
知识产权选择
+ +
+
+ +
+
+ 产权所属者* + +
+ + name="belongPeople" + rules={[{ required: true, message: '请选择/创建知识产权所属者' }]} + > + + + +
{ + setBelongModal(true) + }}>选择
+
+
+
+ 产权联系人* +
+ + name="contacts" + rules={[{ required: true, message: '请选择/创建知识产权联系人' }]} + > + + + +
{ + setConcatModal(true) }}>选择
@@ -427,42 +877,79 @@ export default function ProjNew() {
*/}
- - - - + {(showPrice / 100 - couponNum) < 0 ? 0 : showPrice / 100 - couponNum} - - + 元 +
+
+ + + + + + + + +
+
-
该操作会扣除 {(chargePrice / 100 - couponNum) < 0 ? 0 : chargePrice / 100 - couponNum} 元,确定操作吗?
+
该操作会扣除 + {/* {(chargePrice / 100 - couponNum) < 0 ? 0 : chargePrice / 100 - couponNum} */} + {selectPack ? 0 : (chargePrice / 100 - couponNum) < 0 ? 0 : chargePrice / 100 - couponNum} + 元,确定操作吗?
*/} + { + setPackModal(false) + setNowPackageName('') + setNowpackageInfoId('') + setNowpackageOrderId('') + + }}> + +
+
{ + // setSelectedRowKeys(selectedRowKeys); + + + + // }, + + }} + pagination={{ + defaultPageSize: 5, // 设置默认一页显示 5 条数据, + current: page, + total: total, + onChange: (page: number) => { + setPage(page) + // getPickList(page) + // console.log(page); + + + } + }} + rowKey="packageOrderId" + onRow={(record) => { + return { + onClick: (event: React.MouseEvent) => { + event.stopPropagation(); + // setPackSelectNo(record.packageInfoId) + setSelectedRowKeys([record.packageOrderId]); + setNowPackageName(record.packageName) + setNowpackageInfoId(record.packageInfoId) + setNowpackageOrderId(record.packageOrderId) + }, + style: { cursor: 'pointer' } // 鼠标显示为小手 + }; + }} + /> +
+ + +
+ + + { + setRecommendModal(false) + + }}> + +