update duty info card
parent
d9d005986e
commit
349f125404
|
|
@ -9,3 +9,4 @@ node_modules/
|
||||||
.husky
|
.husky
|
||||||
.prettierignore
|
.prettierignore
|
||||||
.env.*
|
.env.*
|
||||||
|
**/*.svg
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1709729147345" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7587" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M960 170.56L869.44 80 512 437.44 154.56 80 64 170.56 421.44 528 64 885.44l90.56 90.56L512 618.56 869.44 976 960 885.44 602.56 528 960 170.56z" p-id="7588" fill="#d4237a"></path></svg>
|
||||||
|
After Width: | Height: | Size: 514 B |
|
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1709729289782" class="icon" viewBox="0 0 1418 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8708" width="44.3125" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M491.191709 1023.803077L0.136305 539.63733l111.888035-110.273886 379.167369 373.89186L1305.549204 0.433064 1417.437238 110.706951 491.191709 1023.803077z" p-id="8709" fill="#12c53d"></path></svg>
|
||||||
|
After Width: | Height: | Size: 531 B |
|
|
@ -1,6 +1,9 @@
|
||||||
import { Component, ReactNode } from 'react';
|
import { Component, ReactNode } from 'react';
|
||||||
import { View } from '@tarojs/components';
|
import { View, Image } from '@tarojs/components';
|
||||||
|
import { AtTimeline } from 'taro-ui';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
|
import tick from '@/assets/icons/MainPage/tick.svg';
|
||||||
|
import cross from '@/assets/icons/MainPage/cross.svg';
|
||||||
|
|
||||||
export class DutyData {
|
export class DutyData {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -18,6 +21,45 @@ export class DutyData {
|
||||||
dutyRecoverTime: string; // from backend
|
dutyRecoverTime: string; // from backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Card extends Component {
|
||||||
|
props = {
|
||||||
|
isInDuty: false,
|
||||||
|
};
|
||||||
|
render(): ReactNode {
|
||||||
|
const inDuty = this.props.isInDuty;
|
||||||
|
const dc = pt.get().mainPage.dutyCard;
|
||||||
|
const title = inDuty ? dc.inDuty.title : dc.offDuty.title;
|
||||||
|
const iconsrc = inDuty ? tick : cross;
|
||||||
|
return (
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginBottom: 20,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
src={iconsrc}
|
||||||
|
style={{
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginLeft: 10,
|
||||||
|
fontSize: 36,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{title}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class DutyInfo extends Component {
|
export class DutyInfo extends Component {
|
||||||
props = {
|
props = {
|
||||||
data: new DutyData(),
|
data: new DutyData(),
|
||||||
|
|
@ -28,9 +70,13 @@ export class DutyInfo extends Component {
|
||||||
const od = pt.get().mainPage.dutyCard.offDuty;
|
const od = pt.get().mainPage.dutyCard.offDuty;
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<View>{od.title}</View>
|
<Card isInDuty={data.isInDuty} />
|
||||||
<View>{od.reason(data.offDutyReason)}</View>
|
<AtTimeline
|
||||||
<View>{od.recoverTime(data.dutyRecoverTime)}</View>
|
items={[
|
||||||
|
{ title: od.reason(data.offDutyReason) },
|
||||||
|
{ title: od.recoverTime(data.dutyRecoverTime) },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -40,9 +86,13 @@ export class DutyInfo extends Component {
|
||||||
const id = pt.get().mainPage.dutyCard.inDuty;
|
const id = pt.get().mainPage.dutyCard.inDuty;
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<View>{id.title}</View>
|
<Card isInDuty={data.isInDuty} />
|
||||||
<View>{id.currentDutyText(data.currentDuty)}</View>
|
<AtTimeline
|
||||||
<View>{id.inDutyCnt(data.inDutyCnt)}</View>
|
items={[
|
||||||
|
{ title: id.currentDutyText(data.currentDuty) },
|
||||||
|
{ title: id.inDutyCnt(data.inDutyCnt) },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ export interface MainPageText {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const mainPageZhCn: MainPageText = {
|
export const mainPageZhCn: MainPageText = {
|
||||||
mainTitleLine: '您好,这里是E志者协会。',
|
mainTitleLine: '您好,这里是E志者协会',
|
||||||
subTitleLine: '维修请移步`东三-204`实验室。',
|
subTitleLine: '维修请至【东三-204】实验室',
|
||||||
cardTitle: {
|
cardTitle: {
|
||||||
dutyInfo: '204值班情况',
|
dutyInfo: '204值班情况',
|
||||||
stepInfo: '维修步骤',
|
stepInfo: '维修步骤',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue