page.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // import React from 'react';
  2. import './index.less';
  3. import Page from '@src/containers/Page';
  4. // import Assets from '@src/components/Assets';
  5. // import { getMap, formatDate } from '@src/services/Tools';
  6. // import Checkbox from '../../../components/CheckBox';
  7. // import Button from '../../../components/Button';
  8. // import Icon from '../../../components/Icon';
  9. import { Order } from '../../../stores/order';
  10. import { Main } from '../../../stores/main';
  11. // import { ServiceKey } from '../../../../Constant';
  12. // const ServiceKeyMap = getMap(ServiceKey, 'value', 'label');
  13. export default class extends Page {
  14. initState() {
  15. return {};
  16. }
  17. initData() {
  18. const { id } = this.params;
  19. Order.getOrder(id)
  20. .then(result => {
  21. this.setState({ data: result });
  22. });
  23. Main.getContract('course')
  24. .then(result => {
  25. this.setState({ contract: result });
  26. });
  27. }
  28. pay() {
  29. const { id } = this.params;
  30. Order.wechatJs(id)
  31. .then(() => {
  32. });
  33. }
  34. renderView() {
  35. const { productType } = this.state;
  36. if (productType === 'data') {
  37. return this.renderData();
  38. }
  39. if (productType === 'course_package') {
  40. return this.renderCoursePackage();
  41. }
  42. return this.renderSingle();
  43. }
  44. renderData() {
  45. }
  46. renderCoursePackage() {
  47. }
  48. renderSingle() {
  49. }
  50. }