浏览代码

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

魏熙美 5 年前
父节点
当前提交
f282773543

+ 0
- 18
config/routes.js 查看文件

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
             component: './404',
425
             component: './404',
444
           },
426
           },

+ 12
- 2
src/pages/activity/drainage/Detail.jsx 查看文件

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

+ 26
- 2
src/pages/activity/drainage/DrainageList.jsx 查看文件

91
       align: 'center',
91
       align: 'center',
92
       render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>,
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
       title: '新建时间',
109
       title: '新建时间',
96
       dataIndex: 'createDate',
110
       dataIndex: 'createDate',
167
     console.log(formsdate,'111---------------')
181
     console.log(formsdate,'111---------------')
168
     console.log(formsdate,'11122222222')
182
     console.log(formsdate,'11122222222')
169
       // data: { ...submitValue }
183
       // data: { ...submitValue }
170
-      alert(val)
184
+
171
       console.log(formsdate.drainageId,'9999999999999')
185
       console.log(formsdate.drainageId,'9999999999999')
172
       if (formsdate.drainageId) {
186
       if (formsdate.drainageId) {
173
         // { ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }
187
         // { ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }
191
           message.error(err.msg || err.message)
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 查看文件

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

+ 17
- 6
src/pages/activity/helpActivity/edithelpActivity.jsx 查看文件

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

+ 11
- 6
src/pages/activity/helpActivity/helpRecord.jsx 查看文件

293
     e.preventDefault();
293
     e.preventDefault();
294
     props.form.validateFields((err, values) => {
294
     props.form.validateFields((err, values) => {
295
       if (!err) {
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
 
324
 
325
   function handleReset() {
325
   function handleReset() {
326
     props.form.resetFields();
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
   function toCustomerDateil(record) {
330
   function toCustomerDateil(record) {
338
 
338
 
339
   function exportCustomer () {
339
   function exportCustomer () {
340
     const fieldsValue = getFieldsValue()
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
       .then(response => {
342
       .then(response => {
344
         download(response)
343
         download(response)
345
       }).catch(error => {
344
       }).catch(error => {
373
   // 核销
372
   // 核销
374
   setVerifierData({ visible: true, helpId: row.helpRecordInitiateId, helpActivityId: row.helpActivityId, elpRecordInitiateId: '', verificationCode: '' })
373
   setVerifierData({ visible: true, helpId: row.helpRecordInitiateId, helpActivityId: row.helpActivityId, elpRecordInitiateId: '', verificationCode: '' })
375
  }
374
  }
376
-
375
+ // 核销回调
377
  function onSuccess(e) {
376
  function onSuccess(e) {
378
    console.log('回调:', e)
377
    console.log('回调:', e)
379
    getList(e)
378
    getList(e)
380
      // 核销
379
      // 核销
381
    setVerifierData({ visible: false, helpId: '', helpActivityId: '', elpRecordInitiateId: '', verificationCode: '' })
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
   const publicColumns = [
389
   const publicColumns = [
385
     {
390
     {
494
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
499
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
495
               重置
500
               重置
496
             </Button>
501
             </Button>
497
-            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
502
+            <Button style={{ marginLeft: 8 }} onClick={returList}>
498
               返回
503
               返回
499
             </Button>
504
             </Button>
500
         </Form.Item>
505
         </Form.Item>

+ 3
- 3
src/pages/activity/helpActivity/list.jsx 查看文件

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

+ 5
- 0
src/services/apis.js 查看文件

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