|
@@ -66,7 +66,6 @@ const BasicForm = props => {
|
66
|
66
|
}
|
67
|
67
|
|
68
|
68
|
const { dynamicId } = props
|
69
|
|
-
|
70
|
69
|
const handleSubmit = e => {
|
71
|
70
|
e.preventDefault();
|
72
|
71
|
props.form.validateFields((err, values) => {
|
|
@@ -81,7 +80,6 @@ const BasicForm = props => {
|
81
|
80
|
values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
|
82
|
81
|
values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
|
83
|
82
|
}
|
84
|
|
-
|
85
|
83
|
console.log('submit data --->', values)
|
86
|
84
|
if (dynamicId) {
|
87
|
85
|
values.dynamicId = dynamicId
|
|
@@ -114,18 +112,18 @@ const BasicForm = props => {
|
114
|
112
|
<>
|
115
|
113
|
<Form {...formItemLayout} onSubmit={handleSubmit}>
|
116
|
114
|
<Form.Item label="所属项目">
|
117
|
|
- {getFieldDecorator('buildingId', {
|
118
|
|
- initialValue: detailData.buildingId,
|
119
|
|
- rules: [
|
120
|
|
- {
|
121
|
|
- required: true,
|
122
|
|
- message: '请选择所属项目',
|
123
|
|
- },
|
124
|
|
- ],
|
125
|
|
- })(<BuildSelect disabled/>)}
|
|
115
|
+ {getFieldDecorator('buildingId', {
|
|
116
|
+ initialValue: detailData.buildingId,
|
|
117
|
+ rules: [
|
|
118
|
+ {
|
|
119
|
+ required: true,
|
|
120
|
+ message: '请选择所属项目',
|
|
121
|
+ },
|
|
122
|
+ ],
|
|
123
|
+ })(<BuildSelect disabled />)}
|
126
|
124
|
</Form.Item>
|
127
|
125
|
<Form.Item label="活动封面图1">
|
128
|
|
- <img src={detailData.listImgUrl} height="210px" width="375px" />
|
|
126
|
+ <img src={detailData.listImgUrl} height="210px" width="375px" />
|
129
|
127
|
</Form.Item>
|
130
|
128
|
<Form.Item label="活动封面图2">
|
131
|
129
|
<img src={detailData.bannerListImg} height="125px" width="375px" />
|
|
@@ -158,11 +156,11 @@ const BasicForm = props => {
|
158
|
156
|
<span>{detailData.maxEnlistByPerson}</span>
|
159
|
157
|
</Form.Item>
|
160
|
158
|
<Form.Item label="活动详情">
|
161
|
|
- <div style={{ maxHeight: '500px', overflowY: 'auto' }} dangerouslySetInnerHTML={{ __html: detailData.desc}}></div>
|
|
159
|
+ <div style={{ maxHeight: '500px', overflowY: 'auto' }} dangerouslySetInnerHTML={{ __html: detailData.desc }}></div>
|
162
|
160
|
</Form.Item>
|
163
|
161
|
<Form.Item label="报名时间">
|
164
|
162
|
<span>{`${moment(detailData.enlistStart).format('YYYY-MM-DD HH:mm')} —— ${moment(detailData.enlistEnd).format('YYYY-MM-DD HH:mm')}`}</span>
|
165
|
|
- </Form.Item>
|
|
163
|
+ </Form.Item>
|
166
|
164
|
<Form.Item label="权重">
|
167
|
165
|
<span>{detailData.heavy}</span>
|
168
|
166
|
</Form.Item>
|
|
@@ -173,229 +171,235 @@ const BasicForm = props => {
|
173
|
171
|
|
174
|
172
|
const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
|
175
|
173
|
|
176
|
|
-/**
|
177
|
|
- *
|
178
|
|
- *
|
179
|
|
- * @param {*} props
|
180
|
|
- * @returns
|
181
|
|
- */
|
182
|
|
-const Edit = props => {
|
183
|
|
- const [tab, changeTab] = useState('basic')
|
184
|
|
- const { dynamicId } = props.location.query
|
185
|
|
- const [detailData, setDetailData] = useState(false)
|
186
|
|
-
|
187
|
|
- const getDynamicData = dynamicId => {
|
188
|
|
- request({ ...apis.activity.details, params: { dynamicId } }).then((data) => {
|
189
|
|
- console.log(data)
|
190
|
|
- data.activityTime = [moment(data.startDate), moment(data.endDate)]
|
191
|
|
- data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
|
192
|
|
-
|
193
|
|
- setDetailData(data)
|
194
|
|
- })
|
195
|
|
- }
|
|
174
|
+const Poster = (props) => {
|
|
175
|
+ const { dynamicId } = props
|
|
176
|
+ const [inputValue, changeInput] = useState('')
|
|
177
|
+ const [textAreaValue, changeTextArea] = useState('')
|
|
178
|
+ const [imgValue, changeImg] = useState('')
|
|
179
|
+ const [posterId, setPosterId] = useState('')
|
196
|
180
|
|
197
|
|
-
|
|
181
|
+ if (dynamicId) {
|
|
182
|
+ console.log(dynamicId, 'dynamicId')
|
198
|
183
|
useEffect(() => {
|
199
|
|
- if (dynamicId) {
|
200
|
|
- getDynamicData(dynamicId);
|
201
|
|
- }
|
|
184
|
+ request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
|
|
185
|
+ console.log(data, "2222")
|
|
186
|
+ if (data.length > 0) {
|
|
187
|
+ setPosterId(data[0].posterId)
|
|
188
|
+ changeImg(data[0].posterImg)
|
|
189
|
+ changeTextArea(data[0].posterDescription)
|
|
190
|
+ changeInput(data[0].posterTitle)
|
|
191
|
+ }
|
|
192
|
+ }).catch((err) => {
|
|
193
|
+ message.info(err.msg || err.message)
|
|
194
|
+ })
|
|
195
|
+ getMiniappName()
|
202
|
196
|
}, [])
|
|
197
|
+ } else {
|
|
198
|
+ getMiniappName()
|
|
199
|
+ }
|
|
200
|
+ // 获取小程序名称
|
|
201
|
+ const [miniappName, setMiniappName] = useState('')
|
|
202
|
+ function getMiniappName() {
|
|
203
|
+ request({ ...apis.building.getMiniappName }).then(res => {
|
|
204
|
+ console.log(res, "0000000000000")
|
|
205
|
+ setMiniappName(res)
|
|
206
|
+ })
|
|
207
|
+ }
|
203
|
208
|
|
204
|
|
-
|
205
|
|
- const Poster = (props) => {
|
206
|
|
- const [inputValue, changeInput] = useState('')
|
207
|
|
- const [textAreaValue, changeTextArea] = useState('')
|
208
|
|
- const [imgValue, changeImg] = useState('')
|
209
|
|
- const [posterId, setPosterId] = useState('')
|
210
|
|
-
|
|
209
|
+ const submitPoster = () => {
|
211
|
210
|
if (dynamicId) {
|
212
|
|
- console.log(dynamicId, 'dynamicId')
|
213
|
|
- useEffect(() => {
|
214
|
|
- request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
|
215
|
|
- console.log(data, "2222")
|
216
|
|
- if (data.length > 0) {
|
217
|
|
- setPosterId(data[0].posterId)
|
218
|
|
- changeImg(data[0].posterImg)
|
219
|
|
- changeTextArea(data[0].posterDescription)
|
220
|
|
- changeInput(data[0].posterTitle)
|
221
|
|
- }
|
|
211
|
+ if (posterId) {
|
|
212
|
+ request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
|
|
213
|
+ message.info("保存成功")
|
222
|
214
|
}).catch((err) => {
|
223
|
215
|
message.info(err.msg || err.message)
|
224
|
216
|
})
|
225
|
|
- getMiniappName()
|
226
|
|
- }, [])
|
227
|
|
- }else{
|
228
|
|
- getMiniappName()
|
229
|
|
- }
|
230
|
|
- // 获取小程序名称
|
231
|
|
- const [miniappName, setMiniappName] = useState('')
|
232
|
|
- function getMiniappName() {
|
233
|
|
- request({ ...apis.building.getMiniappName }).then(res => {
|
234
|
|
- console.log(res, "0000000000000")
|
235
|
|
- setMiniappName(res)
|
236
|
|
- })
|
237
|
|
- }
|
238
|
|
-
|
239
|
|
- const submitPoster = () => {
|
240
|
|
- if (dynamicId) {
|
241
|
|
- if (posterId) {
|
242
|
|
- request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
|
243
|
|
- message.info("保存成功")
|
244
|
|
- }).catch((err) => {
|
245
|
|
- message.info(err.msg || err.message)
|
246
|
|
- })
|
247
|
|
- } else {
|
248
|
|
- request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
|
249
|
|
- setPosterId(data.posterId)
|
250
|
|
- message.info("保存成功")
|
251
|
|
- }).catch((err) => {
|
252
|
|
- message.info(err.msg || err.message)
|
253
|
|
- })
|
254
|
|
- }
|
255
|
217
|
} else {
|
256
|
|
- message.warn("请先保存基本信息数据")
|
|
218
|
+ request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
|
|
219
|
+ setPosterId(data.posterId)
|
|
220
|
+ message.info("保存成功")
|
|
221
|
+ }).catch((err) => {
|
|
222
|
+ message.info(err.msg || err.message)
|
|
223
|
+ })
|
257
|
224
|
}
|
|
225
|
+ } else {
|
|
226
|
+ message.warn("请先保存基本信息数据")
|
258
|
227
|
}
|
|
228
|
+ }
|
259
|
229
|
|
260
|
|
- return <div>
|
261
|
|
- <div style={{ display: 'flex' }}>
|
262
|
|
- <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
|
263
|
|
- <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
|
264
|
|
- <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
|
265
|
|
- <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
|
266
|
|
- <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
|
267
|
|
- <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
|
268
|
|
- <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
|
269
|
|
- <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
|
270
|
|
- </div>
|
271
|
|
- <p style={{
|
272
|
|
- margin: '10px 20px',
|
273
|
|
- fontSize: '20px',
|
274
|
|
- color: '#222',
|
275
|
|
- fontWeight: '600',
|
276
|
|
- display: '-webkit-box',
|
277
|
|
- lineClamp: '3',
|
278
|
|
- height: '60px',
|
279
|
|
- WebkitLineClamp: '2',
|
280
|
|
- WebkitBoxOrient: 'vertical',
|
281
|
|
- overflow: 'hidden',
|
282
|
|
- textOverflow: 'ellipsis'
|
283
|
|
- }}>{inputValue ? inputValue : '海报标题'}</p>
|
284
|
|
-
|
285
|
|
- <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
|
286
|
|
- <p style={{
|
287
|
|
- margin: '16px 20px 28px 20px',
|
288
|
|
- fontSize: '17px',
|
289
|
|
- color: '#999',
|
290
|
|
- display: '-webkit-box',
|
291
|
|
- lineClamp: '3',
|
292
|
|
- height: '72px',
|
293
|
|
- WebkitLineClamp: '3',
|
294
|
|
- WebkitBoxOrient: 'vertical',
|
295
|
|
- overflow: 'hidden',
|
296
|
|
- textOverflow: 'ellipsis'
|
297
|
|
- }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
|
298
|
|
- <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
|
299
|
|
- <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
|
300
|
|
- <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
|
301
|
|
- <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
|
302
|
|
- </div>
|
|
230
|
+ return <div>
|
|
231
|
+ <div style={{ display: 'flex' }}>
|
|
232
|
+ <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
|
|
233
|
+ <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
|
|
234
|
+ <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
|
|
235
|
+ <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
|
|
236
|
+ <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
|
|
237
|
+ <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
|
|
238
|
+ <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
|
|
239
|
+ <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
|
303
|
240
|
</div>
|
304
|
|
- <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
|
305
|
|
- </div>
|
|
241
|
+ <p style={{
|
|
242
|
+ margin: '10px 20px',
|
|
243
|
+ fontSize: '20px',
|
|
244
|
+ color: '#222',
|
|
245
|
+ fontWeight: '600',
|
|
246
|
+ display: '-webkit-box',
|
|
247
|
+ lineClamp: '3',
|
|
248
|
+ height: '60px',
|
|
249
|
+ WebkitLineClamp: '2',
|
|
250
|
+ WebkitBoxOrient: 'vertical',
|
|
251
|
+ overflow: 'hidden',
|
|
252
|
+ textOverflow: 'ellipsis'
|
|
253
|
+ }}>{inputValue ? inputValue : '海报标题'}</p>
|
306
|
254
|
|
307
|
|
- {/* <div >
|
308
|
|
- <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
|
309
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
|
310
|
|
- <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
|
311
|
|
- </div>
|
312
|
|
- <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
|
313
|
|
- <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
|
314
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
|
315
|
|
- <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
|
|
255
|
+ <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
|
|
256
|
+ <p style={{
|
|
257
|
+ margin: '16px 20px 28px 20px',
|
|
258
|
+ fontSize: '17px',
|
|
259
|
+ color: '#999',
|
|
260
|
+ display: '-webkit-box',
|
|
261
|
+ lineClamp: '3',
|
|
262
|
+ height: '72px',
|
|
263
|
+ WebkitLineClamp: '3',
|
|
264
|
+ WebkitBoxOrient: 'vertical',
|
|
265
|
+ overflow: 'hidden',
|
|
266
|
+ textOverflow: 'ellipsis'
|
|
267
|
+ }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
|
|
268
|
+ <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
|
|
269
|
+ <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
|
|
270
|
+ <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
|
|
271
|
+ <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
|
316
|
272
|
</div>
|
317
|
|
- <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
|
318
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
|
319
|
|
- <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
|
320
|
|
- </div>
|
321
|
|
-
|
322
|
|
- </div> */}
|
|
273
|
+ </div>
|
|
274
|
+ <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
|
323
|
275
|
</div>
|
324
|
|
- {/* <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
|
325
|
|
- <Button onClick={() => cancelPage()}>
|
326
|
|
- 取消
|
327
|
|
- </Button> */}
|
|
276
|
+
|
|
277
|
+ {/* <div >
|
|
278
|
+ <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
|
|
279
|
+ <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
|
|
280
|
+ <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
|
|
281
|
+ </div>
|
|
282
|
+ <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
|
|
283
|
+ <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
|
|
284
|
+ <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
|
|
285
|
+ <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
|
|
286
|
+ </div>
|
|
287
|
+ <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
|
|
288
|
+ <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
|
|
289
|
+ <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
|
|
290
|
+ </div>
|
|
291
|
+
|
|
292
|
+ </div> */}
|
328
|
293
|
</div>
|
|
294
|
+ {/* <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
|
|
295
|
+ <Button onClick={() => cancelPage()}>
|
|
296
|
+ 取消
|
|
297
|
+ </Button> */}
|
|
298
|
+ </div>
|
|
299
|
+
|
|
300
|
+}
|
329
|
301
|
|
330
|
|
- }
|
331
|
302
|
|
332
|
303
|
|
|
304
|
+const Share = (props) => {
|
|
305
|
+ const { dynamicId } = props
|
|
306
|
+
|
|
307
|
+ const [inputValue, changeInput] = useState('')
|
|
308
|
+ const [imgValue, changeImg] = useState('')
|
|
309
|
+ const [shareContentId, setShareContentId] = useState('')
|
333
|
310
|
|
334
|
|
- const Share = (props) => {
|
335
|
|
- const [inputValue, changeInput] = useState('')
|
336
|
|
- const [imgValue, changeImg] = useState('')
|
337
|
|
- const [shareContentId, setShareContentId] = useState('')
|
338
|
311
|
|
|
312
|
+ useEffect(() => {
|
339
|
313
|
if (dynamicId) {
|
340
|
|
- useEffect(() => {
|
341
|
|
- request({ ...apis.activity.shareContent, params: { targetId: dynamicId, targetType: 'activity' }, }).then((data) => {
|
342
|
|
- console.log(data, "2222")
|
343
|
|
- if (data.length > 0) {
|
344
|
|
- setShareContentId(data[0].shareContentId)
|
345
|
|
- changeImg(data[0].shareContentImg)
|
346
|
|
- changeInput(data[0].shareContentTitle)
|
347
|
|
- }
|
|
314
|
+ request({ ...apis.activity.shareContent, params: { targetId: dynamicId, targetType: 'activity' }, }).then((data) => {
|
|
315
|
+ if (data.length > 0) {
|
|
316
|
+ setShareContentId(data[0].shareContentId)
|
|
317
|
+ changeImg(data[0].shareContentImg)
|
|
318
|
+ changeInput(data[0].shareContentTitle)
|
|
319
|
+ }
|
|
320
|
+ }).catch((err) => {
|
|
321
|
+ message.info(err.msg || err.message)
|
|
322
|
+ })
|
|
323
|
+ }
|
|
324
|
+ }, [])
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+ const submitShare = () => {
|
|
328
|
+ if (dynamicId) {
|
|
329
|
+ if (shareContentId) {
|
|
330
|
+ request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
|
|
331
|
+ message.info("保存成功")
|
348
|
332
|
}).catch((err) => {
|
349
|
333
|
message.info(err.msg || err.message)
|
350
|
334
|
})
|
351
|
|
- }, [])
|
352
|
|
- }
|
353
|
|
-
|
354
|
|
- const submitShare = () => {
|
355
|
|
- if (dynamicId) {
|
356
|
|
- if (shareContentId) {
|
357
|
|
- request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
|
358
|
|
- message.info("保存成功")
|
359
|
|
- }).catch((err) => {
|
360
|
|
- message.info(err.msg || err.message)
|
361
|
|
- })
|
362
|
|
- } else {
|
363
|
|
- request({ ...apis.activity.addShareContent, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
|
364
|
|
- setShareContentId(data.shareContentId)
|
365
|
|
- message.info("保存成功")
|
366
|
|
- }).catch(err => {
|
367
|
|
- message.info(err.msg || err.message)
|
368
|
|
- })
|
369
|
|
- }
|
370
|
335
|
} else {
|
371
|
|
- message.warn("请先保存基本信息数据")
|
|
336
|
+ request({ ...apis.activity.addShareContent, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
|
|
337
|
+ setShareContentId(data.shareContentId)
|
|
338
|
+ message.info("保存成功")
|
|
339
|
+ }).catch(err => {
|
|
340
|
+ message.info(err.msg || err.message)
|
|
341
|
+ })
|
372
|
342
|
}
|
|
343
|
+ } else {
|
|
344
|
+ message.warn("请先保存基本信息数据")
|
373
|
345
|
}
|
|
346
|
+ }
|
374
|
347
|
|
375
|
|
- return <div style={{ padding: '20px' }}>
|
376
|
|
- <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
|
377
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
|
378
|
|
- <div>
|
379
|
|
- <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
|
380
|
|
- <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
|
381
|
|
- <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
|
382
|
|
- </div>
|
383
|
|
- </div>
|
384
|
|
- <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
385
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
|
386
|
|
- {inputValue === '' ? '无' : <span>{inputValue}</span>}
|
387
|
|
- </div>
|
388
|
|
- <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
|
389
|
|
- <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
|
390
|
|
- {imgValue === '' ? '无':<img src={imgValue} height="120px" height="150px" />}
|
|
348
|
+ return <div style={{ padding: '20px' }}>
|
|
349
|
+ <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
|
|
350
|
+ <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
|
|
351
|
+ <div>
|
|
352
|
+ <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
|
|
353
|
+ <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
|
|
354
|
+ <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
|
391
|
355
|
</div>
|
392
|
|
- {/* <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
|
393
|
|
- <Button onClick={() => cancelPage()}>
|
394
|
|
- 取消
|
395
|
|
- </Button> */}
|
396
|
356
|
</div>
|
|
357
|
+ <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
|
|
358
|
+ <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
|
|
359
|
+ {inputValue === '' ? '无' : <span>{inputValue}</span>}
|
|
360
|
+ </div>
|
|
361
|
+ <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
|
|
362
|
+ <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
|
|
363
|
+ {imgValue === '' ? '无' : <img src={imgValue} height="120px" height="150px" />}
|
|
364
|
+ </div>
|
|
365
|
+ {/* <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
|
|
366
|
+ <Button onClick={() => cancelPage()}>
|
|
367
|
+ 取消
|
|
368
|
+ </Button> */}
|
|
369
|
+ </div>
|
|
370
|
+}
|
|
371
|
+
|
|
372
|
+/**
|
|
373
|
+ *
|
|
374
|
+ *
|
|
375
|
+ * @param {*} props
|
|
376
|
+ * @returns
|
|
377
|
+ */
|
|
378
|
+const Edit = props => {
|
|
379
|
+ const [tab, changeTab] = useState('basic')
|
|
380
|
+ const { dynamicId } = props.location.query
|
|
381
|
+ const [detailData, setDetailData] = useState(false)
|
|
382
|
+
|
|
383
|
+ const getDynamicData = dynamicId => {
|
|
384
|
+ request({ ...apis.activity.details, params: { dynamicId } }).then((data) => {
|
|
385
|
+ console.log(data)
|
|
386
|
+ data.activityTime = [moment(data.startDate), moment(data.endDate)]
|
|
387
|
+ data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
|
|
388
|
+
|
|
389
|
+ setDetailData(data)
|
|
390
|
+ })
|
397
|
391
|
}
|
398
|
392
|
|
|
393
|
+
|
|
394
|
+ useEffect(() => {
|
|
395
|
+ if (dynamicId) {
|
|
396
|
+ getDynamicData(dynamicId);
|
|
397
|
+ }
|
|
398
|
+ }, [])
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
399
|
403
|
return (
|
400
|
404
|
<div>
|
401
|
405
|
<div>
|
|
@@ -407,18 +411,18 @@ const Edit = props => {
|
407
|
411
|
</div>
|
408
|
412
|
<div>
|
409
|
413
|
{tab === 'basic' && <Basic dynamicId={dynamicId} detailData={detailData} />}
|
410
|
|
- {tab === 'poster' && <Poster />}
|
411
|
|
- {tab === 'share' && <Share />}
|
|
414
|
+ {tab === 'poster' && <Poster dynamicId={dynamicId} />}
|
|
415
|
+ {tab === 'share' && <Share dynamicId={dynamicId} />}
|
412
|
416
|
</div>
|
413
|
|
- <div style={{textAlign: 'center'}}>
|
|
417
|
+ <div style={{ textAlign: 'center' }}>
|
414
|
418
|
<AuthButton name="admin.SignList.get" noRight={null}>
|
415
|
|
- {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, detailData.dynamicId)}><Button>报名记录</Button></span>}
|
416
|
|
- </AuthButton>
|
417
|
|
- <AuthButton name="admin.dymic.qrcode" noRight={null}>
|
418
|
|
- {(detailData.activityStatus === 0 || detailData.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, detailData)}>{<Button>下载二维码</Button>}</span>}
|
419
|
|
- </AuthButton>
|
420
|
|
- <Button onClick={() => cancelPage()}>
|
421
|
|
- 取消
|
|
419
|
+ {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, detailData.dynamicId)}><Button>报名记录</Button></span>}
|
|
420
|
+ </AuthButton>
|
|
421
|
+ <AuthButton name="admin.dymic.qrcode" noRight={null}>
|
|
422
|
+ {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, detailData)}>{<Button>下载二维码</Button>}</span>}
|
|
423
|
+ </AuthButton>
|
|
424
|
+ <Button onClick={() => cancelPage()}>
|
|
425
|
+ 取消
|
422
|
426
|
</Button>
|
423
|
427
|
</div>
|
424
|
428
|
<Prompt message={location =>
|