From 5e5389a17bda9d3c351caba00ab25b79f373556b Mon Sep 17 00:00:00 2001 From: xixi <123@qq.com> Date: Fri, 30 Aug 2024 16:10:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=91=E7=9A=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/myOrder/MyOrder.tsx | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/components/myOrder/MyOrder.tsx b/src/components/myOrder/MyOrder.tsx index ba800ba..b66e19c 100644 --- a/src/components/myOrder/MyOrder.tsx +++ b/src/components/myOrder/MyOrder.tsx @@ -47,6 +47,7 @@ export default function MyOrder() { // const [orderId, setorderId] = useState('') // const [orderDetailsModal, setOrderDetailsModal] = useState(false) //详情弹窗 const [keyWords, setKewWords] = useState('') + const [productName, setProductName] = useState('') const [expandedRowKeys, setExpandedRowKeys] = useState([]); //展开项 const getData = () => { // setDataArray([]) @@ -58,6 +59,7 @@ export default function MyOrder() { page: page, rows: 20, keywords: keyWords, + productName: productName } }, onBefore() { @@ -263,6 +265,7 @@ export default function MyOrder() { // console.log(value); setKewWords(value) } + const handleChange = (e: any) => { // console.log(e.target.value); @@ -270,10 +273,20 @@ export default function MyOrder() { setKewWords('') } } + const namehandleSearch = (value: string) => { + setProductName(value) + } + const namehandleChange = (e: any) => { + // console.log(e.target.value); + if (e.target.value == '') { + // setKewWords('') + setProductName('') + } + } useEffect(() => { getData(); - }, [page, keyWords]); + }, [page, keyWords, productName]); // useEffect(() => { // if (orderId) { // getOrderDetails() @@ -291,11 +304,21 @@ export default function MyOrder() { onSearch={handleSearch} onChange={handleChange} style={{ - width: '300px', + width: '220px', }} allowClear /> + @@ -313,7 +336,7 @@ export default function MyOrder() { expandable={{ expandedRowRender: (record) => { // setorderId(record.orderId) - return
+ return
订单详情