dingxin 5 years ago
parent
commit
a4e6b4bc05

+ 17
- 6
src/pages/activity/helpActivity/edithelpActivity.jsx View File

@@ -80,6 +80,19 @@ const header = props => {
80 80
           values.helpNum = 0
81 81
         }
82 82
 
83
+        // 判断助力人数不得超过200
84
+        if (values.helpNum > 200) {
85
+          message.error('限制助力人数不能超过200')
86
+          return
87
+        }
88
+
89
+        // 判断助力人数必须大于0
90
+        if (values.isEnlist === 1) {
91
+        if (values.helpNum <= 0) {
92
+          message.error('限制助力人数必须大于1')
93
+          return
94
+        }
95
+      }
83 96
         const { activityTime, signupTime, ...submitValue } = values
84 97
         const [startDate, endDate] = activityTime
85 98
         submitValue.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
@@ -135,9 +148,8 @@ const header = props => {
135 148
         })(<Input />)}
136 149
         </Form.Item>
137 150
 
138
-        <Form.Item label="活动主图">
151
+        <Form.Item label="活动主图" help="建议尺寸375*312px">
139 152
           {getFieldDecorator('img')(<ImageUploader />)}
140
-          <span>建议图片尺寸:750px*560px</span>
141 153
         </Form.Item>
142 154
 
143 155
         <Form.Item label="活动时间">
@@ -180,7 +192,7 @@ const header = props => {
180 192
         )}
181 193
         </Form.Item>
182 194
          {
183
-           isEnlist === 1 && <Form.Item label="请输入助力人数">
195
+           isEnlist === 1 && <Form.Item label="请输入助力人数" min={1} max={10}>
184 196
            {getFieldDecorator('helpNum', {
185 197
              rules: [
186 198
                {
@@ -188,13 +200,12 @@ const header = props => {
188 200
                  message: '请输入助力人数',
189 201
                },
190 202
              ],
191
-           })(<Input type="number" />)}
203
+           })(<Input type="number" placeholder="助力人数限制"/>)}
192 204
            </Form.Item>
193 205
          }
194 206
 
195
-        <Form.Item label="活动说明">
207
+        <Form.Item label="活动说明" help="建议宽度:335px,高度不限">
196 208
           {getFieldDecorator('activityInstructions')(<ImageUploader />)}
197
-          <span>建议图片尺寸:750px*560px</span>
198 209
         </Form.Item>
199 210
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
200 211
           <Button type="primary" htmlType="submit">

+ 11
- 6
src/pages/activity/helpActivity/helpRecord.jsx View File

@@ -293,7 +293,7 @@ function body(props) {
293 293
     e.preventDefault();
294 294
     props.form.validateFields((err, values) => {
295 295
       if (!err) {
296
-        getList({ pageNum: 1, pageSize: 10, customerType, ...values })
296
+        getList({ pageNum: 1, pageSize: 10, status: customerType, ...values, helpActivityId })
297 297
       }
298 298
     });
299 299
   }
@@ -324,7 +324,7 @@ function body(props) {
324 324
 
325 325
   function handleReset() {
326 326
     props.form.resetFields();
327
-    getList({ pageNumber: 1, pageSize: 10, customerType })
327
+    getList({ pageNum: 1, pageSize: 10, status: customerType, helpActivityId })
328 328
   }
329 329
 
330 330
   function toCustomerDateil(record) {
@@ -338,8 +338,7 @@ function body(props) {
338 338
 
339 339
   function exportCustomer () {
340 340
     const fieldsValue = getFieldsValue()
341
-    const code = customerType === 'helpSucceed' ? 1 : 0
342
-    request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { ...fieldsValue, customerType, helpActivityId, code } })
341
+    request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { ...fieldsValue, customerType, helpActivityId, condition: customerType } })
343 342
       .then(response => {
344 343
         download(response)
345 344
       }).catch(error => {
@@ -373,13 +372,19 @@ function helpRecord(row) {
373 372
   // 核销
374 373
   setVerifierData({ visible: true, helpId: row.helpRecordInitiateId, helpActivityId: row.helpActivityId, elpRecordInitiateId: '', verificationCode: '' })
375 374
  }
376
-
375
+ // 核销回调
377 376
  function onSuccess(e) {
378 377
    console.log('回调:', e)
379 378
    getList(e)
380 379
      // 核销
381 380
    setVerifierData({ visible: false, helpId: '', helpActivityId: '', elpRecordInitiateId: '', verificationCode: '' })
382 381
  }
382
+ // 返回到首页
383
+ function returList(params) {
384
+  router.push({
385
+      pathname: '/activity/helpActivity/list',
386
+    });
387
+}
383 388
 
384 389
   const publicColumns = [
385 390
     {
@@ -494,7 +499,7 @@ function helpRecord(row) {
494 499
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
495 500
               重置
496 501
             </Button>
497
-            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
502
+            <Button style={{ marginLeft: 8 }} onClick={returList}>
498 503
               返回
499 504
             </Button>
500 505
         </Form.Item>

+ 3
- 3
src/pages/activity/helpActivity/list.jsx View File

@@ -91,7 +91,7 @@ const toEditGoods = (helpActivityId) => () => {
91 91
       align: 'center',
92 92
       render: (x, row) => (
93 93
         <>
94
-          {row.activityStatus === 1 &&
94
+          {row.activityStatus === 0 &&
95 95
           <AuthButton name="admin.SignList.get" noRight={null}>
96 96
         
97 97
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
@@ -100,10 +100,10 @@ const toEditGoods = (helpActivityId) => () => {
100 100
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
101 101
           </AuthButton> }
102 102
 
103
-          {row.activityStatus === 0 &&
103
+          {row.activityStatus === 1 &&
104 104
            <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
105 105
                       <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
106
-                      <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
106
+                      {/* <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span> */}
107 107
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
108 108
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
109 109
             </AuthButton>