add hint for mytickets in repairpage

dev
Dawn1Ocean 2024-04-06 02:05:01 +08:00
parent 3375e00b37
commit 01614c9163
3 changed files with 41 additions and 20 deletions

View File

@ -184,9 +184,16 @@ export default class RepairPage extends Component<{}, RepairPageState> {
} }
render(): ReactNode { render(): ReactNode {
const ticketsRenderer = const hasContinuingticket = this.state.currentTicketsIdName.length !== 0;
this.state.currentTicketsIdName.length !== 0 ? ( const ticketsRenderer = hasContinuingticket ? (
this.state.currentTicketsIdName.map((pair, idx) => ( <View>
<View
className='at-article__h3'
style={{ marginBottom: '20rpx', fontWeight: 'bold' }}
>
{pt.get().repairPage.currentTicket.hint}
</View>
{this.state.currentTicketsIdName.map((pair, idx) => (
<AtCard <AtCard
key={idx} key={idx}
title={pair.values().next().value} //pair.keys().next().value == ticket['device'] + ' ' + ticket['deviceModel'] title={pair.values().next().value} //pair.keys().next().value == ticket['device'] + ' ' + ticket['deviceModel']
@ -210,9 +217,15 @@ export default class RepairPage extends Component<{}, RepairPageState> {
middleButton={middleButton} middleButton={middleButton}
/> />
</AtCard> </AtCard>
)) ))}
</View>
) : ( ) : (
<View></View> <View
className='at-article__h3'
style={{ marginBottom: '20rpx', fontWeight: 'bold' }}
>
{pt.get().repairPage.currentTicket.nohint}
</View>
); );
return ( return (
<View style={{ width: '94%', marginLeft: '3%' }}> <View style={{ width: '94%', marginLeft: '3%' }}>

View File

@ -4,6 +4,8 @@ export interface RepairPageText {
title: string; title: string;
note: string; note: string;
extra: string; extra: string;
hint: string;
nohint: string;
}; };
typeText: { typeText: {
computer: string; computer: string;
@ -51,6 +53,8 @@ export const repairPageZhCn: RepairPageText = {
title: '', title: '',
note: '', note: '',
extra: '详细信息', extra: '详细信息',
hint: '我正在进行的工单',
nohint: '暂无进行中的工单',
}, },
typeText: { typeText: {
computer: '电脑', computer: '电脑',
@ -98,6 +102,8 @@ export const repairPageEnUs: RepairPageText = {
title: '', title: '',
note: '', note: '',
extra: 'Details', extra: 'Details',
hint: 'My continuing tickets',
nohint: 'No continuing tickets',
}, },
typeText: { typeText: {
computer: 'Computer', computer: 'Computer',

View File

@ -16,6 +16,7 @@ export function getCurrentTicket(that: RepairPage) {
.then((res) => { .then((res) => {
const data = res.data.data; const data = res.data.data;
let newIdNameList: Array<Map<number, string>> = []; let newIdNameList: Array<Map<number, string>> = [];
if (data.list.length !== 0) {
data.list.map((ticket: TicketListItem) => { data.list.map((ticket: TicketListItem) => {
if ( if (
ticket['status'] !== 3 && ticket['status'] !== 3 &&
@ -29,6 +30,7 @@ export function getCurrentTicket(that: RepairPage) {
); );
} }
}); });
}
that.setState({ that.setState({
currentTicketsIdName: newIdNameList, currentTicketsIdName: newIdNameList,
}); });