|
@@ -4,16 +4,18 @@ import { Form, Input, Button, Icon, Select, Card, Radio, DatePicker, message, Up
|
4
|
4
|
import apis from '@/services/apis';
|
5
|
5
|
import moment from 'moment';
|
6
|
6
|
import router from 'umi/router';
|
7
|
|
-import BuildSelect from '@/components/SelectButton/BuildSelect'
|
8
|
|
-import request from '@/utils/request'
|
9
|
|
-import yinhao from '@/assets/yinhao.png'
|
|
7
|
+import BuildSelect from '@/components/SelectButton/BuildSelect';
|
|
8
|
+import request from '@/utils/request';
|
|
9
|
+import yinhao from '@/assets/yinhao.png';
|
10
|
10
|
import logo from '@/assets/logo.svg';
|
11
|
11
|
import touxiang from '@/assets/touxiang.jpg';
|
12
|
12
|
import poster1 from '@/assets/poster1.png';
|
13
|
13
|
import poster2 from '@/assets/poster2.png';
|
14
|
14
|
import xiaochengxu from '@/assets/xiaochengxu.png';
|
15
|
15
|
import AuthButton from '@/components/AuthButton';
|
16
|
|
-import Prompt from 'umi/prompt';
|
|
16
|
+import { getImgURL } from '@/utils/image';
|
|
17
|
+import Share from '@/components/Share';
|
|
18
|
+import Poster from '@/components/Poster';
|
17
|
19
|
|
18
|
20
|
const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
19
|
21
|
const { TextArea } = Input;
|
|
@@ -24,82 +26,86 @@ const formItemLayout = {
|
24
|
26
|
};
|
25
|
27
|
|
26
|
28
|
const cancelPage = () => {
|
27
|
|
- router.go('-1')
|
28
|
|
-}
|
|
29
|
+ router.go('-1');
|
|
30
|
+};
|
29
|
31
|
|
30
|
32
|
const getSignList = dynamicId => {
|
31
|
33
|
router.push({
|
32
|
|
- pathname: '/activity/SignList',
|
|
34
|
+ pathname: '/activity/SignupActivity/registrationRecord',
|
33
|
35
|
query: {
|
34
|
36
|
dynamicId,
|
35
|
37
|
},
|
36
|
38
|
});
|
37
|
|
-}
|
|
39
|
+};
|
38
|
40
|
|
39
|
41
|
const newQrcode = row => {
|
40
|
42
|
const x = new XMLHttpRequest();
|
41
|
|
- const resourceUrl = row.qrCode
|
|
43
|
+ const resourceUrl = row.qrCode;
|
42
|
44
|
x.open('GET', resourceUrl, true);
|
43
|
45
|
x.responseType = 'blob';
|
44
|
|
- x.onload = function (e) {
|
45
|
|
- const url = window.URL.createObjectURL(x.response)
|
|
46
|
+ x.onload = function(e) {
|
|
47
|
+ const url = window.URL.createObjectURL(x.response);
|
46
|
48
|
const a = document.createElement('a');
|
47
|
49
|
a.href = url;
|
48
|
|
- a.style.display = 'none'
|
|
50
|
+ a.style.display = 'none';
|
49
|
51
|
a.download = '活动二维码.png';
|
50
|
52
|
a.click();
|
51
|
|
- }
|
|
53
|
+ };
|
52
|
54
|
x.send();
|
53
|
|
-}
|
|
55
|
+};
|
54
|
56
|
|
55
|
57
|
const BasicForm = props => {
|
56
|
|
- const detailData = props.detailData || {}
|
|
58
|
+ const detailData = props.detailData || {};
|
57
|
59
|
|
58
|
60
|
const radioOnChange = e => {
|
59
|
61
|
// setIsEnlist(e.target.value)
|
60
|
|
- }
|
|
62
|
+ };
|
61
|
63
|
|
62
|
|
- const { dynamicId } = props
|
|
64
|
+ const { dynamicId } = props;
|
63
|
65
|
const handleSubmit = e => {
|
64
|
66
|
e.preventDefault();
|
65
|
67
|
props.form.validateFields((err, values) => {
|
66
|
68
|
if (!err) {
|
67
|
69
|
console.log('Received values of form: ', values);
|
68
|
|
- const { activityTime, signupTime } = values
|
69
|
|
- const [startDate, endDate] = activityTime
|
|
70
|
+ const { activityTime, signupTime } = values;
|
|
71
|
+ const [startDate, endDate] = activityTime;
|
70
|
72
|
values.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
|
71
|
73
|
values.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
|
72
|
74
|
if (signupTime) {
|
73
|
|
- const [enlistStart, enlistEnd] = signupTime
|
|
75
|
+ const [enlistStart, enlistEnd] = signupTime;
|
74
|
76
|
values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
|
75
|
77
|
values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
|
76
|
78
|
}
|
77
|
|
- console.log('submit data --->', values)
|
|
79
|
+ console.log('submit data --->', values);
|
78
|
80
|
if (dynamicId) {
|
79
|
|
- values.dynamicId = dynamicId
|
80
|
|
- request({ ...apis.activity.update, data: values }).then(data => {
|
81
|
|
- message.info('保存成功')
|
82
|
|
- // router.go(-1)
|
83
|
|
- }).catch((err) => {
|
84
|
|
- message.info(err.msg || err.message)
|
85
|
|
- })
|
|
81
|
+ values.dynamicId = dynamicId;
|
|
82
|
+ request({ ...apis.activity.update, data: values })
|
|
83
|
+ .then(data => {
|
|
84
|
+ message.info('保存成功');
|
|
85
|
+ // router.go(-1)
|
|
86
|
+ })
|
|
87
|
+ .catch(err => {
|
|
88
|
+ message.info(err.msg || err.message);
|
|
89
|
+ });
|
86
|
90
|
} else {
|
87
|
|
- request({ ...apis.activity.add, data: { ...values } }).then((data) => {
|
88
|
|
- message.info('保存成功')
|
89
|
|
- router.push({
|
90
|
|
- pathname: '/activity/editActivity',
|
91
|
|
- query: {
|
92
|
|
- dynamicId: data.dynamicId,
|
93
|
|
- },
|
|
91
|
+ request({ ...apis.activity.add, data: { ...values } })
|
|
92
|
+ .then(data => {
|
|
93
|
+ message.info('保存成功');
|
|
94
|
+ router.push({
|
|
95
|
+ pathname: '/activity/editActivity',
|
|
96
|
+ query: {
|
|
97
|
+ dynamicId: data.dynamicId,
|
|
98
|
+ },
|
|
99
|
+ });
|
|
100
|
+ // router.go(-1)
|
|
101
|
+ })
|
|
102
|
+ .catch(err => {
|
|
103
|
+ message.info(err.msg || err.message);
|
94
|
104
|
});
|
95
|
|
- // router.go(-1)
|
96
|
|
- }).catch((err) => {
|
97
|
|
- message.info(err.msg || err.message)
|
98
|
|
- })
|
99
|
105
|
}
|
100
|
106
|
}
|
101
|
107
|
});
|
102
|
|
- }
|
|
108
|
+ };
|
103
|
109
|
|
104
|
110
|
const { getFieldDecorator } = props.form;
|
105
|
111
|
return (
|
|
@@ -117,19 +123,24 @@ const BasicForm = props => {
|
117
|
123
|
})(<BuildSelect disabled />)}
|
118
|
124
|
</Form.Item>
|
119
|
125
|
<Form.Item label="活动封面图1">
|
120
|
|
- <img src={detailData.listImgUrl} height="210px" width="375px" />
|
|
126
|
+ <img src={getImgURL(detailData.listImgUrl)} height="210px" width="375px" />
|
121
|
127
|
</Form.Item>
|
122
|
128
|
<Form.Item label="活动封面图2">
|
123
|
|
- <img src={detailData.bannerListImg} height="125px" width="375px" />
|
|
129
|
+ <img src={getImgURL(detailData.bannerListImg)} height="125px" width="375px" />
|
124
|
130
|
</Form.Item>
|
125
|
131
|
<Form.Item label="活动详情主图">
|
126
|
|
- <img src={detailData.imgUrl} height="300px" width="375px" />
|
|
132
|
+ <img src={getImgURL(detailData.imgUrl)} height="300px" width="375px" />
|
127
|
133
|
</Form.Item>
|
128
|
134
|
<Form.Item label="活动标题">
|
129
|
135
|
<span>{detailData.title}</span>
|
130
|
136
|
</Form.Item>
|
|
137
|
+ <Form.Item label="副标题">
|
|
138
|
+ <span>{detailData.halfTitle}</span>
|
|
139
|
+ </Form.Item>
|
131
|
140
|
<Form.Item label="活动时间">
|
132
|
|
- <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(detailData.endDate).format('YYYY-MM-DD HH:mm')}`}</span>
|
|
141
|
+ <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(
|
|
142
|
+ detailData.endDate,
|
|
143
|
+ ).format('YYYY-MM-DD HH:mm')}`}</span>
|
133
|
144
|
</Form.Item>
|
134
|
145
|
<Form.Item label="活动地点">
|
135
|
146
|
<span>{detailData.address}</span>
|
|
@@ -150,219 +161,49 @@ const BasicForm = props => {
|
150
|
161
|
<span>{detailData.maxEnlistByPerson}</span>
|
151
|
162
|
</Form.Item>
|
152
|
163
|
<Form.Item label="活动详情">
|
153
|
|
- <div style={{ maxHeight: '500px', overflowY: 'auto' }} dangerouslySetInnerHTML={{ __html: detailData.desc }}></div>
|
|
164
|
+ <div
|
|
165
|
+ style={{ maxHeight: '500px', overflowY: 'auto' }}
|
|
166
|
+ dangerouslySetInnerHTML={{ __html: detailData.desc }}
|
|
167
|
+ ></div>
|
154
|
168
|
</Form.Item>
|
155
|
169
|
<Form.Item label="报名时间">
|
156
|
|
- <span>{`${moment(detailData.enlistStart).format('YYYY-MM-DD HH:mm')} —— ${moment(detailData.enlistEnd).format('YYYY-MM-DD HH:mm')}`}</span>
|
|
170
|
+ <span>{`${moment(detailData.enlistStart).format('YYYY-MM-DD HH:mm')} —— ${moment(
|
|
171
|
+ detailData.enlistEnd,
|
|
172
|
+ ).format('YYYY-MM-DD HH:mm')}`}</span>
|
157
|
173
|
</Form.Item>
|
158
|
174
|
<Form.Item label="权重">
|
159
|
175
|
<span>{detailData.heavy}</span>
|
160
|
176
|
</Form.Item>
|
161
|
177
|
</Form>
|
|
178
|
+ <div style={{ textAlign: 'center' }}>
|
|
179
|
+ <AuthButton name="admin.SignList.get" noRight={null}>
|
|
180
|
+ {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
|
|
181
|
+ <span
|
|
182
|
+ style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
|
|
183
|
+ onClick={getSignList.bind(this, detailData.dynamicId)}
|
|
184
|
+ >
|
|
185
|
+ <Button>报名记录</Button>
|
|
186
|
+ </span>
|
|
187
|
+ )}
|
|
188
|
+ </AuthButton>
|
|
189
|
+ <AuthButton name="admin.dymic.qrcode" noRight={null}>
|
|
190
|
+ {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
|
|
191
|
+ <span
|
|
192
|
+ style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
|
|
193
|
+ onClick={newQrcode.bind(this, detailData)}
|
|
194
|
+ >
|
|
195
|
+ {<Button>下载二维码</Button>}
|
|
196
|
+ </span>
|
|
197
|
+ )}
|
|
198
|
+ </AuthButton>
|
|
199
|
+ <Button onClick={() => cancelPage()}>取消</Button>
|
|
200
|
+ </div>
|
162
|
201
|
</>
|
163
|
|
- )
|
164
|
|
-}
|
|
202
|
+ );
|
|
203
|
+};
|
165
|
204
|
|
166
|
205
|
const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
|
167
|
206
|
|
168
|
|
-const Poster = (props) => {
|
169
|
|
- const { dynamicId } = props
|
170
|
|
- const [inputValue, changeInput] = useState('')
|
171
|
|
- const [textAreaValue, changeTextArea] = useState('')
|
172
|
|
- const [imgValue, changeImg] = useState('')
|
173
|
|
- const [posterId, setPosterId] = useState('')
|
174
|
|
-
|
175
|
|
- if (dynamicId) {
|
176
|
|
- console.log(dynamicId, 'dynamicId')
|
177
|
|
- useEffect(() => {
|
178
|
|
- request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
|
179
|
|
- console.log(data, "2222")
|
180
|
|
- if (data.length > 0) {
|
181
|
|
- setPosterId(data[0].posterId)
|
182
|
|
- changeImg(data[0].posterImg)
|
183
|
|
- changeTextArea(data[0].posterDescription)
|
184
|
|
- changeInput(data[0].posterTitle)
|
185
|
|
- }
|
186
|
|
- }).catch((err) => {
|
187
|
|
- message.info(err.msg || err.message)
|
188
|
|
- })
|
189
|
|
- getMiniappName()
|
190
|
|
- }, [])
|
191
|
|
- } else {
|
192
|
|
- getMiniappName()
|
193
|
|
- }
|
194
|
|
- // 获取小程序名称
|
195
|
|
- const [miniappName, setMiniappName] = useState('')
|
196
|
|
- function getMiniappName() {
|
197
|
|
- request({ ...apis.building.getMiniappName }).then(res => {
|
198
|
|
- console.log(res, "0000000000000")
|
199
|
|
- setMiniappName(res)
|
200
|
|
- })
|
201
|
|
- }
|
202
|
|
-
|
203
|
|
- const submitPoster = () => {
|
204
|
|
- if (dynamicId) {
|
205
|
|
- if (posterId) {
|
206
|
|
- request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
|
207
|
|
- message.info("保存成功")
|
208
|
|
- }).catch((err) => {
|
209
|
|
- message.info(err.msg || err.message)
|
210
|
|
- })
|
211
|
|
- } else {
|
212
|
|
- request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
|
213
|
|
- setPosterId(data.posterId)
|
214
|
|
- message.info("保存成功")
|
215
|
|
- }).catch((err) => {
|
216
|
|
- message.info(err.msg || err.message)
|
217
|
|
- })
|
218
|
|
- }
|
219
|
|
- } else {
|
220
|
|
- message.warn("请先保存基本信息数据")
|
221
|
|
- }
|
222
|
|
- }
|
223
|
|
-
|
224
|
|
- return <div>
|
225
|
|
- <div style={{ display: 'flex' }}>
|
226
|
|
- <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
|
227
|
|
- <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
|
228
|
|
- <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
|
229
|
|
- <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
|
230
|
|
- <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
|
231
|
|
- <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
|
232
|
|
- <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
|
233
|
|
- <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
|
234
|
|
- </div>
|
235
|
|
- <p style={{
|
236
|
|
- margin: '10px 20px',
|
237
|
|
- fontSize: '20px',
|
238
|
|
- color: '#222',
|
239
|
|
- fontWeight: '600',
|
240
|
|
- display: '-webkit-box',
|
241
|
|
- lineClamp: '3',
|
242
|
|
- height: '60px',
|
243
|
|
- WebkitLineClamp: '2',
|
244
|
|
- WebkitBoxOrient: 'vertical',
|
245
|
|
- overflow: 'hidden',
|
246
|
|
- textOverflow: 'ellipsis'
|
247
|
|
- }}>{inputValue ? inputValue : '海报标题'}</p>
|
248
|
|
-
|
249
|
|
- <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
|
250
|
|
- <p style={{
|
251
|
|
- margin: '16px 20px 28px 20px',
|
252
|
|
- fontSize: '17px',
|
253
|
|
- color: '#999',
|
254
|
|
- display: '-webkit-box',
|
255
|
|
- lineClamp: '3',
|
256
|
|
- height: '72px',
|
257
|
|
- WebkitLineClamp: '3',
|
258
|
|
- WebkitBoxOrient: 'vertical',
|
259
|
|
- overflow: 'hidden',
|
260
|
|
- textOverflow: 'ellipsis'
|
261
|
|
- }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
|
262
|
|
- <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
|
263
|
|
- <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
|
264
|
|
- <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
|
265
|
|
- <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
|
266
|
|
- </div>
|
267
|
|
- </div>
|
268
|
|
- <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
|
269
|
|
- </div>
|
270
|
|
-
|
271
|
|
- {/* <div >
|
272
|
|
- <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
|
273
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
|
274
|
|
- <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
|
275
|
|
- </div>
|
276
|
|
- <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
|
277
|
|
- <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
|
278
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
|
279
|
|
- <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
|
280
|
|
- </div>
|
281
|
|
- <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
|
282
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
|
283
|
|
- <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
|
284
|
|
- </div>
|
285
|
|
-
|
286
|
|
- </div> */}
|
287
|
|
- </div>
|
288
|
|
- {/* <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
|
289
|
|
- <Button onClick={() => cancelPage()}>
|
290
|
|
- 取消
|
291
|
|
- </Button> */}
|
292
|
|
- </div>
|
293
|
|
-
|
294
|
|
-}
|
295
|
|
-
|
296
|
|
-
|
297
|
|
-
|
298
|
|
-const Share = (props) => {
|
299
|
|
- const { dynamicId } = props
|
300
|
|
-
|
301
|
|
- const [inputValue, changeInput] = useState('')
|
302
|
|
- const [imgValue, changeImg] = useState('')
|
303
|
|
- const [shareContentId, setShareContentId] = useState('')
|
304
|
|
-
|
305
|
|
-
|
306
|
|
- useEffect(() => {
|
307
|
|
- if (dynamicId) {
|
308
|
|
- request({ ...apis.activity.shareContent, params: { targetId: dynamicId, targetType: 'activity' }, }).then((data) => {
|
309
|
|
- if (data.length > 0) {
|
310
|
|
- setShareContentId(data[0].shareContentId)
|
311
|
|
- changeImg(data[0].shareContentImg)
|
312
|
|
- changeInput(data[0].shareContentTitle)
|
313
|
|
- }
|
314
|
|
- }).catch((err) => {
|
315
|
|
- message.info(err.msg || err.message)
|
316
|
|
- })
|
317
|
|
- }
|
318
|
|
- }, [])
|
319
|
|
-
|
320
|
|
-
|
321
|
|
- const submitShare = () => {
|
322
|
|
- if (dynamicId) {
|
323
|
|
- if (shareContentId) {
|
324
|
|
- request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
|
325
|
|
- message.info("保存成功")
|
326
|
|
- }).catch((err) => {
|
327
|
|
- message.info(err.msg || err.message)
|
328
|
|
- })
|
329
|
|
- } else {
|
330
|
|
- request({ ...apis.activity.addShareContent, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
|
331
|
|
- setShareContentId(data.shareContentId)
|
332
|
|
- message.info("保存成功")
|
333
|
|
- }).catch(err => {
|
334
|
|
- message.info(err.msg || err.message)
|
335
|
|
- })
|
336
|
|
- }
|
337
|
|
- } else {
|
338
|
|
- message.warn("请先保存基本信息数据")
|
339
|
|
- }
|
340
|
|
- }
|
341
|
|
-
|
342
|
|
- return <div style={{ padding: '20px' }}>
|
343
|
|
- <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
|
344
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
|
345
|
|
- <div>
|
346
|
|
- <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
|
347
|
|
- <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
|
348
|
|
- <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
|
349
|
|
- </div>
|
350
|
|
- </div>
|
351
|
|
- <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
352
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
|
353
|
|
- {inputValue === '' ? '无' : <span>{inputValue}</span>}
|
354
|
|
- </div>
|
355
|
|
- <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
|
356
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
|
357
|
|
- {imgValue === '' ? '无' : <img src={imgValue} height="120px" height="150px" />}
|
358
|
|
- </div>
|
359
|
|
- {/* <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
|
360
|
|
- <Button onClick={() => cancelPage()}>
|
361
|
|
- 取消
|
362
|
|
- </Button> */}
|
363
|
|
- </div>
|
364
|
|
-}
|
365
|
|
-
|
366
|
207
|
/**
|
367
|
208
|
*
|
368
|
209
|
*
|
|
@@ -370,30 +211,27 @@ const Share = (props) => {
|
370
|
211
|
* @returns
|
371
|
212
|
*/
|
372
|
213
|
const Edit = props => {
|
373
|
|
- const [tab, changeTab] = useState('basic')
|
374
|
|
- const { dynamicId } = props.location.query
|
375
|
|
- const [detailData, setDetailData] = useState(false)
|
|
214
|
+ const [tab, changeTab] = useState('basic');
|
|
215
|
+ const { dynamicId } = props.location.query;
|
|
216
|
+ const [detailData, setDetailData] = useState(false);
|
376
|
217
|
|
377
|
218
|
const getDynamicData = dynamicId => {
|
378
|
|
- request({ ...apis.activity.details, params: { dynamicId } }).then((data) => {
|
379
|
|
- console.log(data)
|
380
|
|
- data.activityTime = [moment(data.startDate), moment(data.endDate)]
|
381
|
|
- data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
|
382
|
|
-
|
383
|
|
- setDetailData(data)
|
384
|
|
- })
|
385
|
|
- }
|
|
219
|
+ request({ ...apis.activity.details, params: { dynamicId } }).then(data => {
|
|
220
|
+ console.log(data);
|
|
221
|
+ data.activityTime = [moment(data.startDate), moment(data.endDate)];
|
|
222
|
+ data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)];
|
386
|
223
|
|
|
224
|
+ setDetailData(data);
|
|
225
|
+ });
|
|
226
|
+ };
|
387
|
227
|
|
388
|
228
|
useEffect(() => {
|
389
|
229
|
if (dynamicId) {
|
390
|
230
|
getDynamicData(dynamicId);
|
391
|
231
|
}
|
392
|
|
- }, [])
|
393
|
|
-
|
394
|
|
-
|
395
|
|
-
|
|
232
|
+ }, []);
|
396
|
233
|
|
|
234
|
+ const target = { id: dynamicId, type: 'activity' };
|
397
|
235
|
return (
|
398
|
236
|
<Card>
|
399
|
237
|
<div>
|
|
@@ -405,22 +243,35 @@ const Edit = props => {
|
405
|
243
|
</div>
|
406
|
244
|
<div>
|
407
|
245
|
{tab === 'basic' && <Basic dynamicId={dynamicId} detailData={detailData} />}
|
408
|
|
- {tab === 'poster' && <Poster dynamicId={dynamicId} />}
|
409
|
|
- {tab === 'share' && <Share dynamicId={dynamicId} />}
|
|
246
|
+
|
|
247
|
+ {tab === 'poster' && <Poster target={target} />}
|
|
248
|
+ {tab === 'share' && <Share target={target} />}
|
410
|
249
|
</div>
|
411
|
|
- <div style={{ textAlign: 'center' }}>
|
|
250
|
+ {/* <div style={{ textAlign: 'center' }}>
|
412
|
251
|
<AuthButton name="admin.SignList.get" noRight={null}>
|
413
|
|
- {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, detailData.dynamicId)}><Button>报名记录</Button></span>}
|
|
252
|
+ {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
|
|
253
|
+ <span
|
|
254
|
+ style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
|
|
255
|
+ onClick={getSignList.bind(this, detailData.dynamicId)}
|
|
256
|
+ >
|
|
257
|
+ <Button>报名记录</Button>
|
|
258
|
+ </span>
|
|
259
|
+ )}
|
414
|
260
|
</AuthButton>
|
415
|
261
|
<AuthButton name="admin.dymic.qrcode" noRight={null}>
|
416
|
|
- {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, detailData)}>{<Button>下载二维码</Button>}</span>}
|
|
262
|
+ {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
|
|
263
|
+ <span
|
|
264
|
+ style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
|
|
265
|
+ onClick={newQrcode.bind(this, detailData)}
|
|
266
|
+ >
|
|
267
|
+ {<Button>下载二维码</Button>}
|
|
268
|
+ </span>
|
|
269
|
+ )}
|
417
|
270
|
</AuthButton>
|
418
|
|
- <Button onClick={() => cancelPage()}>
|
419
|
|
- 取消
|
420
|
|
- </Button>
|
421
|
|
- </div>
|
|
271
|
+ <Button onClick={() => cancelPage()}>取消</Button>
|
|
272
|
+ </div> */}
|
422
|
273
|
</Card>
|
423
|
274
|
);
|
424
|
|
-}
|
|
275
|
+};
|
425
|
276
|
|
426
|
|
-export default Edit
|
|
277
|
+export default Edit;
|