添加我的订单搜索条件
This commit is contained in:
parent
5c0dbf01cc
commit
5e5389a17b
@ -47,6 +47,7 @@ export default function MyOrder() {
|
|||||||
// const [orderId, setorderId] = useState('')
|
// const [orderId, setorderId] = useState('')
|
||||||
// const [orderDetailsModal, setOrderDetailsModal] = useState(false) //详情弹窗
|
// const [orderDetailsModal, setOrderDetailsModal] = useState(false) //详情弹窗
|
||||||
const [keyWords, setKewWords] = useState('')
|
const [keyWords, setKewWords] = useState('')
|
||||||
|
const [productName, setProductName] = useState('')
|
||||||
const [expandedRowKeys, setExpandedRowKeys] = useState<any[]>([]); //展开项
|
const [expandedRowKeys, setExpandedRowKeys] = useState<any[]>([]); //展开项
|
||||||
const getData = () => {
|
const getData = () => {
|
||||||
// setDataArray([])
|
// setDataArray([])
|
||||||
@ -58,6 +59,7 @@ export default function MyOrder() {
|
|||||||
page: page,
|
page: page,
|
||||||
rows: 20,
|
rows: 20,
|
||||||
keywords: keyWords,
|
keywords: keyWords,
|
||||||
|
productName: productName
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onBefore() {
|
onBefore() {
|
||||||
@ -263,6 +265,7 @@ export default function MyOrder() {
|
|||||||
// console.log(value);
|
// console.log(value);
|
||||||
setKewWords(value)
|
setKewWords(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleChange = (e: any) => {
|
const handleChange = (e: any) => {
|
||||||
|
|
||||||
// console.log(e.target.value);
|
// console.log(e.target.value);
|
||||||
@ -270,10 +273,20 @@ export default function MyOrder() {
|
|||||||
setKewWords('')
|
setKewWords('')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const namehandleSearch = (value: string) => {
|
||||||
|
setProductName(value)
|
||||||
|
}
|
||||||
|
const namehandleChange = (e: any) => {
|
||||||
|
|
||||||
|
// console.log(e.target.value);
|
||||||
|
if (e.target.value == '') {
|
||||||
|
// setKewWords('')
|
||||||
|
setProductName('')
|
||||||
|
}
|
||||||
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getData();
|
getData();
|
||||||
}, [page, keyWords]);
|
}, [page, keyWords, productName]);
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// if (orderId) {
|
// if (orderId) {
|
||||||
// getOrderDetails()
|
// getOrderDetails()
|
||||||
@ -291,11 +304,21 @@ export default function MyOrder() {
|
|||||||
onSearch={handleSearch}
|
onSearch={handleSearch}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
style={{
|
style={{
|
||||||
width: '300px',
|
width: '220px',
|
||||||
|
|
||||||
}}
|
}}
|
||||||
allowClear
|
allowClear
|
||||||
/>
|
/>
|
||||||
|
<Search placeholder="输入商品名称查询订单"
|
||||||
|
// value={nowKeyword}
|
||||||
|
onSearch={namehandleSearch}
|
||||||
|
onChange={namehandleChange}
|
||||||
|
style={{
|
||||||
|
width: '220px',
|
||||||
|
marginLeft: 10
|
||||||
|
}}
|
||||||
|
allowClear
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Spin tip="加载中..." spinning={isLoading}>
|
<Spin tip="加载中..." spinning={isLoading}>
|
||||||
@ -313,7 +336,7 @@ export default function MyOrder() {
|
|||||||
expandable={{
|
expandable={{
|
||||||
expandedRowRender: (record) => {
|
expandedRowRender: (record) => {
|
||||||
// setorderId(record.orderId)
|
// setorderId(record.orderId)
|
||||||
return <div style={{ padding: '0px 20px',marginLeft:60 }}>
|
return <div style={{ padding: '0px 20px', marginLeft: 60 }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
marginBottom: 10
|
marginBottom: 10
|
||||||
}}>订单详情</div>
|
}}>订单详情</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user