fix: alter message when inDutyCnt === 0

mgy
Dawn1Ocean 2024-05-10 11:27:32 +08:00
parent fc9347e7c1
commit 669896d253
3 changed files with 11 additions and 2 deletions

View File

@ -124,7 +124,13 @@ export class DutyInfo extends Component {
moment(data.otherDutyEnd).format('H:mm') moment(data.otherDutyEnd).format('H:mm')
: id.currentDutyText(data.currentDuty || 'off'), : id.currentDutyText(data.currentDuty || 'off'),
}, },
{ title: id.inDutyCnt(data.inDutyCnt as number) }, {
title: id.inDutyCnt(
data.inDutyCnt === 0
? pt.get().common.zeroMemberOnDuty
: data.inDutyCnt.toString(),
),
},
]} ]}
/> />
</View> </View>

View File

@ -36,7 +36,7 @@ export interface MainPageText {
inDuty: { inDuty: {
title: string; title: string;
currentDutyText: (c: 'off' | '0' | '1' | '2' | '3' | 'others') => string; currentDutyText: (c: 'off' | '0' | '1' | '2' | '3' | 'others') => string;
inDutyCnt: (n: number) => string; inDutyCnt: (n: string) => string;
}; };
}; };
} }

View File

@ -5,6 +5,7 @@ export interface CommonText {
offDutyReason: string; offDutyReason: string;
place: string; place: string;
dutyRecoverTime: string; dutyRecoverTime: string;
zeroMemberOnDuty: string;
} }
export const commonTextZhCn: CommonText = { export const commonTextZhCn: CommonText = {
@ -14,6 +15,7 @@ export const commonTextZhCn: CommonText = {
offDutyReason: '正常值班下班', offDutyReason: '正常值班下班',
place: '204', place: '204',
dutyRecoverTime: '明天 13:30', dutyRecoverTime: '明天 13:30',
zeroMemberOnDuty: '待更新',
}; };
export const commonTextEnUs: CommonText = { export const commonTextEnUs: CommonText = {
@ -23,4 +25,5 @@ export const commonTextEnUs: CommonText = {
offDutyReason: 'Normal Shift', offDutyReason: 'Normal Shift',
place: 'E3-204', place: 'E3-204',
dutyRecoverTime: 'Tomorrow 13:30', dutyRecoverTime: 'Tomorrow 13:30',
zeroMemberOnDuty: 'Wait for update',
}; };