App.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import React, {Component} from 'react';
  2. import {TabBar} from 'antd-mobile';
  3. import {Icon} from 'antd';
  4. import './App.css';
  5. import My from './page/home/My';
  6. import Display from './page/display/Display';
  7. import Manage from "./page/manage/Manage";
  8. class App extends Component {
  9. constructor(props) {
  10. super(props);
  11. this.state = {
  12. selectedTab: 'appointment',
  13. fullScreen: true,
  14. };
  15. }
  16. render() {
  17. return (
  18. <div className="App">
  19. <div style={{position: 'fixed', height: '100%', width: '100%', top: 0}}>
  20. <TabBar
  21. unselectedTintColor="#949494"
  22. tintColor="orange"
  23. barTintColor="white"
  24. >
  25. <TabBar.Item
  26. title="预约"
  27. key="appointment"
  28. icon={<Icon type="fire" />}
  29. selectedIcon={<Icon type="fire" style={{color: 'orange'}}/>}
  30. selected={this.state.selectedTab === 'appointment'}
  31. onPress={() => {
  32. this.setState({
  33. selectedTab: 'appointment',
  34. });
  35. }}
  36. data-seed="logId"
  37. >
  38. <Display/>
  39. </TabBar.Item>
  40. <TabBar.Item
  41. icon={<Icon type="home" />}
  42. selectedIcon={<Icon type="home" style={{color: 'orange'}}/>}
  43. title="我的"
  44. key="my"
  45. selected={this.state.selectedTab === 'my'}
  46. onPress={() => {
  47. this.setState({
  48. selectedTab: 'my',
  49. });
  50. }}
  51. >
  52. <My/>
  53. </TabBar.Item>
  54. <TabBar.Item
  55. icon={<Icon type="setting" />}
  56. selectedIcon={<Icon type="setting" style={{color: 'orange'}}/>}
  57. title="管理"
  58. key="manage"
  59. selected={this.state.selectedTab === 'manage'}
  60. onPress={() => {
  61. this.setState({
  62. selectedTab: 'manage',
  63. });
  64. }}
  65. >
  66. <Manage/>
  67. </TabBar.Item>
  68. </TabBar>
  69. </div>
  70. </div>
  71. );
  72. }
  73. }
  74. export default App;