Browse Source

Merge branch 'v3.5' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into v3.5

魏熙美 5 years ago
parent
commit
f282773543

+ 0
- 18
config/routes.js View File

@@ -421,24 +421,6 @@ export default [
421 421
               },
422 422
             ],
423 423
           },
424
-          {
425
-            path: '/third',
426
-            name: '第三方管理',
427
-            component: '../layouts/BlankLayout',
428
-            routes: [
429
-              {
430
-                path: '/third/thirdList',
431
-                name: '第三方公司',
432
-                component: './third/thirdList',
433
-              },
434
-              {
435
-                path: '/third/editThirdParty',
436
-                name: '编辑活动',
437
-                hideInMenu: true,
438
-                component: './third/editThirdParty',
439
-              },
440
-            ],
441
-          },
442 424
           {
443 425
             component: './404',
444 426
           },

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

@@ -32,14 +32,24 @@ const header = (props) => {
32 32
 
33 33
   function gettaDrainageRecord (params) {
34 34
     request({ ...apis.activity.taDrainageRecord, params: { ...params } }).then((data) => {
35
-      // setDatas(data)
36
-      setTotal(data)
35
+      // setDatas(data) 
37 36
       console.log(data.total, '3333333333333')
37
+      if(data.total!=0){
38
+      setTotal(data)
39
+      // console.log(data.total, '3333333333333')
40
+     
38 41
       setDatas(tableData(data.records))
39 42
       // content = data.records[0]
40 43
       console.log('json: ', eval('(' + data.records[0].content + ')'))
41 44
       setContent(eval('(' + data.records[0].content + ')'))
42 45
       setColumns(tableTitle(eval('(' + data.records[0].content + ')')))
46
+    }
47
+    else{
48
+      message.info('数据为空')
49
+    }
50
+
51
+
52
+
43 53
     }).catch((err) => {
44 54
       console.log(err)
45 55
       message.info(err.msg || err.message)

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

@@ -91,6 +91,20 @@ const header = (props) => {
91 91
       align: 'center',
92 92
       render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>,
93 93
     },
94
+    {
95
+      title: 'appid',
96
+      dataIndex: 'appid',
97
+      key: 'appid',
98
+      align: 'center',
99
+      // render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>,
100
+    },
101
+    {
102
+      title: 'secret',
103
+      dataIndex: 'appSecret',
104
+      key: 'appSecret',
105
+      align: 'center',
106
+      // render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>,
107
+    },
94 108
     {
95 109
       title: '新建时间',
96 110
       dataIndex: 'createDate',
@@ -167,7 +181,7 @@ const header = (props) => {
167 181
     console.log(formsdate,'111---------------')
168 182
     console.log(formsdate,'11122222222')
169 183
       // data: { ...submitValue }
170
-      alert(val)
184
+
171 185
       console.log(formsdate.drainageId,'9999999999999')
172 186
       if (formsdate.drainageId) {
173 187
         // { ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }
@@ -191,9 +205,19 @@ const header = (props) => {
191 205
           message.error(err.msg || err.message)
192 206
         })
193 207
       }
208
+      setDate({
209
+        visible: false,
210
+      });
211
+      gettaDrainage({ pageNum: 1, pageSize: 10 })
212
+    }
213
+
214
+    const handleCancel = val => {
215
+      setDate({
216
+        visible: false,
217
+      });
194 218
     }
195 219
 
196
-    return <XForm onSubmit={handleSubmit} fields={fields}></XForm>
220
+    return <XForm onSubmit={handleSubmit} onCancel={handleCancel}  fields={fields}></XForm>
197 221
     
198 222
   }
199 223
 

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

@@ -29,20 +29,22 @@ const { TextArea } = Input;
29 29
 const Edit = props => {
30 30
   const [tab, changeTab] = useState('basic')
31 31
   // 判断是否展示助力次数的输入框
32
-  // const [help, helpTab] = useState('1')
33 32
   const { groupActivityId } = props.location.query
34 33
   const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
34
+  const [scoreData, setScoreData] = useState({})
35
+  useEffect(() => {
36
+    request(apis.groupActivity.avgScore).then((data) => {
37
+      setScoreData(data);
38
+    })
39
+  }, [])
35 40
   if (groupActivityId) {
36
-    // eslint-disable-next-line react-hooks/rules-of-hooks
37 41
     useEffect(() => {
38
-      // eslint-disable-next-line no-use-before-define
39 42
       getDynamicData(groupActivityId);
40 43
     }, [])
41 44
 
42 45
     // 详情
43 46
     const getDynamicData = (groupActivityId) => {
44 47
       request({ ...apis.groupActivity.details, urlData: { id: groupActivityId } }).then((data) => {
45
-        console.log(data)
46 48
         setDynamicData(data)
47 49
       })
48 50
     }
@@ -83,7 +85,7 @@ const Edit = props => {
83 85
         name: 'mainImg',
84 86
         type: FieldTypes.ImageUploader,
85 87
         value: dynamicData.mainImg,
86
-        help: '建议图片尺寸:750px*560px',
88
+        help: '建议尺寸375*312px',
87 89
       },
88 90
       {
89 91
         label: '活动时间',
@@ -100,6 +102,7 @@ const Edit = props => {
100 102
         name: 'groupBuyPeople',
101 103
         type: FieldTypes.Text,
102 104
         value: dynamicData.groupBuyPeople,
105
+        help: '注:成团所需人数',
103 106
         rules: [
104 107
           { required: true, message: '请输入成团人数' },
105 108
         ]
@@ -109,6 +112,7 @@ const Edit = props => {
109 112
         name: 'integral',
110 113
         type: FieldTypes.Text,
111 114
         value: dynamicData.integral,
115
+        help: '注:用户平均积分' + scoreData.averageScore,
112 116
         rules: [
113 117
           { required: true, message: '请输入所需积分' },
114 118
         ]
@@ -118,7 +122,7 @@ const Edit = props => {
118 122
         name: 'descImg',
119 123
         type: FieldTypes.ImageUploader,
120 124
         value: dynamicData.descImg,
121
-        help: '建议图片尺寸:750px*560px',
125
+        help: '建议宽度:335px,高度不限',
122 126
       },
123 127
     ]
124 128
 
@@ -160,7 +164,6 @@ const Edit = props => {
160 164
       console.log(groupActivityId, 'groupActivityId')
161 165
       useEffect(() => {
162 166
         request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then((data) => {
163
-          console.log(data, "2222")
164 167
           if (data.length > 0) {
165 168
             setPosterId(data[0].posterId)
166 169
             changeImg(data[0].posterImg)
@@ -334,9 +337,9 @@ const Edit = props => {
334 337
     <div>
335 338
       <div>
336 339
         <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
337
-          <Radio.Button value="basic">基本信息1</Radio.Button>
338
-          <Radio.Button value="poster">海报图片1</Radio.Button>
339
-          <Radio.Button value="share">分享设置1</Radio.Button>
340
+          <Radio.Button value="basic">基本信息</Radio.Button>
341
+          <Radio.Button value="poster">海报图片</Radio.Button>
342
+          <Radio.Button value="share">分享设置</Radio.Button>
340 343
         </Radio.Group>
341 344
       </div>
342 345
       <div>

+ 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>

+ 5
- 0
src/services/apis.js View File

@@ -777,6 +777,11 @@ export default {
777 777
     method: 'get',
778 778
     action: 'admin.taRole.get',
779 779
   },
780
+  avgScore: {
781
+    url: `${prefix}/taShareActivity/avgScore`,
782
+    method: 'get',
783
+    action: 'admin.taRole.get',
784
+  },
780 785
   update: {
781 786
     url: `${prefix}/taShareActivity/update`,
782 787
     method: 'put',