💪 optimize: 优化订单列表代码

This commit is contained in:
wangsongsole 2024-01-26 16:55:16 +08:00
parent 4701409bc9
commit a92f045408
1 changed files with 13 additions and 24 deletions

View File

@ -5,9 +5,9 @@ import {
handlerRefund,
putOrderCancel,
putOrderSuccess,
receiveRetry,
refund,
resendCardCode,
receiveRetry
resendCardCode
} from "@/assets/api.js"
import "@/assets/comm.css"
import { nowDay, nowMonth } from "@/assets/comm.js"
@ -35,7 +35,6 @@ export default class orderList extends React.Component {
tabList: [{ title: "订单列表" }],
orderList: [],
filterList: filterList,
selectiondata: [],
menuList: [
{ id: 0, name: "订单状态", check: false },
@ -110,7 +109,6 @@ export default class orderList extends React.Component {
handelResponse(
res,
(response, msg) => {
console.log(msg)
Notify.clear()
Notify.success(msg)
},
@ -277,43 +275,36 @@ export default class orderList extends React.Component {
//清空
clearFn() {
this.setState({ selectiondata: [] })
this.setState({ allcheck: false })
this.setState({ itemcheck: false })
this.setState({ allcheck: false, selectiondata: [], itemcheck: false })
}
//选择时间
onChangeCombinedDate(e) {
this.setState({ combinedValue: e, page: 1, limit: 10, selectiondata: [] })
setTimeout(() => {
this.setState({ combinedValue: e, page: 1, limit: 10, selectiondata: [] }, () => {
this.getOrderFn()
}, 0)
})
}
//page
pageChange(e) {
this.setState({ page: e })
this.setState({ selectiondata: [] })
setTimeout(() => {
this.setState({ selectiondata: [], page: e }, () => {
this.getOrderFn()
}, 0)
})
}
//limit
countChange(e) {
this.setState({ page: 1, limit: e })
this.setState({ selectiondata: [] })
setTimeout(() => {
this.setState({})
this.setState({ selectiondata: [], page: 1, limit: e }, () => {
this.getOrderFn()
}, 0)
})
}
//敲回车查询
sureFn() {
this.setState({ page: 1 })
setTimeout(() => {
this.setState({ page: 1 }, () => {
this.getOrderFn()
}, 300)
})
}
//!提取动态删除核销状态条件
@ -396,9 +387,8 @@ export default class orderList extends React.Component {
componentWillMount() {
let datetime = [tomonth + " " + "00:00:00", day + " " + "23:59:59"]
this.setState({ combinedValue: datetime })
this.getOrderFn(datetime)
this.setState({ tableHeight: window.innerHeight - 430 })
this.setState({ tableHeight: window.innerHeight - 430, combinedValue: datetime })
}
//!状态筛选
@ -427,7 +417,6 @@ export default class orderList extends React.Component {
//! 1:直冲 2:立减金 3:红包
if (e.length && prop === "status") {
console.log(e)
e.map((item, index) => {
if ([6, 7, 8, 9].includes(item)) {
orderType.push(3)