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}
- |
-
-
- 打款备注 |
-
-
- |
-
-
- 说明 |
-
- 请打款时必须按照以上备注填写
- |
-
-
-
-
-
-
付款方信息
+
付款方信息
@@ -402,6 +598,58 @@ export default function Payment(props: IPaymentProps) {
+
+
收款方信息
+
+
+
+
+
+
+
+ 公司名称 |
+
+ {paySystemBank.bankAccountName}
+ |
+
+
+ 开户银行 |
+
+ {paySystemBank.bankName}
+ |
+
+
+ 银行账号 |
+
+ {paySystemBank.bankNumber}
+ |
+
+
+ 银行联行号 |
+
+ {paySystemBank.bankUnionpayNumber}
+ |
+
+
+ 打款备注 |
+
+
+ |
+
+
+ 说明 |
+
+ 请打款时必须按照以上备注填写
+ |
+
+
+
+
+
倒计时:{countdownTime}
)
}
@@ -413,7 +661,26 @@ export default function Payment(props: IPaymentProps) {
正在修改,请稍后...
{/* {
isCountdownTimeout ? (
{
@@ -424,8 +691,9 @@ export default function Payment(props: IPaymentProps) {