ExampleShow.jsx 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import React, {Component} from 'react';
  2. import {Layout, Card, Button, Avatar} from 'antd';
  3. import lo from '../../../images/lo.png'
  4. import './index.css'
  5. const {Content} = Layout;
  6. const {Meta} = Card;
  7. class ExampleShow extends Component {
  8. constructor(props) {
  9. super(props);
  10. this.state = {}
  11. }
  12. renderCard = () => {
  13. let examples = [
  14. {
  15. schemaID: '',
  16. title: '预约',
  17. description: '小程序',
  18. img: 'https://order-img-1254337200.cos.ap-shanghai.myqcloud.com/gh_09a69a242b5a_258.jpg',
  19. deployedNum: 100
  20. },
  21. {
  22. schemaID: '',
  23. title: '预约',
  24. description: '公众号',
  25. img: 'https://order-img-1254337200.cos.ap-shanghai.myqcloud.com/qrcode_for_gh_abcdd8e08f94_258.jpg',
  26. deployedNum: 90
  27. },
  28. {
  29. schemaID: '',
  30. title: '电商',
  31. description: '小程序',
  32. img: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
  33. deployedNum: 120
  34. },
  35. {
  36. schemaID: '',
  37. title: '电商',
  38. description: '公众号',
  39. img: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
  40. deployedNum: 105
  41. }
  42. ];
  43. let {userID} = this.state;
  44. return examples.map((item, index) => (
  45. <span key={index} style={{padding: '10px 0'}}>
  46. <Card
  47. key={index}
  48. style={{width: 300}}
  49. cover={<div className='cover-div'><img className='cover-img' src={item.img}
  50. alt={item.title + '' + item.description}/></div>}
  51. actions={[
  52. <span>已部署: {item.deployedNum}</span>,
  53. <Button type="primary" onClick={() => {
  54. this.props.history.push({
  55. pathname: `/common/deploy-cloud-choose`
  56. });
  57. }}>部署</Button>
  58. ]}
  59. >
  60. <Meta
  61. avatar={<Avatar src={lo}/>}
  62. title={item.title}
  63. description={item.description}
  64. />
  65. </Card>
  66. </span>
  67. ))
  68. };
  69. render() {
  70. return (
  71. <div id="example-show">
  72. <Layout style={{padding: '24px', minHeight: '300px'}}>
  73. <Content className="content">
  74. {this.renderCard()}
  75. </Content>
  76. </Layout>
  77. </div>
  78. )
  79. }
  80. }
  81. export default ExampleShow;