content.jsx 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import React from 'react';
  2. import { Spin, Button, Tabs } from 'antd';
  3. import '../content.less';
  4. import './content.less';
  5. import LeftTab from './leftTab.jsx';
  6. import weixin from '../../../../image/weixin-w.png';
  7. import qq from '../../../../image/qq-w.png';
  8. import weibo from '../../../../image/weibo-w.png';
  9. const TabPane = Tabs.TabPane;
  10. const Content = React.createClass({
  11. getInitialState() {
  12. return {
  13. per: '24',
  14. loading: false,
  15. userlvl: '1',
  16. userid: '1234567',
  17. follow: '0',
  18. chengguo: '0',
  19. kaifa: '0',
  20. fuwu: '0',
  21. xuqiu: '0',
  22. activityArr: [{ type: '成果对接会', title: '龙岗区在线科技成果对接会——智能制造业专场', time: '2017-01-10', link: '' },
  23. { type: '成果对接会', title: '钛白粉行业技术在线对接会', time: '2017-01-11', link: '' }]
  24. };
  25. },
  26. handlekey(key) {
  27. this.setState({
  28. leftKey: key,
  29. });
  30. },
  31. tabChange(key) {
  32. },
  33. render() {
  34. return (
  35. <div className="acc-content">
  36. <LeftTab handlekey={this.handlekey} />
  37. <div className="content-right">
  38. <Spin spinning={this.state.loading} className='spin-box'>
  39. <div className="index-content">
  40. <div className="index-userdata clearfix">
  41. <p className="acc-title">{this.state.userid}</p>
  42. <div className="userdata-img">
  43. <img src="" alt="" />
  44. </div>
  45. <div className="userdata-content">
  46. {(() => {
  47. switch (this.state.userlvl) {
  48. case '1':
  49. return <p className="userdata-lvl">等级:<span>LV1</span> 初来乍到</p>;
  50. case '2':
  51. return <p className="userdata-lvl">等级:<span>LV2</span> 初来乍到</p>;
  52. case '3':
  53. return <p className="userdata-lvl">等级:<span>LV3</span> 初来乍到</p>;
  54. case '4':
  55. return <p className="userdata-lvl">等级:<span>LV4</span> 初来乍到</p>;
  56. case '5':
  57. return <p className="userdata-lvl">等级:<span>LV5</span> 初来乍到</p>;
  58. };
  59. })()}
  60. <p>完善资料 {this.state.per}% ,<a href="./set.html">继续完善</a>,有助于提高您的资信</p>
  61. <p className="userdata-relate">
  62. <Button className="relateqq"><img src={qq} alt="" /> QQ账号登录</Button>
  63. <Button className="relateweibo"><img src={weibo} alt="" />微博账号登录</Button>
  64. <Button className="relateweixin"><img src={weixin} alt="" />微信账号登录</Button>
  65. </p>
  66. <div className="userdata-follow">已有<a href="">{this.state.follow}</a>人关注你</div>
  67. </div>
  68. </div>
  69. <div className="index-record">
  70. <p className="acc-title">我的轨迹</p>
  71. <ul className="record-list clearfix">
  72. <li>技术成果:<a href="">{this.state.chengguo}</a>项</li>
  73. <li>技术开发:<a href="">{this.state.kaifa}</a>项</li>
  74. <li>科技服务:<a href="">{this.state.fuwu}</a>项</li>
  75. <li>发布需求:<a href="">{this.state.xuqiu}</a>项</li>
  76. </ul>
  77. </div>
  78. <div className="index-activity">
  79. <Tabs defaultActiveKey="1" onChange={this.tabChange}>
  80. <TabPane tab="活动" key="1">
  81. <p className="acc-title">即将举办的活动</p>
  82. <ul className="activity-list">
  83. {
  84. this.state.activityArr.map(function (item, i) {
  85. return <li key={i}>
  86. <span className="list-type">[{item.type}]</span>
  87. <span className="list-title">{item.title}</span>
  88. <a href={item.link}>报名</a>
  89. <span className="list-time">{item.time}</span>
  90. </li>;
  91. })
  92. }
  93. </ul>
  94. </TabPane>
  95. <TabPane tab="其他" key="2">Content of Tab Pane 2</TabPane>
  96. </Tabs>
  97. </div>
  98. </div>
  99. </Spin>
  100. </div>
  101. </div>
  102. )
  103. }
  104. });
  105. export default Content;