import { View, Text } from '@tarojs/components';
import { Component, ReactNode } from 'react';
import Taro from '@tarojs/taro';
import { AtCard, AtTimeline, AtAccordion } from 'taro-ui';
import type CustomTabBar from '@/custom-tab-bar';
import PageFooter from '@/components/PageFooter/PageFooter';
import pt from '@/plain-text';
import './index.scss';
interface CardContent {
title: string;
note: string;
extra: JSX.Element | string;
content: JSX.Element;
}
function mainPageCard(c: CardContent): JSX.Element {
return (
{c.content}
);
}
class ExpandItem extends Component {
state = {
open: false,
};
props = {
title: '',
content: ,
};
handleClick(value: boolean) {
this.setState({ open: value });
}
render(): ReactNode {
return (
{this.props.content}
);
}
}
class DutyInfo extends Component {
render(): ReactNode {
return (
x人在岗
);
}
}
class StepInfo extends Component {
render(): ReactNode {
return (
);
}
}
class TipsInfo extends Component {
render(): ReactNode {
return (
);
}
}
export default class Index extends Component {
state = {
dutyInfoCard: {
title: pt.get().mainPage.cardTitle.dutyInfo,
note: 'Tips',
extra: '额外信息',
content: ,
},
stepInfoCard: {
title: pt.get().mainPage.cardTitle.stepInfo,
note: 'Tips 请在20:30以前取走自己的物品哦',
extra: '额外信息',
content: ,
},
tipsInfoCard: {
title: pt.get().mainPage.cardTitle.tipsInfo,
note: 'Tips',
extra: '额外信息',
content: ,
},
};
// 以下是TabBar相关
pageCtx = Taro.getCurrentInstance().page;
componentDidShow() {
const tabbar = Taro.getTabBar(this.pageCtx);
tabbar?.setSelected(0);
}
// 以上是TabBar相关
render(): ReactNode {
const mainPage = pt.get().mainPage;
return (
{mainPage.mainTitleLine}
{mainPage.subTitleLine}
{mainPageCard(this.state.dutyInfoCard)}
{mainPageCard(this.state.tipsInfoCard)}
);
}
}