Compare commits

..

No commits in common. "08401dd64df5ac5d5c5f3e686b7cebc035b1e19e" and "83d2e8419e6c7ee0a0d7b5c0693923ae1368ab5c" have entirely different histories.

5 changed files with 24 additions and 105 deletions

View File

@ -1,16 +1,11 @@
import { View } from '@tarojs/components'; import { View } from '@tarojs/components';
import { AtDivider } from 'taro-ui'; import { AtDivider } from 'taro-ui';
import pt from '@/plain-text';
export default () => { export default () => {
const blankHeight = 120; const blankHeight = 120;
return ( return (
<View> <View>
<AtDivider <AtDivider content='EVA Notify' fontColor='#dddddd' lineColor='#dddddd' />
content={pt.get().pageFooter.dividerText}
fontColor='#dddddd'
lineColor='#dddddd'
/>
<View style={{ height: blankHeight }}></View> <View style={{ height: blankHeight }}></View>
</View> </View>
); );

View File

@ -4,7 +4,6 @@ import Taro from '@tarojs/taro';
import { AtCard, AtTimeline, AtAccordion } from 'taro-ui'; import { AtCard, AtTimeline, AtAccordion } from 'taro-ui';
import type CustomTabBar from '@/custom-tab-bar'; import type CustomTabBar from '@/custom-tab-bar';
import PageFooter from '@/components/PageFooter/PageFooter'; import PageFooter from '@/components/PageFooter/PageFooter';
import pt from '@/plain-text';
import './index.scss'; import './index.scss';
interface CardContent { interface CardContent {
@ -66,7 +65,14 @@ class StepInfo extends Component {
render(): ReactNode { render(): ReactNode {
return ( return (
<View> <View>
<AtTimeline items={pt.get().mainPage.stepList}></AtTimeline> <AtTimeline
items={[
{ title: '线上填写工单' },
{ title: '去东三-204教室维修电脑' },
{ title: '等待电脑维修' },
{ title: '维修结束,取回电脑' },
]}
></AtTimeline>
</View> </View>
); );
} }
@ -76,7 +82,14 @@ class TipsInfo extends Component {
render(): ReactNode { render(): ReactNode {
return ( return (
<View> <View>
<AtTimeline items={pt.get().mainPage.tipsList}></AtTimeline> <AtTimeline
items={[
{ title: '戴尔、Surface、外星人、苹果电脑不能拆机哦~' },
{ title: '数据无价,请随时做好数据备份哦~' },
{ title: '204也是实验室请遵守实验室纪律请勿饮食~' },
{ title: '我们是志愿服务,不收任何礼物哦~' },
]}
></AtTimeline>
</View> </View>
); );
} }
@ -85,19 +98,19 @@ class TipsInfo extends Component {
export default class Index extends Component { export default class Index extends Component {
state = { state = {
dutyInfoCard: { dutyInfoCard: {
title: pt.get().mainPage.cardTitle.dutyInfo, title: '204值班情况',
note: 'Tips', note: 'Tips',
extra: '额外信息', extra: '额外信息',
content: <DutyInfo />, content: <DutyInfo />,
}, },
stepInfoCard: { stepInfoCard: {
title: pt.get().mainPage.cardTitle.stepInfo, title: '维修步骤',
note: 'Tips 请在20:30以前取走自己的物品哦', note: 'Tips 请在20:30以前取走自己的物品哦',
extra: '额外信息', extra: '额外信息',
content: <StepInfo />, content: <StepInfo />,
}, },
tipsInfoCard: { tipsInfoCard: {
title: pt.get().mainPage.cardTitle.tipsInfo, title: '注意事项',
note: 'Tips', note: 'Tips',
extra: '额外信息', extra: '额外信息',
content: <TipsInfo />, content: <TipsInfo />,
@ -113,21 +126,20 @@ export default class Index extends Component {
// 以上是TabBar相关 // 以上是TabBar相关
render(): ReactNode { render(): ReactNode {
const mainPage = pt.get().mainPage;
return ( return (
<View> <View>
<View className='page-title'> <View className='page-title'>
<View className='at-article__h1'>{mainPage.mainTitleLine}</View> <View className='at-article__h1'>E</View>
<View className='at-article__h1'>{mainPage.subTitleLine}</View> <View className='at-article__h1'>-204</View>
</View> </View>
<View style={{ marginTop: 30 }}> <View style={{ marginTop: 30 }}>
{mainPageCard(this.state.dutyInfoCard)} {mainPageCard(this.state.dutyInfoCard)}
<ExpandItem <ExpandItem
title={mainPage.expandTitle.stepInfo} title='查看维修步骤'
content={mainPageCard(this.state.stepInfoCard)} content={mainPageCard(this.state.stepInfoCard)}
/> />
<ExpandItem <ExpandItem
title={mainPage.expandTitle.tipsInfo} title='查看注意事项'
content={mainPageCard(this.state.tipsInfoCard)} content={mainPageCard(this.state.tipsInfoCard)}
/> />
</View> </View>

View File

@ -1,41 +0,0 @@
export interface MainPageText {
mainTitleLine: string;
subTitleLine: string;
cardTitle: {
dutyInfo: string;
stepInfo: string;
tipsInfo: string;
};
expandTitle: {
stepInfo: string;
tipsInfo: string;
};
stepList: Array<{ title: string }>;
tipsList: Array<{ title: string }>;
}
export const mainPageZhCn: MainPageText = {
mainTitleLine: '您好这里是E志者协会。',
subTitleLine: '维修请移步`东三-204`实验室。',
cardTitle: {
dutyInfo: '204值班情况',
stepInfo: '维修步骤',
tipsInfo: '注意事项',
},
expandTitle: {
stepInfo: '查看维修步骤',
tipsInfo: '查看注意事项',
},
stepList: [
{ title: '线上填写工单' },
{ title: '去`东三-204`实验室维修电脑' },
{ title: '等待电脑维修' },
{ title: '维修结束,取回电脑' },
],
tipsList: [
{ title: '戴尔、Surface、外星人、苹果电脑不能拆机哦~' },
{ title: '数据无价,请随时做好数据备份哦~' },
{ title: '204也是实验室请遵守实验室纪律请勿饮食~' },
{ title: '我们是志愿服务,不收任何礼物哦~' },
],
};

View File

@ -1,7 +0,0 @@
export interface PageFooterText {
dividerText: string;
}
export const pageFooterZhCn: PageFooterText = {
dividerText: 'EVA Notify',
};

View File

@ -1,40 +0,0 @@
import { PageFooterText, pageFooterZhCn } from './PageFooter';
import { MainPageText, mainPageZhCn } from './MainPage';
interface TextRecord {
pageFooter: PageFooterText;
mainPage: MainPageText;
}
const textZhCn: TextRecord = {
pageFooter: pageFooterZhCn,
mainPage: mainPageZhCn,
};
// type Lang = 'zh_CN' | 'en_US' | ...;
type Lang = 'zh_CN';
class PlainText {
private readonly textZhCn: TextRecord;
private lang: Lang;
constructor() {
this.textZhCn = textZhCn;
this.lang = 'zh_CN';
}
setLang(lang: Lang) {
this.lang = lang;
}
get(): TextRecord {
if (this.lang == 'zh_CN') {
return this.textZhCn;
}
return this.textZhCn;
}
}
const pt = new PlainText();
export default pt;