add place in mainpage
parent
56ec1827ca
commit
db11f03bda
|
|
@ -10,7 +10,7 @@ export default {
|
||||||
isInDuty: true,
|
isInDuty: true,
|
||||||
inDutyCnt: 3,
|
inDutyCnt: 3,
|
||||||
currentDuty: '2',
|
currentDuty: '2',
|
||||||
place: '东三-204',
|
place: '204',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'GET /user/info': {
|
'GET /user/info': {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ export class DutyData {
|
||||||
this.currentDuty = '2';
|
this.currentDuty = '2';
|
||||||
this.offDutyReason = '学园维修';
|
this.offDutyReason = '学园维修';
|
||||||
this.dutyRecoverTime = '下周一';
|
this.dutyRecoverTime = '下周一';
|
||||||
|
this.place = '东三-204';
|
||||||
}
|
}
|
||||||
|
|
||||||
isInDuty: boolean;
|
isInDuty: boolean;
|
||||||
|
|
@ -19,14 +20,17 @@ export class DutyData {
|
||||||
currentDuty?: 'off' | '1' | '2' | '3';
|
currentDuty?: 'off' | '1' | '2' | '3';
|
||||||
offDutyReason?: string;
|
offDutyReason?: string;
|
||||||
dutyRecoverTime?: string;
|
dutyRecoverTime?: string;
|
||||||
|
place: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Card extends Component {
|
class Card extends Component {
|
||||||
props = {
|
props = {
|
||||||
isInDuty: false,
|
isInDuty: false,
|
||||||
|
place: '东三-204',
|
||||||
};
|
};
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
const inDuty = this.props.isInDuty;
|
const inDuty = this.props.isInDuty;
|
||||||
|
const place = this.props.place;
|
||||||
const dc = pt.get().mainPage.dutyCard;
|
const dc = pt.get().mainPage.dutyCard;
|
||||||
const title = inDuty ? dc.inDuty.title : dc.offDuty.title;
|
const title = inDuty ? dc.inDuty.title : dc.offDuty.title;
|
||||||
const iconsrc = inDuty ? tick : cross;
|
const iconsrc = inDuty ? tick : cross;
|
||||||
|
|
@ -53,7 +57,7 @@ class Card extends Component {
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{title}
|
{'[' + place + '] ' + title}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
@ -71,7 +75,7 @@ export class DutyInfo extends Component {
|
||||||
const od = pt.get().mainPage.dutyCard.offDuty;
|
const od = pt.get().mainPage.dutyCard.offDuty;
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<Card isInDuty={data.isInDuty} />
|
<Card isInDuty={data.isInDuty} place={data.place} />
|
||||||
<AtTimeline
|
<AtTimeline
|
||||||
items={[
|
items={[
|
||||||
{ title: od.reason(data.offDutyReason as string) },
|
{ title: od.reason(data.offDutyReason as string) },
|
||||||
|
|
@ -87,7 +91,7 @@ export class DutyInfo extends Component {
|
||||||
const id = pt.get().mainPage.dutyCard.inDuty;
|
const id = pt.get().mainPage.dutyCard.inDuty;
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<Card isInDuty={data.isInDuty} />
|
<Card isInDuty={data.isInDuty} place={data.place} />
|
||||||
<AtTimeline
|
<AtTimeline
|
||||||
items={[
|
items={[
|
||||||
{ title: id.currentDutyText(data.currentDuty || 'off') },
|
{ title: id.currentDutyText(data.currentDuty || 'off') },
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ export const mainPageZhCn: MainPageText = {
|
||||||
mainTitleLine: '您好,这里是E志者协会',
|
mainTitleLine: '您好,这里是E志者协会',
|
||||||
subTitleLine: '维修请至【东三-204】实验室',
|
subTitleLine: '维修请至【东三-204】实验室',
|
||||||
cardTitle: {
|
cardTitle: {
|
||||||
dutyInfo: '204 值班情况',
|
dutyInfo: '值班情况',
|
||||||
stepInfo: '维修步骤',
|
stepInfo: '维修步骤',
|
||||||
tipsInfo: '注意事项',
|
tipsInfo: '注意事项',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ export function getDutyInfo(that: MainPage) {
|
||||||
isInDuty: data.isInDuty,
|
isInDuty: data.isInDuty,
|
||||||
inDutyCnt: data.inDutyCnt,
|
inDutyCnt: data.inDutyCnt,
|
||||||
currentDuty: data.currentDuty,
|
currentDuty: data.currentDuty,
|
||||||
|
place: data.place,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -26,6 +27,7 @@ export function getDutyInfo(that: MainPage) {
|
||||||
isInDuty: data.isInDuty,
|
isInDuty: data.isInDuty,
|
||||||
offDutyReason: data.offDutyReason,
|
offDutyReason: data.offDutyReason,
|
||||||
dutyRecoverTime: data.dutyRecoverTime,
|
dutyRecoverTime: data.dutyRecoverTime,
|
||||||
|
place: data.place,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -37,6 +39,7 @@ export function getDutyInfo(that: MainPage) {
|
||||||
isInDuty: false,
|
isInDuty: false,
|
||||||
offDutyReason: '获取失败!Network Error!',
|
offDutyReason: '获取失败!Network Error!',
|
||||||
dutyRecoverTime: '获取失败!Network Error!',
|
dutyRecoverTime: '获取失败!Network Error!',
|
||||||
|
place: '204',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue