import React from 'react'; import './index.less'; import { DatePicker } from 'antd-mobile'; import Page from '@src/containers/Page'; import Assets from '@src/components/Assets'; import { formatDate } from '@src/services/Tools'; import { Textbook } from '../../../stores/textbook'; export default class extends Page { initState() { return { date: new Date(), }; } initData() { Textbook.getInfo() .then(result => { this.setState(result); }); this.refreshYear(this.state.date); } refreshYear(date) { this.setState({ date }); Textbook.listYear(date.getFullYear()) .then(() => { this.setState({ months: [] }); }); } renderView() { const { library = {}, date, months = [] } = this.state; return (
最新换库
{library.startDate ? formatDate(library.startDate, 'YYYY年MM月DD日') : ''}
历史记录
{ this.refreshYear(value); }}>
{date.getFullYear()}年
{(months || []).map(month => { return
{month.value}月
{month.list.map(row => { return {row}; })}
; })}
); } }