diff --git a/mock/api.ts b/mock/api.ts index 77106c3..7a7bf9a 100644 --- a/mock/api.ts +++ b/mock/api.ts @@ -10,7 +10,7 @@ export default { isInDuty: true, inDutyCnt: 3, currentDuty: '2', - place: '东三-204', + place: '204', }, }, 'GET /user/info': { diff --git a/src/pages/index/DutyInfo.tsx b/src/pages/index/DutyInfo.tsx index 74626a7..c44a2f6 100644 --- a/src/pages/index/DutyInfo.tsx +++ b/src/pages/index/DutyInfo.tsx @@ -12,6 +12,7 @@ export class DutyData { this.currentDuty = '2'; this.offDutyReason = '学园维修'; this.dutyRecoverTime = '下周一'; + this.place = '东三-204'; } isInDuty: boolean; @@ -19,14 +20,17 @@ export class DutyData { currentDuty?: 'off' | '1' | '2' | '3'; offDutyReason?: string; dutyRecoverTime?: string; + place: string; } class Card extends Component { props = { isInDuty: false, + place: '东三-204', }; render(): ReactNode { const inDuty = this.props.isInDuty; + const place = this.props.place; const dc = pt.get().mainPage.dutyCard; const title = inDuty ? dc.inDuty.title : dc.offDuty.title; const iconsrc = inDuty ? tick : cross; @@ -53,7 +57,7 @@ class Card extends Component { fontWeight: 'bold', }} > - {title} + {'[' + place + '] ' + title} @@ -71,7 +75,7 @@ export class DutyInfo extends Component { const od = pt.get().mainPage.dutyCard.offDuty; return ( - + - +