Browse Source

Merge branch 'dev' into v3.5.30

Yansen 5 years ago
parent
commit
ca1dc01dd5
26 changed files with 1283 additions and 1027 deletions
  1. BIN
      src/assets/close2.png
  2. 217
    213
      src/pages/activity/detailActivity.jsx
  3. 2
    2
      src/pages/activity/drainage/DrainageList.jsx
  4. 10
    142
      src/pages/activity/drainage/components/Basic.jsx
  5. 46
    0
      src/pages/activity/drainage/components/CheckboxGroup.jsx
  6. 44
    16
      src/pages/activity/drainage/components/CustomerData.jsx
  7. 8
    5
      src/pages/activity/drainage/components/Help.jsx
  8. 5
    4
      src/pages/activity/drainage/components/Ranking.jsx
  9. 68
    24
      src/pages/activity/drainage/components/RedPacket.jsx
  10. 6
    5
      src/pages/activity/drainage/components/RedPacketRecord.jsx
  11. 194
    190
      src/pages/activity/groupActivity/detailActivity.jsx
  12. 10
    8
      src/pages/activity/groupActivity/editGroupActivity.jsx
  13. 221
    217
      src/pages/activity/helpActivity/detailActivity.jsx
  14. 22
    8
      src/pages/funds/accountfunds/components/Basic.jsx
  15. 56
    20
      src/pages/funds/accountfunds/components/ConsumerOrder.jsx
  16. 10
    17
      src/pages/funds/accountfunds/components/Contact.jsx
  17. 37
    60
      src/pages/funds/accountfunds/components/Pay.jsx
  18. 11
    3
      src/pages/funds/accountfunds/components/Recharge.jsx
  19. 53
    17
      src/pages/funds/accountfunds/components/RechargeOrder.jsx
  20. 15
    5
      src/pages/funds/accountfunds/components/Refund.jsx
  21. 50
    25
      src/pages/funds/accountfunds/components/RefundOrder.jsx
  22. 51
    34
      src/pages/funds/accountfunds/components/ShowVoucher.jsx
  23. 30
    0
      src/pages/funds/accountfunds/components/styles.less
  24. 2
    1
      src/pages/funds/financialContact/index.jsx
  25. 109
    5
      src/pages/h5SampleManager/h5Sample/addH5.jsx
  26. 6
    6
      src/pages/h5SampleManager/h5Sample/detail.jsx

BIN
src/assets/close2.png View File


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

66
   }
66
   }
67
 
67
 
68
   const { dynamicId } = props
68
   const { dynamicId } = props
69
- 
70
   const handleSubmit = e => {
69
   const handleSubmit = e => {
71
     e.preventDefault();
70
     e.preventDefault();
72
     props.form.validateFields((err, values) => {
71
     props.form.validateFields((err, values) => {
81
           values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
80
           values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
82
           values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
81
           values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
83
         }
82
         }
84
-        
85
         console.log('submit data --->', values)
83
         console.log('submit data --->', values)
86
         if (dynamicId) {
84
         if (dynamicId) {
87
           values.dynamicId = dynamicId
85
           values.dynamicId = dynamicId
114
     <>
112
     <>
115
       <Form {...formItemLayout} onSubmit={handleSubmit}>
113
       <Form {...formItemLayout} onSubmit={handleSubmit}>
116
         <Form.Item label="所属项目">
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
         </Form.Item>
124
         </Form.Item>
127
         <Form.Item label="活动封面图1">
125
         <Form.Item label="活动封面图1">
128
-           <img src={detailData.listImgUrl} height="210px" width="375px" />
126
+          <img src={detailData.listImgUrl} height="210px" width="375px" />
129
         </Form.Item>
127
         </Form.Item>
130
         <Form.Item label="活动封面图2">
128
         <Form.Item label="活动封面图2">
131
           <img src={detailData.bannerListImg} height="125px" width="375px" />
129
           <img src={detailData.bannerListImg} height="125px" width="375px" />
158
           <span>{detailData.maxEnlistByPerson}</span>
156
           <span>{detailData.maxEnlistByPerson}</span>
159
         </Form.Item>
157
         </Form.Item>
160
         <Form.Item label="活动详情">
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
         </Form.Item>
160
         </Form.Item>
163
         <Form.Item label="报名时间">
161
         <Form.Item label="报名时间">
164
           <span>{`${moment(detailData.enlistStart).format('YYYY-MM-DD HH:mm')} —— ${moment(detailData.enlistEnd).format('YYYY-MM-DD HH:mm')}`}</span>
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
         <Form.Item label="权重">
164
         <Form.Item label="权重">
167
           <span>{detailData.heavy}</span>
165
           <span>{detailData.heavy}</span>
168
         </Form.Item>
166
         </Form.Item>
173
 
171
 
174
 const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
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
     useEffect(() => {
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
     if (dynamicId) {
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
         }).catch((err) => {
214
         }).catch((err) => {
223
           message.info(err.msg || err.message)
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
       } else {
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
           </div>
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
           </div>
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
       </div>
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
     </div>
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
     if (dynamicId) {
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
         }).catch((err) => {
332
         }).catch((err) => {
349
           message.info(err.msg || err.message)
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
       } else {
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
       </div>
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
     </div>
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
   return (
403
   return (
400
     <div>
404
     <div>
401
       <div>
405
       <div>
407
       </div>
411
       </div>
408
       <div>
412
       <div>
409
         {tab === 'basic' && <Basic dynamicId={dynamicId} detailData={detailData} />}
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
       </div>
416
       </div>
413
-      <div style={{textAlign: 'center'}}>
417
+      <div style={{ textAlign: 'center' }}>
414
         <AuthButton name="admin.SignList.get" noRight={null}>
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
           </Button>
426
           </Button>
423
       </div>
427
       </div>
424
       <Prompt message={location =>
428
       <Prompt message={location =>

+ 2
- 2
src/pages/activity/drainage/DrainageList.jsx View File

339
             { required: true, message: '请选择是否投放小程序' },
339
             { required: true, message: '请选择是否投放小程序' },
340
           ],
340
           ],
341
         })(
341
         })(
342
-          <Radio.Group onChange={changeMiniapp}>
342
+          <Radio.Group onChange={changeMiniapp} disabled={!!formsDate.activityId}>
343
             <Radio value={1}>是</Radio>
343
             <Radio value={1}>是</Radio>
344
             <Radio value={0}>否</Radio>
344
             <Radio value={0}>否</Radio>
345
           </Radio.Group>
345
           </Radio.Group>
395
           ]
395
           ]
396
         })(<ImageUploader />)}
396
         })(<ImageUploader />)}
397
       </Form.Item>)}
397
       </Form.Item>)}
398
-      {hiddenStatus && (<Form.Item label="活动分享语">
398
+      {hiddenStatus && (<Form.Item label="活动分享语" help="可使用{name}代表用户昵称。">
399
         {getFieldDecorator('shareTitle', {
399
         {getFieldDecorator('shareTitle', {
400
           initialValue: formsDate.shareTitle,
400
           initialValue: formsDate.shareTitle,
401
           rules: [
401
           rules: [

+ 10
- 142
src/pages/activity/drainage/components/Basic.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Slider, Row, Col, Checkbox, Input, Button, InputNumber } from 'antd';
2
+import { Form, Slider, Row, Col, Button, InputNumber, message } from 'antd';
3
 import router from 'umi/router';
3
 import router from 'umi/router';
4
 import apis from '../../../../services/apis';
4
 import apis from '../../../../services/apis';
5
 import request from '../../../../utils/request';
5
 import request from '../../../../utils/request';
6
 import ImageUploader from './ImageUpload';
6
 import ImageUploader from './ImageUpload';
7
 import Styles from './styles.less';
7
 import Styles from './styles.less';
8
-import Navigate from '@/components/Navigate';
9
 import BuildSelect from '../../../../components/SelectButton/BuildSelect2'
8
 import BuildSelect from '../../../../components/SelectButton/BuildSelect2'
9
+import CheckboxGroup from './CheckboxGroup';
10
 
10
 
11
 function Basic(props) {
11
 function Basic(props) {
12
 
12
 
13
     const { id, name } = props
13
     const { id, name } = props
14
 
14
 
15
-    const [registrationInputValue, setRegistrationInputValue] = useState()
16
-
17
-    const [viewProperty, setViewProperty] = useState(['index'])
18
-    const [productionPoster, setProductionPoster] = useState(['index'])
19
-    // const [registrationForm, setRegistrationForm] = useState([])
20
-    const [inputVisible, setInputVisible] = useState(false)
21
-    // const [registrationFormOption, setregistrationFormOption] = useState([
22
-    //     { label: '姓名', value: 'name' },
23
-    //     { label: '电话', value: 'tel' },
24
-    //     { label: '自定义', value: 'abc' },
25
-    // ])
26
-
27
     const [data, setData] = useState({})
15
     const [data, setData] = useState({})
28
     useEffect(() => {
16
     useEffect(() => {
29
         getList();
17
         getList();
30
-        console.log(props.id, '2341')
31
     }, [])
18
     }, [])
32
     // 查询列表
19
     // 查询列表
33
 
20
 
34
     const getList = () => {
21
     const getList = () => {
35
         request({ ...apis.redPacket.detail, urlData: { id } }).then(data => {
22
         request({ ...apis.redPacket.detail, urlData: { id } }).then(data => {
36
-            console.log(data, '2341')
37
-            // s.split("==");
38
-            data.buildingShowPos = data.buildingShowPos.split(',')
39
-
40
-            data.buildingSposterShowPoshowPos = (data.posterShowPos).split(',')
41
-            setViewProperty(data.buildingShowPos)
42
-            setProductionPoster(data.posterShowPos)
43
-            console.log(data, '2341')
44
             setData(data)
23
             setData(data)
45
         })
24
         })
46
     }
25
     }
48
     const updateRedPacket = data => {
27
     const updateRedPacket = data => {
49
         request({ ...apis.redPacket.update, data: { ...data } }).then(data => {
28
         request({ ...apis.redPacket.update, data: { ...data } }).then(data => {
50
             // setData(data)
29
             // setData(data)
30
+            message.success('操作成功')
31
+        }).catch(() => {
32
+            message.error('操作失败')
51
         })
33
         })
52
     }
34
     }
53
 
35
 
56
         e.preventDefault();
38
         e.preventDefault();
57
         props.form.validateFields((err, values) => {
39
         props.form.validateFields((err, values) => {
58
             if (!err) {
40
             if (!err) {
59
-                console.log(values, '------222-------')
60
                 values.activityId = id
41
                 values.activityId = id
61
-                // values.name = name
62
-                values.buildingShowPos = values.buildingShowPos.toString()
63
-                values.posterShowPos = values.posterShowPos.toString()
64
-                console.log(values, '------222-------')
65
                 updateRedPacket(values)
42
                 updateRedPacket(values)
66
             }
43
             }
67
         },
44
         },
68
         )
45
         )
69
     }
46
     }
70
 
47
 
71
-    function onViewPropertyChange(checkedValues) {
72
-        console.log('checked = ', checkedValues);
73
-        setViewProperty(checkedValues)
74
-    }
75
-
76
-    function onProductionPoster(checkedValues) {
77
-        console.log('checked = ', checkedValues);
78
-        setProductionPoster(checkedValues)
79
-    }
80
-
81
-    function onRegistrationForm(checkedValues) {
82
-        console.log('checked = ', checkedValues);
83
-        setRegistrationForm(checkedValues)
84
-    }
85
-    // registrationForm
86
-    // function  (value, list) {
87
-    //     return list.filter(f => f == value)
88
-    // }
89
-    function showInput() {
90
-        setInputVisible(!inputVisible)
91
-    }
92
-
93
-    const handleInputChange = e => {
94
-        setRegistrationInputValue(e.target.value)
95
-        // this.setState({ inputValue: e.target.value });
96
-
97
-    };
98
-
99
-    const handleInputConfirm = () => {
100
-        setregistrationFormOption([
101
-            { label: '姓名', value: 'name' },
102
-            { label: '电话', value: 'tel' },
103
-            { label: registrationInputValue, value: 'abc' },
104
-        ])
105
-
106
-
107
-        setInputVisible(!inputVisible)
108
-    }
109
-
110
     const { getFieldDecorator } = props.form
48
     const { getFieldDecorator } = props.form
111
 
49
 
112
     return (
50
     return (
169
                                     <Slider
107
                                     <Slider
170
                                         min={5}
108
                                         min={5}
171
                                         max={100}
109
                                         max={100}
172
-                                        // value={typeof inputValue === 'number' ? inputValue : 0}
173
                                         step={1}
110
                                         step={1}
174
-                                    // width="100px"
175
-                                    // style={{ width: '100px' }}
176
                                     />,
111
                                     />,
177
                                 )}
112
                                 )}
178
                         </Col>
113
                         </Col>
179
                         <Col span={6}>
114
                         <Col span={6}>
180
                             {getFieldDecorator('topLimitPersons',
115
                             {getFieldDecorator('topLimitPersons',
181
                                 {
116
                                 {
182
-                                    // initialValue: data.topLimitPersons,
183
                                 })(
117
                                 })(
184
                                     <InputNumber
118
                                     <InputNumber
185
                                         min={5}
119
                                         min={5}
186
                                         max={100}
120
                                         max={100}
187
                                         style={{ marginLeft: 16 }}
121
                                         style={{ marginLeft: 16 }}
188
-                                    // value={inputValue}
189
-                                    // onChange={this.onChange}
122
+
190
                                     />,
123
                                     />,
191
                                 )}
124
                                 )}
192
                         </Col>
125
                         </Col>
195
                 <Form.Item label="查看楼盘按钮">
128
                 <Form.Item label="查看楼盘按钮">
196
                     {getFieldDecorator('buildingShowPos',
129
                     {getFieldDecorator('buildingShowPos',
197
                         {
130
                         {
198
-                            initialValue: viewProperty,
199
-                        })(
200
-                            // <Checkbox.Group options={ViewProperty} defaultValue={['Apple']} onChange={onChange} />,style={viewProperty.indexOf('home') == -1 ? {} : { color: '#EF273A' }}
201
-                            <Checkbox.Group name={Styles.Checkboxs} onChange={onViewPropertyChange} style={{ width: '100%' }}>
202
-                                <Row>
203
-                                    <Col span={6}>
204
-                                        <Checkbox className={viewProperty.indexOf('index') === -1 ? {} : Styles.CheckboxStytle} value="index" >首页</Checkbox>
205
-                                    </Col>
206
-                                    <Col span={6}>
207
-                                        <Checkbox className={viewProperty.indexOf('help') === -1 ? {} : Styles.CheckboxStytle} value="help">助力页</Checkbox>
208
-                                    </Col>
209
-                                    <Col span={6}>
210
-                                        <Checkbox className={viewProperty.indexOf('rule') === -1 ? {} : Styles.CheckboxStytle} value="rule">活动规则页</Checkbox>
211
-                                    </Col>
212
-                                </Row>
213
-                            </Checkbox.Group>,
214
-                        )}
131
+                            initialValue: data.buildingShowPos || 'index',
132
+                        })(<CheckboxGroup />)}
215
                 </Form.Item>
133
                 </Form.Item>
216
                 <Form.Item label="关联楼盘">
134
                 <Form.Item label="关联楼盘">
217
                     {getFieldDecorator('buildingId',
135
                     {getFieldDecorator('buildingId',
223
                 </Form.Item>
141
                 </Form.Item>
224
                 <Form.Item label="生成海报按钮">
142
                 <Form.Item label="生成海报按钮">
225
                     {getFieldDecorator('posterShowPos', {
143
                     {getFieldDecorator('posterShowPos', {
226
-                        initialValue: productionPoster,
227
-                    })(
228
-                        <Checkbox.Group name={Styles.Checkboxs} onChange={onProductionPoster} style={{ width: '100%' }}>
229
-                            <Row>
230
-                                <Col span={6}>
231
-                                    <Checkbox className={productionPoster.indexOf('index') === -1 ? {} : Styles.CheckboxStytle} value="index" >首页</Checkbox>
232
-                                </Col>
233
-                                <Col span={6}>
234
-                                    <Checkbox className={productionPoster.indexOf('help') === -1 ? {} : Styles.CheckboxStytle} value="help">助力页</Checkbox>
235
-                                </Col>
236
-                                <Col span={6}>
237
-                                    <Checkbox className={productionPoster.indexOf('rule') === -1 ? {} : Styles.CheckboxStytle} value="rule">活动规则页</Checkbox>
238
-                                </Col>
239
-                            </Row>
240
-                        </Checkbox.Group>,
241
-                    )}
144
+                        initialValue: data.posterShowPos || 'index',
145
+                    })(<CheckboxGroup />)}
242
                 </Form.Item>
146
                 </Form.Item>
243
-                {/* <Form.Item label="报名表单">
244
-                    {getFieldDecorator('registrationForm')(
245
-                        <Checkbox.Group name={Styles.Checkboxs} onChange={onRegistrationForm} style={{ width: '100%' }}>
246
-                            <Row>
247
-                                {registrationFormOption.map((x, index) => {
248
-                                    return <Col span={6}>
249
-                                        {index !== 2 && (<Checkbox className={registrationForm.indexOf(x.value) === -1 ? {} : Styles.CheckboxStytle} value={x.value} >{x.label} </Checkbox>)}
250
-
251
-                                        {inputVisible && index === 2 && (
252
-                                            <Input
253
-                                                // ref={this.saveInputRef}
254
-                                                type="text"
255
-                                                size="small"
256
-                                                style={{ width: 78 }}
257
-                                                // value={inputValue}
258
-                                                onChange={handleInputChange}
259
-                                                onBlur={handleInputConfirm}
260
-                                                onPressEnter={handleInputConfirm}
261
-                                            />
262
-                                        )}
263
-                                        {!inputVisible && index === 2 && (
264
-                                            <Checkbox className={registrationForm.indexOf(x.value) === -1 ? {} : Styles.CheckboxStytle} value={x.value} >{x.label} </Checkbox>
265
-                                        )}
266
-                                        {!inputVisible && index === 2 && x.label === '自定义' && (
267
-                                            <Navigate onClick={showInput} >
268
-                                                修改
269
-                                            </Navigate>
270
-                                        )}
271
-                                    </Col>
272
-                                })}
273
-                            </Row>
274
-                          
275
-                        </Checkbox.Group>,
276
-                    )}
277
-                </Form.Item> */}
278
                 <Form.Item wrapperCol={{ span: 15, offset: 8 }}>
147
                 <Form.Item wrapperCol={{ span: 15, offset: 8 }}>
279
                     <div style={{ width: '190px' }}>
148
                     <div style={{ width: '190px' }}>
280
                         <Button type="primary" style={{ marginRight: '20px' }} htmlType="submit">保存</Button>
149
                         <Button type="primary" style={{ marginRight: '20px' }} htmlType="submit">保存</Button>
281
-                        {/* <Button onClick={() => router.go(-1)} >取消</Button> */}
282
                     </div>
150
                     </div>
283
                 </Form.Item>
151
                 </Form.Item>
284
             </Form>
152
             </Form>

+ 46
- 0
src/pages/activity/drainage/components/CheckboxGroup.jsx View File

1
+import React from 'react'
2
+import { Checkbox, Row, Col } from 'antd'
3
+import classNames from 'classnames'
4
+
5
+import Styles from './styles.less';
6
+
7
+const DataDict = [
8
+    {
9
+        label: '首页',
10
+        value: 'index',
11
+    },
12
+    {
13
+        label: '助力页',
14
+        value: 'help',
15
+    },
16
+    {
17
+        label: '活动规则页',
18
+        value: 'rule',
19
+    },
20
+]
21
+
22
+export default props => {
23
+    const { value, onChange } = props;
24
+    const vals = (value || '').split(',');
25
+    const handleChange = e => {
26
+        onChange(e.join(','));
27
+    }
28
+
29
+    return (
30
+        <Checkbox.Group className={Styles.Checkboxs} onChange={handleChange} style={{ width: '100%' }} value={vals}>
31
+            <Row>
32
+                {
33
+                    DataDict.map(item => {
34
+                        const key = item.value;
35
+                        return (
36
+                            <Col span={6} key={key}>
37
+                                <Checkbox className={classNames({ [Styles.CheckboxStytle]: vals.indexOf(item.value) > -1 })} value={item.value} >{item.label}</Checkbox>
38
+                            </Col>
39
+                        );
40
+                    })
41
+                }
42
+            </Row>
43
+        </Checkbox.Group>
44
+    );
45
+
46
+}

+ 44
- 16
src/pages/activity/drainage/components/CustomerData.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb, DatePicker } from 'antd';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, Avatar } from 'antd';
3
 import router from 'umi/router';
3
 import router from 'umi/router';
4
 import moment from 'moment';
4
 import moment from 'moment';
5
 import apis from '../../../../services/apis';
5
 import apis from '../../../../services/apis';
6
 import request from '../../../../utils/request';
6
 import request from '../../../../utils/request';
7
 
7
 
8
+const { RangePicker } = DatePicker
9
+
8
 const formateValue = v => {
10
 const formateValue = v => {
11
+    const { date, ...values } = v
12
+
13
+    console.log(date)
9
     return {
14
     return {
10
-        ...v,
11
-        startTime: v.startTime ? `${v.startTime.format('YYYY-MM-DDT00:00:00')}Z` : undefined,
12
-        endTime: v.endTime ? `${v.endTime.format('YYYY-MM-DDT23:59:59')}Z` : undefined,
15
+        ...values,
16
+        startTime: date && date[0] ? `${date[0].format('YYYY-MM-DDT00:00:00')}Z` : undefined,
17
+        endTime: date && date[1] ? `${date[1].format('YYYY-MM-DDT23:59:59')}Z` : undefined,
13
     }
18
     }
14
 }
19
 }
15
 
20
 
25
     // 查询列表
30
     // 查询列表
26
 
31
 
27
     const getList = params => {
32
     const getList = params => {
33
+        // const { LocalDate, ...values } = params
34
+        // if (LocalDate != null && LocalDate.length > 0) {
35
+        //     const [refundStartTime, refundEndTime] = LocalDate
36
+        //     values.refundStartTime = `${moment(refundStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
37
+        //     values.refundEndTime = `${moment(refundEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
38
+        // } else {
39
+        //     values.refundStartTime = null
40
+        //     values.refundEndTime = null
41
+        // }
42
+        console.log(params, 'params')
28
         request({ ...apis.redPacket.getRecordByConditionList, params: { ...params, activityId: id, drainageId } }).then(data => {
43
         request({ ...apis.redPacket.getRecordByConditionList, params: { ...params, activityId: id, drainageId } }).then(data => {
29
             setData(data)
44
             setData(data)
30
         })
45
         })
65
             dataIndex: 'avatarurl',
80
             dataIndex: 'avatarurl',
66
             key: 'avatarurl',
81
             key: 'avatarurl',
67
             align: 'center',
82
             align: 'center',
68
-            render: (x, row) => <img src={row.avatarurl} alt="" width="100px"></img >,
83
+            render: (x, row) => <img src={row.avatarurl} alt="" width="64px"></img >,
69
         },
84
         },
70
         {
85
         {
71
             title: '昵称',
86
             title: '昵称',
72
-            dataIndex: 'nickName',
73
-            key: 'nickName',
87
+            dataIndex: 'nickname',
88
+            key: 'nickname',
74
             align: 'center',
89
             align: 'center',
75
         },
90
         },
76
         {
91
         {
87
         },
102
         },
88
         {
103
         {
89
             title: '访问时间',
104
             title: '访问时间',
90
-            dataIndex: 'createDate',
91
-            key: 'createDate',
105
+            dataIndex: 'visitTime',
106
+            key: 'visitTime',
92
             align: 'center',
107
             align: 'center',
93
-            render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
108
+            render: (x, row) => <><span>{`${moment(row.visitTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
94
         },
109
         },
95
         {
110
         {
96
             title: '分享人昵称',
111
             title: '分享人昵称',
97
-            dataIndex: 'sharePersonNickName',
98
-            key: 'sharePersonNickName',
112
+            dataIndex: 'sharePersonNickname',
113
+            key: 'sharePersonNickname',
99
             align: 'center',
114
             align: 'center',
115
+            render: (x, row) => <><span>{row.sharePersonNickname || row.sharePersonName}</span></>,
100
         },
116
         },
101
         {
117
         {
102
             title: '分享人手机号',
118
             title: '分享人手机号',
120
         link.click()
136
         link.click()
121
     }
137
     }
122
 
138
 
139
+    // ...formateValue(values)
123
     const exportReport = () => {
140
     const exportReport = () => {
141
+        props.form.validateFields((err, values) => {
142
+            if (!err) {
143
+                request({ ...apis.redPacket.exportVisitRecordByCondition, responseType: 'blob', params: { ...formateValue(values), activityId: id, drainageId } }).then(data => {
144
+                    download(data)
145
+                }).catch()
146
+            }
147
+        });
124
 
148
 
125
-        request({ ...apis.redPacket.exportVisitRecordByCondition, responseType: 'blob', params: { ...props.form.getFieldsValue(), activityId: id, drainageId } }).then(data => {
126
-            download(data)
127
-        }).catch()
128
     }
149
     }
129
 
150
 
130
     const { getFieldDecorator } = props.form
151
     const { getFieldDecorator } = props.form
140
                         />,
161
                         />,
141
                     )}
162
                     )}
142
                 </Form.Item>
163
                 </Form.Item>
164
+
143
                 <Form.Item>
165
                 <Form.Item>
166
+                    {getFieldDecorator('date')(
167
+                        <RangePicker placeholder={['访问开始时间', '访问结束时间']} />,
168
+                    )}
169
+                </Form.Item>
170
+
171
+                {/* <Form.Item>
144
                     {getFieldDecorator('startTime')(
172
                     {getFieldDecorator('startTime')(
145
                         <DatePicker placeholder="访问开始时间" />,
173
                         <DatePicker placeholder="访问开始时间" />,
146
                     )}
174
                     )}
149
                     {getFieldDecorator('endTime')(
177
                     {getFieldDecorator('endTime')(
150
                         <DatePicker placeholder="访问结束时间" />,
178
                         <DatePicker placeholder="访问结束时间" />,
151
                     )}
179
                     )}
152
-                </Form.Item>
180
+                </Form.Item> */}
153
                 <Form.Item>
181
                 <Form.Item>
154
                     {getFieldDecorator('sharePersonPhone')(
182
                     {getFieldDecorator('sharePersonPhone')(
155
                         <Input
183
                         <Input

+ 8
- 5
src/pages/activity/drainage/components/Help.jsx View File

7
 
7
 
8
 const { RangePicker } = DatePicker;
8
 const { RangePicker } = DatePicker;
9
 
9
 
10
-function validatorNum (rule, value, callback) {
10
+function validatorNum(rule, value, callback) {
11
     callback(value < 1 || value > 1000 ? '人数必须大于0 小于 1000' : undefined);
11
     callback(value < 1 || value > 1000 ? '人数必须大于0 小于 1000' : undefined);
12
 }
12
 }
13
 
13
 
33
     const updateRedPacket = values => {
33
     const updateRedPacket = values => {
34
 
34
 
35
         const [startDate, endDate] = values.date
35
         const [startDate, endDate] = values.date
36
-        values.startDate = `${moment(startDate).format('YYYY-MM-DDT00:00:00.000')}Z`
37
-        values.endDate = `${moment(endDate).format('YYYY-MM-DDT00:00:00.000')}Z`
36
+        console.log(values.date)
37
+        values.startDate = `${moment(startDate).format('YYYY-MM-DDTHH:mm:ss.000')}Z`
38
+        values.endDate = `${moment(endDate).format('YYYY-MM-DDTHH:mm:ss.000')}Z`
38
         values.activityId = id
39
         values.activityId = id
39
         request({ ...apis.redPacket.updateHelp, urlData: { id }, data: { ...values } }).then(data => {
40
         request({ ...apis.redPacket.updateHelp, urlData: { id }, data: { ...values } }).then(data => {
40
-
41
+            message.info('操作成功')
42
+        }).catch(() => {
43
+            message.error('操作失败')
41
         })
44
         })
42
     }
45
     }
43
 
46
 
164
                             { required: true, message: '请设置 活动开始~结束时间' },
167
                             { required: true, message: '请设置 活动开始~结束时间' },
165
                         ],
168
                         ],
166
                     })(
169
                     })(
167
-                        <RangePicker />,
170
+                        <RangePicker showTime={{ format: 'HH:mm:ss' }} />,
168
                     )}
171
                     )}
169
                 </Form.Item>
172
                 </Form.Item>
170
                 <Form.Item label="活动结束提示文案">
173
                 <Form.Item label="活动结束提示文案">

+ 5
- 4
src/pages/activity/drainage/components/Ranking.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb } from 'antd';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Avatar } from 'antd';
3
 import router from 'umi/router';
3
 import router from 'umi/router';
4
 import moment from 'moment';
4
 import moment from 'moment';
5
 import apis from '../../../../services/apis';
5
 import apis from '../../../../services/apis';
28
             if (!err) {
28
             if (!err) {
29
                 // eslint-disable-next-line no-console
29
                 // eslint-disable-next-line no-console
30
                 console.log('提交数据: ', values)
30
                 console.log('提交数据: ', values)
31
+                getList({ pageNum: 1, pageSize: 10, ...values })
31
             }
32
             }
32
         });
33
         });
33
     }
34
     }
52
             dataIndex: 'avatarurl',
53
             dataIndex: 'avatarurl',
53
             key: 'avatarurl',
54
             key: 'avatarurl',
54
             align: 'center',
55
             align: 'center',
55
-            render: (x, row) => <img src={row.qrCodeUrl} alt="" width="100px"></img >,
56
+            render: (x, row) => <img src={row.avatarurl} alt="" width="64px"></img >,
56
         },
57
         },
57
         {
58
         {
58
             title: '昵称',
59
             title: '昵称',
74
         },
75
         },
75
         {
76
         {
76
             title: '发起时间',
77
             title: '发起时间',
77
-            dataIndex: 'targetName',
78
-            key: 'targetName',
78
+            dataIndex: 'createDate',
79
+            key: 'createDate',
79
             align: 'center',
80
             align: 'center',
80
             render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
81
             render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
81
         },
82
         },

+ 68
- 24
src/pages/activity/drainage/components/RedPacket.jsx View File

31
     const updateRedPacket = data => {
31
     const updateRedPacket = data => {
32
         request({ ...apis.redPacket.updateMoney, urlData: { id }, data: { ...data } }).then(data => {
32
         request({ ...apis.redPacket.updateMoney, urlData: { id }, data: { ...data } }).then(data => {
33
             // setData(data)
33
             // setData(data)
34
+            message.info('操作成功')
34
         })
35
         })
35
     }
36
     }
36
 
37
 
38
         e.preventDefault();
39
         e.preventDefault();
39
         props.form.validateFields((err, values) => {
40
         props.form.validateFields((err, values) => {
40
             if (!err) {
41
             if (!err) {
42
+                values.budget = Math.round(values.budget * 100)
43
+                values.minPacket = Math.round(values.minPacket * 100)
44
+                values.maxPacket = Math.round(values.maxPacket * 100)
41
                 console.log(values, '------222-------')
45
                 console.log(values, '------222-------')
46
+                // values
42
                 updateRedPacket(values)
47
                 updateRedPacket(values)
43
             }
48
             }
44
         },
49
         },
62
             <Row style={{ marginBottom: '40px' }}>
67
             <Row style={{ marginBottom: '40px' }}>
63
                 <Col span={8} style={{ paddingRight: '30px' }}>
68
                 <Col span={8} style={{ paddingRight: '30px' }}>
64
                     <div className={Styles.redHeader}>
69
                     <div className={Styles.redHeader}>
65
-                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>账户余额/元</span><span className={Styles.redHeaderTopNum}>{data.availableBalance/100}</span></div>
70
+                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>账户余额/元</span><span className={Styles.redHeaderTopNum}>{data.availableBalance / 100 || 0}</span></div>
66
                         <div className={Styles.redHeaderBottom}> <Navigate onClick={() => toRecharge()}>去充值</Navigate></div>
71
                         <div className={Styles.redHeaderBottom}> <Navigate onClick={() => toRecharge()}>去充值</Navigate></div>
67
                     </div>
72
                     </div>
68
                 </Col>
73
                 </Col>
69
                 <Col span={8} style={{ padding: '0 10px' }}>
74
                 <Col span={8} style={{ padding: '0 10px' }}>
70
                     <div className={Styles.redHeader}>
75
                     <div className={Styles.redHeader}>
71
                         {/* packetSendedNum */}
76
                         {/* packetSendedNum */}
72
-                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包总数量/个</span><span className={Styles.redHeaderTopNum}>{data.sendNum/100}</span></div>
77
+                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包总数量/个</span><span className={Styles.redHeaderTopNum}>{data.sendNum || 0}</span></div>
73
                         <div className={Styles.redHeaderBottom}><Navigate onClick={() => props.toDetail()}>查看详情</Navigate></div>
78
                         <div className={Styles.redHeaderBottom}><Navigate onClick={() => props.toDetail()}>查看详情</Navigate></div>
74
                     </div>
79
                     </div>
75
                 </Col>
80
                 </Col>
76
                 <Col span={8} style={{ paddingLeft: '30px' }}>
81
                 <Col span={8} style={{ paddingLeft: '30px' }}>
77
                     <div className={Styles.redHeader}>
82
                     <div className={Styles.redHeader}>
78
-                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包金额/元</span><span className={Styles.redHeaderTopNum}>{data.sendTotalAmount/100}</span></div>
83
+                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包金额/元</span><span className={Styles.redHeaderTopNum}>{data.sendTotalAmount / 100 || 0}</span></div>
79
                         <div className={Styles.redHeaderBottom}><Navigate onClick={() => props.toDetail(1)}>查看详情</Navigate></div>
84
                         <div className={Styles.redHeaderBottom}><Navigate onClick={() => props.toDetail(1)}>查看详情</Navigate></div>
80
                     </div>
85
                     </div>
81
                 </Col>
86
                 </Col>
83
             <Form labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
88
             <Form labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
84
                 <Form.Item label="本次红包预算/元">
89
                 <Form.Item label="本次红包预算/元">
85
                     {getFieldDecorator('budget', {
90
                     {getFieldDecorator('budget', {
86
-                        initialValue: data.budget,
87
-                        // rules: [
88
-                        //     {
89
-                        //         type: 'number', message: '123'
90
-                        //     }
91
-                        // ],
91
+                        initialValue: data.budget / 100,
92
+                        rules: [
93
+
94
+                            { required: true, message: '请设置合适的红包预算金额', pattern: new RegExp('^[0-9]{1,5}([.][0-9]{1,2})?$') },
95
+                            {
96
+                                validator: (rule, value, callback) => {
97
+                                    callback(value > (data.availableBalance + data.sendTotalAmount) / 100 ? '预算超支' : value < data.sendTotalAmount / 100 ? '红包预算不能小于已发送红包金额' : undefined)
98
+                                }
99
+                            }
100
+                        ],
92
                     },
101
                     },
93
                     )(
102
                     )(
94
-                        <Input type="number" min={0} max={99999} />,
103
+                        <Input type="number"
104
+                            // formatter={value => `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
105
+                            // parser={value => value.replace(/\$\s?|(,*)/g, '')}
106
+                            min={0}
107
+                            max={99999}
108
+                            step={0.01}
109
+                        />,
95
                     )}
110
                     )}
96
                 </Form.Item>
111
                 </Form.Item>
97
                 <Form.Item label="单个红包金额范围/元">
112
                 <Form.Item label="单个红包金额范围/元">
98
                     {getFieldDecorator('minPacket', {
113
                     {getFieldDecorator('minPacket', {
99
-                        initialValue: data.minPacket || 3,
114
+                        initialValue: data.minPacket / 100 || 3,
115
+                        rules: [
116
+                            { required: true, message: '请设置合适的最小红包值', pattern: new RegExp('^[0-9]{1,5}([.][0-9]{1,2})?$') },
117
+                        ],
100
                     })(
118
                     })(
101
-                        <InputNumber min={1} max={1000} />,
119
+                        <InputNumber min={1} max={199} />,
102
                     )}~
120
                     )}~
103
                      {getFieldDecorator('maxPacket', {
121
                      {getFieldDecorator('maxPacket', {
104
-                        initialValue: data.maxPacket || 3,
122
+                        initialValue: data.maxPacket / 100 || 3,
123
+                        rules: [
124
+                            { required: true, message: '请设置合适的最大红包值', pattern: new RegExp('^[0-9]{1,5}([.][0-9]{1,2})?$') },
125
+                        ],
105
                     })(
126
                     })(
106
-                        <InputNumber min={1} max={1000} />,
127
+                        <InputNumber min={1} max={199} />,
107
                     )}
128
                     )}
108
                 </Form.Item>
129
                 </Form.Item>
130
+                {/*  */}
109
                 <Form.Item label="发放红包个数上限">
131
                 <Form.Item label="发放红包个数上限">
110
                     {getFieldDecorator('limitPacketNum', {
132
                     {getFieldDecorator('limitPacketNum', {
111
-                        initialValue: data.limitPacketNum === -1 ? 0 : data.limitPacketNum,
112
-                    })(
113
-                        <Input type="number" />,
114
-                    )}
133
+                        initialValue: data.limitPacketNum === -1 ? -1 : data.limitPacketNum,
134
+                        rules: [
135
+                            // { required: false, message: '请设置合适的发放红包个数上限', pattern: new RegExp('^[0-9]{1,99}\d*$') }, help="-1为不限制红包个数" 
136
+                            {
137
+                                validator: (rule, value, callback) => {
138
+                                    // callback(((value > data.sendNum || data.limitPacketNum === -1) ? undefined : '不能小于已发送个数'))
139
+                                    callback(value >= data.sendNum ? undefined : value == -1 ? undefined : '不能小于已发送个数')
140
+                                },
141
+                            },
142
+
143
+                        ],
144
+                    })(<InputNumber precision={0} min={-1} />,
145
+                    )} -1为不限制红包个数
115
                 </Form.Item>
146
                 </Form.Item>
116
-                <Form.Item label="余额或预算不足时提示文案">
147
+                {/* <Form.Item label="余额或预算不足时提示文案">
117
                     {getFieldDecorator('insufficientBalanceTip', {
148
                     {getFieldDecorator('insufficientBalanceTip', {
118
                         initialValue: data.insufficientBalanceTip || '红包已发送完毕,谢谢您的参与',
149
                         initialValue: data.insufficientBalanceTip || '红包已发送完毕,谢谢您的参与',
150
+                        rules: [
151
+                            { required: true, message: '请设置余额或预算不足时提示文案' },
152
+                        ],
119
                     })(
153
                     })(
120
                         <Input placeholder="红包已发送完毕,谢谢您的参与" />,
154
                         <Input placeholder="红包已发送完毕,谢谢您的参与" />,
121
                     )}
155
                     )}
122
-                </Form.Item>
156
+                </Form.Item> */}
123
                 {/* font-size:22px;
157
                 {/* font-size:22px;
124
 font-family:PingFangSC-Medium,PingFang SC;
158
 font-family:PingFangSC-Medium,PingFang SC;
125
 font-weight:500;
159
 font-weight:500;
127
                 <Row>
161
                 <Row>
128
                     <Col span={8} style={{ textAlign: 'end', fontSize: '0.13rem', fontWeight: '500', color: 'rgba(102,102,102,1)', padding: '0 0.076rem' }}>配置消息</Col>
162
                     <Col span={8} style={{ textAlign: 'end', fontSize: '0.13rem', fontWeight: '500', color: 'rgba(102,102,102,1)', padding: '0 0.076rem' }}>配置消息</Col>
129
                 </Row>
163
                 </Row>
130
-                <Form.Item label="商名称" >
164
+                <Form.Item label="商名称" >
131
                     {getFieldDecorator('mchName', {
165
                     {getFieldDecorator('mchName', {
132
                         initialValue: data.mchName,
166
                         initialValue: data.mchName,
167
+                        rules: [
168
+                            { required: true, message: '请设置商户名称' },
169
+                            { max: 10, message: '标商户名称长度不能超过10个字符' }
170
+                        ],
133
                     })(
171
                     })(
134
                         <Input placeholder="{小程序名}" />,
172
                         <Input placeholder="{小程序名}" />,
135
                     )}
173
                     )}
137
                 <Form.Item label="红包祝福语">
175
                 <Form.Item label="红包祝福语">
138
                     {getFieldDecorator('blessing', {
176
                     {getFieldDecorator('blessing', {
139
                         initialValue: data.blessing,
177
                         initialValue: data.blessing,
178
+                        rules: [
179
+                            { required: true, message: '请设置红包祝福语' },
180
+                        ],
140
                     })(
181
                     })(
141
                         <Input placeholder="祝您中个大红包!" />,
182
                         <Input placeholder="祝您中个大红包!" />,
142
                     )}
183
                     )}
144
                 <Form.Item label="活动名称">
185
                 <Form.Item label="活动名称">
145
                     {getFieldDecorator('activityName', {
186
                     {getFieldDecorator('activityName', {
146
                         initialValue: data.activityName,
187
                         initialValue: data.activityName,
188
+                        rules: [
189
+                            { required: true, message: '请设置活动名称' },
190
+                        ],
147
                     })(
191
                     })(
148
                         <Input placeholder="{活动标题}" />,
192
                         <Input placeholder="{活动标题}" />,
149
                     )}
193
                     )}
151
                 <Form.Item label="备注">
195
                 <Form.Item label="备注">
152
                     {getFieldDecorator('remark', {
196
                     {getFieldDecorator('remark', {
153
                         initialValue: data.remark,
197
                         initialValue: data.remark,
198
+                        rules: [
199
+                            { required: true, message: '请设置remark' },
200
+                        ],
154
                     })(
201
                     })(
155
                         <Input placeholder="点我拆红包" />,
202
                         <Input placeholder="点我拆红包" />,
156
                     )}
203
                     )}
157
                 </Form.Item>
204
                 </Form.Item>
158
-
159
-
160
-
161
                 <Form.Item wrapperCol={{ span: 15, offset: 8 }}>
205
                 <Form.Item wrapperCol={{ span: 15, offset: 8 }}>
162
                     <div style={{ width: '190px' }}>
206
                     <div style={{ width: '190px' }}>
163
                         <Button type="primary" style={{ marginRight: '20px' }} htmlType="submit">保存</Button>
207
                         <Button type="primary" style={{ marginRight: '20px' }} htmlType="submit">保存</Button>

+ 6
- 5
src/pages/activity/drainage/components/RedPacketRecord.jsx View File

6
 import request from '../../../../utils/request';
6
 import request from '../../../../utils/request';
7
 
7
 
8
 const TradingStatus = {
8
 const TradingStatus = {
9
-    processing: '进行中',
9
+    // processing: '进行中',
10
     success: '成功',
10
     success: '成功',
11
     fail: '失败',
11
     fail: '失败',
12
 }
12
 }
77
             dataIndex: 'avatarurl',
77
             dataIndex: 'avatarurl',
78
             key: 'avatarurl',
78
             key: 'avatarurl',
79
             align: 'center',
79
             align: 'center',
80
-            render: (x, row) => <img src={row.qrCodeUrl} alt="" width="100px"></img >,
80
+            render: (x, row) => <img src={row.avatarurl} alt="" width="64px"></img >,
81
         },
81
         },
82
         {
82
         {
83
             title: '手机号',
83
             title: '手机号',
93
         },
93
         },
94
         {
94
         {
95
             title: '金额(元)',
95
             title: '金额(元)',
96
-            dataIndex: 'packetAmount',
97
-            key: 'packetAmount',
96
+            dataIndex: 'amount',
97
+            key: 'amount',
98
             align: 'center',
98
             align: 'center',
99
+            render: x => <span>{x / 100}</span >,
99
         },
100
         },
100
         {
101
         {
101
             title: '发送状态',
102
             title: '发送状态',
102
             dataIndex: 'tradingStatus',
103
             dataIndex: 'tradingStatus',
103
             key: 'tradingStatus',
104
             key: 'tradingStatus',
104
             align: 'center',
105
             align: 'center',
105
-            render: x => <span>{ TradingStatus[x] || ''}</span>,
106
+            render: x => <span>{TradingStatus[x] || ''}</span>,
106
         },
107
         },
107
     ]
108
     ]
108
 
109
 

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

142
 
142
 
143
 const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
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
         }).catch((err) => {
184
         }).catch((err) => {
192
           message.info(err.msg || err.message)
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
       } else {
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
           </div>
242
           </div>
273
-          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
274
         </div>
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
     </div>
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
     if (groupActivityId) {
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
         }).catch((err) => {
299
         }).catch((err) => {
317
           message.info(err.msg || err.message)
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
       } else {
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
       </div>
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
     </div>
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
   return (
371
   return (
368
     <div>
372
     <div>
369
       <div>
373
       <div>
375
       </div>
379
       </div>
376
       <div>
380
       <div>
377
         {tab === 'basic' && <Basic groupActivityId={groupActivityId} detailData={detailData}/>}
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
       </div>
384
       </div>
381
       <div style={{textAlign: 'center'}}>
385
       <div style={{textAlign: 'center'}}>
382
         <AuthButton name="admin.share.record" noRight={null}>
386
         <AuthButton name="admin.share.record" noRight={null}>

+ 10
- 8
src/pages/activity/groupActivity/editGroupActivity.jsx View File

35
     {
35
     {
36
       label: '选择项目',
36
       label: '选择项目',
37
       name: 'buildingId',
37
       name: 'buildingId',
38
-      render: <BuildSelect disabled={disable}/>,
38
+      render: <BuildSelect disabled={disable} />,
39
       value: dynamicData.buildingId,
39
       value: dynamicData.buildingId,
40
       rules: [
40
       rules: [
41
         { required: true, message: '请选择项目' },
41
         { required: true, message: '请选择项目' },
126
       label: '权重',
126
       label: '权重',
127
       name: 'heavy',
127
       name: 'heavy',
128
       type: FieldTypes.Number,
128
       type: FieldTypes.Number,
129
-      render: <Input type="number" style={{ width: 80}} />,
129
+      render: <Input type="number" style={{ width: 80 }} />,
130
       value: dynamicData.heavy,
130
       value: dynamicData.heavy,
131
       rules: [
131
       rules: [
132
         { required: true, message: '请输入权重' },
132
         { required: true, message: '请输入权重' },
268
             WebkitBoxOrient: 'vertical',
268
             WebkitBoxOrient: 'vertical',
269
             overflow: 'hidden',
269
             overflow: 'hidden',
270
             textOverflow: 'ellipsis',
270
             textOverflow: 'ellipsis',
271
-          }}>{ textAreaValue || '海报描述'}</p>
271
+          }}>{textAreaValue || '海报描述'}</p>
272
           <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
272
           <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
273
             <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
273
             <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
274
             <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
274
             <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
283
           <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团海报图</p>
283
           <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团海报图</p>
284
           <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
284
           <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
285
         </div>
285
         </div>
286
-        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600,比例5:4,格式:jpg,用于拼团活动海报</p>
286
+        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px' }}>建议图片尺寸:750*600,比例5:4,格式:jpg,用于拼团活动海报</p>
287
         <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
287
         <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
288
           <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
288
           <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
289
           <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
289
           <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
302
 
302
 
303
 
303
 
304
 const Share = props => {
304
 const Share = props => {
305
+  console.log(props, 'props')
305
   const { groupActivityId } = props
306
   const { groupActivityId } = props
306
   const [inputValue, changeInput] = useState('')
307
   const [inputValue, changeInput] = useState('')
307
   const [imgValue, changeImg] = useState('')
308
   const [imgValue, changeImg] = useState('')
308
   const [shareContentId, setShareContentId] = useState('')
309
   const [shareContentId, setShareContentId] = useState('')
309
 
310
 
310
   useEffect(() => {
311
   useEffect(() => {
311
-      if (groupActivityId) {
312
+    if (groupActivityId) {
312
       request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then(data => {
313
       request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then(data => {
313
         if (data.length > 0) {
314
         if (data.length > 0) {
314
           setShareContentId(data[0].shareContentId)
315
           setShareContentId(data[0].shareContentId)
322
   }, [])
323
   }, [])
323
 
324
 
324
   const submitShare = () => {
325
   const submitShare = () => {
326
+    console.log(groupActivityId)
325
     if (groupActivityId) {
327
     if (groupActivityId) {
326
       if (shareContentId) {
328
       if (shareContentId) {
327
         request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
329
         request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
359
       <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团分享图</p>
361
       <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团分享图</p>
360
       <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
362
       <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
361
     </div>
363
     </div>
362
-    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
364
+    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
363
     <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
365
     <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
364
     <Button onClick={() => cancelPage()}>取消</Button>
366
     <Button onClick={() => cancelPage()}>取消</Button>
365
   </div>
367
   </div>
417
       </div>
419
       </div>
418
       <div>
420
       <div>
419
         {tab === 'basic' && <Basic dynamicData={dynamicData} disable={disable} activityStatus={activityStatus} scoreData={scoreData} groupActivityId={groupActivityId} />}
421
         {tab === 'basic' && <Basic dynamicData={dynamicData} disable={disable} activityStatus={activityStatus} scoreData={scoreData} groupActivityId={groupActivityId} />}
420
-        {tab === 'poster' && <Poster groupActivityId={groupActivityId}/>}
421
-        {tab === 'share' && <Share />}
422
+        {tab === 'poster' && <Poster groupActivityId={groupActivityId} />}
423
+        {tab === 'share' && <Share groupActivityId={groupActivityId} />}
422
       </div>
424
       </div>
423
       <Prompt message={location =>
425
       <Prompt message={location =>
424
         (location.pathname.startsWith('/activity/groupActivity')
426
         (location.pathname.startsWith('/activity/groupActivity')

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

34
 }
34
 }
35
 
35
 
36
 const getSignList = helpActivityId => {
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
 const BasicForm = props => {
45
 const BasicForm = props => {
46
 
46
 
47
   const detailData = props.detailData || {}
47
   const detailData = props.detailData || {}
48
-  
48
+
49
   const { helpActivityId } = props
49
   const { helpActivityId } = props
50
 
50
 
51
   const handleSubmit = e => {
51
   const handleSubmit = e => {
62
           values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
62
           values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
63
           values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
63
           values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
64
         }
64
         }
65
-        
65
+
66
         console.log('submit data --->', values)
66
         console.log('submit data --->', values)
67
         if (helpActivityId) {
67
         if (helpActivityId) {
68
           values.helpActivityId = helpActivityId
68
           values.helpActivityId = helpActivityId
95
     <>
95
     <>
96
       <Form {...formItemLayout} onSubmit={handleSubmit}>
96
       <Form {...formItemLayout} onSubmit={handleSubmit}>
97
         <Form.Item label="所属项目">
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
         </Form.Item>
107
         </Form.Item>
108
         <Form.Item label="活动标题">
108
         <Form.Item label="活动标题">
109
           <span>{detailData.title}</span>
109
           <span>{detailData.title}</span>
112
           <img src={detailData.img} height="300px" width="375px" />
112
           <img src={detailData.img} height="300px" width="375px" />
113
         </Form.Item>
113
         </Form.Item>
114
         <Form.Item label="助力封面图1">
114
         <Form.Item label="助力封面图1">
115
-           <img src={detailData.listImg} height="210px" width="375px" />
115
+          <img src={detailData.listImg} height="210px" width="375px" />
116
         </Form.Item>
116
         </Form.Item>
117
         <Form.Item label="助力封面图2">
117
         <Form.Item label="助力封面图2">
118
           <img src={detailData.bannerListImg} height="125px" width="375px" />
118
           <img src={detailData.bannerListImg} height="125px" width="375px" />
139
 
139
 
140
 const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
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
     if (helpActivityId) {
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
         }).catch((err) => {
183
         }).catch((err) => {
190
           message.info(err.msg || err.message)
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
       } else {
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
           </div>
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
           </div>
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
       </div>
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
     </div>
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
     if (helpActivityId) {
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
         }).catch((err) => {
299
         }).catch((err) => {
316
           message.info(err.msg || err.message)
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
       } else {
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
       </div>
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
     </div>
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
   return (
370
   return (
367
     <div>
371
     <div>
368
       <div>
372
       <div>
373
         </Radio.Group>
377
         </Radio.Group>
374
       </div>
378
       </div>
375
       <div>
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
       </div>
383
       </div>
380
-      <div style={{textAlign: 'center'}}>
384
+      <div style={{ textAlign: 'center' }}>
381
         <AuthButton name="admin.help.record" noRight={null}>
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
               onClick={getSignList.bind(this, detailData.helpActivityId)}>
389
               onClick={getSignList.bind(this, detailData.helpActivityId)}>
386
               <Button>助力记录</Button>
390
               <Button>助力记录</Button>
387
             </span>}
391
             </span>}
388
-          </AuthButton>
389
-          <Button onClick={() => cancelPage()}>
390
-            取消
392
+        </AuthButton>
393
+        <Button onClick={() => cancelPage()}>
394
+          取消
391
           </Button>
395
           </Button>
392
       </div>
396
       </div>
393
       <Prompt message={location =>
397
       <Prompt message={location =>

+ 22
- 8
src/pages/funds/accountfunds/components/Basic.jsx View File

3
 import router from 'umi/router';
3
 import router from 'umi/router';
4
 import moment from 'moment';
4
 import moment from 'moment';
5
 import Navigate from '@/components/Navigate';
5
 import Navigate from '@/components/Navigate';
6
+import AuthButton from '@/components/AuthButton';
6
 import apis from '../../../../services/apis';
7
 import apis from '../../../../services/apis';
7
 import request from '../../../../utils/request';
8
 import request from '../../../../utils/request';
8
 import Styles from './styles.less';
9
 import Styles from './styles.less';
32
 
33
 
33
     const handleOkRecharge = e => {
34
     const handleOkRecharge = e => {
34
         console.log(e, '123123')
35
         console.log(e, '123123')
36
+        if (e == 0) {
37
+            message.error('充值金额不能为0')
38
+            return
39
+        }
35
         if (e) {
40
         if (e) {
36
 
41
 
37
-            request({ ...apis.funds.saveOrder, data: { amount: e } }).then(data => {
42
+            request({ ...apis.funds.saveOrder, data: { amount: Math.round(e * 100) } }).then(data => {
38
                 setAmount(data)
43
                 setAmount(data)
39
                 showModal('pay')
44
                 showModal('pay')
40
             }).catch(err => {
45
             }).catch(err => {
47
     };
52
     };
48
     // data: { amount: e }
53
     // data: { amount: e }
49
     const handleOkRefund = e => {
54
     const handleOkRefund = e => {
50
-        console.log(e, '123123')
55
+        console.log(e, e * 100, '123123')
51
 
56
 
52
         if (e) {
57
         if (e) {
53
-            request({ ...apis.funds.saveRefundOrder, data: { amount: e } }).then(data => {
58
+            request({ ...apis.funds.saveRefundOrder, data: { amount: Math.round(e * 100) } }).then(data => {
54
                 message.info('申请退款成功')
59
                 message.info('申请退款成功')
55
                 setvisiblea(false)
60
                 setvisiblea(false)
56
             }).catch(err => {
61
             }).catch(err => {
72
         if (e === 'success') {
77
         if (e === 'success') {
73
             showModal('contact')
78
             showModal('contact')
74
         } else {
79
         } else {
75
-            showModal()
80
+            // showModal()
81
+            Modal.error({
82
+                title: '充值失败',
83
+                // content: 'some messages...some messages...',
84
+            });
85
+            setvisiblea(false)
76
         }
86
         }
77
         // setConfirmLoading(true)
87
         // setConfirmLoading(true)
78
         // setTimeout(() => {
88
         // setTimeout(() => {
93
             //   buildingId: rowData.buildingId,
103
             //   buildingId: rowData.buildingId,
94
             //   salesBatchId: rowData.salesBatchId,
104
             //   salesBatchId: rowData.salesBatchId,
95
         })
105
         })
96
-        
106
+
97
     }
107
     }
98
 
108
 
99
 
109
 
146
                 </div>
156
                 </div>
147
             </div>
157
             </div>
148
             <div style={{ textAlign: 'center', marginTop: '272px' }}>
158
             <div style={{ textAlign: 'center', marginTop: '272px' }}>
149
-                <Button className={Styles.btn} type="primary" htmlType="submit" onClick={() => showModal('recharge')}>充值</Button>
150
-                <Button className={Styles.btn} style={{ marginLeft: '80px' }} onClick={() => showModal('refund')}>退款</Button>
159
+                <AuthButton name="admin.funds.account.recharge" noRight={null}>
160
+                    <Button className={Styles.btn} type="primary" htmlType="submit" onClick={() => showModal('recharge')}>充值</Button>
161
+                </AuthButton>
162
+                <AuthButton name="admin.funds.account.refund" noRight={null}>
163
+                    <Button className={Styles.btn} style={{ marginLeft: '80px' }} onClick={() => showModal('refund')}>退款</Button>
164
+                </AuthButton>
151
             </div>
165
             </div>
152
 
166
 
153
             <Modal
167
             <Modal
162
             >
176
             >
163
                 {title === '线上充值' && <Recharge value={e => handleOkRecharge(e)}></Recharge>}
177
                 {title === '线上充值' && <Recharge value={e => handleOkRecharge(e)}></Recharge>}
164
                 {title === '申请退款' && <Refund balance={data.availableBalance / 100 || 0} value={e => handleOkRefund(e)}></Refund>}
178
                 {title === '申请退款' && <Refund balance={data.availableBalance / 100 || 0} value={e => handleOkRefund(e)}></Refund>}
165
-                {title === '扫码支付' && visible && <Pay amount={amount} visible={visible} value={e => handleOkRepay(e)}></Pay>}
179
+                {title === '扫码支付' && <Pay amount={amount} visible={visible} value={e => handleOkRepay(e)}></Pay>}
166
                 {title === '联系我们' && <Contact></Contact>}
180
                 {title === '联系我们' && <Contact></Contact>}
167
 
181
 
168
             </Modal>
182
             </Modal>

+ 56
- 20
src/pages/funds/accountfunds/components/ConsumerOrder.jsx View File

5
 import apis from '../../../../services/apis';
5
 import apis from '../../../../services/apis';
6
 import request from '../../../../utils/request';
6
 import request from '../../../../utils/request';
7
 import Navigate from '@/components/Navigate';
7
 import Navigate from '@/components/Navigate';
8
+import AuthButton from '@/components/AuthButton'
8
 
9
 
9
 const { Option } = Select
10
 const { Option } = Select
11
+const { RangePicker } = DatePicker
12
+
10
 
13
 
11
 function RechargeOrder(props) {
14
 function RechargeOrder(props) {
12
 
15
 
21
     // 查询列表
24
     // 查询列表
22
 
25
 
23
     const getList = params => {
26
     const getList = params => {
24
-        if (params.startTime) {
25
-            params.startTime = `${moment(params.startTime).format('YYYY-MM-DDT00:00:00')}Z`;
26
-        }
27
-        if (params.endTime) {
28
-            params.endTime = `${moment(params.endTime).format('YYYY-MM-DDT23:59:59')}Z`;
27
+
28
+        const { LocalDate, ...values } = params
29
+        if (LocalDate != null && LocalDate.length > 0) {
30
+            const [startTime, endTime] = LocalDate
31
+            values.startTime = `${moment(startTime).format('YYYY-MM-DDT00:00:00')}Z`;
32
+            values.endTime = `${moment(endTime).format('YYYY-MM-DDT23:59:59')}Z`;
33
+        } else {
34
+            values.startTime = null
35
+            values.endTime = null
29
         }
36
         }
30
-        console.log("请求数据", params)
31
-        request({ ...apis.funds.consumeOrderByConditionlist, params: { ...params, consumeType: 'RedPacket' } }).then(data => {
37
+        // if (params.startTime) {
38
+        //     params.startTime = `${moment(params.startTime).format('YYYY-MM-DDT00:00:00')}Z`;
39
+        // }
40
+        // if (params.endTime) {
41
+        //     params.endTime = `${moment(params.endTime).format('YYYY-MM-DDT23:59:59')}Z`;
42
+        // }
43
+        // console.log("请求数据", params)
44
+        request({ ...apis.funds.consumeOrderByConditionlist, params: { ...values, consumeType: 'RedPacket' } }).then(data => {
32
             setData(data)
45
             setData(data)
33
         })
46
         })
34
     }
47
     }
78
             dataIndex: 'amount',
91
             dataIndex: 'amount',
79
             key: 'amount',
92
             key: 'amount',
80
             align: 'center',
93
             align: 'center',
94
+            render: x => <><span>{x / 100 || ''}</span></>,
81
         },
95
         },
82
         {
96
         {
83
             title: '消费方式',
97
             title: '消费方式',
84
             dataIndex: 'itemType',
98
             dataIndex: 'itemType',
85
             key: 'itemType',
99
             key: 'itemType',
86
             align: 'center',
100
             align: 'center',
87
-            render: (x, row) => <><span>{`${row.itemType == 'RedPacket' ? '红包' : ''}`}</span></>,
101
+            // render: () => <>红包</>,
102
+            render: (x, row) => <><span>{`${row.consumeType === 'RedPacket' ? '红包' : ''}`}</span></>,
88
         },
103
         },
89
         {
104
         {
90
             title: '活动名称',
105
             title: '活动名称',
97
             dataIndex: 'createDate',
112
             dataIndex: 'createDate',
98
             key: 'createDate',
113
             key: 'createDate',
99
             align: 'center',
114
             align: 'center',
100
-            render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
115
+            render: (x, row) => <><span>{`${moment(row.visitTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
101
         },
116
         },
102
         {
117
         {
103
             title: '接收人手机号',
118
             title: '接收人手机号',
131
 
146
 
132
     const exportReport = () => {
147
     const exportReport = () => {
133
         const requestParams = props.form.getFieldsValue();
148
         const requestParams = props.form.getFieldsValue();
134
-        if (requestParams.startTime) {
135
-            requestParams.startTime = `${moment(requestParams.startTime).format('YYYY-MM-DDT00:00:00')}Z`;
136
-        }
137
-        if (requestParams.endTime) {
138
-            requestParams.endTime = `${moment(requestParams.endTime).format('YYYY-MM-DDT23:59:59')}Z`;
149
+
150
+        const { LocalDate, ...values } = requestParams
151
+        if (LocalDate != null && LocalDate.length > 0) {
152
+            const [startTime, endTime] = LocalDate
153
+            values.startTime = `${moment(startTime).format('YYYY-MM-DDT00:00:00')}Z`;
154
+            values.endTime = `${moment(endTime).format('YYYY-MM-DDT23:59:59')}Z`;
155
+        } else {
156
+            values.startTime = null
157
+            values.endTime = null
139
         }
158
         }
140
-        request({ ...apis.funds.exportConsumeOrderByCondition, responseType: 'blob', params: { ...requestParams, consumeType: 'redPackage' } }).then(data => {
159
+        // if (requestParams.startTime) {
160
+        //     requestParams.startTime = `${moment(requestParams.startTime).format('YYYY-MM-DDT00:00:00')}Z`;
161
+        // }
162
+        // if (requestParams.endTime) {
163
+        //     requestParams.endTime = `${moment(requestParams.endTime).format('YYYY-MM-DDT23:59:59')}Z`;
164
+        // }
165
+        request({ ...apis.funds.exportConsumeOrderByCondition, responseType: 'blob', params: { ...values, consumeType: 'RedPacket' } }).then(data => {
141
             download(data)
166
             download(data)
142
         }).catch()
167
         }).catch()
143
     }
168
     }
155
                         />,
180
                         />,
156
                     )}
181
                     )}
157
                 </Form.Item>
182
                 </Form.Item>
183
+
184
+
185
+                <Form.Item>
186
+                    {getFieldDecorator('LocalDate')(
187
+                        <RangePicker placeholder={['消费开始时间', '消费结束时间']} />,
188
+                    )}
189
+                </Form.Item>
190
+                {/* 
191
+
158
                 <Form.Item>
192
                 <Form.Item>
159
                     {getFieldDecorator('startTime')(
193
                     {getFieldDecorator('startTime')(
160
                         <DatePicker placeholder="消费开始时间" />,
194
                         <DatePicker placeholder="消费开始时间" />,
164
                     {getFieldDecorator('endTime')(
198
                     {getFieldDecorator('endTime')(
165
                         <DatePicker placeholder="消费结束时间" />,
199
                         <DatePicker placeholder="消费结束时间" />,
166
                     )}
200
                     )}
167
-                </Form.Item>
201
+                </Form.Item> */}
168
                 <Form.Item>
202
                 <Form.Item>
169
                     {getFieldDecorator('tradingStatus')(
203
                     {getFieldDecorator('tradingStatus')(
170
                         <Select style={{ width: '180px' }} placeholder="消费状态">
204
                         <Select style={{ width: '180px' }} placeholder="消费状态">
195
                 </Form.Item>
229
                 </Form.Item>
196
             </Form>
230
             </Form>
197
             <div style={{ marginTop: '20px' }}>
231
             <div style={{ marginTop: '20px' }}>
198
-                <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
232
+                <AuthButton name="admin.funds.account.recharge" noRight={null}>
233
+                    <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
234
+                </AuthButton>
199
             </div>
235
             </div>
200
             <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
236
             <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
201
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
237
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
217
                 <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }}>
253
                 <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }}>
218
                     <Form.Item label="昵称">
254
                     <Form.Item label="昵称">
219
 
255
 
220
-                        <span>{modalData.nickName}</span>
256
+                        <span>{modalData.nickname}</span>
221
 
257
 
222
                     </Form.Item>
258
                     </Form.Item>
223
                     <Form.Item label="头像">
259
                     <Form.Item label="头像">
224
 
260
 
225
-                        <img src={modalData.avatarurl} alt="" />
261
+                        <img src={modalData.avatarurl} alt="" width="100px" height="100px" />
226
 
262
 
227
                     </Form.Item>
263
                     </Form.Item>
228
                     <Form.Item label="姓名">
264
                     <Form.Item label="姓名">
229
 
265
 
230
-                        <span>{modalData.name}</span>
266
+                        <span>{modalData.name || modalData.nickname}</span>
231
 
267
 
232
                     </Form.Item>
268
                     </Form.Item>
233
                     <Form.Item label="手机号">
269
                     <Form.Item label="手机号">

+ 10
- 17
src/pages/funds/accountfunds/components/Contact.jsx View File

1
-import React, { useState } from 'react';
2
-import { Button, Input, Row, Col } from 'antd';
3
-import Styles from './styles.less';
4
-import Navigate from '@/components/Navigate';
1
+import React from 'react';
2
+import ContactText from './contactText'
5
 
3
 
6
-const Recharge = props => {
7
-
8
-    const [value, setValue] = useState()
9
-
10
-    return (
11
-        <>
12
-            <span style={{ fontSize: '22px', color: '#979797', lineHeight: '30px' }}>重要说明:</span>
13
-            <div style={{ fontSize: '18px', color: '#333', lineHeight: '34px', marginTop: '20px' }}>
14
-                您已充值成功,微信充值到账为T+7,因此,充值金额7日后才能到账,为不影响客户使用,实际活动金额由橙蕉预先充值垫付,需要在使用预算前和运营人员确认橙蕉余额是否充足, <Navigate>请联系我们</Navigate>
15
-            </div>
16
-        </>
17
-    )
18
-}
4
+const Recharge = () => (
5
+    <>
6
+        <span style={{ fontSize: '22px', color: '#979797', lineHeight: '30px' }}>重要说明:</span>
7
+        <div style={{ fontSize: '18px', color: '#333', lineHeight: '34px', marginTop: '20px' }}>
8
+            您已充值成功,微信充值到账为T+7,因此,充值金额7日后才能到账,为不影响客户使用,实际活动金额由橙蕉预先充值垫付,需要在使用预算前和运营人员确认橙蕉余额是否充足,<ContactText />
9
+        </div>
10
+    </>
11
+)
19
 export default Recharge
12
 export default Recharge

+ 37
- 60
src/pages/funds/accountfunds/components/Pay.jsx View File

1
-import React, { useState, useEffect } from 'react';
1
+import React, { useState, useEffect, useMemo } from 'react';
2
 import { Button, Input, Row, Col, message } from 'antd';
2
 import { Button, Input, Row, Col, message } from 'antd';
3
 import QRCode from 'qrcode.react';
3
 import QRCode from 'qrcode.react';
4
 import Styles from './styles.less';
4
 import Styles from './styles.less';
5
 import apis from '../../../../services/apis';
5
 import apis from '../../../../services/apis';
6
 import request from '../../../../utils/request';
6
 import request from '../../../../utils/request';
7
 
7
 
8
+
9
+let intervalState = true
8
 const Recharge = props => {
10
 const Recharge = props => {
9
 
11
 
10
-    const { amount, visible } = props
11
-    console.log(amount, visible, 'amount')
12
+    const { amount } = props
13
+    console.log(amount, 'amount')
12
     const { orderInfo } = amount
14
     const { orderInfo } = amount
13
     console.log(orderInfo, 'orderInfo')
15
     console.log(orderInfo, 'orderInfo')
14
     useEffect(() => {
16
     useEffect(() => {
15
-        getByInfo
17
+        console.log(props.visible, 'props.visible')
18
+
19
+        return () => clearInterval(getByInfo);
16
         // setTimeout(() => { getByInfo() }, 1000)
20
         // setTimeout(() => { getByInfo() }, 1000)
17
-    }, [])
21
+    }, [props.visible])
18
 
22
 
19
 
23
 
20
     const getByInfo = setInterval(() => {
24
     const getByInfo = setInterval(() => {
21
-
22
-
23
-
24
-        request({ ...apis.funds.getByInfo, params: { orderId: orderInfo.orderId } }).then(data => {
25
-            if (data.tradingStatus === 'processing') {
26
-
27
-                // clearInterval(getByInfo)
28
-                // props.value()
29
-                if (!visible) { clearInterval(getByInfo) }
30
-            } else if (data.tradingStatus === 'success') {
31
-                mmessage.info('充值成功')
32
-                
33
-                props.value('success')
25
+        if (intervalState) {
26
+            intervalState = false
27
+            request({ ...apis.funds.getByInfo, params: { orderId: orderInfo.orderId } }).then(data => {
28
+                if (data.tradingStatus === 'processing') {
29
+                    // clearInterval(getByInfo)
30
+                    // props.value()
31
+                    // if (!visible) { clearInterval(getByInfo) }
32
+                    intervalState = true
33
+                } else if (data.tradingStatus === 'success') {
34
+                    message.info('充值成功')
35
+                    clearInterval(getByInfo)
36
+
37
+                    props.value('success')
38
+                } else {
39
+                    message.info('充值失败')
40
+                    clearInterval(getByInfo)
41
+                    props.value('fail')
42
+                }
43
+                // tradingStatus
44
+                // setTimeout(() => { getByInfo() }, 1000)
45
+            }).catch(err => {
46
+                console.log(err)
34
                 clearInterval(getByInfo)
47
                 clearInterval(getByInfo)
35
-            } else {
36
-                mmessage.info('充值失败')
37
-                
48
+                message.info('充值失败')
38
                 props.value('fail')
49
                 props.value('fail')
39
-                clearInterval(getByInfo)
40
-            }
41
-            // tradingStatus
42
-            // setTimeout(() => { getByInfo() }, 1000)
43
-        }).catch(err => {
44
-            console.log(err)
45
-            clearInterval(getByInfo)
46
-        })
47
-    }, 1000)
48
-
49
-
50
-    // {
51
-    //     request({ ...apis.funds.getByInfo, params: { orderId: orderInfo.orderId } }).then(data => {
52
-    //         if (data.tradingStatus === 'processing') {
53
-    //             setTimeout(() => { getByInfo() }, 1000)
54
-    //         } else if (data.tradingStatus === 'success') {
55
-    //             mmessage.info('充值成功')
56
-    //         } else {
57
-    //             mmessage.info('充值失败')
58
-    //         }
59
-
60
-    //         // tradingStatus
61
-    //         // setTimeout(() => { getByInfo() }, 1000)
62
-    //     }).catch(err => {
63
-    //         console.log(err)
64
-    //     })
65
-    // }
66
-    // getByInfo
67
-
68
-
69
-    // const [value, setValue] = useState()
50
+            })
51
+        }
52
+    }, 2000)
70
 
53
 
71
-    // function onChange(e) {
72
-    //     if (e.target.value <= 0) return
73
-    //     if (e.target.value > 99999.99) { setValue(99999.99); return }
74
-    //     console.log('changed', e.target.value);
75
-    //     setValue(e.target.value)
76
 
54
 
77
-    // }
78
     return (
55
     return (
79
         <>
56
         <>
80
             <div style={{ fontSize: '18px', fontWeight: '400', color: '#333333' }}>
57
             <div style={{ fontSize: '18px', fontWeight: '400', color: '#333333' }}>
81
-                <span onClick={props.value}>充值金额{amount.amount}元</span><span style={{ marginLeft: '80px' }}>微信商户手续费率{amount.mchPayRate}</span><span style={{ marginLeft: '80px' }}>手续费{amount.serviceFee}元</span>
58
+                <span onClick={props.value}>充值金额{amount.amount / 100 || 0}元</span><span style={{ marginLeft: '80px' }}>微信商户手续费率{amount.mchPayRate}</span><span style={{ marginLeft: '80px' }}>手续费{amount.serviceFee / 100 || 0}元</span>
82
                 {/* <img src="" alt="" width:/> */}
59
                 {/* <img src="" alt="" width:/> */}
83
             </div>
60
             </div>
84
             <div style={{ height: '278px', borderRadius: '12px', border: '1px solid rgba(218,218,218,1', margin: '40px 0', display: 'flex' }}>
61
             <div style={{ height: '278px', borderRadius: '12px', border: '1px solid rgba(218,218,218,1', margin: '40px 0', display: 'flex' }}>
92
                 </div>
69
                 </div>
93
                 <div className={Styles.boxRight}>
70
                 <div className={Styles.boxRight}>
94
                     <div className={Styles.child}>
71
                     <div className={Styles.child}>
95
-                        <p style={{ lineHeight: '43px', height: '43px', marginBottom: '5px' }}><span style={{ fontSize: '32px', fontWeight: '600', color: '#EF273A' }}>¥{amount.realAmount}</span><span style={{ marginLeft: '5px' }}>应付金额</span></p>
72
+                        <p style={{ lineHeight: '43px', height: '43px', marginBottom: '5px' }}><span style={{ fontSize: '32px', fontWeight: '600', color: '#EF273A' }}>¥{amount.realAmount / 100 || 0}</span><span style={{ marginLeft: '5px' }}>应付金额</span></p>
96
                         <p>仅支持微信支付</p>
73
                         <p>仅支持微信支付</p>
97
                     </div>
74
                     </div>
98
 
75
 

+ 11
- 3
src/pages/funds/accountfunds/components/Recharge.jsx View File

7
 const Recharge = props => {
7
 const Recharge = props => {
8
 
8
 
9
     const [value, setValue] = useState()
9
     const [value, setValue] = useState()
10
-
10
+    // /^1[3456789]\d{9}$/
11
     function onChange(e) {
11
     function onChange(e) {
12
-        if (e.target.value <= 0) return
12
+        // if (e.target.value < 0) return
13
+        // if (e.target.value == '') { setValue(e.target.value); return }
14
+        // if (!(/^[0-9]{1,5}([.][0-9]{1,2})?$/.test(e.target.value))) return
15
+        // if (e.target.value > balance) { setValue(balance); return }
16
+        // // console.log('changed', e.target.value);
17
+        // setValue(e.target.value)
18
+        if (e.target.value == '') { setValue(e.target.value); return }
19
+        if (e.target.value < 0) return
20
+        if (!(/^[0-9]{1,5}([.][0-9]{1,2})?$/.test(e.target.value))) return
13
         if (e.target.value > 99999.99) { setValue(99999.99); return }
21
         if (e.target.value > 99999.99) { setValue(99999.99); return }
14
         console.log('changed', e.target.value);
22
         console.log('changed', e.target.value);
15
         setValue(e.target.value)
23
         setValue(e.target.value)
25
                     <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px', marginTop: '20px' }}>1.充值流程:输入充值金额-点击确定-扫码支付-支付成功。</p>
33
                     <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px', marginTop: '20px' }}>1.充值流程:输入充值金额-点击确定-扫码支付-支付成功。</p>
26
                     <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px' }}>2.因微信限制,微信充值有手续费,因此充值金额中应包含手续费,费率1%。</p>
34
                     <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px' }}>2.因微信限制,微信充值有手续费,因此充值金额中应包含手续费,费率1%。</p>
27
                     <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px' }}>3.微信充值到账为T+7,因此,充值金额7日后才能到账,为不影响客户使用,实际活动金额由橙蕉预先充值垫付,需要在使用预算前和运营人员确认橙蕉余额是否充足。充值后请联系我们。</p>
35
                     <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px' }}>3.微信充值到账为T+7,因此,充值金额7日后才能到账,为不影响客户使用,实际活动金额由橙蕉预先充值垫付,需要在使用预算前和运营人员确认橙蕉余额是否充足。充值后请联系我们。</p>
28
-                    <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px' }}>4.您也可使用银行卡转账/支付宝支付/对公账户打款/现金支付等方式充值,具体方式<ContactText /></p>
36
+                    <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px' }}>4.您也可使用银行卡转账/支付宝支付/对公账户打款/现金支付等方式充值,具体方式<ContactText /></p>
29
                 </Col>
37
                 </Col>
30
             </Row>
38
             </Row>
31
             <div style={{ textAlign: 'center', marginTop: '40px' }}>
39
             <div style={{ textAlign: 'center', marginTop: '40px' }}>

+ 53
- 17
src/pages/funds/accountfunds/components/RechargeOrder.jsx View File

5
 import Navigate from '@/components/Navigate'
5
 import Navigate from '@/components/Navigate'
6
 import apis from '../../../../services/apis';
6
 import apis from '../../../../services/apis';
7
 import request from '../../../../utils/request';
7
 import request from '../../../../utils/request';
8
+import AuthButton from '@/components/AuthButton';
8
 import ShowVoucher from './ShowVoucher';
9
 import ShowVoucher from './ShowVoucher';
9
 
10
 
11
+const { RangePicker } = DatePicker
12
+
10
 
13
 
11
 const { Option } = Select
14
 const { Option } = Select
12
 
15
 
28
     // 查询列表
31
     // 查询列表
29
 
32
 
30
     const getList = params => {
33
     const getList = params => {
31
-        if (params.payStartTime) {
32
-            params.payStartTime = `${moment(params.payStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
33
-        }
34
-        if (params.payEndTime) {
35
-            params.payEndTime = `${moment(params.payEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
34
+
35
+
36
+        const { LocalDate, ...values } = params
37
+        if (LocalDate != null && LocalDate.length > 0) {
38
+            const [payStartTime, payEndTime] = LocalDate
39
+            values.payStartTime = `${moment(payStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
40
+            values.payEndTime = `${moment(payEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
41
+        } else {
42
+            values.payStartTime = null
43
+            values.payEndTime = null
36
         }
44
         }
45
+        // if (params.payStartTime) {
46
+        //     params.payStartTime = `${moment(params.payStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
47
+        // }
48
+        // if (params.payEndTime) {
49
+        //     params.payEndTime = `${moment(params.payEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
50
+        // }
37
 
51
 
38
-        request({ ...apis.funds.czlist, params: { ...params } }).then(data => {
52
+        request({ ...apis.funds.czlist, params: { ...values } }).then(data => {
39
             setData(data)
53
             setData(data)
40
         })
54
         })
41
     }
55
     }
89
             dataIndex: 'amount',
103
             dataIndex: 'amount',
90
             key: 'amount',
104
             key: 'amount',
91
             align: 'center',
105
             align: 'center',
106
+            render: x => <><span>{x / 100 || ''}</span></>,
92
         },
107
         },
93
         {
108
         {
94
             title: '充值方式',
109
             title: '充值方式',
109
             dataIndex: 'certificateUrlList',
124
             dataIndex: 'certificateUrlList',
110
             key: 'certificateUrlList',
125
             key: 'certificateUrlList',
111
             align: 'center',
126
             align: 'center',
112
-            render: (x, row) => <>{`${row.certificateUrlList == null ? '' :<Navigate onClick={() => openImg(x)}>查看</Navigate> }`}</>,
127
+            render: (x, row) => <>{row.certificateUrlList == null ? '' : <Navigate onClick={() => openImg(x)}>查看</Navigate>}</>,
113
         },
128
         },
114
         {
129
         {
115
             title: '充值状态',
130
             title: '充值状态',
116
             dataIndex: 'tradingStatus',
131
             dataIndex: 'tradingStatus',
117
             key: 'tradingStatus',
132
             key: 'tradingStatus',
118
             align: 'center',
133
             align: 'center',
119
-            render: (x, row) => <><span>{row.tradingStatus == 'processing' ? '待支付' : (row.tradingStatus == 'success' ? '已支付' : '已超时')}</span></>,
134
+            render: (x, row) => <><span>{row.tradingStatus == 'processing' ? '待支付' : (row.tradingStatus == 'success' ? '已支付' : '失败')}</span></>,
120
         },
135
         },
121
         {
136
         {
122
             title: '支付时间',
137
             title: '支付时间',
145
 
160
 
146
     const exportReport = () => {
161
     const exportReport = () => {
147
         const requestParams = props.form.getFieldsValue();
162
         const requestParams = props.form.getFieldsValue();
148
-        if (requestParams.payStartTime) {
149
-            requestParams.payStartTime = `${moment(requestParams.payStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
150
-        }
151
-        if (requestParams.payEndTime) {
152
-            requestParams.payEndTime = `${moment(requestParams.payEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
163
+
164
+        
165
+        const { LocalDate, ...values } = requestParams
166
+        if (LocalDate != null && LocalDate.length > 0) {
167
+            const [payStartTime, payEndTime] = LocalDate
168
+            values.payStartTime = `${moment(payStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
169
+            values.payEndTime = `${moment(payEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
170
+        } else {
171
+            values.payStartTime = null
172
+            values.payEndTime = null
153
         }
173
         }
154
-        request({ ...apis.funds.czexportList, responseType: 'blob', params: { ...requestParams } }).then(data => {
174
+        // if (requestParams.payStartTime) {
175
+        //     requestParams.payStartTime = `${moment(requestParams.payStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
176
+        // }
177
+        // if (requestParams.payEndTime) {
178
+        //     requestParams.payEndTime = `${moment(requestParams.payEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
179
+        // }
180
+        request({ ...apis.funds.czexportList, responseType: 'blob', params: { ...values } }).then(data => {
155
             download(data)
181
             download(data)
156
         }).catch()
182
         }).catch()
157
     }
183
     }
167
                         />,
193
                         />,
168
                     )}
194
                     )}
169
                 </Form.Item>
195
                 </Form.Item>
196
+
170
                 <Form.Item>
197
                 <Form.Item>
198
+                    {getFieldDecorator('LocalDate')(
199
+                        <RangePicker placeholder={['支付开始时间', '支付结束时间']} />,
200
+                    )}
201
+                </Form.Item>
202
+
203
+
204
+                {/* <Form.Item>
171
                     {getFieldDecorator('payStartTime')(
205
                     {getFieldDecorator('payStartTime')(
172
                         <DatePicker placeholder="支付开始时间" />,
206
                         <DatePicker placeholder="支付开始时间" />,
173
                     )}
207
                     )}
176
                     {getFieldDecorator('payEndTime')(
210
                     {getFieldDecorator('payEndTime')(
177
                         <DatePicker placeholder="支付结束时间" />,
211
                         <DatePicker placeholder="支付结束时间" />,
178
                     )}
212
                     )}
179
-                </Form.Item>
213
+                </Form.Item> */}
180
                 <Form.Item>
214
                 <Form.Item>
181
                     {getFieldDecorator('isOffline')(
215
                     {getFieldDecorator('isOffline')(
182
                         <Select style={{ width: '180px' }} placeholder="充值方式">
216
                         <Select style={{ width: '180px' }} placeholder="充值方式">
192
                             <Option value="">全部</Option>
226
                             <Option value="">全部</Option>
193
                             <Option value="processing">待支付</Option>
227
                             <Option value="processing">待支付</Option>
194
                             <Option value="success">已支付</Option>
228
                             <Option value="success">已支付</Option>
195
-                            <Option value="fail">已超时</Option>
229
+                            <Option value="fail">失败</Option>
196
                         </Select>,
230
                         </Select>,
197
                     )}
231
                     )}
198
                 </Form.Item>
232
                 </Form.Item>
216
                 </Form.Item>
250
                 </Form.Item>
217
             </Form>
251
             </Form>
218
             <div style={{ marginTop: '20px' }}>
252
             <div style={{ marginTop: '20px' }}>
219
-                <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
253
+                <AuthButton name="admin.funds.account.export" noRight={null}>
254
+                    <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
255
+                </AuthButton>
220
             </div>
256
             </div>
221
             <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
257
             <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
222
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
258
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>

+ 15
- 5
src/pages/funds/accountfunds/components/Refund.jsx View File

1
 import React, { useState } from 'react';
1
 import React, { useState } from 'react';
2
 import { Button, Input, Row, Col } from 'antd';
2
 import { Button, Input, Row, Col } from 'antd';
3
 import Styles from './styles.less';
3
 import Styles from './styles.less';
4
-import Navigate from '@/components/Navigate';
4
+import ContactText from './contactText'
5
 
5
 
6
 const Recharge = props => {
6
 const Recharge = props => {
7
-
8
     const { balance } = props
7
     const { balance } = props
9
 
8
 
9
+    // if (e.target.value == 0) { setValue(0); return }
10
+    // if (e.target.value <= 0) return
11
+    // if (!(/^[0-9]{1,5}([.][0-9]{1,2})?$/.test(e.target.value))) return
12
+    // if (e.target.value > 99999.99) { setValue(99999.99); return }
13
+    // console.log('changed', e.target.value);
14
+    // setValue(e.target.value)
15
+
10
     const [value, setValue] = useState()
16
     const [value, setValue] = useState()
11
 
17
 
12
     function onChange(e) {
18
     function onChange(e) {
13
-        // if (e.target.value <= 0) return
14
-        // if (e.target.value > balance) { setValue(balance); return }
15
         console.log('changed', e.target.value);
19
         console.log('changed', e.target.value);
20
+        // if (e.target.value == 0) { setValue(); return }
21
+        if (e.target.value < 0) return
22
+        if (e.target.value == '') { setValue(e.target.value); return }
23
+        if (!(/^[0-9]{1,5}([.][0-9]{1,2})?$/.test(e.target.value))) return
24
+        if (e.target.value > balance) { setValue(balance); return }
25
+        // console.log('changed', e.target.value);
16
         setValue(e.target.value)
26
         setValue(e.target.value)
17
 
27
 
18
     }
28
     }
23
                 <Col span={17} offset={1}>
33
                 <Col span={17} offset={1}>
24
                     <Input type="number" min={0} step={0.01} value={value} onChange={onChange} style={{ marginBottom: '40px' }}></Input>
34
                     <Input type="number" min={0} step={0.01} value={value} onChange={onChange} style={{ marginBottom: '40px' }}></Input>
25
                     <span style={{ fontSize: '20px', color: '#979797', lineHeight: '30px' }}>账户余额:{balance}元</span>
35
                     <span style={{ fontSize: '20px', color: '#979797', lineHeight: '30px' }}>账户余额:{balance}元</span>
26
-                    <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px', marginTop: '20px' }}>因微信商户平台限制,需先提交退款申请,提交后会冻结退款额对应余额资金,冻结金额无法使用,若您的平台有正在举办的活动等需要消费的地方,请预留充足的余额。如有疑问, <Navigate>请联系我们</Navigate></p>
36
+                    <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px', marginTop: '20px' }}>因微信商户平台限制,需先提交退款申请,提交后会冻结退款额对应余额资金,冻结金额无法使用,若您的平台有正在举办的活动等需要消费的地方,请预留充足的余额。如有疑问, <ContactText /></p>
27
                 </Col>
37
                 </Col>
28
             </Row>
38
             </Row>
29
             <div style={{ textAlign: 'center', marginTop: '40px' }}>
39
             <div style={{ textAlign: 'center', marginTop: '40px' }}>

+ 50
- 25
src/pages/funds/accountfunds/components/RefundOrder.jsx View File

5
 import withActions from '@/components/ActionList';
5
 import withActions from '@/components/ActionList';
6
 import EditIcon from '@/components/EditIcon';
6
 import EditIcon from '@/components/EditIcon';
7
 import apis from '../../../../services/apis';
7
 import apis from '../../../../services/apis';
8
+import AuthButton from '@/components/AuthButton';
8
 import request from '../../../../utils/request';
9
 import request from '../../../../utils/request';
9
 import Navigate from '@/components/Navigate'
10
 import Navigate from '@/components/Navigate'
10
 import ShowVoucher from './ShowVoucher';
11
 import ShowVoucher from './ShowVoucher';
11
 
12
 
12
 const { Option } = Select
13
 const { Option } = Select
13
 
14
 
15
+const { RangePicker } = DatePicker
16
+
14
 function RechargeOrder(props) {
17
 function RechargeOrder(props) {
15
 
18
 
16
     // const [taNoticeList, setTaNoticeList] = useState([])
19
     // const [taNoticeList, setTaNoticeList] = useState([])
24
     // 查询列表
27
     // 查询列表
25
 
28
 
26
     const getList = params => {
29
     const getList = params => {
27
-        if (params.refundStartTime) {
28
-            params.refundStartTime = `${moment(params.refundStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
29
-        }
30
-        if (params.refundEndTime) {
31
-            params.refundEndTime = `${moment(params.refundEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
30
+
31
+        const { LocalDate, ...values } = params
32
+        if (LocalDate != null && LocalDate.length > 0) {
33
+            const [refundStartTime, refundEndTime] = LocalDate
34
+            values.refundStartTime = `${moment(refundStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
35
+            values.refundEndTime = `${moment(refundEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
36
+        } else {
37
+            values.refundStartTime = null
38
+            values.refundEndTime = null
32
         }
39
         }
33
-        request({ ...apis.funds.refundlist, params: { ...params } }).then(data => {
40
+        // if (params.refundStartTime) {
41
+        //     params.refundStartTime = `${moment(params.refundStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
42
+        // }
43
+        // if (params.refundEndTime) {
44
+        //     params.refundEndTime = `${moment(params.refundEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
45
+        // }
46
+        request({ ...apis.funds.refundlist, params: { ...values } }).then(data => {
34
             setData(data)
47
             setData(data)
35
         })
48
         })
36
     }
49
     }
84
             dataIndex: 'amount',
97
             dataIndex: 'amount',
85
             key: 'amount',
98
             key: 'amount',
86
             align: 'center',
99
             align: 'center',
87
-        render: (x, row) => <><span>{`${row.amount/100}`}</span></>,
100
+            render: (x, row) => <><span>{`${row.amount / 100}`}</span></>,
88
         },
101
         },
89
         {
102
         {
90
             title: '退款创建时间',
103
             title: '退款创建时间',
98
             dataIndex: 'auditStatus',
111
             dataIndex: 'auditStatus',
99
             key: 'auditStatus',
112
             key: 'auditStatus',
100
             align: 'center',
113
             align: 'center',
114
+            // width: '20%',
101
             render: (x, row) => <><span>{row.auditStatus == 'checking' ? '已申请' : (row.auditStatus == 'agree' ? '已退款' : '已驳回')}</span></>,
115
             render: (x, row) => <><span>{row.auditStatus == 'checking' ? '已申请' : (row.auditStatus == 'agree' ? '已退款' : '已驳回')}</span></>,
102
         },
116
         },
103
         {
117
         {
105
             dataIndex: 'auditResult',
119
             dataIndex: 'auditResult',
106
             key: 'auditResult',
120
             key: 'auditResult',
107
             align: 'center',
121
             align: 'center',
122
+            width: '20%',
108
         },
123
         },
109
 
124
 
110
         {
125
         {
112
             dataIndex: 'certificateUrlList',
127
             dataIndex: 'certificateUrlList',
113
             key: 'certificateUrlList',
128
             key: 'certificateUrlList',
114
             align: 'center',
129
             align: 'center',
115
-            render: (x, row) => <>{`${row.certificateUrlList == null ? '' :<Navigate onClick={() => openImg(x)}>查看</Navigate> }`}</>,
130
+            render: (x, row) => <>{row.certificateUrlList == null ? '' : <Navigate onClick={() => openImg(x)}>查看</Navigate>}</>,
116
         },
131
         },
117
         {
132
         {
118
             title: '操作',
133
             title: '操作',
146
 
161
 
147
     const exportReport = () => {
162
     const exportReport = () => {
148
         const requestParams = props.form.getFieldsValue();
163
         const requestParams = props.form.getFieldsValue();
149
-        if (requestParams.refundStartTime) {
150
-            requestParams.refundStartTime = `${moment(requestParams.refundStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
164
+        const { LocalDate, ...values } = requestParams
165
+        if (LocalDate != null && LocalDate.length > 0) {
166
+            const [refundStartTime, refundEndTime] = LocalDate
167
+            values.refundStartTime = `${moment(refundStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
168
+            values.refundEndTime = `${moment(refundEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
169
+        } else {
170
+            values.refundStartTime = null
171
+            values.refundEndTime = null
151
         }
172
         }
152
-        if (requestParams.refundEndTime) {
153
-            requestParams.refundEndTime = `${moment(requestParams.refundEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
154
-        }
155
-        request({ ...apis.funds.refundexportList, responseType: 'blob', params: { ...requestParams } }).then(data => {
173
+        // if (requestParams.refundStartTime) {
174
+        //     requestParams.refundStartTime = `${moment(requestParams.refundStartTime).format('YYYY-MM-DDT00:00:00')}Z`;
175
+        // }
176
+        // if (requestParams.refundEndTime) {
177
+        //     requestParams.refundEndTime = `${moment(requestParams.refundEndTime).format('YYYY-MM-DDT23:59:59')}Z`;
178
+        // }
179
+        request({ ...apis.funds.refundexportList, responseType: 'blob', params: { ...values } }).then(data => {
156
             download(data)
180
             download(data)
157
         }).catch()
181
         }).catch()
158
     }
182
     }
170
                         />,
194
                         />,
171
                     )}
195
                     )}
172
                 </Form.Item>
196
                 </Form.Item>
197
+
173
                 <Form.Item>
198
                 <Form.Item>
199
+                    {getFieldDecorator('LocalDate')(
200
+                        <RangePicker placeholder={['退款开始时间', '退款结束时间']} />,
201
+                    )}
202
+                </Form.Item>
203
+                {/* <Form.Item>
174
                     {getFieldDecorator('refundStartTime')(
204
                     {getFieldDecorator('refundStartTime')(
175
                         <DatePicker placeholder="退款开始时间" />,
205
                         <DatePicker placeholder="退款开始时间" />,
176
                     )}
206
                     )}
179
                     {getFieldDecorator('refundEndTime')(
209
                     {getFieldDecorator('refundEndTime')(
180
                         <DatePicker placeholder="退款结束时间" />,
210
                         <DatePicker placeholder="退款结束时间" />,
181
                     )}
211
                     )}
182
-                </Form.Item>
212
+                </Form.Item> */}
183
                 <Form.Item>
213
                 <Form.Item>
184
                     {getFieldDecorator('auditStatus')(
214
                     {getFieldDecorator('auditStatus')(
185
                         <Select style={{ width: '180px' }} placeholder="退款状态">
215
                         <Select style={{ width: '180px' }} placeholder="退款状态">
186
                             <Option value="">全部</Option>
216
                             <Option value="">全部</Option>
187
                             <Option value="checking">已申请</Option>
217
                             <Option value="checking">已申请</Option>
188
-                            <Option value="agree">已驳回</Option>
189
-                            <Option value="unagree">已退款</Option>
218
+                            <Option value="unagree">已驳回</Option>
219
+                            <Option value="agree">已退款</Option>
190
                         </Select>,
220
                         </Select>,
191
                     )}
221
                     )}
192
                 </Form.Item>
222
                 </Form.Item>
193
-                <Form.Item>
194
-                    {getFieldDecorator('phone')(
195
-                        <Input
196
-                            placeholder="接收人手机号"
197
-                        />,
198
-                    )}
199
-                </Form.Item>
200
                 <Form.Item>
223
                 <Form.Item>
201
                     <Button type="primary" htmlType="submit"> 搜索</Button>
224
                     <Button type="primary" htmlType="submit"> 搜索</Button>
202
                     <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
225
                     <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
203
                 </Form.Item>
226
                 </Form.Item>
204
             </Form>
227
             </Form>
205
             <div style={{ marginTop: '20px' }}>
228
             <div style={{ marginTop: '20px' }}>
206
-                <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
229
+                <AuthButton name="admin.funds.account.export" noRight={null}>
230
+                    <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
231
+                </AuthButton>
207
             </div>
232
             </div>
208
             <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
233
             <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
209
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
234
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>

+ 51
- 34
src/pages/funds/accountfunds/components/ShowVoucher.jsx View File

1
-import React, { useState, useRef, useEffect } from "react";
2
-import { Alert, message } from 'antd';
1
+import React from 'react';
3
 import Swiper from 'swiper';
2
 import Swiper from 'swiper';
4
-import router from 'umi/router';
5
-// import request from '../../utils/request'
6
 import styles from './styles.less'
3
 import styles from './styles.less'
7
-import closeImg from '../../../../assets/close.png';
4
+import closeImg from '../../../../assets/close2.png';
8
 import classNames from 'classnames';
5
 import classNames from 'classnames';
9
 import 'swiper/css/swiper.min.css';
6
 import 'swiper/css/swiper.min.css';
10
 
7
 
11
-const storageKey = 'showSwiperIndex';
12
-
13
-// const ShowVoucher = props => {
14
-
15
-
16
-//     useEffect(()={
17
-
18
-//     },[])
19
-
20
-//     return <>
21
-//         <div className={styles.content}>
22
-//             <img src={closeImg} alt="" className={styles.close} onClick={() => props.closeSwiper} />
23
-//             <div className={classNames(['swiper-container', styles.carousel])}  >
24
-//                 <div className={classNames(['swiper-wrapper', styles.carousel])} >
25
-//                     {props.data.bannerList.map((item, index) =>
26
-//                         <div key={'swiper' + index} className={classNames(['swiper-slide', styles.carouselItem])} >
27
-//                             <img style={{ width: '100%', height: '100%', borderRadius: '10px' }} src={item.noticeImg} alt="" />
28
-//                         </div>,
29
-//                     )}
30
-//                 </div>
31
-//                 <div className={classNames(['swiper-pagination', styles.dots])}  ></div>
32
-//             </div>
33
-//             {/* 123 */}
34
-//         </div>
35
-//     </>
36
-// }
37
-
38
 class ShowVoucher extends React.Component {
8
 class ShowVoucher extends React.Component {
39
     constructor(props) {
9
     constructor(props) {
40
         super(props);
10
         super(props);
93
                         <div className={classNames(['swiper-container', styles.carousel])} >
63
                         <div className={classNames(['swiper-container', styles.carousel])} >
94
                             <div className={classNames(['swiper-wrapper', styles.carousel])} >
64
                             <div className={classNames(['swiper-wrapper', styles.carousel])} >
95
                                 {bannerList.map((item, index) =>
65
                                 {bannerList.map((item, index) =>
96
-                                    <div key={'swiper' + index} className={classNames(['swiper-slide', styles.carouselItem])} onClick={() => this.handleSwiperItem(item)}>
97
-                                        <img style={{ width: '100%', height: '100%', borderRadius: '10px' }} src={item} alt="" />
66
+                                    <div key={'swiper' + index} className={classNames(['swiper-slide', styles.carouselItem])} >
67
+                                        {/* <img style={{ width: '100%', borderRadius: '10px' }} src={item} alt="" /> */}
68
+                                        <img style={{ maxHeight: '504px', borderRadius: '10px' }} src={item} alt="" />
98
                                     </div>,
69
                                     </div>,
99
                                 )}
70
                                 )}
100
                             </div>
71
                             </div>
109
 
80
 
110
 
81
 
111
 export default ShowVoucher
82
 export default ShowVoucher
83
+
84
+
85
+
86
+
87
+
88
+// import React, { useState, useEffect } from 'react';
89
+// import Carousel, { Modal, ModalGateway } from 'react-images';
90
+
91
+// const ShowVoucher = props => {
92
+//     const { bannerList = [], open, onClose } = props;
93
+//     const [modalIsOpen, setModalIsOpen] = useState(open)
94
+//     useEffect(() => {
95
+//         setModalIsOpen(open)
96
+//     }, [bannerList, open])
97
+
98
+//     const toggleModal = () => {
99
+//         setModalIsOpen(!modalIsOpen)
100
+//         if (typeof onClose === 'function') {
101
+//             onClose()
102
+//         }
103
+
104
+//     }
105
+//     const styleInit = {
106
+//         header: (base, state) => ({ //头部样式
107
+//             position: 'absolute',
108
+//             top: 90,
109
+//             right: 90,
110
+//             zIndex: 9999,
111
+//         }),
112
+//         view: (base, state) => ({
113
+//             textAlign: 'center',
114
+//             height: state.isFullscreen ? '100%' : 600  //当点击全屏的时候图片样式
115
+//         })
116
+//     }
117
+//     return (
118
+//         <ModalGateway >
119
+//             {modalIsOpen ? (
120
+//                 <Modal onClose={toggleModal} >
121
+//                     <Carousel views={bannerList} styles={styleInit} />
122
+//                 </Modal>
123
+//             ) : null}
124
+//         </ModalGateway>
125
+//     );
126
+
127
+// }
128
+

+ 30
- 0
src/pages/funds/accountfunds/components/styles.less View File

33
     }
33
     }
34
   }
34
   }
35
 
35
 
36
+  .mask{
37
+    width: 100vw;
38
+    height: 100vh;
39
+    // max-height: 600px;
40
+    background-color: rgba(0,0,0,0.32);
41
+    position: fixed;
42
+    z-index: 999;
43
+    top: 0;
44
+    left: 0;
45
+}
46
+
36
   .btn {
47
   .btn {
37
     width: 140px;
48
     width: 140px;
38
     height: 45px;
49
     height: 45px;
97
         right: -22px;
108
         right: -22px;
98
         z-index: 9;
109
         z-index: 9;
99
     }
110
     }
111
+}
112
+
113
+.carousel {
114
+  width: 32vw;
115
+  min-width: 757px;
116
+  height: 21.3vw;
117
+  min-height: 504px;
118
+  border-radius: 10px;
119
+  text-align: center;
120
+  
121
+  .carouselItem{
122
+      width: 32vw;
123
+      min-width: 757px;
124
+      height: 21.3vw;
125
+      min-height: 504px;
126
+      position: relative;
127
+      display: inline-block;
128
+     
129
+  }
100
 }
130
 }

+ 2
- 1
src/pages/funds/financialContact/index.jsx View File

50
             dataIndex: 'sex',
50
             dataIndex: 'sex',
51
             key: 'sex',
51
             key: 'sex',
52
             align: 'center',
52
             align: 'center',
53
+            render: x => <span>{x == 1 ? '男' : x === 2 ? '女' : '未知'}</span >,
53
         },
54
         },
54
         {
55
         {
55
             title: '头像',
56
             title: '头像',
56
             dataIndex: 'avatar',
57
             dataIndex: 'avatar',
57
             key: 'avatar',
58
             key: 'avatar',
58
             align: 'center',
59
             align: 'center',
59
-            render: (x, row) => <img src={row.qrCodeUrl} alt="" width="100px"></img >,
60
+            render: (x, row) => <img src={row.avatar} alt="" width="93px" height="93px"></img >,
60
         },
61
         },
61
         {
62
         {
62
             title: '固话',
63
             title: '固话',

+ 109
- 5
src/pages/h5SampleManager/h5Sample/addH5.jsx View File

7
 import request from '../../../utils/request';
7
 import request from '../../../utils/request';
8
 import AuthButton from '@/components/AuthButton';
8
 import AuthButton from '@/components/AuthButton';
9
 import ImageUploader from '../../../components/XForm/ImageUpload';
9
 import ImageUploader from '../../../components/XForm/ImageUpload';
10
-
11
-const { Option } = Select;
12
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
13
-
10
+import BuildSelect from '../../../components/SelectButton/BuildSelect2'
14
 
11
 
15
 const header = props => {
12
 const header = props => {
16
     const sampleId = props.location.query.id;
13
     const sampleId = props.location.query.id;
14
+
15
+    const [data, setData] = useState({})
16
+
17
+    const [visible, setVisible] = useState(false)
17
     // const sampleName = props.location.query.sampleName;
18
     // const sampleName = props.location.query.sampleName;
18
     // const [sampleData, setSampleData] = useState({})
19
     // const [sampleData, setSampleData] = useState({})
19
 
20
 
52
                 values.fromH5Sample = true
53
                 values.fromH5Sample = true
53
                 request({ ...apis.activity.addtaDrainage, data: { ...values } }).then(data => {
54
                 request({ ...apis.activity.addtaDrainage, data: { ...values } }).then(data => {
54
                     message.info('操作成功')
55
                     message.info('操作成功')
56
+                    setData(data)
57
+                    setVisible(true)
55
 
58
 
56
                 }).catch(err => {
59
                 }).catch(err => {
57
                     message.error(err.msg || err.message)
60
                     message.error(err.msg || err.message)
68
         });
71
         });
69
     }
72
     }
70
 
73
 
74
+    function disabledDate(current) {
75
+        // Can not select days before today and today 
76
+        // console.log(current, 'current')
77
+        // return current && current < moment().startOf('day');
78
+        return current < moment().add(0, 'd');
79
+    }
80
+
81
+    const disabledHours = () => {
82
+        const hours = [];
83
+        console.log(moment().hour(), 'moment().hour()')
84
+        for (let i = 0; i < moment().hour(); i++) {
85
+            hours.push(i);
86
+        }
87
+        return hours;
88
+    };
89
+
90
+    const disabledMinutes = currentDate => {
91
+        const currentMinute = moment().minute();
92
+        const currentHour = moment(currentDate).hour();
93
+        const minutes = [];
94
+        if (currentHour === moment().hour()) {
95
+            for (let i = 0; i <= currentMinute; i++) {
96
+                minutes.push(i);
97
+            }
98
+        }
99
+        return minutes;
100
+    };
101
+
102
+    const disabledTime = dateTime => {
103
+        if (moment(dateTime).isBefore(moment(), 'day')) {
104
+            return {
105
+                disabledHours: () => [],
106
+                disabledMinutes: () => [],
107
+            };
108
+        }
109
+        console.log(moment(dateTime).isSame(moment(), 'day'), 'moment(dateTime).isSame(moment(), )')
110
+        console.log(moment(dateTime).isSame(moment().add(1, 'days'), 'day'), 'moment(dateTime).isSame(moment().add(1,  )')
111
+        if (moment(dateTime).isSame(moment().add(1, 'days'), 'day')) {
112
+            return {
113
+                disabledHours: () => disabledHours(dateTime),
114
+                disabledMinutes: () => disabledMinutes(dateTime),
115
+            };
116
+        }
117
+    };
118
+
119
+    const toH5Edit = () => {
120
+        router.push({
121
+            pathname: '/activity/drainage/h5edit',
122
+            query: {
123
+                id: data.activityId,
124
+                name: data.name,
125
+                drainageId: data.drainageId,
126
+            },
127
+        });
128
+    }
129
+
130
+    const toDrainageDetail = () => {
131
+        router.push({
132
+            pathname: '/activity/drainage/DetailDrainage',
133
+            query: {
134
+                drainageId: data.drainageId,
135
+            },
136
+        });
137
+    }
138
+
71
     const { getFieldDecorator } = props.form;
139
     const { getFieldDecorator } = props.form;
72
 
140
 
141
+    function validatorNum(rule, value, callback) {
142
+        callback(value < 1 || value > 1000 ? '人数必须大于0 小于 1000' : undefined);
143
+    }
144
+
73
     return (
145
     return (
74
         <>
146
         <>
75
             <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
147
             <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
83
                         ],
155
                         ],
84
                     })(<Input placeholder="H5活动名称" />)}
156
                     })(<Input placeholder="H5活动名称" />)}
85
                 </Form.Item>
157
                 </Form.Item>
158
+                <Form.Item label="选择项目">
159
+                    {getFieldDecorator('buildingId')(
160
+                        <BuildSelect />,
161
+                    )}
162
+                </Form.Item>
86
                 <Form.Item label="下架时间">
163
                 <Form.Item label="下架时间">
87
                     {getFieldDecorator('endDate', {
164
                     {getFieldDecorator('endDate', {
88
                         // initialValue: formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm:ss') : null,
165
                         // initialValue: formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm:ss') : null,
89
                         rules: [
166
                         rules: [
90
                             { required: true, message: '请输入下架时间' },
167
                             { required: true, message: '请输入下架时间' },
168
+
169
+                            // {
170
+                            //     validator: (rule, value, callback) => {
171
+                            //         callback(moment(value).isSame(moment().add(1, 'days'), 'day') ? '金额最多5位整数 2位小数' : undefined)
172
+                            //     }
173
+                            // }
174
+
91
                         ]
175
                         ]
92
                     })(
176
                     })(
93
                         <DatePicker
177
                         <DatePicker
94
                             showTime={{ format: 'HH:mm:ss' }}
178
                             showTime={{ format: 'HH:mm:ss' }}
179
+                            disabledDate={disabledDate}
180
+                            disabledTime={disabledTime}
181
+                            showToday={false}
95
                         />,
182
                         />,
96
                     )}
183
                     )}
97
                 </Form.Item>
184
                 </Form.Item>
103
                         ]
190
                         ]
104
                     })(<ImageUploader />)}
191
                     })(<ImageUploader />)}
105
                 </Form.Item>
192
                 </Form.Item>
106
-                <Form.Item label="活动分享语">
193
+                <Form.Item label="活动分享语" help="可使用{name}代表用户昵称。">
107
                     {getFieldDecorator('shareTitle', {
194
                     {getFieldDecorator('shareTitle', {
108
                         // initialValue: formsDate.shareTitle,
195
                         // initialValue: formsDate.shareTitle,
109
                         rules: [
196
                         rules: [
130
             <Button onClick={() => router.go(-1)}>取消</Button>
217
             <Button onClick={() => router.go(-1)}>取消</Button>
131
                 </Form.Item>
218
                 </Form.Item>
132
             </Form>
219
             </Form>
220
+            <Modal
221
+                title="新增成功"
222
+                visible={visible}
223
+                // onOk={handleOk}
224
+                // confirmLoading={confirmLoading}
225
+                onCancel={() => setVisible(false)}
226
+                footer={null}
227
+            // width="1000px"
228
+            // maskClosable={false}
229
+            >
230
+                建议修改内容以适合您的项目,若有红包等需要消费的内容,请到资金管理中查看余额是否充足
231
+                <div style={{ width: '300px', margin: '30px auto', display: 'flex', justifyContent: 'space-between' }}>
232
+                    <Button type="primary" style={{ width: '140px' }} onClick={toH5Edit}>修改配置</Button>
233
+
234
+                    <Button style={{ width: '140px' }} onClick={toDrainageDetail}>查看H5活动详情</Button>
235
+                </div>
236
+            </Modal>
133
         </>
237
         </>
134
     )
238
     )
135
 }
239
 }

+ 6
- 6
src/pages/h5SampleManager/h5Sample/detail.jsx View File

121
         </Form.Item>
121
         </Form.Item>
122
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
122
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
123
           <div style={{ margin: '0.16rem 0 0.06rem' }}>
123
           <div style={{ margin: '0.16rem 0 0.06rem' }}>
124
-            <AuthButton name="admin.h5Sample.activity.add" noRight={null}>
124
+            {!!demandData.h5TemplateId && <AuthButton name="admin.h5Sample.activity.add" noRight={null}>
125
               <Button type="primary" onClick={toAddH5(sampleId)} style={{ marginRight: '20px' }}>
125
               <Button type="primary" onClick={toAddH5(sampleId)} style={{ marginRight: '20px' }}>
126
                 创建H5活动
126
                 创建H5活动
127
               </Button>
127
               </Button>
128
-            </AuthButton>
128
+            </AuthButton>}
129
             <Button type="primary" onClick={toDetail(sampleId)} style={{ marginRight: '20px' }}>
129
             <Button type="primary" onClick={toDetail(sampleId)} style={{ marginRight: '20px' }}>
130
               提交需求
130
               提交需求
131
           </Button>
131
           </Button>
135
           </div>
135
           </div>
136
         </Form.Item>
136
         </Form.Item>
137
         <div style={{ position: 'fixed', right: '0.4rem', bottom: '6%' }}>
137
         <div style={{ position: 'fixed', right: '0.4rem', bottom: '6%' }}>
138
-          <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between', marginBottom: '20px' }}>样例可直接使用 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
139
-            <AuthButton name="admin.h5Sample.activity.add" noRight={null}>
138
+          {!!demandData.h5TemplateId && <AuthButton name="admin.h5Sample.activity.add" noRight={null}>
139
+            <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between', marginBottom: '20px' }}>样例可直接使用 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
140
               <Button type="primary" onClick={toAddH5(sampleId)} >
140
               <Button type="primary" onClick={toAddH5(sampleId)} >
141
                 创建H5活动
141
                 创建H5活动
142
               </Button>
142
               </Button>
143
-            </AuthButton>
144
-          </div>
143
+            </div>
144
+          </AuthButton>}
145
           <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between' }}>我想办类似活动 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
145
           <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between' }}>我想办类似活动 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
146
             <Button type="primary" onClick={toDetail(sampleId)} >
146
             <Button type="primary" onClick={toDetail(sampleId)} >
147
               提交需求
147
               提交需求