add place in mainpage
parent
56ec1827ca
commit
db11f03bda
|
|
@ -10,7 +10,7 @@ export default {
|
|||
isInDuty: true,
|
||||
inDutyCnt: 3,
|
||||
currentDuty: '2',
|
||||
place: '东三-204',
|
||||
place: '204',
|
||||
},
|
||||
},
|
||||
'GET /user/info': {
|
||||
|
|
|
|||
|
|
@ -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') },
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export const mainPageZhCn: MainPageText = {
|
|||
mainTitleLine: '您好,这里是E志者协会',
|
||||
subTitleLine: '维修请至【东三-204】实验室',
|
||||
cardTitle: {
|
||||
dutyInfo: '204 值班情况',
|
||||
dutyInfo: '值班情况',
|
||||
stepInfo: '维修步骤',
|
||||
tipsInfo: '注意事项',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export function getDutyInfo(that: MainPage) {
|
|||
isInDuty: data.isInDuty,
|
||||
inDutyCnt: data.inDutyCnt,
|
||||
currentDuty: data.currentDuty,
|
||||
place: data.place,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
|
|
@ -26,6 +27,7 @@ export function getDutyInfo(that: MainPage) {
|
|||
isInDuty: data.isInDuty,
|
||||
offDutyReason: data.offDutyReason,
|
||||
dutyRecoverTime: data.dutyRecoverTime,
|
||||
place: data.place,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -37,6 +39,7 @@ export function getDutyInfo(that: MainPage) {
|
|||
isInDuty: false,
|
||||
offDutyReason: '获取失败!Network Error!',
|
||||
dutyRecoverTime: '获取失败!Network Error!',
|
||||
place: '204',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue