|
@@ -0,0 +1,134 @@
|
|
1
|
+import React, { useState, useEffect } from 'react';
|
|
2
|
+import { Card, Checkbox, Button, Upload } from 'antd';
|
|
3
|
+import apis from '../../services/apis';
|
|
4
|
+import request from '../../utils/request'
|
|
5
|
+import { uploaderProps } from '../../utils/upload';
|
|
6
|
+import head1 from '../../assets/head1.png';
|
|
7
|
+import head2 from '../../assets/head2.png';
|
|
8
|
+import head3 from '../../assets/head3.png';
|
|
9
|
+import link from '../../assets/link.png';
|
|
10
|
+
|
|
11
|
+const { Meta } = Card;
|
|
12
|
+
|
|
13
|
+/**
|
|
14
|
+ *
|
|
15
|
+ *
|
|
16
|
+ * @param {*} props
|
|
17
|
+ * @returns
|
|
18
|
+ */
|
|
19
|
+const PosterCard = (props) => {
|
|
20
|
+ const [data, setData] = useState([])
|
|
21
|
+ const [indexOneUrl, setIndexOneUrl] = useState('')
|
|
22
|
+ const [indexTwoUrl, setIndexTwoUrl] = useState('')
|
|
23
|
+ const [indexThreeUrl, setIndexThreeUrl] = useState('')
|
|
24
|
+ let resultData = []
|
|
25
|
+
|
|
26
|
+ useEffect(() => {
|
|
27
|
+ }, [])
|
|
28
|
+
|
|
29
|
+ const handleUploadIndexOneSucess = url => {
|
|
30
|
+ console.log(url, "第一张图上传回调");
|
|
31
|
+ setIndexOneUrl(url)
|
|
32
|
+ resultData[0] = url
|
|
33
|
+ resultData[1] = indexTwoUrl
|
|
34
|
+ resultData[2] = indexThreeUrl
|
|
35
|
+ props.onChange(resultData)
|
|
36
|
+ }
|
|
37
|
+
|
|
38
|
+ const handleUploadIndexTwoSucess = url => {
|
|
39
|
+ console.log(url, "第二张图上传回调");
|
|
40
|
+ setIndexTwoUrl(url)
|
|
41
|
+ resultData[0] = indexOneUrl
|
|
42
|
+ resultData[1] = url
|
|
43
|
+ resultData[2] = indexThreeUrl
|
|
44
|
+ props.onChange(resultData)
|
|
45
|
+ }
|
|
46
|
+
|
|
47
|
+ const handleUploadIndexThreeSucess = url => {
|
|
48
|
+ console.log(url, "第三张图上传回调");
|
|
49
|
+ setIndexThreeUrl(url)
|
|
50
|
+ resultData[0] = indexOneUrl
|
|
51
|
+ resultData[1] = indexTwoUrl
|
|
52
|
+ resultData[2] = url
|
|
53
|
+ props.onChange(resultData)
|
|
54
|
+ }
|
|
55
|
+
|
|
56
|
+ return (
|
|
57
|
+
|
|
58
|
+ <div style={{ display: 'flex' }}>
|
|
59
|
+
|
|
60
|
+ <div style={{ width: '420px', height: '940px', display: 'inline-block', marginTop: '30px' }}>
|
|
61
|
+ <div style={{ width: '375px', height: '780px', backgroundColor: '#CFCFCF', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
|
|
62
|
+ <img style={{ width: '100%', height: '100%' }} src={indexOneUrl} alt="" />
|
|
63
|
+ <img src={head1} style={{ width: '66px', height: '66px', position: 'absolute', left: '20px', bottom: '38px' }} alt="" />
|
|
64
|
+ <p style={{ margin: '0', fontSize: '18px', position: 'absolute', left: '96px', bottom: '79px', color: '#333' }}>小五子</p>
|
|
65
|
+ <p style={{ margin: '0', fontSize: '15px', position: 'absolute', left: '96px', bottom: '58px', color: '#333' }}>175 1256 0225</p>
|
|
66
|
+ <p style={{ margin: '0', fontSize: '14px', position: 'absolute', left: '96px', bottom: '39px', color: '#666' }}>邀请您参与活动</p>
|
|
67
|
+ <img src={link} style={{ margin: '0', width: '80px', height: '80px', backgroundColor: '#fff', padding: '4px', borderRadius: '6px', position: 'absolute', right: '30px', bottom: '45px' }} alt="" />
|
|
68
|
+ <p style={{ margin: '0', fontSize: '13px', position: 'absolute', right: '30px', bottom: '20px', color: '#666' }}>长按识别更多</p>
|
|
69
|
+
|
|
70
|
+ </div>
|
|
71
|
+ <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>生成海报分享给朋友</p>
|
|
72
|
+ <p style={{ textAlign: 'center' }}>
|
|
73
|
+ <Upload showUploadList={false}
|
|
74
|
+ {...uploaderProps}
|
|
75
|
+ onSuccess={handleUploadIndexOneSucess}>
|
|
76
|
+ <Button>
|
|
77
|
+ 上传图片
|
|
78
|
+ </Button>
|
|
79
|
+ </Upload>
|
|
80
|
+ </p>
|
|
81
|
+ </div>
|
|
82
|
+
|
|
83
|
+ <div style={{ width: '420px', height: '940px', display: 'inline-block', marginTop: '30px' }}>
|
|
84
|
+ <div style={{ width: '375px', height: '780px', backgroundColor: '#CFCFCF', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
|
|
85
|
+ <img style={{ width: '100%', height: '100%' }} src={indexTwoUrl} alt="" />
|
|
86
|
+ <img src={head1} style={{ width: '66px', height: '66px', position: 'absolute', left: '20px', bottom: '122px' }} alt="" />
|
|
87
|
+ <p style={{ margin: '0', fontSize: '18px', position: 'absolute', left: '96px', bottom: '163px', color: '#333' }}>小五子</p>
|
|
88
|
+ <p style={{ margin: '0', fontSize: '15px', position: 'absolute', left: '96px', bottom: '142px', color: '#333' }}>175 1256 0225</p>
|
|
89
|
+ <p style={{ margin: '0', fontSize: '14px', position: 'absolute', left: '96px', bottom: '121px', color: '#666' }}>邀请您参与活动</p>
|
|
90
|
+ <div style={{ margin: '0', width: '100%', height: '112px', backgroundColor: '#fff', position: 'absolute', left: '0px', bottom: '0.5px', }}>
|
|
91
|
+ <p style={{ margin: '0', fontSize: '16px', position: 'absolute', left: '30px', bottom: '58px', color: '#666' }}>长按识别小程序码</p>
|
|
92
|
+ <p style={{ margin: '0', fontSize: '16px', position: 'absolute', left: '30px', bottom: '31px', color: '#666' }}>进入<span style={{ margin: '0 10px', fontSize: '17px', color: '#000' }}>致云</span>查看详情</p>
|
|
93
|
+ <img src={link} style={{ margin: '0', width: '100px', height: '100px', position: 'absolute', right: '20px', bottom: '6px' }} alt="" />
|
|
94
|
+ </div>
|
|
95
|
+ </div>
|
|
96
|
+ <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>生成海报分享给朋友</p>
|
|
97
|
+ <p style={{ textAlign: 'center' }}>
|
|
98
|
+ <Upload showUploadList={false}
|
|
99
|
+ {...uploaderProps}
|
|
100
|
+ onSuccess={handleUploadIndexTwoSucess}>
|
|
101
|
+ <Button>
|
|
102
|
+ 上传图片
|
|
103
|
+ </Button>
|
|
104
|
+ </Upload></p>
|
|
105
|
+ </div>
|
|
106
|
+
|
|
107
|
+ <div style={{ width: '420px', height: '940px', display: 'inline-block', marginTop: '30px' }}>
|
|
108
|
+ <div style={{ width: '375px', height: '780px', backgroundColor: '#CFCFCF', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
|
|
109
|
+ <img style={{ width: '100%', height: '100%' }} src={indexThreeUrl} alt="" />
|
|
110
|
+ <img src={head1} style={{ width: '66px', height: '66px', position: 'absolute', left: '20px', bottom: '142px' }} alt="" />
|
|
111
|
+ <p style={{ margin: '0', fontSize: '18px', position: 'absolute', left: '96px', bottom: '183px', color: '#333' }}>小五子</p>
|
|
112
|
+ <p style={{ margin: '0', fontSize: '15px', position: 'absolute', left: '96px', bottom: '162px', color: '#333' }}>175 1256 0225</p>
|
|
113
|
+ <p style={{ margin: '0', fontSize: '14px', position: 'absolute', left: '96px', bottom: '141px', color: '#666' }}>邀请您参与活动</p>
|
|
114
|
+ <div style={{ margin: '0', width: '335px', borderRadius: '6px', height: '112px', backgroundColor: '#fff', position: 'absolute', left: '20px', bottom: '20px', }}></div>
|
|
115
|
+ <p style={{ margin: '0', fontSize: '16px', position: 'absolute', left: '50px', bottom: '78px', color: '#666' }}>长按识别小程序码</p>
|
|
116
|
+ <p style={{ margin: '0', fontSize: '16px', position: 'absolute', left: '50px', bottom: '51px', color: '#666' }}>进入<span style={{ margin: '0 10px', fontSize: '17px', color: '#000' }}>致云</span>查看详情</p>
|
|
117
|
+ <img src={link} style={{ margin: '0', width: '100px', height: '100px', position: 'absolute', right: '50px', bottom: '26px' }} alt="" />
|
|
118
|
+ </div>
|
|
119
|
+ <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>生成海报分享给朋友</p>
|
|
120
|
+ <p style={{ textAlign: 'center' }}>
|
|
121
|
+ <Upload showUploadList={false}
|
|
122
|
+ {...uploaderProps}
|
|
123
|
+ onSuccess={handleUploadIndexThreeSucess}>
|
|
124
|
+ <Button>
|
|
125
|
+ 上传图片
|
|
126
|
+ </Button>
|
|
127
|
+ </Upload>
|
|
128
|
+ </p>
|
|
129
|
+ </div>
|
|
130
|
+ </div>
|
|
131
|
+ )
|
|
132
|
+}
|
|
133
|
+export default PosterCard
|
|
134
|
+
|