refactor ticketListItem

This commit is contained in:
Dawn_Ocean
2024-03-14 12:09:51 +08:00
parent 802d008767
commit 84507f7214
7 changed files with 18 additions and 2 deletions
+10
View File
@@ -1,5 +1,6 @@
import RepairPage from '@/pages/repair/repair';
import Taro from '@tarojs/taro';
import { TicketListItem } from '@/components/TicketListItem/TicketListItem';
import { getUrl } from '.';
export function getCurrentTicket(that: RepairPage) {
@@ -12,6 +13,15 @@ export function getCurrentTicket(that: RepairPage) {
})
.then((res) => {
const data = res.data.data;
const currentTicket: Array<TicketListItem> = [];
data.list.array.forEach((ticket: TicketListItem) => {
if (ticket['status'] != 5) {
currentTicket.push(ticket);
}
});
that.setState({
currentTicket: currentTicket,
});
})
.catch((err) => {
console.log(err);