import React from 'react'; import './index.less'; import Page from '@src/containers/Page'; import { getMap } from '@src/services/Tools'; import Money from '../../../components/Money'; import Button from '../../../components/Button'; import Tag from '../../../components/Tag'; // import Avatar from '../../../components/Avatar'; import { Course } from '../../../stores/course'; import { Order } from '../../../stores/order'; import { ServiceKey, ServiceParamMap } from '../../../../Constant'; export default class extends Page { init() { } initData() { const { id } = this.params; Course.getPackage(id).then(result => { result.originPrice = result.courses.reduce((x, y) => x + y, 0); this.setState({ data: result }); }); } buy() { Order.speedPay({ productType: 'course_package', productId: this.params.id }) .then((result) => { linkTo(`/pay/${result.id}`); }); } renderView() { const { data = {} } = this.state; return (