diff --git a/doc/api.md b/doc/api.md
index 9480b01..4471d70 100644
--- a/doc/api.md
+++ b/doc/api.md
@@ -44,9 +44,12 @@ data:
{
"isInDuty": true,
"inDutyCnt": 3,
- "currentDuty": "2",
- "place": "东三-204",
- "otherDutyTime": ""
+ "currentDuty": "1",
+ "place": "", // 只有当 currentDuty 为 others 时,place 和 值班时间 才不为空
+ "otherDutyStart": "",
+ "otherDutyEnd": "",
+ "offDutyReason": "",
+ "dutyRecoverTime": ""
}
```
@@ -59,8 +62,11 @@ data:
"isInDuty": true,
"inDutyCnt": 3,
"currentDuty": "others",
- "place": "蓝田",
- "otherDutyTime": "9:30-11:30"
+ "place": "蓝田", // 只有当 currentDuty 为 others 时,place 才不为空
+ "otherDutyStart": "2024-03-07T11:52:48.523303", // Timestamp
+ "otherDutyEnd": "2024-03-07T13:52:48.523303",
+ "offDutyReason": "",
+ "dutyRecoverTime": ""
}
```
@@ -71,6 +77,11 @@ data:
```json
{
"isInDuty": false,
+ "inDutyCnt": 0,
+ "currentDuty": "0", // '0' 代表正常值班时间下班,'others' 代表其他值班时间下班
+ "place": "",
+ "otherDutyStart": "",
+ "otherDutyEnd": "",
"offDutyReason": "学园维修",
"dutyRecoverTime": "下周一"
}
diff --git a/mock/api.ts b/mock/api.ts
index 012cbd0..c713d73 100644
--- a/mock/api.ts
+++ b/mock/api.ts
@@ -14,18 +14,19 @@ export default {
'GET /duty/info': {
success: true,
data: {
- token: 'token_test',
isInDuty: true,
inDutyCnt: 3,
currentDuty: 'others',
- otherDutyTime: '9:30-11:30',
+ otherDutyStart: '2024-03-07T09:30:48.523303',
+ otherDutyEnd: '2024-03-07T13:30:48.523303',
place: '蓝田',
+ offDutyReason: '',
+ dutyRecoverTime: '',
},
},
'GET /user/info': {
success: true,
data: {
- token: 'token_test',
name: '马保国',
phone: 13333333333,
},
@@ -116,7 +117,6 @@ export default {
'GET /member/duty/info': {
success: true,
data: {
- token: 'token_test',
isInDuty: true,
inDutyCnt: 6,
currentDuty: '3',
diff --git a/src/pages/TicketDetail/TicketDetail.tsx b/src/pages/TicketDetail/TicketDetail.tsx
index 3211b43..2e365cc 100644
--- a/src/pages/TicketDetail/TicketDetail.tsx
+++ b/src/pages/TicketDetail/TicketDetail.tsx
@@ -410,28 +410,28 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
onClose={this.handleStatusCancel.bind(this)}
>
- {pt.get().ticketDetail.statusModifyMessage['0']}
+ {pt.get().ticketDetail.statusModifyMessage.get('0')}
- {pt.get().ticketDetail.statusModifyMessage['1']}
+ {pt.get().ticketDetail.statusModifyMessage.get('1')}
- {pt.get().ticketDetail.statusModifyMessage['2']}
+ {pt.get().ticketDetail.statusModifyMessage.get('2')}
- {pt.get().ticketDetail.statusModifyMessage['3']}
+ {pt.get().ticketDetail.statusModifyMessage.get('3')}
- {pt.get().ticketDetail.statusModifyMessage['4']}
+ {pt.get().ticketDetail.statusModifyMessage.get('4')}
- {pt.get().ticketDetail.statusModifyMessage['5']}
+ {pt.get().ticketDetail.statusModifyMessage.get('5')}
- {pt.get().ticketDetail.statusModifyMessage['6']}
+ {pt.get().ticketDetail.statusModifyMessage.get('6')}
- {pt.get().ticketDetail.statusModifyMessage['7']}
+ {pt.get().ticketDetail.statusModifyMessage.get('7')}
@@ -106,8 +118,11 @@ export class DutyInfo extends Component {
{
title:
data.currentDuty == 'others'
- ? id.currentDutyText('others') + data.otherDutyTime
- : id.currentDutyText(data.currentDuty || 'off'),
+ ? id.currentDutyText('others') +
+ moment(data.otherDutyStart).format('H:mm') +
+ ' - ' +
+ moment(data.otherDutyEnd).format('H:mm')
+ : id.currentDutyText(data.currentDuty || '0'),
},
{ title: id.inDutyCnt(data.inDutyCnt as number) },
]}
diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx
index dcc228d..f506e02 100644
--- a/src/pages/user/user.tsx
+++ b/src/pages/user/user.tsx
@@ -123,7 +123,7 @@ export default class UserPage extends Component {
className='at-row at-row__justify--center at-row__align--center'
style='height:120rpx;color:#696969;'
>
- EVA Eta v1.0.0
+ EVA Eta v1.0.1
string;
+ currentDutyText: (c: '0' | '1' | '2' | '3' | 'others') => string;
inDutyCnt: (n: number) => string;
};
};
}
export const mainPageZhCn: MainPageText = {
+ normal: {
+ recoverTime: '明天 13:30',
+ reason: '正常下班',
+ },
titleLine: {
main: '您好,这里是E志者协会',
sub: '维修请至【东三-204】实验室',
@@ -85,7 +93,7 @@ export const mainPageZhCn: MainPageText = {
title: '值班中',
currentDutyText: (c) => {
switch (c) {
- case 'off':
+ case '0':
return '当前未值班';
case '1':
return '第一班 13:30-16:00';
@@ -103,6 +111,10 @@ export const mainPageZhCn: MainPageText = {
};
export const mainPageEnUs: MainPageText = {
+ normal: {
+ recoverTime: 'Tomorrow 13:30',
+ reason: 'Normal shift',
+ },
titleLine: {
main: 'Hi! This is EVA.',
sub: 'For maintenance, please go to [204 Lab, E3 building]',
@@ -148,8 +160,8 @@ export const mainPageEnUs: MainPageText = {
title: 'On Duty',
currentDutyText: (c) => {
switch (c) {
- case 'off':
- return 'Currently not on duty';
+ case '0':
+ return 'Normal Shift';
case '1':
return '1st Shift 13:30-16:00';
case '2':
diff --git a/src/service/dutyInfo.ts b/src/service/dutyInfo.ts
index 34c394f..ef45f81 100644
--- a/src/service/dutyInfo.ts
+++ b/src/service/dutyInfo.ts
@@ -20,28 +20,10 @@ export function getDutyInfo(that: MainPage) {
return;
}
const data = res.data.data;
- if (data.isInDuty) {
- that.setState({
- rs: former.trans(true),
- dutyData: {
- isInDuty: data.isInDuty,
- inDutyCnt: data.inDutyCnt,
- currentDuty: data.currentDuty,
- otherDutyTime: data.otherDutyTime,
- place: data.place,
- },
- });
- } else {
- that.setState({
- rs: former.trans(true),
- dutyData: {
- isInDuty: data.isInDuty,
- offDutyReason: data.offDutyReason,
- dutyRecoverTime: data.dutyRecoverTime,
- place: data.place,
- },
- });
- }
+ that.setState({
+ rs: former.trans(true),
+ dutyData: data,
+ });
})
.catch((err) => {
console.log(err.errMsg);