wrap up detailframework in atcard in repair page

This commit is contained in:
Dawn_Ocean
2024-03-14 16:51:21 +08:00
parent 84507f7214
commit 9931b23337
8 changed files with 68 additions and 35 deletions
+12 -6
View File
@@ -1,9 +1,11 @@
import RepairPage from '@/pages/repair/repair';
import Taro from '@tarojs/taro';
import { TicketListItem } from '@/components/TicketListItem/TicketListItem';
import pt from '@/plain-text';
import DetailFramework from '@/components/DetailFramework/DetailFramework';
import { getUrl } from '.';
export function getCurrentTicket(that: RepairPage) {
export function getCurrentTicket(that: RepairPage, middleButton, isInfoShow) {
Taro.request({
url: getUrl('/user/mytickets'),
method: 'GET',
@@ -13,17 +15,21 @@ 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);
let newIdList: Array<number> = [];
data.list.map((ticket: TicketListItem) => {
if (ticket['status'] !== 5) {
newIdList.push(ticket.id);
}
});
that.setState({
currentTicket: currentTicket,
currentTicketsId: newIdList,
});
})
.catch((err) => {
console.log(err);
Taro.atMessage({
message: pt.get().button.submitText.error + err.toString(),
type: 'error',
});
});
}