import React from 'react'; import './index.less'; import { Tabs } from 'antd-mobile'; import Page from '@src/containers/Page'; import Assets from '@src/components/Assets'; import { formatDate, getMap } from '@src/services/Tools'; import Money from '../../../components/Money'; import Button from '../../../components/Button'; import Tag from '../../../components/Tag'; import { Course } from '../../../stores/course'; import { Order } from '../../../stores/order'; import { DataType } from '../../../../Constant'; import { FAQItem, CommentItem } from '../../../components/Item'; const DataTypeMap = getMap(DataType, 'value', 'label'); export default class extends Page { initState() { return { tab: 'content' }; } initData() { const { id } = this.params; Course.getData(id).then(data => { this.setState({ data }); }); } buy() { Order.speedPay({ productType: 'data', productId: this.params.id }) .then((result) => { linkTo(`/pay/${result.id}`); }); } renderText() { const { tab, data } = this.state; let content; switch (tab) { case 'content': case 'authorContent': case 'methodContent': content =
; break; case 'faq': content = (