Преглед изворни кода

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

顾绍勇 пре 5 година
родитељ
комит
43dbb2c10a

+ 2
- 2
config/config.js Прегледај датотеку

@@ -83,8 +83,8 @@ export default {
83 83
   targets: {
84 84
     ie: 11,
85 85
   },
86
-  publicPath: './',
87
-  // publicPath: 'https://njcjweb.oss-accelerate.aliyuncs.com/admin/',
86
+  // publicPath: './',
87
+  publicPath: 'https://njcjweb.oss-accelerate.aliyuncs.com/admin/',
88 88
   history: 'hash',
89 89
   devtool: isAntDesignProPreview ? 'source-map' : false,
90 90
   // umi routes: https://umijs.org/zh/guide/router.html

BIN
public/favicon.png Прегледај датотеку


+ 1
- 1
src/components/SelectButton/BuildSelect.jsx Прегледај датотеку

@@ -55,7 +55,7 @@ const BuildingSelect = props => {
55 55
       filterOption={(input, option) =>
56 56
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57 57
       }>
58
-          <Option key="" value="">全部项目</Option>
58
+          {/* <Option key="" value="">全部项目</Option> */}
59 59
           {data.map(building => (
60 60
             <Option key={building.buildingId} value={building.buildingId}>{building.buildingName}</Option>
61 61
           ))}

+ 1
- 1
src/components/SelectButton/channelSelect.jsx Прегледај датотеку

@@ -37,7 +37,7 @@ const ChannelSelect = props => {
37 37
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
38 38
       }>
39 39
           {data.map(Item => (
40
-            <Option key={Item.channelId} value={Item.channelId}> {console.log(Item)}{Item.channelName} </Option>
40
+            <Option key={Item.channelId} value={Item.channelId}> {Item.channelName} </Option>
41 41
           ))}
42 42
       </Select>
43 43
   )

+ 2
- 2
src/pages/activity/ActivityList.jsx Прегледај датотеку

@@ -43,7 +43,7 @@ const header = props => {
43 43
   }, [])
44 44
 
45 45
   // 跳转到编辑商品
46
-  const toEditGoods = dynamicId => () => {
46
+  const toEditGoods = dynamicId  => () => {
47 47
     router.push({
48 48
       pathname: '/activity/editActivity',
49 49
       query: {
@@ -196,7 +196,7 @@ const header = props => {
196 196
           {<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={toDataReacord(row.dynamicId)}>数据记录<Icon type="form" className={styles.edit} /></span>}
197 197
           {/* </AuthButton> */}
198 198
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
199
-            {(row.activityStatus === 0 || row.activityStatus === 1) && <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>}
199
+            {(row.activityStatus === 0 || row.activityStatus === 1) && <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId,row.count)}>编辑<Icon type="form" className={styles.edit} /></span>}
200 200
           </AuthButton>
201 201
           
202 202
           {/* {(row.activityStatus === 0 || row.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>{'下载二维码'} {<Icon type="qrcode" className={styles.shoppingCart} />}</span>} */}

+ 1
- 0
src/pages/activity/dataRecord/index.jsx Прегледај датотеку

@@ -46,6 +46,7 @@ const DataRecord = props => {
46 46
     return <>
47 47
         <div>
48 48
             <div>
49
+                <span>{data.activityName || '0'}</span>
49 50
                 <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
50 51
                 <Modal
51 52
                     title="指标说明(数据会存在一定时间延迟)"

+ 5
- 4
src/pages/activity/editActivity.jsx Прегледај датотеку

@@ -121,8 +121,9 @@ const BasicForm = props => {
121 121
             message.info(checks)
122 122
             return
123 123
           }
124
-          console.log(data.count,values.personNum)
125
-          if (data.count || 0 > values.personNum) {
124
+          console.log(data.enlistNum,values.personNum,'143')
125
+
126
+          if (data.enlistNum > values.personNum) {
126 127
             message.info('活动人数必须大于已报名人数')
127 128
             return
128 129
           }
@@ -257,7 +258,7 @@ const BasicForm = props => {
257 258
               //   message: '活动人数必须大于已报名人数',
258 259
               // },
259 260
             ],
260
-          })(<Input type="number"   />)}
261
+          })(<Input type="number" />)}
261 262
         </Form.Item>
262 263
         <Form.Item label="用户携带人数" help="每个用户最多可携带参与活动的人数">
263 264
           {getFieldDecorator('maxEnlistByPerson', {
@@ -320,7 +321,7 @@ const Edit = props => {
320 321
   const { dynamicId } = props.location.query
321 322
 
322 323
 
323
-  const Poster = (props) => {
324
+  const Poster = props => {
324 325
     const [inputValue, changeInput] = useState('')
325 326
     const [textAreaValue, changeTextArea] = useState('')
326 327
     const [imgValue, changeImg] = useState('')

+ 1
- 1
src/pages/activity/groupActivity/detailActivity.jsx Прегледај датотеку

@@ -121,7 +121,7 @@ const BasicForm = props => {
121 121
           <img src={detailData.bannerListImg} height="125px" width="375px" />
122 122
         </Form.Item>
123 123
         <Form.Item label="活动时间">
124
-          <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(detailData.endDate).format('YYYY-MM-DD HH:mm:ss')}`}</span>
124
+      <span>{`${moment(detailData.startTime).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(detailData.endTime).format('YYYY-MM-DD HH:mm:ss')}`}</span>
125 125
         </Form.Item>
126 126
         <Form.Item label="成团人数">
127 127
             <span>{detailData.groupBuyPeople}</span>

+ 337
- 337
src/pages/activity/groupActivity/editGroupActivity.jsx Прегледај датотеку

@@ -27,385 +27,385 @@ const cancelPage = () => {
27 27
   });
28 28
 }
29 29
 
30
-/**
31
- *
32
- *
33
- * @param {*} props
34
- * @returns
35
- */
36
-const Edit = props => {
37
-  const [tab, changeTab] = useState('basic')
38
-  // 判断是否展示助力次数的输入框
39
-  const { groupActivityId } = props.location.query
40
-  const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
41
-  const [scoreData, setScoreData] = useState({})
42
-  const [activityStatus, setActivityStatus] = useState({})
43
-  const [disable, setDisable] = useState(false)
44 30
 
45
-  useEffect(() => {
46
-    request(apis.groupActivity.avgScore).then((data) => {
47
-      setScoreData(data);
48
-    })
49
-  }, [])
31
+const Basic = props => {
32
+  const { dynamicData, disable, activityStatus, scoreData, groupActivityId } = props;
50 33
 
51
-    useEffect(() => {
52
-      if (groupActivityId) {
53
-      getDynamicData(groupActivityId);
54
-    }
55
-    }, [groupActivityId])
34
+  const fields = [
35
+    {
36
+      label: '选择项目',
37
+      name: 'buildingId',
38
+      render: <BuildSelect disabled={disable}/>,
39
+      value: dynamicData.buildingId,
40
+      rules: [
41
+        { required: true, message: '请选择项目' },
42
+      ],
43
+    },
44
+    {
45
+      label: '活动标题',
46
+      name: 'activityName',
47
+      type: FieldTypes.Text,
48
+      value: dynamicData.activityName,
49
+      rules: [
50
+        { required: true, message: '请输入活动标题' },
51
+      ]
52
+    },
53
+    {
54
+      label: '拼团详情主图',
55
+      name: 'mainImg',
56
+      type: FieldTypes.ImageUploader,
57
+      value: dynamicData.mainImg,
58
+      rules: [
59
+        { required: true, message: '请输入拼团详情主图' },
60
+      ],
61
+      help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:拼团活动详情',
62
+    },
63
+    {
64
+      label: '拼团封面图1',
65
+      name: 'listImg',
66
+      type: FieldTypes.ImageUploader,
67
+      value: dynamicData.listImg,
68
+      rules: [
69
+        { required: true, message: '请输入拼团封面图1' },
70
+      ],
71
+      help: '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于:活动列表/首页推荐',
72
+    },
73
+    {
74
+      label: '拼团封面图2',
75
+      name: 'bannerListImg',
76
+      type: FieldTypes.ImageUploader,
77
+      value: dynamicData.bannerListImg,
78
+      rules: [
79
+        { required: true, message: '请输入拼团封面图2' },
80
+      ],
81
+      help: '建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页',
82
+    },
83
+    {
84
+      label: '活动时间',
85
+      name: 'activityTime',
86
+      type: FieldTypes.RangePicker,
87
+      value: dynamicData.startTime != null ? [moment(dynamicData.startTime, 'YYYY-MM-DD HH:mm'), moment(dynamicData.endTime, 'YYYY-MM-DD HH:mm')] : null,
88
+      props: { showTime: { format: 'HH:mm' } },
89
+      rules: [
90
+        { required: true, message: '请选择活动时间' },
91
+      ],
92
+    },
93
+    {
94
+      label: '成团人数',
95
+      name: 'groupBuyPeople',
96
+      type: FieldTypes.Text,
97
+      value: dynamicData.groupBuyPeople,
98
+      props: { disabled: activityStatus === 0 },
99
+      help: '注:成团所需人数',
100
+      rules: [
101
+        { required: true, message: '请输入成团人数' },
102
+      ]
103
+    },
104
+    {
105
+      label: '所需积分',
106
+      name: 'integral',
107
+      type: FieldTypes.Text,
108
+      value: dynamicData.integral,
109
+      props: { disabled: activityStatus === 0 },
110
+      help: `注:用户平均积分${scoreData.averageScore}`,
111
+      rules: [
112
+        { required: true, message: '请输入所需积分' },
113
+      ]
114
+    },
115
+    {
116
+      label: '活动说明',
117
+      name: 'descImg',
118
+      type: FieldTypes.ImageUploader,
119
+      value: dynamicData.descImg,
120
+      rules: [
121
+        { required: true, message: '请输入活动说明' },
122
+      ],
123
+      help: '建议宽度:750px,高度不限,格式:jpg,用于活动详情',
124
+    },
125
+    {
126
+      label: '权重',
127
+      name: 'heavy',
128
+      type: FieldTypes.Number,
129
+      render: <Input type="number" style={{ width: 80}} />,
130
+      value: dynamicData.heavy,
131
+      rules: [
132
+        { required: true, message: '请输入权重' },
133
+      ],
134
+      help: '数字越大越靠前',
135
+    },
136
+  ]
56 137
 
57
-    // 详情
58
-    const getDynamicData = (groupActivityId) => {
59
-      request({ ...apis.groupActivity.details, urlData: { id: groupActivityId } }).then((data) => {
60
-        setDynamicData(data)
61
-        setActivityStatus(data.activityStatus)
62
-        setDisable(data.activityStatus === 0 ? true : false)
63
-      })
138
+  function compareDate(dateTime1, dateTime2) {
139
+    return new Date(dateTime1) > new Date(dateTime2);
64 140
   }
65 141
 
66
-  const radioOnChange = e => {
67
-    console.log(e.target.value)
68
-    setDynamicData({ ...dynamicData, isEnlist: e.target.value })
69
-  }
142
+  const handleSubmit = val => {
143
+    const { activityTime, signupTime, ...submitValue } = val
70 144
 
71
-  const Basic = props => {
72
-    const fields = [
73
-      {
74
-        label: '选择项目',
75
-        name: 'buildingId',
76
-        render: <BuildSelect disabled={disable}/>,
77
-        value: dynamicData.buildingId,
78
-        rules: [
79
-          { required: true, message: '请选择项目' },
80
-        ],
81
-      },
82
-      {
83
-        label: '活动标题',
84
-        name: 'activityName',
85
-        type: FieldTypes.Text,
86
-        value: dynamicData.activityName,
87
-        rules: [
88
-          { required: true, message: '请输入活动标题' },
89
-        ]
90
-      },
91
-      {
92
-        label: '拼团详情主图',
93
-        name: 'mainImg',
94
-        type: FieldTypes.ImageUploader,
95
-        value: dynamicData.mainImg,
96
-        rules: [
97
-          { required: true, message: '请输入拼团详情主图' },
98
-        ],
99
-        help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:拼团活动详情',
100
-      },
101
-      {
102
-        label: '拼团封面图1',
103
-        name: 'listImg',
104
-        type: FieldTypes.ImageUploader,
105
-        value: dynamicData.listImg,
106
-        rules: [
107
-          { required: true, message: '请输入拼团封面图1' },
108
-        ],
109
-        help: '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于:活动列表/首页推荐',
110
-      },
111
-      {
112
-        label: '拼团封面图2',
113
-        name: 'bannerListImg',
114
-        type: FieldTypes.ImageUploader,
115
-        value: dynamicData.bannerListImg,
116
-        rules: [
117
-          { required: true, message: '请输入拼团封面图2' },
118
-        ],
119
-        help: '建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页',
120
-      },
121
-      {
122
-        label: '活动时间',
123
-        name: 'activityTime',
124
-        type: FieldTypes.RangePicker,
125
-        value: dynamicData.startTime != null ? [moment(dynamicData.startTime, 'YYYY-MM-DD HH:mm'), moment(dynamicData.endTime, 'YYYY-MM-DD HH:mm')] : null,
126
-        props: { showTime: { format: 'HH:mm' } },
127
-        rules: [
128
-          { required: true, message: '请选择活动时间' },
129
-        ],
130
-      },
131
-      {
132
-        label: '成团人数',
133
-        name: 'groupBuyPeople',
134
-        type: FieldTypes.Text,
135
-        value: dynamicData.groupBuyPeople,
136
-        props: {disabled: activityStatus === 0 ? true : false },
137
-        help: '注:成团所需人数',
138
-        rules: [
139
-          { required: true, message: '请输入成团人数' },
140
-        ]
141
-      },
142
-      {
143
-        label: '所需积分',
144
-        name: 'integral',
145
-        type: FieldTypes.Text,
146
-        value: dynamicData.integral,
147
-        props: {disabled: activityStatus === 0 ? true : false },
148
-        help: '注:用户平均积分' + scoreData.averageScore,
149
-        rules: [
150
-          { required: true, message: '请输入所需积分' },
151
-        ]
152
-      },
153
-      {
154
-        label: '活动说明',
155
-        name: 'descImg',
156
-        type: FieldTypes.ImageUploader,
157
-        value: dynamicData.descImg,
158
-        rules: [
159
-          { required: true, message: '请输入活动说明' },
160
-        ],
161
-        help: '建议宽度:750px,高度不限,格式:jpg,用于活动详情',
162
-      },
163
-      {
164
-        label: '权重',
165
-        name: 'heavy',
166
-        type: FieldTypes.Number,
167
-        render: <Input type="number" style={{ width: 80}} />,
168
-        value: dynamicData.heavy,
169
-        rules: [
170
-          { required: true, message: '请输入权重' },
171
-        ],
172
-        help: '数字越大越靠前',
173
-      },
174
-    ]
145
+    const [startTime, endTime] = activityTime
146
+    submitValue.startTime = moment(startTime).format('YYYY-MM-DD HH:mm');
147
+    submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
175 148
 
176
-    function compareDate(dateTime1, dateTime2) {
177
-      var formatDate1 = new Date(dateTime1)
178
-      var formatDate2 = new Date(dateTime2)
179
-      if (formatDate1 > formatDate2) {
180
-        return true;
181
-      }
182
-      else {
183
-        return false;
149
+    if (groupActivityId) {
150
+      const nowDate = new Date()
151
+      if (!compareDate(nowDate, startTime)) {
152
+        message.info('修改后的开始时间不得大于当前时间(会存在已经成功助力或者发起助力的用户)')
153
+        return
184 154
       }
155
+      submitValue.groupActivityId = groupActivityId
156
+      request({ ...apis.groupActivity.update, data: submitValue }).then(data => {
157
+        message.info('保存成功')
158
+        // cancelPage()
159
+      }).catch(() => {
160
+        // message.info(err.msg || err.message)
161
+      })
162
+    } else {
163
+      request({ ...apis.groupActivity.add, data: submitValue }).then(data => {
164
+        router.push({
165
+          pathname: '/activity/groupActivity/editGroupActivity',
166
+          query: {
167
+            groupActivityId: data,
168
+          },
169
+        });
170
+        message.info("保存成功")
171
+        // cancelPage()
172
+      }).catch(() => {
173
+        // message.info(err.msg || err.message)
174
+      })
185 175
     }
176
+  }
186 177
 
187
-    const handleSubmit = val => {
188
-      const { activityTime, signupTime, ...submitValue } = val
189
-      console.log('val', val)
190
-      const [startTime, endTime] = activityTime
191
-      submitValue.startTime = moment(startTime).format('YYYY-MM-DD HH:mm');
192
-      submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
193
-      console.log('submit data --->', submitValue)
194
-      if (groupActivityId) {
178
+  return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
179
+}
195 180
 
196
-        const nowDate = new Date()
197
-        if (!compareDate(nowDate, startTime)) {
181
+const Poster = props => {
182
+  const { groupActivityId } = props;
183
+  const [inputValue, changeInput] = useState('')
184
+  const [textAreaValue, changeTextArea] = useState('')
185
+  const [imgValue, changeImg] = useState('')
186
+  const [posterId, setPosterId] = useState('')
187
+  // const [miniappName, setMiniappName] = useState('')
198 188
 
199
-          message.info("修改后的开始时间不得大于当前时间(会存在已经成功助力或者发起助力的用户)")
200
-          return
189
+  useEffect(() => {
190
+    if (groupActivityId) {
191
+      request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then(data => {
192
+        if (data.length > 0) {
193
+          setPosterId(data[0].posterId)
194
+          changeImg(data[0].posterImg)
195
+          changeTextArea(data[0].posterDescription)
196
+          changeInput(data[0].posterTitle)
201 197
         }
202
-        submitValue.groupActivityId = groupActivityId
203
-        request({ ...apis.groupActivity.update, data: submitValue }).then((data) => {
204
-          message.info("保存成功")
205
-          // cancelPage()
206
-        }).catch((err) => {
207
-          // message.info(err.msg || err.message)
208
-        })
209
-      } else {
210
-        request({ ...apis.groupActivity.add, data: submitValue }).then((data) => {
211
-          router.push({
212
-            pathname: '/activity/groupActivity/editGroupActivity',
213
-            query: {
214
-              groupActivityId: data,
215
-            },
216
-          });
217
-          message.info("保存成功")
218
-          // cancelPage()
219
-        }).catch((err) => {
220
-          // message.info(err.msg || err.message)
221
-        })
222
-      }
198
+      }).catch(err => {
199
+        message.info(err.msg || err.message)
200
+      })
223 201
     }
224 202
 
225
-    return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
226
-  }
203
+    // getMiniappName()
204
+  }, [])
227 205
 
228
-  const Poster = (props) => {
229
-    const [inputValue, changeInput] = useState('')
230
-    const [textAreaValue, changeTextArea] = useState('')
231
-    const [imgValue, changeImg] = useState('')
232
-    const [posterId, setPosterId] = useState('')
206
+  // // 获取小程序名称
207
+  // function getMiniappName() {
208
+  //   request({ ...apis.building.getMiniappName }).then(res => {
209
+  //     setMiniappName(res)
210
+  //   })
211
+  // }
233 212
 
213
+  const submitPoster = () => {
234 214
     if (groupActivityId) {
235
-      console.log(groupActivityId, 'groupActivityId')
236
-      useEffect(() => {
237
-        request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then((data) => {
238
-          if (data.length > 0) {
239
-            setPosterId(data[0].posterId)
240
-            changeImg(data[0].posterImg)
241
-            changeTextArea(data[0].posterDescription)
242
-            changeInput(data[0].posterTitle)
243
-          }
244
-        }).catch((err) => {
215
+      if (posterId) {
216
+        request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: groupActivityId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then(data => {
217
+          message.info('保存成功')
218
+        }).catch(err => {
245 219
           message.info(err.msg || err.message)
246 220
         })
247
-        getMiniappName()
248
-      }, [])
249
-    }else{
250
-      getMiniappName()
251
-    }
252
-    // 获取小程序名称
253
-    const [miniappName, setMiniappName] = useState('')
254
-    function getMiniappName() {
255
-      request({ ...apis.building.getMiniappName }).then(res => {
256
-        console.log(res, "0000000000000")
257
-        setMiniappName(res)
258
-      })
259
-    }
260
-
261
-    const submitPoster = () => {
262
-      if (groupActivityId) {
263
-        if (posterId) {
264
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: groupActivityId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
265
-            message.info("保存成功")
266
-          }).catch((err) => {
267
-            message.info(err.msg || err.message)
268
-          })
269
-        } else {
270
-          request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
271
-            setPosterId(data.posterId)
272
-            message.info("保存成功")
273
-          }).catch((err) => {
274
-            message.info(err.msg || err.message)
275
-          })
276
-        }
277 221
       } else {
278
-        message.warn("请先保存基本信息数据")
222
+        request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then(data => {
223
+          setPosterId(data.posterId)
224
+          message.info('保存成功')
225
+        }).catch(err => {
226
+          message.info(err.msg || err.message)
227
+        })
279 228
       }
229
+    } else {
230
+      message.warn('请先保存基本信息数据')
280 231
     }
232
+  }
281 233
 
282
-    return <div>
283
-      <div style={{ display: 'flex' }}>
284
-        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
285
-          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
286
-            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
287
-            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
288
-              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
289
-              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
290
-              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
291
-              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
292
-            </div>
293
-            <p style={{
294
-              margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
295
-              display: '-webkit-box', lineClamp: '3', height: '60px',
296
-              WebkitLineClamp: '2',
297
-              WebkitBoxOrient: 'vertical',
298
-              overflow: 'hidden',
299
-              textOverflow: 'ellipsis'
300
-            }}>{inputValue ? inputValue : '海报标题'}</p>
301
-
302
-            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
303
-            <p style={{
304
-              margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
305
-              display: '-webkit-box', lineClamp: '3', height: '72px',
306
-              WebkitLineClamp: '3',
307
-              WebkitBoxOrient: 'vertical',
308
-              overflow: 'hidden',
309
-              textOverflow: 'ellipsis'
310
-            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
311
-            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
312
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
313
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
314
-              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
315
-            </div>
234
+  return <div>
235
+    <div style={{ display: 'flex' }}>
236
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
237
+        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
238
+          <img style={{ width: '100%', height: '300px' }} src={imgValue || poster1} alt="" />
239
+          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
240
+            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
241
+            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
242
+            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
243
+            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
316 244
           </div>
317
-          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
318
-        </div>
245
+          <p style={{
246
+            margin: '10px 20px',
247
+            fontSize: '20px',
248
+            color: '#222',
249
+            fontWeight: '600',
250
+            display: '-webkit-box',
251
+            lineClamp: '3',
252
+            height: '60px',
253
+            WebkitLineClamp: '2',
254
+            WebkitBoxOrient: 'vertical',
255
+            overflow: 'hidden',
256
+            textOverflow: 'ellipsis',
257
+          }}>{inputValue || '海报标题'}</p>
319 258
 
320
-        <div >
321
-          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
322
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团海报图</p>
323
-            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
324
-          </div>
325
-          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600,比例5:4,格式:jpg,用于拼团活动海报</p>
326
-          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
327
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
328
-            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
329
-          </div>
330
-          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
331
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
332
-            <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
259
+          <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
260
+          <p style={{
261
+            margin: '16px 20px 28px 20px',
262
+            fontSize: '17px',
263
+            color: '#999',
264
+            display: '-webkit-box',
265
+            lineClamp: '3',
266
+            height: '72px',
267
+            WebkitLineClamp: '3',
268
+            WebkitBoxOrient: 'vertical',
269
+            overflow: 'hidden',
270
+            textOverflow: 'ellipsis',
271
+          }}>{ textAreaValue || '海报描述'}</p>
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>
274
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
275
+            <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
333 276
           </div>
277
+        </div>
278
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
279
+      </div>
334 280
 
281
+      <div >
282
+        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
283
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团海报图</p>
284
+          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
285
+        </div>
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' }}>
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)} />
335 290
         </div>
291
+        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
292
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
293
+          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
294
+        </div>
295
+
336 296
       </div>
337
-      <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
338
-      <Button onClick={() => cancelPage()}>取消</Button>
339 297
     </div>
340
-
341
-  }
298
+    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
299
+    <Button onClick={() => cancelPage()}>取消</Button>
300
+  </div>
301
+}
342 302
 
343 303
 
304
+const Share = props => {
305
+  const { groupActivityId } = props
306
+  const [inputValue, changeInput] = useState('')
307
+  const [imgValue, changeImg] = useState('')
308
+  const [shareContentId, setShareContentId] = useState('')
344 309
 
345
-  const Share = (props) => {
346
-    const [inputValue, changeInput] = useState('')
347
-    const [imgValue, changeImg] = useState('')
348
-    const [shareContentId, setShareContentId] = useState('')
310
+  useEffect(() => {
311
+      if (groupActivityId) {
312
+      request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then(data => {
313
+        if (data.length > 0) {
314
+          setShareContentId(data[0].shareContentId)
315
+          changeImg(data[0].shareContentImg)
316
+          changeInput(data[0].shareContentTitle)
317
+        }
318
+      }).catch(err => {
319
+        message.info(err.msg || err.message)
320
+      })
321
+    }
322
+  }, [])
349 323
 
324
+  const submitShare = () => {
350 325
     if (groupActivityId) {
351
-      useEffect(() => {
352
-        request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' }, }).then((data) => {
353
-          console.log(data, "2222")
354
-          if (data.length > 0) {
355
-            setShareContentId(data[0].shareContentId)
356
-            changeImg(data[0].shareContentImg)
357
-            changeInput(data[0].shareContentTitle)
358
-          }
359
-        }).catch((err) => {
326
+      if (shareContentId) {
327
+        request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
328
+          message.info('保存成功')
329
+        }).catch(err => {
360 330
           message.info(err.msg || err.message)
361 331
         })
362
-      }, [])
363
-    }
364
-
365
-    const submitShare = () => {
366
-      if (groupActivityId) {
367
-        if (shareContentId) {
368
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
369
-            message.info("保存成功")
370
-          }).catch((err) => {
371
-            message.info(err.msg || err.message)
372
-          })
373
-        } else {
374
-          request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
375
-            setShareContentId(data.shareContentId)
376
-            message.info("保存成功")
377
-          }).catch((err) => {
378
-            message.info(err.msg || err.message)
379
-          })
380
-        }
381 332
       } else {
382
-        message.warn("请先保存基本信息数据")
333
+        request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then(data => {
334
+          setShareContentId(data.shareContentId)
335
+          message.info('保存成功')
336
+        }).catch(err => {
337
+          message.info(err.msg || err.message)
338
+        })
383 339
       }
340
+    } else {
341
+      message.warn('请先保存基本信息数据')
384 342
     }
343
+  }
385 344
 
386
-    return <div style={{ padding: '20px' }}>
387
-      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
388
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
389
-        <div>
390
-          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
391
-          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
392
-          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
393
-        </div>
394
-      </div>
395
-      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
396
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
397
-        <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
398
-      </div>
399
-      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
400
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团分享图</p>
401
-        <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
345
+  return <div style={{ padding: '20px' }}>
346
+    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
347
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
348
+      <div>
349
+        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
350
+        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue || '置业V客厅 精准获客平台'}</p>
351
+        <img style={{ width: '200px', height: '160px' }} src={imgValue || poster2} alt="" />
402 352
       </div>
403
-      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
404
-      <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
405
-      <Button onClick={() => cancelPage()}>取消</Button>
406 353
     </div>
354
+    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
355
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
356
+      <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
357
+    </div>
358
+    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
359
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团分享图</p>
360
+      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
361
+    </div>
362
+    <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>
364
+    <Button onClick={() => cancelPage()}>取消</Button>
365
+  </div>
366
+}
367
+
368
+
369
+/**
370
+ *
371
+ *
372
+ * @param {*} props
373
+ * @returns
374
+ */
375
+const Edit = props => {
376
+  const [tab, changeTab] = useState('basic')
377
+  // 判断是否展示助力次数的输入框
378
+  const { groupActivityId } = props.location.query
379
+  const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
380
+  const [scoreData, setScoreData] = useState({})
381
+  const [activityStatus, setActivityStatus] = useState({})
382
+  const [disable, setDisable] = useState(false)
383
+
384
+  // 详情
385
+  const getDynamicData = id => {
386
+    request({ ...apis.groupActivity.details, urlData: { id } }).then(data => {
387
+      setDynamicData(data)
388
+      setActivityStatus(data.activityStatus)
389
+      setDisable(data.activityStatus === 0)
390
+    })
407 391
   }
408 392
 
393
+  useEffect(() => {
394
+    request(apis.groupActivity.avgScore).then(data => {
395
+      setScoreData(data);
396
+    })
397
+  }, [])
398
+
399
+  useEffect(() => {
400
+    if (groupActivityId) {
401
+      getDynamicData(groupActivityId);
402
+    }
403
+  }, [groupActivityId])
404
+
405
+  // const radioOnChange = e => {
406
+  //   setDynamicData({ ...dynamicData, isEnlist: e.target.value })
407
+  // }
408
+
409 409
   return (
410 410
     <div>
411 411
       <div>
@@ -416,14 +416,14 @@ const Edit = props => {
416 416
         </Radio.Group>
417 417
       </div>
418 418
       <div>
419
-        {tab === 'basic' && <Basic />}
420
-        {tab === 'poster' && <Poster />}
419
+        {tab === 'basic' && <Basic dynamicData={dynamicData} disable={disable} activityStatus={activityStatus} scoreData={scoreData} groupActivityId={groupActivityId} />}
420
+        {tab === 'poster' && <Poster groupActivityId={groupActivityId}/>}
421 421
         {tab === 'share' && <Share />}
422 422
       </div>
423 423
       <Prompt message={location =>
424
-        location.pathname.startsWith("/activity/groupActivity")
424
+        (location.pathname.startsWith('/activity/groupActivity')
425 425
           ? true
426
-          : localStorage.removeItem("groupActivePageParams")} />
426
+          : localStorage.removeItem('groupActivePageParams'))} />
427 427
     </div>
428 428
   );
429 429
 }

+ 1
- 0
src/pages/channel/brokerList.jsx Прегледај датотеку

@@ -43,6 +43,7 @@ const columns = [
43 43
     dataIndex: 'nickname',
44 44
     key: 'nickname',
45 45
     align: 'center',
46
+    render: (text, list) => <><span>{ list.name || list.nickname }</span></>,
46 47
   },
47 48
   {
48 49
     title: '电话',

+ 11
- 7
src/pages/channel/channelList.jsx Прегледај датотеку

@@ -68,7 +68,7 @@ const columns = [
68 68
       render: (text, record) => <a style={ { color: '#66B3FF' } } onClick= {() => toBroker(record)} >{ record.brokerCount }</a>,
69 69
   },
70 70
   {
71
-    title: '推荐客户有效',
71
+    title: '推荐客户有效',
72 72
     dataIndex: 'recommendCount',
73 73
     key: 'recommendCount',
74 74
     align: 'center',
@@ -144,10 +144,12 @@ const header = props => {
144 144
   }
145 145
   // 查询
146 146
   function queryList() {
147
+   
147 148
     getList({ pageNum: 1, pageSize: 10, channelId: channelNmae })
148 149
   }
149 150
   // 重置
150 151
   function reset() {
152
+    setChannelNmae()
151 153
     getList({ pageNum: 1, pageSize: 10 })
152 154
   }
153 155
 
@@ -163,11 +165,13 @@ const header = props => {
163 165
 
164 166
   // 分页
165 167
   function onChange(pageNumber) {
166
-    props.form.validateFields((err, values) => {
167
-      if (!err) {
168
-        getList({ pageNum: pageNumber, pageSize: 10, ...values })
169
-      }
170
-    });
168
+    getList({ pageNum: pageNumber, pageSize: 10, channelId: channelNmae })
169
+    // getList({ pageNum: pageNumber, pageSize: 10, ...values })
170
+    // props.form.validateFields((err, values) => {
171
+    //   if (!err) {
172
+    //     getList({ pageNum: pageNumber, pageSize: 10, ...values })
173
+    //   }
174
+    // });
171 175
   }
172 176
 
173 177
   function onChannelChange(value) {
@@ -193,7 +197,7 @@ const header = props => {
193 197
         <AuthButton name="admin.channel.search" noRight={null}>
194 198
           <Button type="primary" onClick={() => queryList()}>查询</Button>
195 199
           </AuthButton>
196
-          {/* <Button onClick={() => reset() }>重置</Button> */}
200
+          <Button onClick={() => reset() } style={{marginLeft:'8px'}}>重置</Button>
197 201
         </div>
198 202
       </div>
199 203
       <AuthButton name="admin.channel.post" noRight={null}>

+ 74
- 53
src/pages/channel/independentList/index.jsx Прегледај датотеку

@@ -24,11 +24,11 @@ class ModalTable extends React.Component {
24 24
   }
25 25
 
26 26
   // 挂载之后
27
-  componentDidMount () {
27
+  componentDidMount() {
28 28
     this.getList({ pageNumber: 1, pageSize: 5 })
29 29
   }
30 30
 
31
-  componentDidUpdate (preProps, preState) {
31
+  componentDidUpdate(preProps, preState) {
32 32
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
33 33
       this.getList({ pageNumber: 1, pageSize: 5 })
34 34
       this.setState({ visibleData: this.props.visibleData });
@@ -37,16 +37,16 @@ class ModalTable extends React.Component {
37 37
 
38 38
   // 弹框确定按钮
39 39
   // eslint-disable-next-line react/sort-comp
40
-  handleOk () {
40
+  handleOk() {
41 41
     this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
42 42
   }
43 43
 
44 44
   // 弹框取消按钮
45
-  handleCancel () {
45
+  handleCancel() {
46 46
     this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
47 47
   }
48 48
 
49
-  getList (params) {
49
+  getList(params) {
50 50
     console.log('this.state.visibleData', this.state.visibleData)
51 51
     const { customerId } = this.state.visibleData
52 52
     if (customerId === '' || customerId === undefined) {
@@ -70,25 +70,25 @@ class ModalTable extends React.Component {
70 70
   }
71 71
 
72 72
   // 分页
73
-  onChange (pageNum) {
74
-    props.form.validateFields((err, values) => {
75
-      if (!err) {
76
-        getList({ pageNumber: pageNum, pageSize: 5, ...values })
77
-      }
78
-    });
73
+  onChange(pageNum) {
74
+
75
+    this.getList({ pageNumber: pageNum, pageSize: 5, })
76
+
79 77
   }
80 78
 
81
-  render () {
79
+  render() {
82 80
     const columns = [
83 81
       {
84 82
         title: '头像',
85 83
         // eslint-disable-next-line jsx-a11y/alt-text
86
-        render: (text, records) => <img src={records.picture} width={50} height={50} />,
84
+        render: (text, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
85
+        // render: (text, records) => <img src={records.picture} width={50} height={50} />,
87 86
       },
88 87
       {
89 88
         title: '用户名',
90 89
         dataIndex: 'name',
91 90
         key: 'name',
91
+        // render: (row) => <><span>{console.log(row, 'row')}{row.name || row.nickname}</span></>,
92 92
       },
93 93
       {
94 94
         title: '电话',
@@ -110,20 +110,37 @@ class ModalTable extends React.Component {
110 110
         title: '推荐时间',
111 111
         dataIndex: 'createDate',
112 112
         key: 'createDate',
113
-        render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
113
+        render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
114 114
       },
115 115
       {
116 116
         title: '状态',
117 117
         // eslint-disable-next-line consistent-return
118 118
         render: (text, records) => {
119 119
           console.log("retrun", records)
120
-          if (records.status === 1) { if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
120
+          //     if (records.status === 1) { return '报备' }
121
+          // if (records.status === 2) { return '推荐' }
122
+          // if (records.status === 3) { return '认购' }
123
+          // if (records.status === 4) { return '签约' }
124
+          // if (records.verifyStatus === 1) { return '待审核' }
125
+          // if (records.verifyStatus === 2) { return '审核同意' }
126
+          // if (records.verifyStatus === 3) { return '签约' }
127
+          // if (records.status === 1) { if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
128
+          // if (records.status === 2) { return '到访' }
129
+          // if (records.status === 3) { return '认购' }
130
+          // if (records.status === 4) { return '签约' }
131
+          // if (records.verifyStatus === 1) { return '待审核' }
132
+          // if (records.verifyStatus === 2) { return '审核同意' }
133
+          // if (records.verifyStatus === 3) { return '签约' }
134
+          if (records.status === 1) {
135
+            if (records.verifyStatus === 0) { return '待审核' }
136
+            if (records.verifyStatus === 1) { return '报备' }
137
+            // if (records.reportRecommendStatus === 1) { return '报备' }
138
+            // if (records.reportRecommendStatus === 2) { return '推荐' }}
139
+            if (records.verifyStatus === 2) { return '审核驳回' }
140
+           }
121 141
           if (records.status === 2) { return '到访' }
122 142
           if (records.status === 3) { return '认购' }
123 143
           if (records.status === 4) { return '签约' }
124
-          if (records.verifyStatus === 1) { return '待审核' }
125
-          if (records.verifyStatus === 2) { return '审核同意' }
126
-          if (records.verifyStatus === 3) { return '签约' }
127 144
           // reportRecommendStatus
128 145
         },
129 146
       },
@@ -160,13 +177,13 @@ class InviteTable extends React.Component {
160 177
   }
161 178
 
162 179
   // 挂载之后
163
-  componentDidMount () {
164
-    
180
+  componentDidMount() {
181
+
165 182
   }
166 183
 
167
-  componentDidUpdate (preProps, preState) {
184
+  componentDidUpdate(preProps, preState) {
168 185
     const { customerId } = this.props.visibleData
169
-    
186
+
170 187
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
171 188
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
172 189
       this.setState({ visibleData: this.props.visibleData });
@@ -175,18 +192,18 @@ class InviteTable extends React.Component {
175 192
 
176 193
   // 弹框确定按钮
177 194
   // eslint-disable-next-line react/sort-comp
178
-  handleOk () {
195
+  handleOk() {
179 196
     this.setState({ dataSource: { records: [] } })
180 197
     this.props.onCancel()
181 198
   }
182 199
 
183 200
   // 弹框取消按钮
184
-  handleCancel () {
201
+  handleCancel() {
185 202
     this.setState({ dataSource: { records: [] } })
186 203
     this.props.onCancel()
187 204
   }
188 205
 
189
-  getList (params) {
206
+  getList(params) {
190 207
     const { id } = params
191 208
     console.log(id)
192 209
     if (id === '' || id === undefined) {
@@ -196,16 +213,16 @@ class InviteTable extends React.Component {
196 213
       this.setState({ dataSource: res })
197 214
     }).catch(err => {
198 215
       // eslint-disable-next-line no-unused-expressions
199
-    
216
+
200 217
     })
201 218
   }
202 219
 
203 220
   // 分页
204
-  onChange (pageNum) {
221
+  onChange(pageNum) {
205 222
     this.getList({ pageNumber: pageNum, pageSize: 5 })
206 223
   }
207 224
 
208
-  render () {
225
+  render() {
209 226
     const columns = [
210 227
       {
211 228
         title: '头像',
@@ -219,7 +236,7 @@ class InviteTable extends React.Component {
219 236
         dataIndex: 'nickname',
220 237
         key: 'nickname',
221 238
         align: 'center',
222
-        render: text => <a>{text}</a>,
239
+        render: (row) => <><span>{console.log(row, 'row')}{row.name || row.nickname}</span></>,
223 240
       },
224 241
       {
225 242
         title: '电话',
@@ -259,8 +276,8 @@ class InviteTable extends React.Component {
259 276
  * @param {*} props
260 277
  * @returns
261 278
  */
262
-function body (props) {
263
-  const { getFieldDecorator } = props.form
279
+function body(props) {
280
+  const { getFieldDecorator, getFieldsValue } = props.form
264 281
 
265 282
   // eslint-disable-next-line react-hooks/rules-of-hooks
266 283
   const [dataSource, setDataSource] = useState({ records: [] })
@@ -271,7 +288,7 @@ function body (props) {
271 288
   }, [])
272 289
 
273 290
 
274
-  function openNotificationWithIcon (type, message) {
291
+  function openNotificationWithIcon(type, message) {
275 292
     notification[type]({
276 293
       message,
277 294
       description:
@@ -279,7 +296,7 @@ function body (props) {
279 296
     });
280 297
   }
281 298
 
282
-  function getList (params) {
299
+  function getList(params) {
283 300
     // 网路请求
284 301
     request({ ...apis.customer.agents, params: { ...params } }).then(res => {
285 302
       setDataSource(res)
@@ -289,7 +306,7 @@ function body (props) {
289 306
   }
290 307
 
291 308
   // 提交事件
292
-  function handleSubmit (e) {
309
+  function handleSubmit(e) {
293 310
     e.preventDefault();
294 311
     props.form.validateFields((err, values) => {
295 312
       if (!err) {
@@ -302,24 +319,24 @@ function body (props) {
302 319
   // eslint-disable-next-line react-hooks/rules-of-hooks
303 320
   const [gInviteData, setGInviteData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
304 321
   // Change 事件
305
-  function handleSelectChange (e) {
322
+  function handleSelectChange(e) {
306 323
     // eslint-disable-next-line no-console
307 324
     console.log(e)
308 325
   }
309
-  function gM (row) {
326
+  function gM(row) {
310 327
     setGVisibleData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
311 328
 
312 329
     setGInviteData({ visible: false })
313 330
   }
314 331
 
315
-  function Invite (row) {
332
+  function Invite(row) {
316 333
     setGInviteData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
317 334
 
318 335
     setGVisibleData({ visible: false })
319 336
   }
320 337
 
321 338
   // 分页
322
-  function onChange (pageNum) {
339
+  function onChange(pageNum) {
323 340
     // eslint-disable-next-line react-hooks/rules-of-hooks
324 341
     getList({ pageNumber: pageNum, pageSize: 10 })
325 342
   }
@@ -327,11 +344,12 @@ function body (props) {
327 344
   /**
328 345
     * 重置搜索
329 346
     */
330
-  function handleReset () {
347
+  function handleReset() {
331 348
     props.form.resetFields();
349
+    getList({ pageNumber: 1, pageSize: 10 })
332 350
   }
333 351
 
334
-  function toAudit (cuurentId) {
352
+  function toAudit(cuurentId) {
335 353
     router.push({
336 354
       pathname: '/customer/recommendCustomer/audit',
337 355
       query: {
@@ -340,8 +358,10 @@ function body (props) {
340 358
     })
341 359
   }
342 360
 
343
-  function exportIndependen () {
344
-    request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob' })
361
+  function exportIndependen() {
362
+    const fieldsValue = getFieldsValue()
363
+    console.log('fieldsValue', fieldsValue)
364
+    request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob', params: { ...fieldsValue } })
345 365
       .then(response => {
346 366
         download(response)
347 367
       }).catch(error => {
@@ -349,7 +369,7 @@ function body (props) {
349 369
       })
350 370
   }
351 371
 
352
-  function download (data) {
372
+  function download(data) {
353 373
     if (!data) {
354 374
       return
355 375
     }
@@ -373,6 +393,7 @@ function body (props) {
373 393
       title: '姓名',
374 394
       dataIndex: 'nickname',
375 395
       key: 'nickname',
396
+      render: (_, record) => <><span>{record.name || record.nickname}</span></>,
376 397
     },
377 398
     {
378 399
       title: '电话',
@@ -396,7 +417,7 @@ function body (props) {
396 417
       title: '所属渠道',
397 418
       dataIndex: 'channelName',
398 419
       key: 'channelName',
399
-      render: (_, record) => <><span>{record.channelName }</span></>,
420
+      render: (_, record) => <><span>{record.channelName}</span></>,
400 421
     },
401 422
     {
402 423
       title: '操作',
@@ -436,16 +457,16 @@ function body (props) {
436 457
   return (
437 458
     <>
438 459
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
439
-      <Form.Item>
460
+        <Form.Item>
440 461
           {getFieldDecorator('channelId')(
441
-           <ChannelSelect />
442
-          //   <Select defaultValue="渠道名称" style={{ width: 180 }} onChange={handleChange}>
443
-          //   <option value="">全部</option>
444
-          //   {data.channelNmae.map(Item =>
445
-          //     <Option value={Item.channelId}> {Item.channelName} </Option>,
446
-          //   )}
447
-      
448
-          // </Select>,
462
+            <ChannelSelect />
463
+            //   <Select defaultValue="渠道名称" style={{ width: 180 }} onChange={handleChange}>
464
+            //   <option value="">全部</option>
465
+            //   {data.channelNmae.map(Item =>
466
+            //     <Option value={Item.channelId}> {Item.channelName} </Option>,
467
+            //   )}
468
+
469
+            // </Select>,
449 470
           )}
450 471
         </Form.Item>
451 472
         <Form.Item>

+ 41
- 24
src/pages/channel/recommendClients.jsx Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select,Avatar } from 'antd';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Avatar } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import channels from './channelList.less';
5 5
 import router from 'umi/router';
@@ -52,14 +52,14 @@ const columns = [
52 52
     // key: 'img',
53 53
     align: 'center',
54 54
 
55
-    render: (text, record) =>  <Avatar shape="square"   src={record.picture} size={64} icon="user" /> ,
55
+    render: (text, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
56 56
   },
57 57
   {
58 58
     title: '用户姓名',
59 59
     dataIndex: 'name',
60 60
     key: 'name',
61 61
     align: 'center',
62
-    render: text => <a>{text}</a>,
62
+    render: (text, record) => <div>{record.name}</div>,
63 63
   },
64 64
   {
65 65
     title: '电话',
@@ -72,7 +72,7 @@ const columns = [
72 72
     dataIndex: 'sex',
73 73
     key: 'sex',
74 74
     align: 'center',
75
-    render: (text, record) => <span>{ record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知' }</span>
75
+    render: (text, record) => <span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span>
76 76
   },
77 77
   {
78 78
     title: '意向项目',
@@ -85,7 +85,7 @@ const columns = [
85 85
     dataIndex: 'createDate',
86 86
     key: 'createDate',
87 87
     align: 'center',
88
-    render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
88
+    render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
89 89
   },
90 90
   {
91 91
     title: '状态',
@@ -94,21 +94,38 @@ const columns = [
94 94
     align: 'center',
95 95
     // eslint-disable-next-line consistent-return
96 96
     render: (text, records) => {
97
-      if (records.status === 1) { return '报备' }
98
-      if (records.status === 2) { return '推荐' }
97
+      //    if (records.status === 1) { if(records.reportRecommendStatus === 0) {return '未审核'} if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
98
+      // if (records.status === 2) { return '到访' }
99
+      // if (records.status === 3) { return '认购' }
100
+      // if (records.status === 4) { return '签约' }
101
+      // if (records.verifyStatus === 1) { return '待审核' }
102
+      // if (records.verifyStatus === 2) { return '审核同意' }
103
+      // if (records.verifyStatus === 3) { return '签约' }
104
+      // if (records.status === 1) { return '报备' }
105
+      // if (records.status === 2) { return '推荐' }
106
+      // if (records.status === 3) { return '认购' }
107
+      // if (records.status === 4) { return '签约' }
108
+      // if (records.verifyStatus === 1) { return '待审核' }
109
+      // if (records.verifyStatus === 2) { return '审核同意' }
110
+      // if (records.verifyStatus === 3) { return '签约' }
111
+      if (records.status === 1) {
112
+        if (records.verifyStatus === 0) { return '待审核' }
113
+        if (records.verifyStatus === 1) { return '报备' }
114
+        // if (records.reportRecommendStatus === 1) { return '报备' }
115
+        // if (records.reportRecommendStatus === 2) { return '推荐' }}
116
+        if (records.verifyStatus === 2) { return '审核驳回' }
117
+       }
118
+      if (records.status === 2) { return '到访' }
99 119
       if (records.status === 3) { return '认购' }
100 120
       if (records.status === 4) { return '签约' }
101
-      if (records.verifyStatus === 1) { return '待审核' }
102
-      if (records.verifyStatus === 2) { return '审核同意' }
103
-      if (records.verifyStatus === 3) { return '签约' }
104
-    },
121
+    }
105 122
   },
106 123
 ];
107 124
 
108 125
 const header = props => {
109 126
   // eslint-disable-next-line react-hooks/rules-of-hooks
110 127
   const [data, setData] = useState({})
111
-//   const [page, changePage] = useState({})
128
+  //   const [page, changePage] = useState({})
112 129
   // eslint-disable-next-line react-hooks/rules-of-hooks
113 130
   useEffect(() => {
114 131
     getListRecommend({ pageNumber: 1, pageSize: 10 })
@@ -129,23 +146,23 @@ const header = props => {
129 146
   function getListRecommend(params) {
130 147
     request({ ...apis.channelList.getListRecommend, urlData: { id: props.location.query.id }, params: { ...params } }).then((data) => {
131 148
       setData(data)
132
-  }).catch((err) => {
149
+    }).catch((err) => {
133 150
       console.log(err)
134 151
       message.info(err.msg || err.message)
135
-  })
152
+    })
136 153
   }
137 154
 
138 155
 
139
-   // 分页
140
- function onChange(pageNum) {
141
-      // eslint-disable-next-line react-hooks/rules-of-hooks
142
-      getListRecommend({ pageNumber: pageNum, pageSize: 9 })
143
-    }
144
-return (
145
-  <>
146
-  <Table dataSource={data.records} rowKey="recommendClist" columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
147
-  </>
148
-)
156
+  // 分页
157
+  function onChange(pageNum) {
158
+    // eslint-disable-next-line react-hooks/rules-of-hooks
159
+    getListRecommend({ pageNumber: pageNum, pageSize: 9 })
160
+  }
161
+  return (
162
+    <>
163
+      <Table dataSource={data.records} rowKey="recommendClist" columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
164
+    </>
165
+  )
149 166
 }
150 167
 
151 168
 function handleMenuClick(e) {

+ 1
- 1
src/pages/customer/customerlist/customerDetail.jsx Прегледај датотеку

@@ -151,7 +151,7 @@ function header(props) {
151 151
               <p className={styles.rightItem}>国家:{dataConsultant && dataConsultant.country}</p>
152 152
               <p className={styles.rightItem}>省份:{dataConsultant && dataConsultant.provience}</p>
153 153
               <p className={styles.rightItem}>城市:{dataConsultant && dataConsultant.city}</p>
154
-              <p className={styles.rightItem}>来访渠道:{data.personFrom ? data.personFrom : "其他"}</p>
154
+              <p className={styles.rightItem}>来渠道:{data.personFrom ? data.personFrom : "其他"}</p>
155 155
               {/* <p className={styles.rightItem}>详细信息:</p> */}
156 156
               {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */}
157 157
               {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}

+ 1
- 1
src/pages/customer/customerlist/publicCustomerDetail.jsx Прегледај датотеку

@@ -139,7 +139,7 @@ function onChange(number) {
139 139
           <div className={publicStyle.Centered}>
140 140
           <p>访问时长:{ data.duration }秒</p>
141 141
           <p>访问次数:{ data.visitTimes }次</p>
142
-          <p className={publicStyle.rightItem}>来访渠道:{data.personFrom ? data.personFrom : '其他'}</p>
142
+          <p className={publicStyle.rightItem}>来渠道:{data.personFrom ? data.personFrom : '其他'}</p>
143 143
           {/* <p>预约人数:{ data.visiteNum }</p> */}
144 144
           </div>
145 145
           {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}

+ 24
- 14
src/pages/recommend/recommendCustomer/audit.jsx Прегледај датотеку

@@ -56,12 +56,13 @@ function body(props) {
56 56
   function getById(currentId) {
57 57
     request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
58 58
       res.reportDate = moment(res.reportDate)
59
-     props.form.setFieldsValue(res)
59
+      props.form.setFieldsValue(res)
60 60
     })
61 61
   }
62 62
 
63 63
   function submitDate(params) {
64 64
     // props.form.setFieldsValue(res)
65
+    console.log(params, 'params')
65 66
     request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
66 67
       // eslint-disable-next-line no-unused-expressions
67 68
       openNotificationWithIcon('success', '操作成功')
@@ -77,7 +78,8 @@ function body(props) {
77 78
     e.preventDefault();
78 79
     props.form.validateFields((err, values) => {
79 80
       if (!err) {
80
-        submitDate({ ...values })
81
+        submitDate({ verifyStatus: '1' })
82
+        // submitDate({ ...values })
81 83
       }
82 84
     });
83 85
   }
@@ -195,20 +197,28 @@ function body(props) {
195 197
               <Option value={1}>已通过</Option>
196 198
               <Option value={2}>已驳回</Option>
197 199
             </Select>,
198
-          )}
200
+          )}onClick={() => submitDate({ verifyStatus: '1' })}
199 201
         </Form.Item> */}
200
-        <Form.Item label="归属置业顾问">
201
-            <Row gutter={8}>
202
-              <Col span={12}>
203
-                {getFieldDecorator('consultantName')(<Input placeholder="请选择置业顾问" />)}
204
-              </Col>
205
-              <Col span={12}>
206
-                <Button onClick={() => showConsultant()}>选择</Button>
207
-              </Col>
208
-            </Row>
202
+        <Form.Item label="归属置业顾问"
203
+      >
204
+          <Row gutter={8}>
205
+            <Col span={12}>
206
+              {getFieldDecorator('consultantName', {
207
+                rules: [
208
+                  {
209
+                    required: true,
210
+                    message: '请选择置业顾问',
211
+                  },
212
+                ],
213
+              })(<Input placeholder="请选择置业顾问" />)}
214
+            </Col>
215
+            <Col span={12}>
216
+              <Button onClick={() => showConsultant()}>选择</Button>
217
+            </Col>
218
+          </Row>
209 219
         </Form.Item>
210 220
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
211
-          <Button type="primary" className={Styles.SubmitButton} onClick={() => submitDate({ verifyStatus: '1' })}>
221
+          <Button type="primary" className={Styles.SubmitButton} htmlType="submit" >
212 222
             审核通过
213 223
           </Button>
214 224
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@@ -219,7 +229,7 @@ function body(props) {
219 229
       </Form>
220 230
 
221 231
       {/* 选择置业顾问 */}
222
-      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)}/>
232
+      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} />
223 233
     </>
224 234
   );
225 235
 }