wrap up detailframework in atcard in repair page
This commit is contained in:
+27
-13
@@ -16,7 +16,7 @@ import { submitTicket } from '@/service/submitTicket';
|
||||
import type CustomTabBar from '@/custom-tab-bar';
|
||||
import repairLogo from '@/assets/icons/RepairPage/repair.svg';
|
||||
import DetailFramework from '@/components/DetailFramework/DetailFramework';
|
||||
import { TicketListItem } from '@/components/TicketListItem/TicketListItem';
|
||||
import { getCurrentTicket } from '@/service/currentTicket';
|
||||
import './repair.scss';
|
||||
|
||||
interface RepairPageState {
|
||||
@@ -29,11 +29,22 @@ interface RepairPageState {
|
||||
isLoading: boolean;
|
||||
isDisable: boolean;
|
||||
checkedList: Array<number>;
|
||||
currentTicket: Array<TicketListItem>;
|
||||
currentTicketsId: Array<number>;
|
||||
}
|
||||
|
||||
const submitInterval = 5000;
|
||||
|
||||
const middleButton = <View></View>;
|
||||
|
||||
const isInfoShow = {
|
||||
device: true,
|
||||
createdTime: true,
|
||||
description: false,
|
||||
current: true,
|
||||
notelist: true,
|
||||
showAllNotes: false,
|
||||
};
|
||||
|
||||
export default class RepairPage extends Component<{}, RepairPageState> {
|
||||
state = {
|
||||
type: 1 as 0 | 1,
|
||||
@@ -45,10 +56,12 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
||||
isLoading: false,
|
||||
isDisable: true,
|
||||
checkedList: [0],
|
||||
currentTicket: [],
|
||||
currentTicketsId: [] as Array<number>,
|
||||
};
|
||||
|
||||
componentDidMount(): void {
|
||||
getCurrentTicket(this, middleButton, isInfoShow);
|
||||
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
isDisable: false,
|
||||
@@ -149,19 +162,20 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
||||
}
|
||||
|
||||
render(): ReactNode {
|
||||
const middleButton = <View></View>;
|
||||
|
||||
const isInfoShow = {
|
||||
device: true,
|
||||
createdTime: true,
|
||||
description: false,
|
||||
current: true,
|
||||
notelist: true,
|
||||
showAllNotes: false,
|
||||
};
|
||||
const ticketsRenderer = this.state.currentTicketsId.map((id, idx) => (
|
||||
<AtCard key={idx}>
|
||||
<DetailFramework
|
||||
id={id}
|
||||
isInfoShow={isInfoShow}
|
||||
middleButton={middleButton}
|
||||
/>
|
||||
</AtCard>
|
||||
));
|
||||
console.log(ticketsRenderer);
|
||||
return (
|
||||
<View>
|
||||
<AtMessage />
|
||||
{ticketsRenderer}
|
||||
<AtCard
|
||||
note={pt.get().repairPage.cardText.note}
|
||||
title={pt.get().repairPage.cardText.title}
|
||||
|
||||
Reference in New Issue
Block a user