2 Зміни

Автор SHA1 Повідомлення Дата
  xujing c66a346234 Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into dev 5 years ago
  xujing 8b74512046 commit 5 years ago

+ 217
- 213
src/pages/activity/detailActivity.jsx View File

@@ -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 =>

+ 194
- 190
src/pages/activity/groupActivity/detailActivity.jsx View File

@@ -142,228 +142,232 @@ const BasicForm = props => {
142 142
 
143 143
 const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
144 144
 
145
-/**
146
- *
147
- *
148
- * @param {*} props
149
- * @returns
150
- */
151
-const Edit = props => {
152
-  const [tab, changeTab] = useState('basic')
153
-  const { groupActivityId } = props.location.query
154
-  const [detailData, setDetailData] = useState(false)
155
-
156
-  useEffect(() => {
157
-    if (groupActivityId) {
158
-      getDynamicData(groupActivityId);
159
-    }
160
-  }, [])
161
-
162
-  // 查询详情
163
-  const getDynamicData = (groupActivityId) => {
164
-    request({ ...apis.groupActivity.details, urlData: {id: groupActivityId } }).then((data) => {
165
-      console.log(data)
166
-      data.activityTime = [moment(data.startTime), moment(data.endTime)]
145
+const Poster = (props) => {
146
+  const { groupActivityId } = props
147
+  const [inputValue, changeInput] = useState('')
148
+  const [textAreaValue, changeTextArea] = useState('')
149
+  const [imgValue, changeImg] = useState('')
150
+  const [posterId, setPosterId] = useState('')
167 151
 
168
-      // setActivityStatus(data.activityStatus)
169
-      // setDisable(data.activityStatus === 0 ? true : false)
170
-      // props.form.setFieldsValue(data)
171
-      setDetailData(data)
152
+  if (groupActivityId) {
153
+    console.log(groupActivityId, 'groupActivityId')
154
+    useEffect(() => {
155
+      request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then((data) => {
156
+        if (data.length > 0) {
157
+          setPosterId(data[0].posterId)
158
+          changeImg(data[0].posterImg)
159
+          changeTextArea(data[0].posterDescription)
160
+          changeInput(data[0].posterTitle)
161
+        }
162
+      }).catch((err) => {
163
+        message.info(err.msg || err.message)
164
+      })
165
+      getMiniappName()
166
+    }, [])
167
+  }else{
168
+    getMiniappName()
169
+  }
170
+  // 获取小程序名称
171
+  const [miniappName, setMiniappName] = useState('')
172
+  function getMiniappName() {
173
+    request({ ...apis.building.getMiniappName }).then(res => {
174
+      console.log(res, "0000000000000")
175
+      setMiniappName(res)
172 176
     })
173 177
   }
174 178
 
175
-  const Poster = (props) => {
176
-    const [inputValue, changeInput] = useState('')
177
-    const [textAreaValue, changeTextArea] = useState('')
178
-    const [imgValue, changeImg] = useState('')
179
-    const [posterId, setPosterId] = useState('')
180
-
181
-    if (groupActivityId) {
182
-      console.log(groupActivityId, 'groupActivityId')
183
-      useEffect(() => {
184
-        request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then((data) => {
185
-          if (data.length > 0) {
186
-            setPosterId(data[0].posterId)
187
-            changeImg(data[0].posterImg)
188
-            changeTextArea(data[0].posterDescription)
189
-            changeInput(data[0].posterTitle)
190
-          }
179
+  const submitPoster = () => {
180
+    if (helpActivityId) {
181
+      if (posterId) {
182
+        request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
183
+          message.info("保存成功")
191 184
         }).catch((err) => {
192 185
           message.info(err.msg || err.message)
193 186
         })
194
-        getMiniappName()
195
-      }, [])
196
-    }else{
197
-      getMiniappName()
198
-    }
199
-    // 获取小程序名称
200
-    const [miniappName, setMiniappName] = useState('')
201
-    function getMiniappName() {
202
-      request({ ...apis.building.getMiniappName }).then(res => {
203
-        console.log(res, "0000000000000")
204
-        setMiniappName(res)
205
-      })
206
-    }
207
-
208
-    const submitPoster = () => {
209
-      if (helpActivityId) {
210
-        if (posterId) {
211
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
212
-            message.info("保存成功")
213
-          }).catch((err) => {
214
-            message.info(err.msg || err.message)
215
-          })
216
-        } else {
217
-          request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
218
-            setPosterId(data.posterId)
219
-            message.info("保存成功")
220
-          }).catch((err) => {
221
-            message.info(err.msg || err.message)
222
-          })
223
-        }
224 187
       } else {
225
-        message.warn("请先保存基本信息数据")
188
+        request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
189
+          setPosterId(data.posterId)
190
+          message.info("保存成功")
191
+        }).catch((err) => {
192
+          message.info(err.msg || err.message)
193
+        })
226 194
       }
195
+    } else {
196
+      message.warn("请先保存基本信息数据")
227 197
     }
198
+  }
228 199
 
229
-    return <div>
230
-      <div style={{ display: 'flex' }}>
231
-        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
232
-          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
233
-            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
234
-            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
235
-              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
236
-              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
237
-              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
238
-              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
239
-            </div>
240
-            <p style={{
241
-              margin: '10px 20px',
242
-              fontSize: '20px',
243
-              color: '#222',
244
-              fontWeight: '600',
245
-              display: '-webkit-box',
246
-              lineClamp: '3',
247
-              height: '60px',
248
-              WebkitLineClamp: '2',
249
-              WebkitBoxOrient: 'vertical',
250
-              overflow: 'hidden',
251
-              textOverflow: 'ellipsis'
252
-            }}>{inputValue ? inputValue : '海报标题'}</p>
200
+  return <div>
201
+    <div style={{ display: 'flex' }}>
202
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
203
+        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
204
+          <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
205
+          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
206
+            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
207
+            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
208
+            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
209
+            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
210
+          </div>
211
+          <p style={{
212
+            margin: '10px 20px',
213
+            fontSize: '20px',
214
+            color: '#222',
215
+            fontWeight: '600',
216
+            display: '-webkit-box',
217
+            lineClamp: '3',
218
+            height: '60px',
219
+            WebkitLineClamp: '2',
220
+            WebkitBoxOrient: 'vertical',
221
+            overflow: 'hidden',
222
+            textOverflow: 'ellipsis'
223
+          }}>{inputValue ? inputValue : '海报标题'}</p>
253 224
 
254
-            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
255
-            <p style={{
256
-              margin: '16px 20px 28px 20px',
257
-              fontSize: '17px',
258
-              color: '#999',
259
-              display: '-webkit-box',
260
-              lineClamp: '3',
261
-              height: '72px',
262
-              WebkitLineClamp: '3',
263
-              WebkitBoxOrient: 'vertical',
264
-              overflow: 'hidden',
265
-              textOverflow: 'ellipsis'
266
-            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
267
-            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
268
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
269
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
270
-              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
271
-            </div>
225
+          <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
226
+          <p style={{
227
+            margin: '16px 20px 28px 20px',
228
+            fontSize: '17px',
229
+            color: '#999',
230
+            display: '-webkit-box',
231
+            lineClamp: '3',
232
+            height: '72px',
233
+            WebkitLineClamp: '3',
234
+            WebkitBoxOrient: 'vertical',
235
+            overflow: 'hidden',
236
+            textOverflow: 'ellipsis'
237
+          }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
238
+          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
239
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
240
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
241
+            <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
272 242
           </div>
273
-          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
274 243
         </div>
244
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
245
+      </div>
275 246
 
276
-        {/* <div >
277
-          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
278
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
279
-            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
280
-          </div>
281
-          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
282
-          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
283
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
284
-            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
285
-          </div>
286
-          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
287
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
288
-            <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
289
-          </div>
247
+      {/* <div >
248
+        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
249
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
250
+          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
251
+        </div>
252
+        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
253
+        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
254
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
255
+          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
256
+        </div>
257
+        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
258
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
259
+          <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
260
+        </div>
290 261
 
291
-        </div> */}
292
-      </div>
293
-      {/* <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
294
-      <Button onClick={() => cancelPage()}>
295
-        取消
296
-      </Button> */}
262
+      </div> */}
297 263
     </div>
264
+    {/* <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
265
+    <Button onClick={() => cancelPage()}>
266
+      取消
267
+    </Button> */}
268
+  </div>
269
+
270
+}
298 271
 
299
-  }
300 272
 
301 273
 
274
+const Share = (props) => {
275
+  const { groupActivityId } = props
276
+  const [inputValue, changeInput] = useState('')
277
+  const [imgValue, changeImg] = useState('')
278
+  const [shareContentId, setShareContentId] = useState('')
302 279
 
303
-  const Share = (props) => {
304
-    const [inputValue, changeInput] = useState('')
305
-    const [imgValue, changeImg] = useState('')
306
-    const [shareContentId, setShareContentId] = useState('')
280
+  if (groupActivityId) {
281
+    useEffect(() => {
282
+      request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' }, }).then((data) => {
283
+        if (data.length > 0) {
284
+          setShareContentId(data[0].shareContentId)
285
+          changeImg(data[0].shareContentImg)
286
+          changeInput(data[0].shareContentTitle)
287
+        }
288
+      }).catch((err) => {
289
+        message.info(err.msg || err.message)
290
+      })
291
+    }, [])
292
+  }
307 293
 
294
+  const submitShare = () => {
308 295
     if (groupActivityId) {
309
-      useEffect(() => {
310
-        request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' }, }).then((data) => {
311
-          if (data.length > 0) {
312
-            setShareContentId(data[0].shareContentId)
313
-            changeImg(data[0].shareContentImg)
314
-            changeInput(data[0].shareContentTitle)
315
-          }
296
+      if (shareContentId) {
297
+        request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
298
+          message.info("保存成功")
316 299
         }).catch((err) => {
317 300
           message.info(err.msg || err.message)
318 301
         })
319
-      }, [])
320
-    }
321
-
322
-    const submitShare = () => {
323
-      if (groupActivityId) {
324
-        if (shareContentId) {
325
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
326
-            message.info("保存成功")
327
-          }).catch((err) => {
328
-            message.info(err.msg || err.message)
329
-          })
330
-        } else {
331
-          request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
332
-            setShareContentId(data.shareContentId)
333
-            message.info("保存成功")
334
-          }).catch(err => {
335
-            message.info(err.msg || err.message)
336
-          })
337
-        }
338 302
       } else {
339
-        message.warn("请先保存基本信息数据")
303
+        request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
304
+          setShareContentId(data.shareContentId)
305
+          message.info("保存成功")
306
+        }).catch(err => {
307
+          message.info(err.msg || err.message)
308
+        })
340 309
       }
310
+    } else {
311
+      message.warn("请先保存基本信息数据")
341 312
     }
313
+  }
342 314
 
343
-    return <div style={{ padding: '20px' }}>
344
-      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
345
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
346
-        <div>
347
-          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
348
-          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
349
-          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
350
-        </div>
351
-      </div>
352
-      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
353
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
354
-        {inputValue === '' ? '无' : <span>{inputValue}</span>}
355
-      </div>
356
-      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
357
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
358
-        {imgValue === '' ? '无':<img src={imgValue} height="120px" height="150px" />}
315
+  return <div style={{ padding: '20px' }}>
316
+    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
317
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
318
+      <div>
319
+        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
320
+        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
321
+        <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
359 322
       </div>
360
-      {/* <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
361
-      <Button onClick={() => cancelPage()}>
362
-        取消
363
-      </Button> */}
364 323
     </div>
324
+    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
325
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
326
+      {inputValue === '' ? '无' : <span>{inputValue}</span>}
327
+    </div>
328
+    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
329
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
330
+      {imgValue === '' ? '无':<img src={imgValue} height="120px" height="150px" />}
331
+    </div>
332
+    {/* <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
333
+    <Button onClick={() => cancelPage()}>
334
+      取消
335
+    </Button> */}
336
+  </div>
337
+}
338
+
339
+/**
340
+ *
341
+ *
342
+ * @param {*} props
343
+ * @returns
344
+ */
345
+const Edit = props => {
346
+  const [tab, changeTab] = useState('basic')
347
+  const { groupActivityId } = props.location.query
348
+  const [detailData, setDetailData] = useState(false)
349
+
350
+  useEffect(() => {
351
+    if (groupActivityId) {
352
+      getDynamicData(groupActivityId);
353
+    }
354
+  }, [])
355
+
356
+  // 查询详情
357
+  const getDynamicData = (groupActivityId) => {
358
+    request({ ...apis.groupActivity.details, urlData: {id: groupActivityId } }).then((data) => {
359
+      console.log(data)
360
+      data.activityTime = [moment(data.startTime), moment(data.endTime)]
361
+
362
+      // setActivityStatus(data.activityStatus)
363
+      // setDisable(data.activityStatus === 0 ? true : false)
364
+      // props.form.setFieldsValue(data)
365
+      setDetailData(data)
366
+    })
365 367
   }
366 368
 
369
+  
370
+
367 371
   return (
368 372
     <div>
369 373
       <div>
@@ -375,8 +379,8 @@ const Edit = props => {
375 379
       </div>
376 380
       <div>
377 381
         {tab === 'basic' && <Basic groupActivityId={groupActivityId} detailData={detailData}/>}
378
-        {tab === 'poster' && <Poster />}
379
-        {tab === 'share' && <Share />}
382
+        {tab === 'poster' && <Poster groupActivityId={groupActivityId} />}
383
+        {tab === 'share' && <Share groupActivityId={groupActivityId} />}
380 384
       </div>
381 385
       <div style={{textAlign: 'center'}}>
382 386
         <AuthButton name="admin.share.record" noRight={null}>

+ 221
- 217
src/pages/activity/helpActivity/detailActivity.jsx View File

@@ -34,18 +34,18 @@ const cancelPage = () => {
34 34
 }
35 35
 
36 36
 const getSignList = helpActivityId => {
37
-    router.push({
38
-        pathname: '/activity/helpActivity/signList',
39
-        query: {
40
-          helpActivityId,
41
-        },
42
-      });
37
+  router.push({
38
+    pathname: '/activity/helpActivity/signList',
39
+    query: {
40
+      helpActivityId,
41
+    },
42
+  });
43 43
 }
44 44
 
45 45
 const BasicForm = props => {
46 46
 
47 47
   const detailData = props.detailData || {}
48
-  
48
+
49 49
   const { helpActivityId } = props
50 50
 
51 51
   const handleSubmit = e => {
@@ -62,7 +62,7 @@ const BasicForm = props => {
62 62
           values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
63 63
           values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
64 64
         }
65
-        
65
+
66 66
         console.log('submit data --->', values)
67 67
         if (helpActivityId) {
68 68
           values.helpActivityId = helpActivityId
@@ -95,15 +95,15 @@ const BasicForm = props => {
95 95
     <>
96 96
       <Form {...formItemLayout} onSubmit={handleSubmit}>
97 97
         <Form.Item label="所属项目">
98
-        {getFieldDecorator('buildingId', {
99
-          initialValue: detailData.buildingId,
100
-          rules: [
101
-            {
102
-              required: true,
103
-              message: '请选择所属项目',
104
-            },
105
-          ],
106
-        })(<BuildSelect disabled/>)}
98
+          {getFieldDecorator('buildingId', {
99
+            initialValue: detailData.buildingId,
100
+            rules: [
101
+              {
102
+                required: true,
103
+                message: '请选择所属项目',
104
+              },
105
+            ],
106
+          })(<BuildSelect disabled />)}
107 107
         </Form.Item>
108 108
         <Form.Item label="活动标题">
109 109
           <span>{detailData.title}</span>
@@ -112,7 +112,7 @@ const BasicForm = props => {
112 112
           <img src={detailData.img} height="300px" width="375px" />
113 113
         </Form.Item>
114 114
         <Form.Item label="助力封面图1">
115
-           <img src={detailData.listImg} height="210px" width="375px" />
115
+          <img src={detailData.listImg} height="210px" width="375px" />
116 116
         </Form.Item>
117 117
         <Form.Item label="助力封面图2">
118 118
           <img src={detailData.bannerListImg} height="125px" width="375px" />
@@ -139,230 +139,234 @@ const BasicForm = props => {
139 139
 
140 140
 const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
141 141
 
142
-/**
143
- *
144
- *
145
- * @param {*} props
146
- * @returns
147
- */
148
-const Edit = props => {
149
-  const [tab, changeTab] = useState('basic')
150
-  const { helpActivityId } = props.location.query
151
-  const [detailData, setDetailData] = useState(false)
152 142
 
153
-  const getDynamicData = helpActivityId => {
154
-    
155
-    request({ ...apis.helpActivity.details, params: { helpActivityId } }).then((data) => {
156
-      console.log(data)
157
-      data.activityTime = [moment(data.startDate), moment(data.endDate)]
158
-      data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
143
+const Poster = (props) => {
144
+  const { helpActivityId } = props
145
+  const [inputValue, changeInput] = useState('')
146
+  const [textAreaValue, changeTextArea] = useState('')
147
+  const [imgValue, changeImg] = useState('')
148
+  const [posterId, setPosterId] = useState('')
159 149
 
160
-      setDetailData(data)
150
+  if (helpActivityId) {
151
+    console.log(helpActivityId, 'helpActivityId')
152
+    useEffect(() => {
153
+      request({ ...apis.activity.poster, params: { targetId: helpActivityId, targetType: 'helpActivity' } }).then((data) => {
154
+        console.log(data, "2222")
155
+        if (data.length > 0) {
156
+          setPosterId(data[0].posterId)
157
+          changeImg(data[0].posterImg)
158
+          changeTextArea(data[0].posterDescription)
159
+          changeInput(data[0].posterTitle)
160
+        }
161
+      }).catch((err) => {
162
+        message.info(err.msg || err.message)
163
+      })
164
+      getMiniappName()
165
+    }, [])
166
+  } else {
167
+    getMiniappName()
168
+  }
169
+  // 获取小程序名称
170
+  const [miniappName, setMiniappName] = useState('')
171
+  function getMiniappName() {
172
+    request({ ...apis.building.getMiniappName }).then(res => {
173
+      console.log(res, "0000000000000")
174
+      setMiniappName(res)
161 175
     })
162 176
   }
163 177
 
164
-  useEffect(() => {
165
-    
166
-    if (helpActivityId) {
167
-      
168
-      getDynamicData(helpActivityId);
169
-    }
170
-  }, [])
171
-
172
-  const Poster = (props) => {
173
-    const [inputValue, changeInput] = useState('')
174
-    const [textAreaValue, changeTextArea] = useState('')
175
-    const [imgValue, changeImg] = useState('')
176
-    const [posterId, setPosterId] = useState('')
177
-
178
+  const submitPoster = () => {
178 179
     if (helpActivityId) {
179
-      console.log(helpActivityId, 'helpActivityId')
180
-      useEffect(() => {
181
-        request({ ...apis.activity.poster, params: { targetId: helpActivityId, targetType: 'helpActivity' } }).then((data) => {
182
-          console.log(data, "2222")
183
-          if (data.length > 0) {
184
-            setPosterId(data[0].posterId)
185
-            changeImg(data[0].posterImg)
186
-            changeTextArea(data[0].posterDescription)
187
-            changeInput(data[0].posterTitle)
188
-          }
180
+      if (posterId) {
181
+        request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
182
+          message.info("保存成功")
189 183
         }).catch((err) => {
190 184
           message.info(err.msg || err.message)
191 185
         })
192
-        getMiniappName()
193
-      }, [])
194
-    }else{
195
-      getMiniappName()
196
-    }
197
-    // 获取小程序名称
198
-    const [miniappName, setMiniappName] = useState('')
199
-    function getMiniappName() {
200
-      request({ ...apis.building.getMiniappName }).then(res => {
201
-        console.log(res, "0000000000000")
202
-        setMiniappName(res)
203
-      })
204
-    }
205
-
206
-    const submitPoster = () => {
207
-      if (helpActivityId) {
208
-        if (posterId) {
209
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
210
-            message.info("保存成功")
211
-          }).catch((err) => {
212
-            message.info(err.msg || err.message)
213
-          })
214
-        } else {
215
-          request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
216
-            setPosterId(data.posterId)
217
-            message.info("保存成功")
218
-          }).catch((err) => {
219
-            message.info(err.msg || err.message)
220
-          })
221
-        }
222 186
       } else {
223
-        message.warn("请先保存基本信息数据")
187
+        request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
188
+          setPosterId(data.posterId)
189
+          message.info("保存成功")
190
+        }).catch((err) => {
191
+          message.info(err.msg || err.message)
192
+        })
224 193
       }
194
+    } else {
195
+      message.warn("请先保存基本信息数据")
225 196
     }
197
+  }
226 198
 
227
-    return <div>
228
-      <div style={{ display: 'flex' }}>
229
-        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
230
-          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
231
-            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
232
-            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
233
-              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
234
-              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
235
-              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
236
-              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
237
-            </div>
238
-            <p style={{
239
-              margin: '10px 20px',
240
-              fontSize: '20px',
241
-              color: '#222',
242
-              fontWeight: '600',
243
-              display: '-webkit-box',
244
-              lineClamp: '3',
245
-              height: '60px',
246
-              WebkitLineClamp: '2',
247
-              WebkitBoxOrient: 'vertical',
248
-              overflow: 'hidden',
249
-              textOverflow: 'ellipsis'
250
-            }}>{inputValue ? inputValue : '海报标题'}</p>
251
-
252
-            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
253
-            <p style={{
254
-              margin: '16px 20px 28px 20px',
255
-              fontSize: '17px',
256
-              color: '#999',
257
-              display: '-webkit-box',
258
-              lineClamp: '3',
259
-              height: '72px',
260
-              WebkitLineClamp: '3',
261
-              WebkitBoxOrient: 'vertical',
262
-              overflow: 'hidden',
263
-              textOverflow: 'ellipsis'
264
-            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
265
-            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
266
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
267
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
268
-              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
269
-            </div>
199
+  return <div>
200
+    <div style={{ display: 'flex' }}>
201
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
202
+        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
203
+          <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
204
+          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
205
+            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
206
+            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
207
+            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
208
+            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
270 209
           </div>
271
-          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
272
-        </div>
210
+          <p style={{
211
+            margin: '10px 20px',
212
+            fontSize: '20px',
213
+            color: '#222',
214
+            fontWeight: '600',
215
+            display: '-webkit-box',
216
+            lineClamp: '3',
217
+            height: '60px',
218
+            WebkitLineClamp: '2',
219
+            WebkitBoxOrient: 'vertical',
220
+            overflow: 'hidden',
221
+            textOverflow: 'ellipsis'
222
+          }}>{inputValue ? inputValue : '海报标题'}</p>
273 223
 
274
-        {/* <div >
275
-          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
276
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
277
-            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
224
+          <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
225
+          <p style={{
226
+            margin: '16px 20px 28px 20px',
227
+            fontSize: '17px',
228
+            color: '#999',
229
+            display: '-webkit-box',
230
+            lineClamp: '3',
231
+            height: '72px',
232
+            WebkitLineClamp: '3',
233
+            WebkitBoxOrient: 'vertical',
234
+            overflow: 'hidden',
235
+            textOverflow: 'ellipsis'
236
+          }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
237
+          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
238
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
239
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
240
+            <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
278 241
           </div>
279
-          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
280
-          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
281
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
282
-            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
283
-          </div>
284
-          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
285
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
286
-            <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
287
-          </div>
288
-
289
-        </div> */}
242
+        </div>
243
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
290 244
       </div>
291
-      {/* <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
292
-      <Button onClick={() => cancelPage()}>
293
-        取消
294
-      </Button> */}
245
+
246
+      {/* <div >
247
+        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
248
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
249
+          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
250
+        </div>
251
+        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
252
+        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
253
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
254
+          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
255
+        </div>
256
+        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
257
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
258
+          <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
259
+        </div>
260
+
261
+      </div> */}
295 262
     </div>
263
+    {/* <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
264
+    <Button onClick={() => cancelPage()}>
265
+      取消
266
+    </Button> */}
267
+  </div>
296 268
 
297
-  }
269
+}
298 270
 
299 271
 
300 272
 
301
-  const Share = (props) => {
302
-    const [inputValue, changeInput] = useState('')
303
-    const [imgValue, changeImg] = useState('')
304
-    const [shareContentId, setShareContentId] = useState('')
273
+const Share = (props) => {
274
+  const { helpActivityId } = props
275
+  const [inputValue, changeInput] = useState('')
276
+  const [imgValue, changeImg] = useState('')
277
+  const [shareContentId, setShareContentId] = useState('')
305 278
 
279
+  if (helpActivityId) {
280
+    useEffect(() => {
281
+      request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'helpActivity' }, }).then((data) => {
282
+        console.log(data, "2222")
283
+        if (data.length > 0) {
284
+          setShareContentId(data[0].shareContentId)
285
+          changeImg(data[0].shareContentImg)
286
+          changeInput(data[0].shareContentTitle)
287
+        }
288
+      }).catch((err) => {
289
+        message.info(err.msg || err.message)
290
+      })
291
+    }, [])
292
+  }
293
+
294
+  const submitShare = () => {
306 295
     if (helpActivityId) {
307
-      useEffect(() => {
308
-        request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'helpActivity' }, }).then((data) => {
309
-          console.log(data, "2222")
310
-          if (data.length > 0) {
311
-            setShareContentId(data[0].shareContentId)
312
-            changeImg(data[0].shareContentImg)
313
-            changeInput(data[0].shareContentTitle)
314
-          }
296
+      if (shareContentId) {
297
+        request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
298
+          message.info("保存成功")
315 299
         }).catch((err) => {
316 300
           message.info(err.msg || err.message)
317 301
         })
318
-      }, [])
319
-    }
320
-
321
-    const submitShare = () => {
322
-      if (helpActivityId) {
323
-        if (shareContentId) {
324
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'helpActivity', 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: helpActivityId, shareContentType: 'helpActivity', 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 302
       } else {
338
-        message.warn("请先保存基本信息数据")
303
+        request({ ...apis.activity.addShareContent, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
304
+          setShareContentId(data.shareContentId)
305
+          message.info("保存成功")
306
+        }).catch(err => {
307
+          message.info(err.msg || err.message)
308
+        })
339 309
       }
310
+    } else {
311
+      message.warn("请先保存基本信息数据")
340 312
     }
313
+  }
341 314
 
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" />}
315
+  return <div style={{ padding: '20px' }}>
316
+    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
317
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
318
+      <div>
319
+        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
320
+        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
321
+        <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
358 322
       </div>
359
-      {/* <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
360
-      <Button onClick={() => cancelPage()}>
361
-        取消
362
-      </Button> */}
363 323
     </div>
324
+    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
325
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
326
+      {inputValue === '' ? '无' : <span>{inputValue}</span>}
327
+    </div>
328
+    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
329
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
330
+      {imgValue === '' ? '无' : <img src={imgValue} height="120px" height="150px" />}
331
+    </div>
332
+    {/* <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
333
+    <Button onClick={() => cancelPage()}>
334
+      取消
335
+    </Button> */}
336
+  </div>
337
+}
338
+
339
+/**
340
+ *
341
+ *
342
+ * @param {*} props
343
+ * @returns
344
+ */
345
+const Edit = props => {
346
+  const [tab, changeTab] = useState('basic')
347
+  const { helpActivityId } = props.location.query
348
+  const [detailData, setDetailData] = useState(false)
349
+
350
+  const getDynamicData = helpActivityId => {
351
+
352
+    request({ ...apis.helpActivity.details, params: { helpActivityId } }).then((data) => {
353
+      console.log(data)
354
+      data.activityTime = [moment(data.startDate), moment(data.endDate)]
355
+      data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
356
+
357
+      setDetailData(data)
358
+    })
364 359
   }
365 360
 
361
+  useEffect(() => {
362
+
363
+    if (helpActivityId) {
364
+
365
+      getDynamicData(helpActivityId);
366
+    }
367
+  }, [])
368
+
369
+
366 370
   return (
367 371
     <div>
368 372
       <div>
@@ -373,21 +377,21 @@ const Edit = props => {
373 377
         </Radio.Group>
374 378
       </div>
375 379
       <div>
376
-        {tab === 'basic' && <Basic helpActivityId={helpActivityId} detailData={detailData}/>}
377
-        {tab === 'poster' && <Poster />}
378
-        {tab === 'share' && <Share />}
380
+        {tab === 'basic' && <Basic helpActivityId={helpActivityId} detailData={detailData} />}
381
+        {tab === 'poster' && <Poster helpActivityId={helpActivityId} />}
382
+        {tab === 'share' && <Share helpActivityId={helpActivityId} />}
379 383
       </div>
380
-      <div style={{textAlign: 'center'}}>
384
+      <div style={{ textAlign: 'center' }}>
381 385
         <AuthButton name="admin.help.record" noRight={null}>
382
-          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && 
383
-            <span 
384
-              style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} 
386
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) &&
387
+            <span
388
+              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
385 389
               onClick={getSignList.bind(this, detailData.helpActivityId)}>
386 390
               <Button>助力记录</Button>
387 391
             </span>}
388
-          </AuthButton>
389
-          <Button onClick={() => cancelPage()}>
390
-            取消
392
+        </AuthButton>
393
+        <Button onClick={() => cancelPage()}>
394
+          取消
391 395
           </Button>
392 396
       </div>
393 397
       <Prompt message={location =>