fangmingyue преди 2 години
родител
ревизия
7ccef7a406

+ 38
- 38
config/proxy.js Целия файл

@@ -1,38 +1,38 @@
1
-/**
2
- * 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
3
- * The agent cannot take effect in the production environment
4
- * so there is no configuration of the production environment
5
- * For details, please see
6
- * https://pro.ant.design/docs/deploy
7
- */
8
-export default {
9
-  dev: {
10
-    '/api/': {
11
-      // target: 'https://xlk.njyz.tech/',
12
-      target: 'http://192.168.89.147:8081',
13
-      // target: 'https://www.newhousehold.cn',
14
-      changeOrigin: true,
15
-      pathRewrite: {
16
-        '^': '',
17
-      },
18
-    },
19
-  },
20
-  test: {
21
-    '/api/': {
22
-      target: 'https://xlk.njyz.tech',
23
-      changeOrigin: true,
24
-      pathRewrite: {
25
-        '^': '',
26
-      },
27
-    },
28
-  },
29
-  pre: {
30
-    '/api/': {
31
-      target: 'your pre url',
32
-      changeOrigin: true,
33
-      pathRewrite: {
34
-        '^': '',
35
-      },
36
-    },
37
-  },
38
-};
1
+/**
2
+ * 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
3
+ * The agent cannot take effect in the production environment
4
+ * so there is no configuration of the production environment
5
+ * For details, please see
6
+ * https://pro.ant.design/docs/deploy
7
+ */
8
+export default {
9
+  dev: {
10
+    '/api/': {
11
+      // target: 'https://xlk.njyz.tech/',
12
+      target: 'http://192.168.89.76:8081',
13
+      // target: 'https://www.newhousehold.cn',
14
+      changeOrigin: true,
15
+      pathRewrite: {
16
+        '^': '',
17
+      },
18
+    },
19
+  },
20
+  test: {
21
+    '/api/': {
22
+      target: 'https://xlk.njyz.tech',
23
+      changeOrigin: true,
24
+      pathRewrite: {
25
+        '^': '',
26
+      },
27
+    },
28
+  },
29
+  pre: {
30
+    '/api/': {
31
+      target: 'your pre url',
32
+      changeOrigin: true,
33
+      pathRewrite: {
34
+        '^': '',
35
+      },
36
+    },
37
+  },
38
+};

BIN
pc-admin.rar Целия файл


+ 284
- 287
src/pages/activity/groupRoomActivity/detail.jsx Целия файл

@@ -1,287 +1,284 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Card, Radio, DatePicker, message, Upload } from 'antd';
3
-
4
-import apis from '@/services/apis';
5
-import moment from 'moment';
6
-import router from 'umi/router';
7
-import BuildSelect from '@/components/SelectButton/BuildSelect';
8
-import request from '@/utils/request';
9
-import yinhao from '@/assets/yinhao.png';
10
-import logo from '@/assets/logo.svg';
11
-import touxiang from '@/assets/touxiang.jpg';
12
-import poster1 from '@/assets/poster1.png';
13
-import poster2 from '@/assets/poster2.png';
14
-import xiaochengxu from '@/assets/xiaochengxu.png';
15
-import AuthButton from '@/components/AuthButton';
16
-import { getImgURL } from '@/utils/image';
17
-import Share from '@/components/Share';
18
-import Poster from '@/components/Poster';
19
-import PictureQRcode from '@/utils/imageQC'
20
-
21
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
-const { TextArea } = Input;
23
-
24
-const formItemLayout = {
25
-  labelCol: { span: 6 },
26
-  wrapperCol: { span: 14 },
27
-};
28
-
29
-const cancelPage = () => {
30
-  router.go('-1');
31
-};
32
-
33
-const getSignList = dynamicId => {
34
-  router.push({
35
-    pathname: '/activity/groupRoomActivity/registrationRecord',
36
-    query: {
37
-      dynamicId,
38
-    },
39
-  });
40
-};
41
-
42
-
43
-
44
-// const newQrcode = row => {
45
-//   const x = new XMLHttpRequest();
46
-//   const resourceUrl = row.qrCode;
47
-//   x.open('GET', resourceUrl, true);
48
-//   x.responseType = 'blob';
49
-//   x.onload = function (e) {
50
-//     const url = window.URL.createObjectURL(x.response);
51
-//     const a = document.createElement('a');
52
-//     a.href = url;
53
-//     a.style.display = 'none';
54
-//     a.download = '活动二维码.png';
55
-//     a.click();
56
-//   };
57
-//   x.send();
58
-// };
59
-
60
-const BasicForm = props => {
61
-  const detailData = props.detailData || {};
62
-
63
-  const radioOnChange = e => {
64
-    // setIsEnlist(e.target.value)
65
-  };
66
-
67
-  const { dynamicId } = props;
68
-  const handleSubmit = e => {
69
-    e.preventDefault();
70
-    props.form.validateFields((err, values) => {
71
-      if (!err) {
72
-        console.log('Received values of form: ', values);
73
-        const { activityTime, signupTime } = values;
74
-        const [startDate, endDate] = activityTime;
75
-        values.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
76
-        values.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
77
-        if (signupTime) {
78
-          const [enlistStart, enlistEnd] = signupTime;
79
-          values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
80
-          values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
81
-        }
82
-        console.log('submit data --->', values);
83
-        if (dynamicId) {
84
-          values.dynamicId = dynamicId;
85
-          request({ ...apis.activity.update, data: values })
86
-            .then(data => {
87
-              message.info('保存成功');
88
-              // router.go(-1)
89
-            })
90
-            .catch(err => {
91
-              message.info(err.msg || err.message);
92
-            });
93
-        } else {
94
-          request({ ...apis.activity.add, data: { ...values } })
95
-            .then(data => {
96
-              message.info('保存成功');
97
-              router.push({
98
-                pathname: '/activity/editActivity',
99
-                query: {
100
-                  dynamicId: data.dynamicId,
101
-                },
102
-              });
103
-              // router.go(-1)
104
-            })
105
-            .catch(err => {
106
-              message.info(err.msg || err.message);
107
-            });
108
-        }
109
-      }
110
-    });
111
-  };
112
-
113
-  const { getFieldDecorator } = props.form;
114
-  return (
115
-    <>
116
-      <Form {...formItemLayout} onSubmit={handleSubmit}>
117
-        <Form.Item label="所属项目">
118
-          {getFieldDecorator('buildingId', {
119
-            initialValue: detailData.buildingId,
120
-            rules: [
121
-              {
122
-                required: true,
123
-                message: '请选择所属项目',
124
-              },
125
-            ],
126
-          })(<BuildSelect disabled />)}
127
-        </Form.Item>
128
-        <Form.Item label="活动封面图1">
129
-          <img src={getImgURL(detailData.listImgUrl)} height="210px" width="375px" />
130
-        </Form.Item>
131
-        {/* <Form.Item label="活动封面图2">
132
-          <img src={getImgURL(detailData.bannerListImg)} height="125px" width="375px" />
133
-        </Form.Item> */}
134
-        <Form.Item label="活动详情主图">
135
-          <img src={getImgURL(detailData.imgUrl)} height="300px" width="375px" />
136
-        </Form.Item>
137
-        <Form.Item label="活动标题">
138
-          <span>{detailData.title}</span>
139
-        </Form.Item>
140
-        <Form.Item label="副标题">
141
-          <span>{detailData.halfTitle}</span>
142
-        </Form.Item>
143
-        <Form.Item label="活动时间">
144
-          <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(
145
-            detailData.endDate,
146
-          ).format('YYYY-MM-DD HH:mm')}`}</span>
147
-        </Form.Item>
148
-        <Form.Item label="活动地点">
149
-          <span>{detailData.address}</span>
150
-        </Form.Item>
151
-        <Form.Item label="活动人数">
152
-          <span>{detailData.personNum}</span>
153
-        </Form.Item>
154
-        <Form.Item label="团房价">
155
-          <span>{detailData.groupBuyPrice}</span>
156
-        </Form.Item>
157
-        {/* <Form.Item label="阅读量">
158
-          <span>{detailData.pvNum}</span>
159
-        </Form.Item>
160
-        <Form.Item label="转发量">
161
-          <span>{detailData.shareNum}</span>
162
-        </Form.Item>
163
-        <Form.Item label="收藏数">
164
-          <span>{detailData.saveNum}</span>
165
-        </Form.Item>
166
-        <Form.Item label="最大报名人数">
167
-          <span>{detailData.maxEnlistByPerson}</span>
168
-        </Form.Item> */}
169
-        <Form.Item label="活动详情">
170
-          <div
171
-            style={{ maxHeight: '500px', overflowY: 'auto' }}
172
-            dangerouslySetInnerHTML={{ __html: detailData.desc }}
173
-          ></div>
174
-        </Form.Item>
175
-        <Form.Item label="报名时间">
176
-          <span>{`${moment(detailData.enlistStart).format('YYYY-MM-DD HH:mm')} —— ${moment(
177
-            detailData.enlistEnd,
178
-          ).format('YYYY-MM-DD HH:mm')}`}</span>
179
-        </Form.Item>
180
-        <Form.Item label="权重">
181
-          <span>{detailData.heavy}</span>
182
-        </Form.Item>
183
-      </Form>
184
-      <div style={{ textAlign: 'center' }}>
185
-        <AuthButton name="admin.SignList.get" noRight={null}>
186
-          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
187
-            <span
188
-              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
189
-              onClick={getSignList.bind(this, detailData.dynamicId)}
190
-            >
191
-              <Button>报名记录</Button>
192
-            </span>
193
-          )}
194
-        </AuthButton>
195
-        <AuthButton name="admin.dymic.qrcode" noRight={null}>
196
-          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
197
-            <span
198
-              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
199
-              // onClick={newQrcode.bind(this, detailData)}
200
-
201
-              onClick={() => {
202
-                PictureQRcode(detailData, '活动二维码')
203
-              }}
204
-            >
205
-              {<Button>下载二维码</Button>}
206
-            </span>
207
-          )}
208
-        </AuthButton>
209
-        <Button onClick={() => cancelPage()}>取消</Button>
210
-      </div>
211
-    </>
212
-  );
213
-};
214
-
215
-const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
216
-
217
-/**
218
- *
219
- *
220
- * @param {*} props
221
- * @returns
222
- */
223
-const Edit = props => {
224
-  const [tab, changeTab] = useState('basic');
225
-  const { dynamicId } = props.location.query;
226
-  const [detailData, setDetailData] = useState(false);
227
-
228
-  const getDynamicData = dynamicId => {
229
-    request({ ...apis.activity.details, params: { dynamicId } }).then(data => {
230
-      console.log(data);
231
-      data.activityTime = [moment(data.startDate), moment(data.endDate)];
232
-      data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)];
233
-
234
-      setDetailData(data);
235
-    });
236
-  };
237
-
238
-  useEffect(() => {
239
-    if (dynamicId) {
240
-      getDynamicData(dynamicId);
241
-    }
242
-  }, []);
243
-
244
-  const target = { id: dynamicId, type: 'activity' };
245
-  return (
246
-    <Card>
247
-      <div>
248
-        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
249
-          <Radio.Button value="basic">基本信息</Radio.Button>
250
-          {/* <Radio.Button value="poster">海报图片</Radio.Button>
251
-          <Radio.Button value="share">分享设置</Radio.Button> */}
252
-        </Radio.Group>
253
-      </div>
254
-      <div>
255
-        {tab === 'basic' && <Basic dynamicId={dynamicId} detailData={detailData} />}
256
-
257
-        {tab === 'poster' && <Poster target={target} />}
258
-        {tab === 'share' && <Share target={target} />}
259
-      </div>
260
-      {/* <div style={{ textAlign: 'center' }}>
261
-        <AuthButton name="admin.SignList.get" noRight={null}>
262
-          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
263
-            <span
264
-              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
265
-              onClick={getSignList.bind(this, detailData.dynamicId)}
266
-            >
267
-              <Button>报名记录</Button>
268
-            </span>
269
-          )}
270
-        </AuthButton>
271
-        <AuthButton name="admin.dymic.qrcode" noRight={null}>
272
-          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
273
-            <span
274
-              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
275
-              onClick={newQrcode.bind(this, detailData)}
276
-            >
277
-              {<Button>下载二维码</Button>}
278
-            </span>
279
-          )}
280
-        </AuthButton>
281
-        <Button onClick={() => cancelPage()}>取消</Button>
282
-      </div> */}
283
-    </Card>
284
-  );
285
-};
286
-
287
-export default Edit;
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Card, Radio, DatePicker, message, Upload } from 'antd';
3
+
4
+import apis from '@/services/apis';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '@/components/SelectButton/BuildSelect';
8
+import request from '@/utils/request';
9
+import yinhao from '@/assets/yinhao.png';
10
+import logo from '@/assets/logo.svg';
11
+import touxiang from '@/assets/touxiang.jpg';
12
+import poster1 from '@/assets/poster1.png';
13
+import poster2 from '@/assets/poster2.png';
14
+import xiaochengxu from '@/assets/xiaochengxu.png';
15
+import AuthButton from '@/components/AuthButton';
16
+import { getImgURL } from '@/utils/image';
17
+import Share from '@/components/Share';
18
+import Poster from '@/components/Poster';
19
+import PictureQRcode from '@/utils/imageQC'
20
+
21
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
+const { TextArea } = Input;
23
+
24
+const formItemLayout = {
25
+  labelCol: { span: 6 },
26
+  wrapperCol: { span: 14 },
27
+};
28
+
29
+const cancelPage = () => {
30
+  router.go('-1');
31
+};
32
+
33
+const getSignList = dynamicId => {
34
+  router.push({
35
+    pathname: '/activity/groupRoomActivity/registrationRecord',
36
+    query: {
37
+      dynamicId,
38
+    },
39
+  });
40
+};
41
+
42
+
43
+
44
+// const newQrcode = row => {
45
+//   const x = new XMLHttpRequest();
46
+//   const resourceUrl = row.qrCode;
47
+//   x.open('GET', resourceUrl, true);
48
+//   x.responseType = 'blob';
49
+//   x.onload = function (e) {
50
+//     const url = window.URL.createObjectURL(x.response);
51
+//     const a = document.createElement('a');
52
+//     a.href = url;
53
+//     a.style.display = 'none';
54
+//     a.download = '活动二维码.png';
55
+//     a.click();
56
+//   };
57
+//   x.send();
58
+// };
59
+
60
+const BasicForm = props => {
61
+  const detailData = props.detailData || {};
62
+
63
+  const radioOnChange = e => {
64
+    // setIsEnlist(e.target.value)
65
+  };
66
+
67
+  const { dynamicId } = props;
68
+  const handleSubmit = e => {
69
+    e.preventDefault();
70
+    props.form.validateFields((err, values) => {
71
+      if (!err) {
72
+        console.log('Received values of form: ', values);
73
+        const { activityTime, signupTime } = values;
74
+        const [startDate, endDate] = activityTime;
75
+        values.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
76
+        values.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
77
+        if (signupTime) {
78
+          const [enlistStart, enlistEnd] = signupTime;
79
+          values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
80
+          values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
81
+        }
82
+        console.log('submit data --->', values);
83
+        if (dynamicId) {
84
+          values.dynamicId = dynamicId;
85
+          request({ ...apis.activity.update, data: values })
86
+            .then(data => {
87
+              message.info('保存成功');
88
+              // router.go(-1)
89
+            })
90
+            .catch(err => {
91
+              message.info(err.msg || err.message);
92
+            });
93
+        } else {
94
+          request({ ...apis.activity.add, data: { ...values } })
95
+            .then(data => {
96
+              message.info('保存成功');
97
+              router.push({
98
+                pathname: '/activity/editActivity',
99
+                query: {
100
+                  dynamicId: data.dynamicId,
101
+                },
102
+              });
103
+              // router.go(-1)
104
+            })
105
+            .catch(err => {
106
+              message.info(err.msg || err.message);
107
+            });
108
+        }
109
+      }
110
+    });
111
+  };
112
+
113
+  const { getFieldDecorator } = props.form;
114
+  return (
115
+    <>
116
+      <Form {...formItemLayout} onSubmit={handleSubmit}>
117
+        <Form.Item label="所属项目">
118
+          {getFieldDecorator('buildingId', {
119
+            initialValue: detailData.buildingId,
120
+            rules: [
121
+              {
122
+                required: true,
123
+                message: '请选择所属项目',
124
+              },
125
+            ],
126
+          })(<BuildSelect disabled />)}
127
+        </Form.Item>
128
+        <Form.Item label="活动封面图1">
129
+          <img src={getImgURL(detailData.listImgUrl)} height="210px" width="375px" />
130
+        </Form.Item>
131
+        {/* <Form.Item label="活动封面图2">
132
+          <img src={getImgURL(detailData.bannerListImg)} height="125px" width="375px" />
133
+        </Form.Item> */}
134
+        <Form.Item label="活动详情主图">
135
+          <img src={getImgURL(detailData.imgUrl)} height="300px" width="375px" />
136
+        </Form.Item>
137
+        <Form.Item label="活动标题">
138
+          <span>{detailData.title}</span>
139
+        </Form.Item>
140
+        <Form.Item label="副标题">
141
+          <span>{detailData.halfTitle}</span>
142
+        </Form.Item>
143
+        <Form.Item label="活动时间">
144
+          <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(
145
+            detailData.endDate,
146
+          ).format('YYYY-MM-DD HH:mm')}`}</span>
147
+        </Form.Item>
148
+        <Form.Item label="活动地点">
149
+          <span>{detailData.address}</span>
150
+        </Form.Item>
151
+        <Form.Item label="活动人数">
152
+          <span>{detailData.personNum}</span>
153
+        </Form.Item>
154
+        <Form.Item label="团房价">
155
+          <span>{detailData.groupBuyPrice}</span>
156
+        </Form.Item>
157
+        {/* <Form.Item label="阅读量">
158
+          <span>{detailData.pvNum}</span>
159
+        </Form.Item>
160
+        <Form.Item label="转发量">
161
+          <span>{detailData.shareNum}</span>
162
+        </Form.Item>
163
+        <Form.Item label="收藏数">
164
+          <span>{detailData.saveNum}</span>
165
+        </Form.Item>
166
+        <Form.Item label="最大报名人数">
167
+          <span>{detailData.maxEnlistByPerson}</span>
168
+        </Form.Item> */}
169
+        <Form.Item label="活动详情">
170
+          <div
171
+            style={{ maxHeight: '500px', overflowY: 'auto' }}
172
+            dangerouslySetInnerHTML={{ __html: detailData.desc }}
173
+          ></div>
174
+        </Form.Item>
175
+        <Form.Item label="报名时间">
176
+          <span>{`${moment(detailData.enlistStart).format('YYYY-MM-DD HH:mm')} —— ${moment(
177
+            detailData.enlistEnd,
178
+          ).format('YYYY-MM-DD HH:mm')}`}</span>
179
+        </Form.Item>
180
+        <Form.Item label="权重">
181
+          <span>{detailData.heavy}</span>
182
+        </Form.Item>
183
+      </Form>
184
+      <div style={{ textAlign: 'center' }}>
185
+        <AuthButton name="admin.SignList.get" noRight={null}>
186
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
187
+            <span
188
+              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
189
+              onClick={getSignList.bind(this, detailData.dynamicId)}
190
+            >
191
+              <Button>报名记录</Button>
192
+            </span>
193
+          )}
194
+        </AuthButton>
195
+        <AuthButton name="admin.dymic.qrcode" noRight={null}>
196
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
197
+            <span
198
+              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
199
+              // onClick={newQrcode.bind(this, detailData)}
200
+              onClick={() => { PictureQRcode(detailData, '活动二维码') }}
201
+            >
202
+              {<Button>下载二维码</Button>}
203
+            </span>
204
+          )}
205
+        </AuthButton>
206
+        <Button onClick={() => cancelPage()}>取消</Button>
207
+      </div>
208
+    </>
209
+  );
210
+};
211
+
212
+const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
213
+
214
+/**
215
+ *
216
+ *
217
+ * @param {*} props
218
+ * @returns
219
+ */
220
+const Edit = props => {
221
+  const [tab, changeTab] = useState('basic');
222
+  const { dynamicId } = props.location.query;
223
+  const [detailData, setDetailData] = useState(false);
224
+
225
+  const getDynamicData = dynamicId => {
226
+    request({ ...apis.activity.details, params: { dynamicId } }).then(data => {
227
+      console.log(data);
228
+      data.activityTime = [moment(data.startDate), moment(data.endDate)];
229
+      data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)];
230
+
231
+      setDetailData(data);
232
+    });
233
+  };
234
+
235
+  useEffect(() => {
236
+    if (dynamicId) {
237
+      getDynamicData(dynamicId);
238
+    }
239
+  }, []);
240
+
241
+  const target = { id: dynamicId, type: 'activity' };
242
+  return (
243
+    <Card>
244
+      <div>
245
+        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
246
+          <Radio.Button value="basic">基本信息</Radio.Button>
247
+          {/* <Radio.Button value="poster">海报图片</Radio.Button>
248
+          <Radio.Button value="share">分享设置</Radio.Button> */}
249
+        </Radio.Group>
250
+      </div>
251
+      <div>
252
+        {tab === 'basic' && <Basic dynamicId={dynamicId} detailData={detailData} />}
253
+
254
+        {tab === 'poster' && <Poster target={target} />}
255
+        {tab === 'share' && <Share target={target} />}
256
+      </div>
257
+      {/* <div style={{ textAlign: 'center' }}>
258
+        <AuthButton name="admin.SignList.get" noRight={null}>
259
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
260
+            <span
261
+              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
262
+              onClick={getSignList.bind(this, detailData.dynamicId)}
263
+            >
264
+              <Button>报名记录</Button>
265
+            </span>
266
+          )}
267
+        </AuthButton>
268
+        <AuthButton name="admin.dymic.qrcode" noRight={null}>
269
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
270
+            <span
271
+              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
272
+              onClick={newQrcode.bind(this, detailData)}
273
+            >
274
+              {<Button>下载二维码</Button>}
275
+            </span>
276
+          )}
277
+        </AuthButton>
278
+        <Button onClick={() => cancelPage()}>取消</Button>
279
+      </div> */}
280
+    </Card>
281
+  );
282
+};
283
+
284
+export default Edit;

+ 55
- 0
src/pages/broker/list/detail.jsx Целия файл

@@ -0,0 +1,55 @@
1
+import { getBrokerDetails } from '@/services/apis';
2
+import { useRef, useEffect } from 'react';
3
+import React from 'react';
4
+import { Avatar, Row, Col } from 'antd';
5
+import { fetch, apis } from '@/utils/request';
6
+
7
+function agentDeal (props) {
8
+  const { detail, personId, api } = props;
9
+  const formRef = useRef();
10
+
11
+  useEffect(() => {
12
+    if (personId) {
13
+      getBrokerDetails(personId).then((res) => {
14
+        res; console.log('方方', res)
15
+      });
16
+    }
17
+
18
+  }, [personId]);
19
+
20
+
21
+  const list = [
22
+    {
23
+      title: '姓名',
24
+      render: detail.name,
25
+    },
26
+    {
27
+      title: '手机号',
28
+      render: detail.phone,
29
+    },
30
+    {
31
+      title: '身份证号',
32
+      render: detail.idNo,
33
+    },
34
+    {
35
+      title: '银行卡号',
36
+      render: detail.personId,
37
+    },
38
+  ];
39
+  return (
40
+    <>
41
+      <Row>
42
+        {list.map((x, index) => {
43
+          return (
44
+            <div key={index} style={{ marginBottom: '20px', display: 'flex' }}>
45
+              <Col span={7}>{x.title}:</Col>
46
+              <Col span={17}>{x.render || '--'}</Col>
47
+            </div>
48
+          );
49
+        })}
50
+      </Row>
51
+    </>
52
+  );
53
+}
54
+
55
+export default agentDeal;

+ 46
- 25
src/pages/broker/list/index.jsx Целия файл

@@ -1,10 +1,12 @@
1
-import React, { useMemo, useRef, useCallback, useState } from 'react'
2
-import { Button, notification, Spin, Badge, Select } from 'antd'
1
+import React, { useMemo, useRef, useCallback, useState, useEffect, OperButton } from 'react'
2
+import { Button, notification, Spin, Badge, Select, Modal, Input } from 'antd'
3 3
 import { router } from 'umi'
4 4
 import Link from 'umi/link';
5 5
 import moment from 'moment'
6 6
 import QueryTable from '@/components/QueryTable'
7 7
 import { fetch, apis } from '@/utils/request';
8
+import DealDetail from './detail';
9
+// import { useSearchParams } from '@umijs/max';
8 10
 
9 11
 const searchFields = [
10 12
   {
@@ -46,9 +48,14 @@ const searchFields = [
46 48
     )
47 49
   },
48 50
 ]
49
-
50 51
 export default (props) => {
51
-  const ref = useRef()
52
+  const [detail, setDetail, personId] = useState({});
53
+  const [open, setOpen] = useState(false);
54
+  const hideModal = () => {
55
+    setOpen(false);
56
+  };
57
+
58
+  const ref = useRef();
52 59
 
53 60
   const tableColumns = [
54 61
     {
@@ -57,7 +64,7 @@ export default (props) => {
57 64
       key: 'avatarurl',
58 65
       align: 'center',
59 66
       render: (t) => {
60
-        return <img src={t} width={64} height={64} style={{borderRadius: '4px'}} alt="" />
67
+        return <img src={t} width={64} height={64} style={{ borderRadius: '4px' }} alt="" />
61 68
       }
62 69
     },
63 70
     {
@@ -77,7 +84,7 @@ export default (props) => {
77 84
       key: 'customerNum',
78 85
       align: 'right',
79 86
       width: 120,
80
-      render: (t, row) => <Link to={`/broker/customer/list?recommendPerson=${row.personId}`}>{ !t ? 0 : t }</Link>
87
+      render: (t, row) => <Link to={`/broker/customer/list?recommendPerson=${row.personId}`}>{!t ? 0 : t}</Link>
81 88
     },
82 89
     {
83 90
       title: '佣金总数',
@@ -115,26 +122,40 @@ export default (props) => {
115 122
       align: 'center',
116 123
       render: (t) => moment(t).format('YYYY-MM-DD HH:mm')
117 124
     },
118
-    // {
119
-    //   title: '操作',
120
-    //   key: 'options',
121
-    //   align: 'center',
122
-    //   render: (_, row) => (
123
-    //     <>
124
-    //       <OperButton onClick={() => router.push(`/broker/announcement/edit?id=${row.screenId}`)}>详情</OperButton>
125
-    //       <OperButton.Confirm title="确认进行操作?" color="#1890ff" onClick={() => onPublish(row)}>{row.status === 1 ? '取消发布' : '发布'}</OperButton.Confirm>
126
-    //     </>
127
-    //   )
128
-    // },
125
+    {
126
+      title: '操作',
127
+      dataIndex: 'options',
128
+      key: 'options',
129
+      align: 'center',
130
+      render: (_, row) => (
131
+        <>
132
+          {/* <OperButton onClick={() => router.push(`/broker/announcement/edit?id=${row.screenId}`)}>详情</OperButton>
133
+          <OperButton.Confirm title="确认进行操作?" color="#1890ff" onClick={() => onPublish(row)}>{row.status === 1 ? '取消发布' : '发布'}</OperButton.Confirm> */}
134
+          {/* to={`/admin/bkBankCard?personId=${row}`}  , router.push(`/admin/bkBankCard?personId=${row.personId}`) */}
135
+          <Button
136
+            type="link" onClick={() => {
137
+              setDetail(row), setOpen(true)
138
+            }}
139
+          >
140
+            查看详情
141
+          </Button>
142
+        </>
143
+      )
144
+    },
129 145
   ]
130
-
146
+  // console.log('尝试', row.detail);
131 147
   return (
132
-    <QueryTable
133
-      ref={ref}
134
-      rowKey="personId"
135
-      api={apis.broker.getBrokerList}
136
-      searchFields={searchFields}
137
-      columns={tableColumns}
138
-    />
148
+    <>
149
+      <QueryTable
150
+        ref={ref}
151
+        rowKey="personId"
152
+        api={apis.broker.getBrokerList}
153
+        searchFields={searchFields}
154
+        columns={tableColumns}
155
+      />
156
+      <Modal title="经纪人详情" visible={open} onOk={hideModal} onCancel={hideModal} footer={null}>
157
+        <DealDetail detail={detail} personId={personId} api={apis.broker.getBrokerDetails} />
158
+      </Modal>
159
+    </>
139 160
   )
140 161
 }

+ 71
- 73
src/pages/customer/deal/detail.jsx Целия файл

@@ -1,73 +1,71 @@
1
-import React from 'react';
2
-import { Avatar, Row, Col } from 'antd';
3
-import apis from '../../../services/apis';
4
-import moment from 'moment';
5
-import WxDictSelect from '@/components/SelectButton/WxDictSelect';
6
-import BuildingSelect from '@/components/SelectButton/BuildSelect';
7
-import QueryTable from '@/components/QueryTable';
8
-
9
-function costomerDeal(props) {
10
-  const { detail } = props;
11
-
12
-  const list = [
13
-    {
14
-      title: '所属项目',
15
-      render: detail.buildingName,
16
-    },
17
-    {
18
-      title: '客户姓名',
19
-      render: detail.name,
20
-    },
21
-    {
22
-      title: '归属渠道',
23
-      render: detail.recommendName
24
-        ? `${detail.recommendName}/${detail.recommendTel}`
25
-        : '--',
26
-    },
27
-    {
28
-      title: '内场接待',
29
-      render: detail.realtyConsultantName ? `${detail.realtyConsultantName}/${detail.realtyConsultantTel}` : '--',
30
-    },
31
-    {
32
-      title: '业绩分成人|占比%',
33
-      render: detail.dividendsName,
34
-    },
35
-    {
36
-      title: '户型',
37
-      render: detail.houseTypeName,
38
-    },
39
-    {
40
-      title: '房号',
41
-      render: detail.houseInfo,
42
-    },
43
-    {
44
-      title: '签约日期',
45
-      render: moment(detail.createDate).format('YYYY-MM-DD HH:mm:ss'),
46
-    },
47
-    {
48
-      title: '成交金额',
49
-      render: detail.price,
50
-    },
51
-    {
52
-      title: '备注',
53
-      render: detail.remark,
54
-    },
55
-  ];
56
-
57
-  return (
58
-    <>
59
-      <Row>
60
-        {list.map((x, index) => {
61
-          return (
62
-            <div key={index} style={{ marginBottom: '20px', display: 'flex' }}>
63
-              <Col span={7}>{x.title}:</Col>
64
-              <Col span={17}>{x.render || '--'}</Col>
65
-            </div>
66
-          );
67
-        })}
68
-      </Row>
69
-    </>
70
-  );
71
-}
72
-
73
-export default costomerDeal;
1
+import React from 'react';
2
+import { Avatar, Row, Col } from 'antd';
3
+import apis from '../../../services/apis';
4
+import moment from 'moment';
5
+import WxDictSelect from '@/components/SelectButton/WxDictSelect';
6
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
7
+import QueryTable from '@/components/QueryTable';
8
+
9
+function costomerDeal (props) {
10
+  const { detail } = props;
11
+  const list = [
12
+    {
13
+      title: '所属项目',
14
+      render: detail.buildingName,
15
+    },
16
+    {
17
+      title: '客户姓名',
18
+      render: detail.name,
19
+    },
20
+    {
21
+      title: '归属渠道',
22
+      render: detail.recommendName
23
+        ? `${detail.recommendName}/${detail.recommendTel}`
24
+        : '--',
25
+    },
26
+    {
27
+      title: '内场接待',
28
+      render: detail.realtyConsultantName ? `${detail.realtyConsultantName}/${detail.realtyConsultantTel}` : '--',
29
+    },
30
+    {
31
+      title: '业绩分成人|占比%',
32
+      render: detail.dividendsName,
33
+    },
34
+    {
35
+      title: '户型',
36
+      render: detail.houseTypeName,
37
+    },
38
+    {
39
+      title: '房号',
40
+      render: detail.houseInfo,
41
+    },
42
+    {
43
+      title: '签约日期',
44
+      render: moment(detail.createDate).format('YYYY-MM-DD HH:mm:ss'),
45
+    },
46
+    {
47
+      title: '成交金额',
48
+      render: detail.price,
49
+    },
50
+    {
51
+      title: '备注',
52
+      render: detail.remark,
53
+    },
54
+  ];
55
+  return (
56
+    <>
57
+      <Row>
58
+        {list.map((x, index) => {
59
+          return (
60
+            <div key={index} style={{ marginBottom: '20px', display: 'flex' }}>
61
+              <Col span={7}>{x.title}:</Col>
62
+              <Col span={17}>{x.render || '--'}</Col>
63
+            </div>
64
+          );
65
+        })}
66
+      </Row>
67
+    </>
68
+  );
69
+}
70
+
71
+export default costomerDeal;

+ 156
- 156
src/pages/customer/deal/index.jsx Целия файл

@@ -1,156 +1,156 @@
1
-import React, { useState } from 'react';
2
-import { Avatar, Modal } from 'antd';
3
-import apis from '../../../services/apis';
4
-import moment from 'moment';
5
-import WxDictSelect from '@/components/SelectButton/WxDictSelect';
6
-import BuildingSelect from '@/components/SelectButton/BuildSelect';
7
-import QueryTable from '@/components/QueryTable';
8
-import DealDetail from './detail';
9
-
10
-function costomerDrift(props) {
11
-  const [visible, setVisible] = useState(false);
12
-  const [detail, setDetail] = useState({});
13
-  const columns = [
14
-    {
15
-      title: '头像',
16
-      dataIndex: 'picture',
17
-      key: 'picture',
18
-      align: 'center',
19
-      render: (_, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
20
-    },
21
-    {
22
-      title: '姓名',
23
-      dataIndex: 'name',
24
-      key: 'name',
25
-      align: 'center',
26
-    },
27
-    {
28
-      title: '电话',
29
-      dataIndex: 'phone',
30
-      key: 'phone',
31
-      align: 'center',
32
-    },
33
-
34
-    {
35
-      title: '性别',
36
-      dataIndex: 'sex',
37
-      key: 'sex',
38
-      align: 'center',
39
-      // eslint-disable-next-line no-nested-ternary
40
-      render: (_, record) => (
41
-        <span>{record.sex === '1' ? '男' : record.sex === '2' ? '女' : '未知'}</span>
42
-      ),
43
-    },
44
-    {
45
-      title: '所属项目',
46
-      dataIndex: 'buildingName',
47
-      key: 'buildingName',
48
-      align: 'center',
49
-    },
50
-    {
51
-      title: '成交金额',
52
-      dataIndex: 'price',
53
-      key: 'price',
54
-      align: 'center',
55
-    },
56
-    {
57
-      title: '报备人',
58
-      dataIndex: 'recommendName',
59
-      key: 'recommendName',
60
-      align: 'center',
61
-      width: 200,
62
-      render: (_, record) => {
63
-        const phone = record.recommendTel ? ` ${record.recommendTel}` : ''
64
-        return <span>{`${record.recommendName}${phone}`}</span>
65
-      },
66
-    },
67
-    {
68
-      title: '签约日期',
69
-      dataIndex: 'createDate',
70
-      key: 'createDate',
71
-      align: 'center',
72
-      render: t => moment(t).format('YYYY-MM-DD HH:mm:ss'),
73
-    },
74
-    {
75
-      title: '状态',
76
-      dataIndex: 'type',
77
-      key: 'type',
78
-      align: 'center',
79
-      render: t => t=='signatory'?'签约':t=='commission'?'结佣':'--'
80
-      
81
-    },
82
-    {
83
-      title: '操作',
84
-      dataIndex: 'edit',
85
-      key: 'edit',
86
-      align: 'center',
87
-      render: (_, record) => (
88
-        <>
89
-          <a
90
-            onClick={() => {
91
-              setDetail(record), setVisible(true);
92
-            }}
93
-          >
94
-            查看详情
95
-          </a>
96
-        </>
97
-      ),
98
-    },
99
-  ];
100
-
101
-  const searchFields = [
102
-    {
103
-      name: 'buildingId',
104
-      label: '项目',
105
-      placeholder: '请选择项目',
106
-      render: () => <BuildingSelect style={{ width: 160 }} />,
107
-    },
108
-    {
109
-      name: 'name',
110
-      label: '姓名',
111
-      placeholder: '请输入姓名',
112
-    },
113
-    {
114
-      name: 'phone',
115
-      label: '电话',
116
-      placeholder: '请输入电话',
117
-    },
118
-    {
119
-      name: 'type',
120
-      label: '状态',
121
-      placeholder: '请选择状态',
122
-      type: 'select',
123
-      options: [
124
-        { label: '全部', value: '' },
125
-        { label: '签约', value: 'signatory' },
126
-        { label: '结佣', value: 'commission' },
127
-      ],
128
-    },
129
-  ];
130
-  // pageNum=1&pageSize=10&buildingId=&name=&phone=&type=
131
-  return (
132
-    <>
133
-      <QueryTable
134
-        rowKey="customerSignatoryId"
135
-        api={apis.customer.getDealList}
136
-        searchFields={searchFields}
137
-        columns={columns}
138
-      />
139
-      <Modal
140
-      title='客户详情'
141
-        visible={visible}
142
-        onOk={() => {
143
-          setVisible(false);
144
-        }}
145
-        onCancel={() => {
146
-          setVisible(false);
147
-        }}
148
-        footer={null}
149
-      >
150
-        <DealDetail detail={detail} />
151
-      </Modal>
152
-    </>
153
-  );
154
-}
155
-
156
-export default costomerDrift;
1
+import React, { useState } from 'react';
2
+import { Avatar, Modal } from 'antd';
3
+import apis from '../../../services/apis';
4
+import moment from 'moment';
5
+import WxDictSelect from '@/components/SelectButton/WxDictSelect';
6
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
7
+import QueryTable from '@/components/QueryTable';
8
+import DealDetail from './detail';
9
+
10
+function costomerDrift (props) {
11
+  const [visible, setVisible] = useState(false);
12
+  const [detail, setDetail] = useState({});
13
+  const columns = [
14
+    {
15
+      title: '头像',
16
+      dataIndex: 'picture',
17
+      key: 'picture',
18
+      align: 'center',
19
+      render: (_, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
20
+    },
21
+    {
22
+      title: '姓名',
23
+      dataIndex: 'name',
24
+      key: 'name',
25
+      align: 'center',
26
+    },
27
+    {
28
+      title: '电话',
29
+      dataIndex: 'phone',
30
+      key: 'phone',
31
+      align: 'center',
32
+    },
33
+
34
+    {
35
+      title: '性别',
36
+      dataIndex: 'sex',
37
+      key: 'sex',
38
+      align: 'center',
39
+      // eslint-disable-next-line no-nested-ternary
40
+      render: (_, record) => (
41
+        <span>{record.sex === '1' ? '男' : record.sex === '2' ? '女' : '未知'}</span>
42
+      ),
43
+    },
44
+    {
45
+      title: '所属项目',
46
+      dataIndex: 'buildingName',
47
+      key: 'buildingName',
48
+      align: 'center',
49
+    },
50
+    {
51
+      title: '成交金额',
52
+      dataIndex: 'price',
53
+      key: 'price',
54
+      align: 'center',
55
+    },
56
+    {
57
+      title: '报备人',
58
+      dataIndex: 'recommendName',
59
+      key: 'recommendName',
60
+      align: 'center',
61
+      width: 200,
62
+      render: (_, record) => {
63
+        const phone = record.recommendTel ? ` ${record.recommendTel}` : ''
64
+        return <span>{`${record.recommendName}${phone}`}</span>
65
+      },
66
+    },
67
+    {
68
+      title: '签约日期',
69
+      dataIndex: 'createDate',
70
+      key: 'createDate',
71
+      align: 'center',
72
+      render: t => moment(t).format('YYYY-MM-DD HH:mm:ss'),
73
+    },
74
+    {
75
+      title: '状态',
76
+      dataIndex: 'type',
77
+      key: 'type',
78
+      align: 'center',
79
+      render: t => t == 'signatory' ? '签约' : t == 'commission' ? '结佣' : '--'
80
+
81
+    },
82
+    {
83
+      title: '操作',
84
+      dataIndex: 'edit',
85
+      key: 'edit',
86
+      align: 'center',
87
+      render: (_, record) => (
88
+        <>
89
+          <a
90
+            onClick={() => {
91
+              setDetail(record), setVisible(true);
92
+            }}
93
+          >
94
+            查看详情
95
+          </a>
96
+        </>
97
+      ),
98
+    },
99
+  ];
100
+
101
+  const searchFields = [
102
+    {
103
+      name: 'buildingId',
104
+      label: '项目',
105
+      placeholder: '请选择项目',
106
+      render: () => <BuildingSelect style={{ width: 160 }} />,
107
+    },
108
+    {
109
+      name: 'name',
110
+      label: '姓名',
111
+      placeholder: '请输入姓名',
112
+    },
113
+    {
114
+      name: 'phone',
115
+      label: '电话',
116
+      placeholder: '请输入电话',
117
+    },
118
+    {
119
+      name: 'type',
120
+      label: '状态',
121
+      placeholder: '请选择状态',
122
+      type: 'select',
123
+      options: [
124
+        { label: '全部', value: '' },
125
+        { label: '签约', value: 'signatory' },
126
+        { label: '结佣', value: 'commission' },
127
+      ],
128
+    },
129
+  ];
130
+  // pageNum=1&pageSize=10&buildingId=&name=&phone=&type=
131
+  return (
132
+    <>
133
+      <QueryTable
134
+        rowKey="customerSignatoryId"
135
+        api={apis.customer.getDealList}
136
+        searchFields={searchFields}
137
+        columns={columns}
138
+      />
139
+      <Modal
140
+        title='客户详情'
141
+        visible={visible}
142
+        onOk={() => {
143
+          setVisible(false);
144
+        }}
145
+        onCancel={() => {
146
+          setVisible(false);
147
+        }}
148
+        footer={null}
149
+      >
150
+        <DealDetail detail={detail} />
151
+      </Modal>
152
+    </>
153
+  );
154
+}
155
+
156
+export default costomerDrift;

+ 20
- 15
src/services/apis.js Целия файл

@@ -220,10 +220,10 @@ export default {
220 220
       }
221 221
 
222 222
     },
223
-    logs:{
223
+    logs: {
224 224
       url: `${prefix}/building/logs`,
225
-        method: 'GET',
226
-        action: 'admin.building.logs.get',
225
+      method: 'GET',
226
+      action: 'admin.building.logs.get',
227 227
     }
228 228
 
229 229
   },
@@ -346,7 +346,7 @@ export default {
346 346
     },
347 347
     //回访
348 348
     reply: {
349
-      
349
+
350 350
       method: 'PUT',
351 351
       url: `${prefix}/reply/:id`,
352 352
       action: '',
@@ -414,8 +414,8 @@ export default {
414 414
       url: `${prefix}/marking/signatory`,
415 415
       action: 'admin.marking.signatory.put',
416 416
     },
417
-     // 结佣
418
-     commission: {
417
+    // 结佣
418
+    commission: {
419 419
       method: 'PUT',
420 420
       url: `${prefix}/marking/commission`,
421 421
       action: 'admin.marking.commission.put',
@@ -426,7 +426,7 @@ export default {
426 426
       url: `${prefix}/marking/invalidCustomer`,
427 427
       action: 'admin.marking.invalidCustomer.put',
428 428
     },
429
-    
429
+
430 430
     recommendGetById: {
431 431
       method: 'GET',
432 432
       url: `${prefix}/customer/recommend/getById/:id`,
@@ -999,35 +999,35 @@ export default {
999 999
       method: 'DELETE',
1000 1000
       action: 'admin.taPolicy.id.delete',
1001 1001
     },
1002
-  
1003
-    getPolicyTypeList:{
1002
+
1003
+    getPolicyTypeList: {
1004 1004
       url: `${prefix}/taPolicyType`,
1005 1005
       method: 'GET',
1006 1006
       action: 'admin.taPolicyType.get',
1007 1007
     },
1008
-    addPolicyType:{
1008
+    addPolicyType: {
1009 1009
       url: `${prefix}/taPolicyType`,
1010 1010
       method: 'Post',
1011 1011
       action: 'admin.taPolicyType.Post',
1012 1012
     },
1013 1013
 
1014
-    getPolicyTypeDetail:{
1014
+    getPolicyTypeDetail: {
1015 1015
       url: `${prefix}/taPolicyType/:id`,
1016 1016
       method: 'GET',
1017 1017
       action: 'admin.taPolicyType.id.get',
1018 1018
     },
1019 1019
 
1020
-    upDatePolicyType:{
1020
+    upDatePolicyType: {
1021 1021
       url: `${prefix}/taPolicyType/:id`,
1022 1022
       method: 'PUT',
1023 1023
       action: 'admin.taPolicyType.id.put',
1024 1024
     },
1025
-    deletePolicyType:{
1025
+    deletePolicyType: {
1026 1026
       url: `${prefix}/taPolicyType/:id`,
1027 1027
       method: 'DELETE',
1028 1028
       action: 'admin.taPolicyType.id.delete',
1029 1029
     },
1030
- 
1030
+
1031 1031
     // getPolicyTypeList:{
1032 1032
     //   url: `${prefix}/taPolicyType`,
1033 1033
     //   method: 'GET',
@@ -1170,7 +1170,7 @@ export default {
1170 1170
       method: 'DELETE',
1171 1171
       action: 'admin.channel.id.delete',
1172 1172
     },
1173
- 
1173
+
1174 1174
     // getListBroker: {
1175 1175
     //   url: `${prefix}/channel/InviteClientsList`,
1176 1176
     //   method: 'GET',
@@ -2469,5 +2469,10 @@ export default {
2469 2469
       method: 'GET',
2470 2470
       url: `${prefix}/broker/customer`,
2471 2471
     },
2472
+    // 获取经纪人详情
2473
+    getBrokerDetails: {
2474
+      method: 'GET',
2475
+      url: `${prefix}/admin/bkBankCard`,
2476
+    },
2472 2477
   }
2473 2478
 };

+ 42
- 29
src/utils/imageQC.js Целия файл

@@ -1,29 +1,42 @@
1
-
2
-import { message } from 'antd';
3
-//测试封装
4
-export default function PictureQRcode(res, title) {
5
-  if (res.qrCode === null || res.qrCode == 'null') {
6
-    message.error(`保存失败${res.qrCode}`);
7
-
8
-  } else {
9
-    const x = new XMLHttpRequest();
10
-    const resourceUrl = res.qrCode;
11
-    x.open('GET', resourceUrl, true);
12
-    x.responseType = 'blob';
13
-    x.onload = function (e) {
14
-      const url = window.URL.createObjectURL(x.response);
15
-      const a = document.createElement('a');
16
-      a.href = url;
17
-      a.style.display = 'none';
18
-      a.download = `${title}.png`;
19
-      a.click();
20
-    };
21
-    x.send();
22
-    message.info(`保存成功`);
23
-
24
-
25
-  }
26
-
27
-
28
-}
29
-
1
+
2
+import { message } from 'antd';
3
+//测试封装
4
+export default function PictureQRcode(res, title) {
5
+  if (res.qrCode === null || res.qrCode == 'null') {
6
+    message.error(`保存失败${res.qrCode}`);
7
+    const x = new XMLHttpRequest();
8
+    const resourceUrl = res.qrCode;
9
+    x.open('GET', resourceUrl, true);
10
+    x.responseType = 'blob';
11
+    x.onload = function (e) {
12
+      const url = window.URL.createObjectURL(x.response);
13
+      const a = document.createElement('a');
14
+      a.href = url;
15
+      a.style.display = 'none';
16
+      a.download = `${title}.png`;
17
+      a.click();
18
+    };
19
+    x.send();
20
+
21
+  } else {
22
+    const x = new XMLHttpRequest();
23
+    const resourceUrl = res.qrCode;
24
+    x.open('GET', resourceUrl, true);
25
+    x.responseType = 'blob';
26
+    x.onload = function (e) {
27
+      const url = window.URL.createObjectURL(x.response);
28
+      const a = document.createElement('a');
29
+      a.href = url;
30
+      a.style.display = 'none';
31
+      a.download = `${title}.png`;
32
+      a.click();
33
+    };
34
+    x.send();
35
+    message.info(`保存成功`);
36
+
37
+
38
+  }
39
+
40
+
41
+}
42
+