add place in mainpage

This commit is contained in:
Dawn_Ocean
2024-03-19 22:46:42 +08:00
parent 56ec1827ca
commit db11f03bda
4 changed files with 12 additions and 5 deletions
+7 -3
View File
@@ -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}
</View>
</View>
</View>
@@ -71,7 +75,7 @@ export class DutyInfo extends Component {
const od = pt.get().mainPage.dutyCard.offDuty;
return (
<View>
<Card isInDuty={data.isInDuty} />
<Card isInDuty={data.isInDuty} place={data.place} />
<AtTimeline
items={[
{ title: od.reason(data.offDutyReason as string) },
@@ -87,7 +91,7 @@ export class DutyInfo extends Component {
const id = pt.get().mainPage.dutyCard.inDuty;
return (
<View>
<Card isInDuty={data.isInDuty} />
<Card isInDuty={data.isInDuty} place={data.place} />
<AtTimeline
items={[
{ title: id.currentDutyText(data.currentDuty || 'off') },