import React from 'react';
import './index.less';
import { Anchor } from 'antd';
import { Tabs } from 'antd-mobile';
import Page from '@src/containers/Page';
import Assets from '@src/components/Assets';
import { getMap } from '@src/services/Tools';
import Money from '../../../components/Money';
import { LinkBlock, CourseBlock, DataBlock } from '../../../components/Block';
import { Main } from '../../../stores/main';
import { Course } from '../../../stores/course';
import { ServiceKey, CourseVsType } from '../../../../Constant';
export default class extends Page {
init() {
this.courseVsMap = {};
}
initData() {
Promise.all(ServiceKey.map(service => {
return Main.getService(service.value).then(result => {
this.setState({ [service.value]: result });
});
}));
Course.allVs().then(list => {
this.courseVsMap = getMap(list, 'vsType');
this.setState({ vsList: list });
});
Course.listVideo({ page: 1, size: 4, order: 'saleNumber', direction: 'desc' })
.then(result => {
this.setState({ courseTop: result.list });
});
Course.listData({ page: 1, size: 4, order: 'saleNumber', direction: 'desc' })
.then((result) => {
this.setState({ dataTop: result.list });
});
}
renderView() {
const { courseTop = [], dataTop = [] } = this.state;
return [