App.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import React from 'react';
  2. import { Router, Route, hashHistory} from 'react-router';
  3. import ChatBase from './view/ChatBase/ChatBaseView';
  4. import ChatExpert from './view/ChatExpert/ChatExpertView';
  5. import Expert from './view/Expert/ExpertView';
  6. import ExpertInquiry from './view/ExpertInquiry/ExpertInquiryView';
  7. import Home from './view/Home/Home';
  8. import Login from './view/Login/LoginView';
  9. import MyOrder from './view/MyOrder/MyOrderView';
  10. import SendChatLog from './view/SendChatLog/SendChatLogView';
  11. import UserMessage from './view/UserMessage/UserMessageView';
  12. import Referral from './view/Referral/ReferralView';
  13. import Test from './test';
  14. import ChiefDoctor from './view/ChiefDoctor/ChiefDoctor';
  15. import MyPatient from './view/MyPatient/MyPatient';
  16. import AllDoctor from './view/MyAllDoctor/MyAllDoctor';
  17. import MyAssociatedDoctor from './view/MyAssociatedDoctor/MyAssociatedDoctor';
  18. class App extends React.Component {
  19. constructor(props) {
  20. super(props);
  21. this.state = {};
  22. }
  23. componentWillMount() {
  24. fetch('data.json')
  25. .then((res) => res.json())
  26. .then((res) => {
  27. this.setState(res);
  28. });
  29. }
  30. render() {
  31. return (
  32. <div>
  33. <Router history={hashHistory}>
  34. <Route path="/" component={Login}/>
  35. <Route path="/test" component={Test}/>
  36. <Route path="/chatBase" component={ChatBase}/>
  37. <Route path="/chatExpert" component={ChatExpert}/>
  38. <Route path="/expert" component={Expert}/>
  39. <Route path="/expertinquiry" component={ExpertInquiry}/>
  40. <Route path="/home" component={Home}/>
  41. <Route path="/myOrder" component={MyOrder}/>
  42. <Route path="/sendChatLog" component={SendChatLog}/>
  43. <Route path="/userMessage" component={UserMessage}/>
  44. <Route path="/referral" component={Referral}/>
  45. <Route path="/chiefdoctor" component={ChiefDoctor}/>
  46. <Route path="/mypatient" component={MyPatient} />
  47. <Route path="/myalldoctor" component={AllDoctor} />
  48. <Route path="/myassociateddoctor" component={MyAssociatedDoctor} />
  49. </Router>
  50. {/*<div>*/}
  51. {/*<ul>*/}
  52. {/*<li><a href="#/">login</a></li>*/}
  53. {/*/!*<li><a href="#/test">test</a></li>*!/*/}
  54. {/*<li><a href="#/chatBase">chatBase</a></li>*/}
  55. {/*<li><a href="#/chatExpert">chatExpert</a></li>*/}
  56. {/*<li><a href="#/expert">expert</a></li>*/}
  57. {/*<li><a href="#/expertinquiry">ExpertInquiry</a></li>*/}
  58. {/*<li><a href="#/home">home</a></li>*/}
  59. {/*<li><a href="#/myOrder">myOrder</a></li>*/}
  60. {/*<li><a href="#/sendChatLog">sendChatLog</a></li>*/}
  61. {/*<li><a href="#/userMessage">userMessage</a></li>*/}
  62. {/*</ul>*/}
  63. {/*</div>*/}
  64. </div>
  65. );
  66. }
  67. }
  68. export default App;