add random tips on currentTicket card
This commit is contained in:
@@ -17,6 +17,7 @@ import type CustomTabBar from '@/custom-tab-bar';
|
||||
import repairLogo from '@/assets/icons/RepairPage/repair.svg';
|
||||
import DetailFramework from '@/components/DetailFramework/DetailFramework';
|
||||
import { getCurrentTicket } from '@/service/currentTicket';
|
||||
import { randomInt } from '@/utils/random';
|
||||
import './repair.scss';
|
||||
|
||||
interface RepairPageState {
|
||||
@@ -29,7 +30,7 @@ interface RepairPageState {
|
||||
isLoading: boolean;
|
||||
isDisable: boolean;
|
||||
checkedList: Array<number>;
|
||||
currentTicketsId: Array<number>;
|
||||
currentTicketsIdName: Array<Map<number, string>>;
|
||||
}
|
||||
|
||||
const submitInterval = 5000;
|
||||
@@ -56,11 +57,11 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
||||
isLoading: false,
|
||||
isDisable: true,
|
||||
checkedList: [0],
|
||||
currentTicketsId: [] as Array<number>,
|
||||
currentTicketsIdName: [] as Array<Map<number, string>>,
|
||||
};
|
||||
|
||||
componentDidMount(): void {
|
||||
getCurrentTicket(this, middleButton, isInfoShow);
|
||||
getCurrentTicket(this);
|
||||
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
@@ -162,10 +163,19 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
||||
}
|
||||
|
||||
render(): ReactNode {
|
||||
const ticketsRenderer = this.state.currentTicketsId.map((id, idx) => (
|
||||
<AtCard key={idx}>
|
||||
const ticketsRenderer = this.state.currentTicketsIdName.map((pair, idx) => (
|
||||
<AtCard
|
||||
key={idx}
|
||||
title={pair.get(pair.keys()[0])}
|
||||
extra={pt.get().repairPage.currentTicket.extra}
|
||||
note={
|
||||
pt.get().tips.tipsText[
|
||||
randomInt(0, pt.get().tips.tipsText.length - 1)
|
||||
]
|
||||
}
|
||||
>
|
||||
<DetailFramework
|
||||
id={id}
|
||||
id={pair.keys()[0]}
|
||||
isInfoShow={isInfoShow}
|
||||
middleButton={middleButton}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user