diff --git a/doc/api.md b/doc/api.md index 4471d70..d4d4624 100644 --- a/doc/api.md +++ b/doc/api.md @@ -87,6 +87,23 @@ data: } ``` +#### 当前值班暂停 + +data: + +```json +{ + "isInDuty": false, + "inDutyCnt": 0, + "currentDuty": "off", // 'off' 代表当前值班暂停 + "place": "", + "otherDutyStart": "", + "otherDutyEnd": "", + "offDutyReason": "考试周", + "dutyRecoverTime": "下周一" +} +``` + ## 账号登陆 ### 微信小程序登陆 `POST /login` OK diff --git a/src/pages/index/DutyInfo.tsx b/src/pages/index/DutyInfo.tsx index 5492fae..569f027 100644 --- a/src/pages/index/DutyInfo.tsx +++ b/src/pages/index/DutyInfo.tsx @@ -21,7 +21,7 @@ export class DutyData { isInDuty: boolean; inDutyCnt?: number; - currentDuty?: '0' | '1' | '2' | '3' | 'others'; + currentDuty?: 'off' | '0' | '1' | '2' | '3' | 'others'; otherDutyStart?: string; otherDutyEnd?: string; offDutyReason?: string; @@ -122,7 +122,7 @@ export class DutyInfo extends Component { moment(data.otherDutyStart).format('H:mm') + ' - ' + moment(data.otherDutyEnd).format('H:mm') - : id.currentDutyText(data.currentDuty || '0'), + : id.currentDutyText(data.currentDuty || 'off'), }, { title: id.inDutyCnt(data.inDutyCnt as number) }, ]} diff --git a/src/plain-text/MainPage.ts b/src/plain-text/MainPage.ts index c70dd5c..5cb35ab 100644 --- a/src/plain-text/MainPage.ts +++ b/src/plain-text/MainPage.ts @@ -37,7 +37,7 @@ export interface MainPageText { }; inDuty: { title: string; - currentDutyText: (c: '0' | '1' | '2' | '3' | 'others') => string; + currentDutyText: (c: 'off' | '0' | '1' | '2' | '3' | 'others') => string; inDutyCnt: (n: number) => string; }; }; @@ -93,8 +93,10 @@ export const mainPageZhCn: MainPageText = { title: '值班中', currentDutyText: (c) => { switch (c) { + case 'off': + return '暂停值班'; case '0': - return '当前未值班'; + return '休息中'; case '1': return '第一班 13:30-16:00'; case '2': @@ -160,6 +162,8 @@ export const mainPageEnUs: MainPageText = { title: 'On Duty', currentDutyText: (c) => { switch (c) { + case 'off': + return 'Duty paused'; case '0': return 'Normal Shift'; case '1':