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

View File

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

View File

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