zhoulisen 5 jaren geleden
bovenliggende
commit
45bb267fad
29 gewijzigde bestanden met toevoegingen van 2339 en 294 verwijderingen
  1. 30
    0
      config/routes.js
  2. 1
    0
      package.json
  3. 7
    9
      src/pages/activity/drainage/DrainageList.jsx
  4. 145
    111
      src/pages/activity/drainage/components/Basic.jsx
  5. 60
    30
      src/pages/activity/drainage/components/CustomerData.jsx
  6. 50
    31
      src/pages/activity/drainage/components/Help.jsx
  7. 27
    20
      src/pages/activity/drainage/components/ImageUpload.jsx
  8. 49
    21
      src/pages/activity/drainage/components/Ranking.jsx
  9. 58
    29
      src/pages/activity/drainage/components/RedPacket.jsx
  10. 34
    24
      src/pages/activity/drainage/components/RedPacketRecord.jsx
  11. 88
    3
      src/pages/activity/drainage/components/style.less
  12. 5
    4
      src/pages/activity/drainage/detailDrainage.jsx
  13. 9
    9
      src/pages/activity/drainage/h5edit.jsx
  14. 174
    0
      src/pages/funds/accountfunds/components/Basic.jsx
  15. 236
    0
      src/pages/funds/accountfunds/components/ConsumerOrder.jsx
  16. 19
    0
      src/pages/funds/accountfunds/components/Contact.jsx
  17. 104
    0
      src/pages/funds/accountfunds/components/Pay.jsx
  18. 38
    0
      src/pages/funds/accountfunds/components/Recharge.jsx
  19. 226
    0
      src/pages/funds/accountfunds/components/RechargeOrder.jsx
  20. 36
    0
      src/pages/funds/accountfunds/components/Refund.jsx
  21. 209
    0
      src/pages/funds/accountfunds/components/RefundOrder.jsx
  22. 115
    0
      src/pages/funds/accountfunds/components/ShowVoucher.jsx
  23. 17
    0
      src/pages/funds/accountfunds/components/contactText.jsx
  24. 100
    0
      src/pages/funds/accountfunds/components/styles.less
  25. 68
    0
      src/pages/funds/accountfunds/index.jsx
  26. 141
    0
      src/pages/funds/financialContact/index.jsx
  27. 139
    0
      src/pages/h5SampleManager/h5Sample/addH5.jsx
  28. 23
    3
      src/pages/h5SampleManager/h5Sample/detail.jsx
  29. 131
    0
      src/services/apis.js

+ 30
- 0
config/routes.js Bestand weergeven

@@ -841,6 +841,12 @@ export default [
841 841
                 hideInMenu: true,
842 842
                 component: './h5SampleManager/h5Sample/add',
843 843
               },
844
+              {
845
+                path: '/h5SampleManager/h5Sample/addH5',
846
+                name: '创建H5活动',
847
+                hideInMenu: true,
848
+                component: './h5SampleManager/h5Sample/addH5',
849
+              },
844 850
               {
845 851
                 path: '/h5SampleManager/h5Demand/list',
846 852
                 name: 'H5需求单',
@@ -942,6 +948,30 @@ export default [
942 948
               },   
943 949
             ],
944 950
           },
951
+          {
952
+            path: '/funds',
953
+            name: '资金管理',
954
+            component: '../layouts/BlankLayout',
955
+            routes: [
956
+              {
957
+                path: '/funds/accountfunds',
958
+                name: '账户资金',
959
+                component: './funds/accountfunds/index',
960
+              },
961
+           
962
+              // {
963
+              //   path: '/fund/qrcodelist/add',
964
+              //   name: '新增',
965
+              //   hideInMenu: true,
966
+              //   component: './fund/qrcodelist/add',
967
+              // },   
968
+              {
969
+                path: '/funds/financialContact',
970
+                name: '财务联系人',
971
+                component: './funds/financialContact/index',
972
+              },   
973
+            ],
974
+          },
945 975
           // {
946 976
           //   path: '/miniapp',
947 977
           //   name: '小程序管理',

+ 1
- 0
package.json Bestand weergeven

@@ -56,6 +56,7 @@
56 56
     "moment": "^2.24.0",
57 57
     "omit.js": "^1.0.2",
58 58
     "path-to-regexp": "^3.0.0",
59
+    "qrcode.react": "^1.0.0",
59 60
     "qs": "^6.7.0",
60 61
     "react": "^16.8.6",
61 62
     "react-amap": "^1.2.8",

+ 7
- 9
src/pages/activity/drainage/DrainageList.jsx Bestand weergeven

@@ -264,26 +264,24 @@ const header = props => {
264 264
           values.endDate = moment(values.endDate._d).format('YYYY-MM-DD HH:mm:ss')
265 265
           if (formsDate.drainageId) {
266 266
             // { ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }
267
-            request({ ...apis.activity.updatetaDrainage, urlData: { id: formsDate.drainageId }, data: values }).then((data) => {
267
+            request({ ...apis.activity.updatetaDrainage, urlData: { id: formsDate.drainageId }, data: values }).then(data => {
268 268
               message.info('操作成功!')
269
-              gettaDrainage(JSON.parse(localStorage.getItem("drainageActivePageParams")))
269
+              gettaDrainage(JSON.parse(localStorage.getItem('drainageActivePageParams')))
270 270
               setDate({
271 271
                 visible: false,
272 272
               });
273
-            }).catch((err) => {
273
+            }).catch(err => {
274 274
               console.log('111111', err)
275 275
               message.info(err.msg || err.message)
276 276
             })
277
-
278 277
           } else {
279
-
280
-            request({ ...apis.activity.addtaDrainage, data: values }).then((data) => {
281
-              message.info("操作成功")
282
-              gettaDrainage(JSON.parse(localStorage.getItem("drainageActivePageParams")))
278
+            request({ ...apis.activity.addtaDrainage, data: values }).then(data => {
279
+              message.info('操作成功')
280
+              gettaDrainage(JSON.parse(localStorage.getItem('drainageActivePageParams')))
283 281
               setDate({
284 282
                 visible: false,
285 283
               });
286
-            }).catch((err) => {
284
+            }).catch(err => {
287 285
               message.error(err.msg || err.message)
288 286
             })
289 287
           }

+ 145
- 111
src/pages/activity/drainage/components/Basic.jsx Bestand weergeven

@@ -1,7 +1,6 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Slider, Row, Col, Checkbox, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb } from 'antd';
2
+import { Form, Slider, Row, Col, Checkbox, Input, Button, InputNumber } from 'antd';
3 3
 import router from 'umi/router';
4
-import moment from 'moment';
5 4
 import apis from '../../../../services/apis';
6 5
 import request from '../../../../utils/request';
7 6
 import ImageUploader from './ImageUpload';
@@ -9,44 +8,61 @@ import Styles from './styles.less';
9 8
 import Navigate from '@/components/Navigate';
10 9
 import BuildSelect from '../../../../components/SelectButton/BuildSelect2'
11 10
 
12
-const registrationFormOption = [
13
-    { label: '姓名', value: 'name' },
14
-    { label: '电话', value: 'tel' },
15
-    { label: '自定义', value: 'abc' },
16
-];
17
-
18 11
 function Basic(props) {
19 12
 
13
+    const { id, name } = props
14
+
20 15
     const [registrationInputValue, setRegistrationInputValue] = useState()
21 16
 
22
-    const [viewProperty, setViewProperty] = useState([])
23
-    const [productionPoster, setProductionPoster] = useState([])
24
-    const [registrationForm, setRegistrationForm] = useState([])
17
+    const [viewProperty, setViewProperty] = useState(['index'])
18
+    const [productionPoster, setProductionPoster] = useState(['index'])
19
+    // const [registrationForm, setRegistrationForm] = useState([])
25 20
     const [inputVisible, setInputVisible] = useState(false)
26
-    const [registrationFormOption, setregistrationFormOption] = useState([
27
-        { label: '姓名', value: 'name' },
28
-        { label: '电话', value: 'tel' },
29
-        { label: '自定义', value: 'abc' },
30
-    ])
21
+    // const [registrationFormOption, setregistrationFormOption] = useState([
22
+    //     { label: '姓名', value: 'name' },
23
+    //     { label: '电话', value: 'tel' },
24
+    //     { label: '自定义', value: 'abc' },
25
+    // ])
31 26
 
32
-    // const [data, setData] = useState({})V
27
+    const [data, setData] = useState({})
33 28
     useEffect(() => {
34
-        // getList({ pageNum: 1, pageSize: 10 });
29
+        getList();
35 30
         console.log(props.id, '2341')
36 31
     }, [])
37 32
     // 查询列表
38
-    true
39
-    const getList = params => {
40
-        // request({ ...apis.relatedOrganization.get, params: { ...params } }).then(data => {
41
-        //     setData(data)
42
-        // })
33
+
34
+    const getList = () => {
35
+        request({ ...apis.redPacket.detail, urlData: { id } }).then(data => {
36
+            console.log(data, '2341')
37
+            // s.split("==");
38
+            data.buildingShowPos = data.buildingShowPos.split(',')
39
+
40
+            data.buildingSposterShowPoshowPos = (data.posterShowPos).split(',')
41
+            setViewProperty(data.buildingShowPos)
42
+            setProductionPoster(data.posterShowPos)
43
+            console.log(data, '2341')
44
+            setData(data)
45
+        })
46
+    }
47
+
48
+    const updateRedPacket = data => {
49
+        request({ ...apis.redPacket.update, data: { ...data } }).then(data => {
50
+            // setData(data)
51
+        })
43 52
     }
44 53
 
54
+
45 55
     function handleSubmit(e) {
46 56
         e.preventDefault();
47 57
         props.form.validateFields((err, values) => {
48 58
             if (!err) {
49 59
                 console.log(values, '------222-------')
60
+                values.activityId = id
61
+                // values.name = name
62
+                values.buildingShowPos = values.buildingShowPos.toString()
63
+                values.posterShowPos = values.posterShowPos.toString()
64
+                console.log(values, '------222-------')
65
+                updateRedPacket(values)
50 66
             }
51 67
         },
52 68
         )
@@ -89,17 +105,6 @@ function Basic(props) {
89 105
 
90 106
 
91 107
         setInputVisible(!inputVisible)
92
-        // const { inputValue } = this.state;
93
-        // let { tags } = this.state;
94
-        // if (inputValue && tags.indexOf(inputValue) === -1) {
95
-        //   tags = [...tags, inputValue];
96
-        // }
97
-        // console.log(tags);
98
-        // this.setState({
99
-        //   tags,
100
-        //   inputVisible: false,
101
-        //   inputValue: '',
102
-        // });
103 108
     }
104 109
 
105 110
     const { getFieldDecorator } = props.form
@@ -108,85 +113,125 @@ function Basic(props) {
108 113
 
109 114
         <>
110 115
             <Form labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
111
-                <Form.Item label="文本标签">
112
-                    {getFieldDecorator('text')(
113
-                        <span>活动名称</span>,
114
-                    )}
116
+                <Form.Item label="活动名称">
117
+                    <span>{data.name}</span>
115 118
                 </Form.Item>
116
-                <Form.Item label="扫码查看">
117
-                    {getFieldDecorator('channelId')(
118
-                        <img src="" alt />,
119
-                    )}
119
+                <Form.Item label="扫码查看" >
120
+                    <img src={data.qrcode || ''} alt="" />
120 121
                 </Form.Item>
121
-                <Form.Item label="首页背景图">
122
-                    {getFieldDecorator('23423')(
123
-                        <ImageUploader />,
124
-                    )}
122
+                <Form.Item label="首页背景图" help="建议尺寸:750*1206px,格式:jpg;内容区大小:750*1150">
123
+                    {getFieldDecorator('indexBackgroundImg',
124
+                        {
125
+                            initialValue: data.indexBackgroundImg,
126
+                        })(
127
+                            <ImageUploader />,
128
+                        )}
125 129
                 </Form.Item>
126
-                <Form.Item label="分享海报图">
127
-                    {getFieldDecorator('23423')(
128
-                        <ImageUploader />,
129
-                    )}
130
+                <Form.Item label="分享海报图" help="建议尺寸:750*1206px,格式:jpg;内容区大小:750*1150">
131
+                    {getFieldDecorator('sharePosterImg',
132
+                        {
133
+                            initialValue: data.sharePosterImg,
134
+                        })(
135
+                            <ImageUploader />,
136
+                        )}
130 137
                 </Form.Item>
131
-                <Form.Item label="活动规则图">
132
-                    {getFieldDecorator('23423')(
133
-                        <ImageUploader />,
134
-                    )}
138
+                <Form.Item label="活动规则图" help="建议尺寸:750*1206px,格式:jpg">
139
+                    {getFieldDecorator('activityRulesImg',
140
+                        {
141
+                            initialValue: data.activityRulesImg,
142
+                        })(
143
+                            <ImageUploader />,
144
+                        )}
135 145
                 </Form.Item>
136
-                <Form.Item label="助力页背景图">
137
-                    {getFieldDecorator('23423')(
138
-                        <ImageUploader />,
139
-                    )}
146
+                <Form.Item label="助力页背景图" help="建议尺寸:750*1206px,格式:jpg;内容区大小:750*1150">
147
+                    {getFieldDecorator('helpBackgroundImg',
148
+                        {
149
+                            initialValue: data.helpBackgroundImg,
150
+                        })(
151
+                            <ImageUploader />,
152
+                        )}
140 153
                 </Form.Item>
141
-                <Form.Item label="排行榜背景图">
142
-                    {getFieldDecorator('23423')(
143
-                        <ImageUploader />,
144
-                    )}
154
+                <Form.Item label="排行榜背景图" help="建议尺寸:750*1206px,格式:jpg;内容区大小:750*1150">
155
+                    {getFieldDecorator('rankingBackgroundImg',
156
+                        {
157
+                            initialValue: data.rankingBackgroundImg,
158
+                        })(
159
+                            <ImageUploader />,
160
+                        )}
145 161
                 </Form.Item>
146 162
                 <Form.Item label="上榜人数限制">
147
-                    {getFieldDecorator('number')(
148
-                        <Slider
149
-                            min={5}
150
-                            max={100}
151
-                            value={typeof inputValue === 'number' ? inputValue : 0}
152
-                            step={1}
153
-                            // width="100px"
154
-                            style={{ width: '100px' }}
155
-                        />,
156
-                    )}
163
+                    <Row>
164
+                        <Col span={6}>
165
+                            {getFieldDecorator('topLimitPersons',
166
+                                {
167
+                                    initialValue: typeof data.topLimitPersons === 'number' ? data.topLimitPersons : 0,
168
+                                })(
169
+                                    <Slider
170
+                                        min={5}
171
+                                        max={100}
172
+                                        // value={typeof inputValue === 'number' ? inputValue : 0}
173
+                                        step={1}
174
+                                    // width="100px"
175
+                                    // style={{ width: '100px' }}
176
+                                    />,
177
+                                )}
178
+                        </Col>
179
+                        <Col span={6}>
180
+                            {getFieldDecorator('topLimitPersons',
181
+                                {
182
+                                    // initialValue: data.topLimitPersons,
183
+                                })(
184
+                                    <InputNumber
185
+                                        min={5}
186
+                                        max={100}
187
+                                        style={{ marginLeft: 16 }}
188
+                                    // value={inputValue}
189
+                                    // onChange={this.onChange}
190
+                                    />,
191
+                                )}
192
+                        </Col>
193
+                    </Row>
157 194
                 </Form.Item>
158 195
                 <Form.Item label="查看楼盘按钮">
159
-                    {getFieldDecorator('ViewProperty')(
160
-                        // <Checkbox.Group options={ViewProperty} defaultValue={['Apple']} onChange={onChange} />,style={viewProperty.indexOf('home') == -1 ? {} : { color: '#EF273A' }}
161
-                        <Checkbox.Group name={Styles.Checkboxs} onChange={onViewPropertyChange} style={{ width: '100%' }}>
162
-                            <Row>
163
-                                <Col span={6}>
164
-                                    <Checkbox className={viewProperty.indexOf('home') === -1 ? {} : Styles.CheckboxStytle} value="home" >首页</Checkbox>
165
-                                </Col>
166
-                                <Col span={6}>
167
-                                    <Checkbox className={viewProperty.indexOf('group') === -1 ? {} : Styles.CheckboxStytle} value="group">助力页</Checkbox>
168
-                                </Col>
169
-                                <Col span={6}>
170
-                                    <Checkbox className={viewProperty.indexOf('rule') === -1 ? {} : Styles.CheckboxStytle} value="rule">活动规则页</Checkbox>
171
-                                </Col>
172
-                            </Row>
173
-                        </Checkbox.Group>,
174
-                    )}
196
+                    {getFieldDecorator('buildingShowPos',
197
+                        {
198
+                            initialValue: viewProperty,
199
+                        })(
200
+                            // <Checkbox.Group options={ViewProperty} defaultValue={['Apple']} onChange={onChange} />,style={viewProperty.indexOf('home') == -1 ? {} : { color: '#EF273A' }}
201
+                            <Checkbox.Group name={Styles.Checkboxs} onChange={onViewPropertyChange} style={{ width: '100%' }}>
202
+                                <Row>
203
+                                    <Col span={6}>
204
+                                        <Checkbox className={viewProperty.indexOf('index') === -1 ? {} : Styles.CheckboxStytle} value="index" >首页</Checkbox>
205
+                                    </Col>
206
+                                    <Col span={6}>
207
+                                        <Checkbox className={viewProperty.indexOf('help') === -1 ? {} : Styles.CheckboxStytle} value="help">助力页</Checkbox>
208
+                                    </Col>
209
+                                    <Col span={6}>
210
+                                        <Checkbox className={viewProperty.indexOf('rule') === -1 ? {} : Styles.CheckboxStytle} value="rule">活动规则页</Checkbox>
211
+                                    </Col>
212
+                                </Row>
213
+                            </Checkbox.Group>,
214
+                        )}
175 215
                 </Form.Item>
176 216
                 <Form.Item label="关联楼盘">
177
-                    {getFieldDecorator('buildId')(
178
-                        <BuildSelect />,
179
-                    )}
217
+                    {getFieldDecorator('buildingId',
218
+                        {
219
+                            initialValue: data.buildingId,
220
+                        })(
221
+                            <BuildSelect />,
222
+                        )}
180 223
                 </Form.Item>
181 224
                 <Form.Item label="生成海报按钮">
182
-                    {getFieldDecorator('ProductionPoster')(
225
+                    {getFieldDecorator('posterShowPos', {
226
+                        initialValue: productionPoster,
227
+                    })(
183 228
                         <Checkbox.Group name={Styles.Checkboxs} onChange={onProductionPoster} style={{ width: '100%' }}>
184 229
                             <Row>
185 230
                                 <Col span={6}>
186
-                                    <Checkbox className={productionPoster.indexOf('home') === -1 ? {} : Styles.CheckboxStytle} value="home" >首页</Checkbox>
231
+                                    <Checkbox className={productionPoster.indexOf('index') === -1 ? {} : Styles.CheckboxStytle} value="index" >首页</Checkbox>
187 232
                                 </Col>
188 233
                                 <Col span={6}>
189
-                                    <Checkbox className={productionPoster.indexOf('group') === -1 ? {} : Styles.CheckboxStytle} value="group">助力页</Checkbox>
234
+                                    <Checkbox className={productionPoster.indexOf('help') === -1 ? {} : Styles.CheckboxStytle} value="help">助力页</Checkbox>
190 235
                                 </Col>
191 236
                                 <Col span={6}>
192 237
                                     <Checkbox className={productionPoster.indexOf('rule') === -1 ? {} : Styles.CheckboxStytle} value="rule">活动规则页</Checkbox>
@@ -195,13 +240,13 @@ function Basic(props) {
195 240
                         </Checkbox.Group>,
196 241
                     )}
197 242
                 </Form.Item>
198
-                <Form.Item label="报名表单">
243
+                {/* <Form.Item label="报名表单">
199 244
                     {getFieldDecorator('registrationForm')(
200 245
                         <Checkbox.Group name={Styles.Checkboxs} onChange={onRegistrationForm} style={{ width: '100%' }}>
201 246
                             <Row>
202 247
                                 {registrationFormOption.map((x, index) => {
203 248
                                     return <Col span={6}>
204
-                                        {index !== 2 && (<Checkbox className={viewProperty.indexOf(x.value) === -1 ? {} : Styles.CheckboxStytle} value={x.value} >{x.label} </Checkbox>)}
249
+                                        {index !== 2 && (<Checkbox className={registrationForm.indexOf(x.value) === -1 ? {} : Styles.CheckboxStytle} value={x.value} >{x.label} </Checkbox>)}
205 250
 
206 251
                                         {inputVisible && index === 2 && (
207 252
                                             <Input
@@ -216,31 +261,20 @@ function Basic(props) {
216 261
                                             />
217 262
                                         )}
218 263
                                         {!inputVisible && index === 2 && (
219
-                                            <Checkbox className={viewProperty.indexOf(x.value) === -1 ? {} : Styles.CheckboxStytle} value={x.value} >{x.label} </Checkbox>
264
+                                            <Checkbox className={registrationForm.indexOf(x.value) === -1 ? {} : Styles.CheckboxStytle} value={x.value} >{x.label} </Checkbox>
220 265
                                         )}
221 266
                                         {!inputVisible && index === 2 && x.label === '自定义' && (
222
-                                            <Navigate onClick={showInput}  >
267
+                                            <Navigate onClick={showInput} >
223 268
                                                 修改
224 269
                                             </Navigate>
225 270
                                         )}
226 271
                                     </Col>
227 272
                                 })}
228 273
                             </Row>
229
-                            {/* registrationForm */}
230
-                            {/* <Row>
231
-                                <Col span={6}>
232
-                                    <Checkbox className={viewProperty.indexOf('home') === -1 ? {} : Styles.CheckboxStytle} value="home" >姓名</Checkbox>
233
-                                </Col>
234
-                                <Col span={6}>
235
-                                    <Checkbox className={viewProperty.indexOf('group') === -1 ? {} : Styles.CheckboxStytle} value="group">电话</Checkbox>
236
-                                </Col>
237
-                                <Col span={6}>
238
-                                    <Checkbox className={viewProperty.indexOf('rule') === -1 ? {} : Styles.CheckboxStytle} value="rule">活动规则页</Checkbox>
239
-                                </Col>
240
-                            </Row> */}
274
+                          
241 275
                         </Checkbox.Group>,
242 276
                     )}
243
-                </Form.Item>
277
+                </Form.Item> */}
244 278
                 <Form.Item wrapperCol={{ span: 15, offset: 8 }}>
245 279
                     <div style={{ width: '190px' }}>
246 280
                         <Button type="primary" style={{ marginRight: '20px' }} htmlType="submit">保存</Button>

+ 60
- 30
src/pages/activity/drainage/components/CustomerData.jsx Bestand weergeven

@@ -7,18 +7,27 @@ import request from '../../../../utils/request';
7 7
 
8 8
 function CustomerData(props) {
9 9
 
10
+    const { id } = props
10 11
     // const [taNoticeList, setTaNoticeList] = useState([])
11
-    const [data, setData] = useState([])
12
+    const [data, setData] = useState({})
12 13
 
13 14
     useEffect(() => {
14
-        // getList({ pageNum: 1, pageSize: 10 });
15
+        getList({ pageNum: 1, pageSize: 10 });
15 16
     }, [])
16 17
     // 查询列表
17 18
 
18 19
     const getList = params => {
19
-        // request({ ...apis.relatedOrganization.get, params: { ...params } }).then(data => {
20
-        //     setData(data)
21
-        // })
20
+        request({ ...apis.redPacket.getRecordByConditionList, params: { ...params, activityId: id } }).then(data => {
21
+            setData(data)
22
+        })
23
+    }
24
+
25
+    const changePageNum = pageNumber => {
26
+        props.form.validateFields((err, values) => {
27
+            if (!err) {
28
+                getList({ pageNum: pageNumber, pageSize: 10, ...values })
29
+            }
30
+        });
22 31
     }
23 32
 
24 33
     function handleSubmit(e) {
@@ -27,7 +36,7 @@ function CustomerData(props) {
27 36
             if (!err) {
28 37
                 // eslint-disable-next-line no-console
29 38
                 console.log('提交数据: ', values)
30
-
39
+                getList({ pageNum: 1, pageSize: 10 }, ...values)
31 40
             }
32 41
         });
33 42
     }
@@ -35,56 +44,77 @@ function CustomerData(props) {
35 44
     function handleReset() {
36 45
         props.form.resetFields();
37 46
 
38
-        // getList({ pageNum: 1, pageSize: 10 })
47
+        getList({ pageNum: 1, pageSize: 10 })
39 48
     }
40 49
 
41 50
     const columns = [
42 51
         {
43 52
             title: '头像',
44
-            dataIndex: 'targetName',
45
-            key: 'targetName',
53
+            dataIndex: 'avatarurl',
54
+            key: 'avatarurl',
46 55
             align: 'center',
47
-            render: (x, row) => <img src={row.qrCodeUrl} alt="" width="100px"></img >,
56
+            render: (x, row) => <img src={row.avatarurl} alt="" width="100px"></img >,
48 57
         },
49 58
         {
50 59
             title: '昵称',
51
-            dataIndex: 'targetName',
52
-            key: 'targetName',
60
+            dataIndex: 'nickName',
61
+            key: 'nickName',
53 62
             align: 'center',
54 63
         },
55 64
         {
56 65
             title: '姓名',
57
-            dataIndex: 'targetName',
58
-            key: 'targetName',
66
+            dataIndex: 'name',
67
+            key: 'name',
59 68
             align: 'center',
60 69
         },
61 70
         {
62 71
             title: '手机号',
63
-            dataIndex: 'targetName',
64
-            key: 'targetName',
72
+            dataIndex: 'phone',
73
+            key: 'phone',
65 74
             align: 'center',
66 75
         },
67 76
         {
68
-            title: '发放时间',
69
-            dataIndex: 'targetName',
70
-            key: 'targetName',
77
+            title: '访问时间',
78
+            dataIndex: 'createDate',
79
+            key: 'createDate',
71 80
             align: 'center',
72 81
             render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
73 82
         },
74 83
         {
75 84
             title: '分享人昵称',
76
-            dataIndex: 'targetName',
77
-            key: 'targetName',
85
+            dataIndex: 'sharePersonNickName',
86
+            key: 'sharePersonNickName',
78 87
             align: 'center',
79 88
         },
80 89
         {
81 90
             title: '分享人手机号',
82
-            dataIndex: 'targetName',
83
-            key: 'targetName',
91
+            dataIndex: 'sharePersonPhone',
92
+            key: 'sharePersonPhone',
84 93
             align: 'center',
85 94
         },
86 95
     ]
87 96
 
97
+    function download(data) {
98
+        if (!data) {
99
+            console.log('234')
100
+            return
101
+        }
102
+        const url = window.URL.createObjectURL(new Blob([data]))
103
+        const link = document.createElement('a')
104
+        link.style.display = 'none'
105
+        link.href = url
106
+        link.setAttribute('download', '客户数据.xlsx')
107
+        document.body.append(link)
108
+        link.click()
109
+    }
110
+
111
+    const exportReport = () => {
112
+
113
+        request({ ...apis.redPacket.exportVisitRecordByCondition, responseType: 'blob', params: { ...props.form.getFieldsValue(), activityId: id } }).then(data => {
114
+            download(data)
115
+        }).catch()
116
+    }
117
+
88 118
     const { getFieldDecorator } = props.form
89 119
 
90 120
     return (
@@ -92,7 +122,7 @@ function CustomerData(props) {
92 122
         <>
93 123
             <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
94 124
                 <Form.Item>
95
-                    {getFieldDecorator('tel')(
125
+                    {getFieldDecorator('phone')(
96 126
                         <Input
97 127
                             placeholder="手机号"
98 128
                         />,
@@ -109,7 +139,7 @@ function CustomerData(props) {
109 139
                     )}
110 140
                 </Form.Item>
111 141
                 <Form.Item>
112
-                    {getFieldDecorator('tel')(
142
+                    {getFieldDecorator('sharePersonPhone')(
113 143
                         <Input
114 144
                             placeholder="分享人手机号"
115 145
                         />,
@@ -121,15 +151,15 @@ function CustomerData(props) {
121 151
                 </Form.Item>
122 152
             </Form>
123 153
             <div style={{ marginTop: '20px' }}>
124
-                <span style={{ lineHeight: '32px' }}>共筛选出XX条数据</span>
125
-                <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
154
+                <span style={{ lineHeight: '32px' }}>共筛选出{data.total}条数据</span>
155
+                <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
126 156
             </div>
127
-            <Table dataSource={data} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
157
+            <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
128 158
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
129
-                {/* <Pagination
159
+                <Pagination
130 160
                     showQuickJumper
131 161
                     defaultCurrent={1}
132
-                    total={data.total} onChange={e => changePageNum(e)} current={data.current} /> */}
162
+                    total={data.total} onChange={e => changePageNum(e)} current={data.current} />
133 163
             </div>
134 164
         </>
135 165
 

src/pages/activity/drainage/components/Group.jsx → src/pages/activity/drainage/components/Help.jsx Bestand weergeven

@@ -7,20 +7,34 @@ import request from '../../../../utils/request';
7 7
 
8 8
 const { RangePicker } = DatePicker;
9 9
 
10
-function Group(props) {
10
+function Help(props) {
11
+
12
+    const { id, name } = props
11 13
 
12 14
     // const [taNoticeList, setTaNoticeList] = useState([])
13
-    // const [data, setData] = useState({})
15
+    const [data, setData] = useState({})
14 16
 
15 17
     useEffect(() => {
16
-        // getList({ pageNum: 1, pageSize: 10 });
18
+        getHelpDetail();
17 19
     }, [])
18 20
     // 查询列表
19 21
 
20
-    const getList = params => {
21
-        // request({ ...apis.relatedOrganization.get, params: { ...params } }).then(data => {
22
-        //     setData(data)
23
-        // })
22
+    const getHelpDetail = () => {
23
+        request({ ...apis.redPacket.helpDetail, urlData: { id } }).then(data => {
24
+            data.date = [moment(data.startDate), moment(data.endDate)]
25
+            setData(data)
26
+        })
27
+    }
28
+
29
+    const updateRedPacket = values => {
30
+
31
+        const [startDate, endDate] = values.date
32
+        values.startDate = `${moment(startDate).format('YYYY-MM-DDT00:00:00.000')}Z`
33
+        values.endDate = `${moment(endDate).format('YYYY-MM-DDT00:00:00.000')}Z`
34
+        values.activityId = id
35
+        request({ ...apis.redPacket.updateHelp, urlData: { id }, data: { ...values } }).then(data => {
36
+
37
+        })
24 38
     }
25 39
 
26 40
     function handleSubmit(e) {
@@ -28,6 +42,11 @@ function Group(props) {
28 42
         props.form.validateFields((err, values) => {
29 43
             if (!err) {
30 44
                 console.log(values, '------222-------')
45
+
46
+                // date
47
+
48
+                // values.
49
+                updateRedPacket(values)
31 50
             }
32 51
         },
33 52
         )
@@ -40,79 +59,79 @@ function Group(props) {
40 59
         <>
41 60
             <Form labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
42 61
                 <Form.Item label="助力成功需要人数">
43
-                    {getFieldDecorator('groupsuccess', {
44
-                        initialValue: '3',
62
+                    {getFieldDecorator('helpSuccesPersons', {
63
+                        initialValue: data.helpSuccesPersons || 3,
45 64
                     },
46 65
                     )(
47 66
                         <InputNumber min={1} max={1000} />,
48 67
                     )}
49 68
                 </Form.Item>
50 69
                 <Form.Item label="单人每人助力次数限制">
51
-                    {getFieldDecorator('number', {
52
-                        initialValue: '3',
70
+                    {getFieldDecorator('limitNumPerDay', {
71
+                        initialValue: data.limitNumPerDay || 3,
53 72
                     })(
54 73
                         <InputNumber min={1} max={1000} />,
55 74
                     )}
56 75
                 </Form.Item>
57 76
                 <Form.Item label="超出时提示文案">
58
-                    {getFieldDecorator('text', {
59
-
77
+                    {getFieldDecorator('limitPerDayIllegalTip', {
78
+                        initialValue: data.limitPerDayIllegalTip || '每人每天最多只能助力3次',
60 79
                     })(
61 80
                         <Input placeholder="每人每天最多只能助力3次" />,
62 81
                     )}
63 82
                 </Form.Item>
64 83
                 <Form.Item label="单人总助力次数限制">
65
-                    {getFieldDecorator('one', {
66
-                        initialValue: '3',
84
+                    {getFieldDecorator('limitNumPerPerson', {
85
+                        initialValue: data.limitNumPerPerson || 3,
67 86
                     })(
68 87
                         <InputNumber min={1} max={1000} />,
69 88
                     )}
70 89
                 </Form.Item>
71 90
                 <Form.Item label="超出时提示文案">
72
-                    {getFieldDecorator('text', {
73
-
91
+                    {getFieldDecorator('limitPerPersonIllegalTip', {
92
+                        initialValue: data.limitPerPersonIllegalTip || '每人最多只能为他人助力3次',
74 93
                     })(
75 94
                         <Input placeholder="每人最多只能为他人助力3次" />,
76 95
                     )}
77 96
                 </Form.Item>
78 97
                 <Form.Item label="为同一人助力次数限制">
79
-                    {getFieldDecorator('one', {
80
-                        initialValue: '3',
98
+                    {getFieldDecorator('limitNumForEachPerson', {
99
+                        initialValue: data.limitNumForEachPerson || 3,
81 100
                     })(
82 101
                         <InputNumber min={1} max={1000} />,
83 102
                     )}
84 103
                 </Form.Item>
85 104
                 <Form.Item label="超出时提示文案">
86
-                    {getFieldDecorator('text', {
87
-
105
+                    {getFieldDecorator('limitForEachPersonIllegalTip', {
106
+                        initialValue: data.limitForEachPersonIllegalTip || '只能为同一人助力1次',
88 107
                     })(
89 108
                         <Input placeholder="只能为同一人助力1次" />,
90 109
                     )}
91 110
                 </Form.Item>
92 111
                 <Form.Item label="助力成功时提示文案">
93
-                    {getFieldDecorator('text', {
94
-
112
+                    {getFieldDecorator('successTip', {
113
+                        initialValue: data.successTip || '助力成功!快去告诉你的好友吧',
95 114
                     })(
96 115
                         <Input placeholder="助力成功!快去告诉你的好友吧" />,
97 116
                     )}
98 117
                 </Form.Item>
99 118
                 <Form.Item label="其他无法助力时提示文案">
100
-                    {getFieldDecorator('text', {
101
-
119
+                    {getFieldDecorator('warnningTip', {
120
+                        initialValue: data.warnningTip || '无法助力!具体原因请看活动规则',
102 121
                     })(
103 122
                         <Input placeholder="无法助力!具体原因请看活动规则" />,
104 123
                     )}
105 124
                 </Form.Item>
106 125
                 <Form.Item label="活动开始~结束时间">
107
-                    {getFieldDecorator('text', {
108
-
126
+                    {getFieldDecorator('date', {
127
+                        initialValue: data.date,
109 128
                     })(
110 129
                         <RangePicker />,
111 130
                     )}
112 131
                 </Form.Item>
113 132
                 <Form.Item label="超出时提示文案">
114
-                    {getFieldDecorator('text', {
115
-
133
+                    {getFieldDecorator('activityEndTip', {
134
+                        initialValue: data.activityEndTip,
116 135
                     })(
117 136
                         <Input placeholder="活动已经结束啦" />,
118 137
                     )}
@@ -130,6 +149,6 @@ function Group(props) {
130 149
     )
131 150
 }
132 151
 
133
-const WrappedGroup = Form.create({ name: 'Group' })(Group);
152
+const WrappedHelp = Form.create({ name: 'Help' })(Help);
134 153
 
135
-export default WrappedGroup
154
+export default WrappedHelp

+ 27
- 20
src/pages/activity/drainage/components/ImageUpload.jsx Bestand weergeven

@@ -1,8 +1,8 @@
1 1
 import React from 'react';
2 2
 import { Upload, Icon, message } from 'antd';
3
-import './style.less';
3
+// import './style.less';
4 4
 import { uploaderProps } from '../../../../utils/upload';
5
-
5
+import './style.less';
6 6
 
7 7
 
8 8
 class ImageUpload extends React.Component {
@@ -12,7 +12,7 @@ class ImageUpload extends React.Component {
12 12
     };
13 13
 
14 14
     handleChange = info => {
15
-        if (info.file.status === "uploading") {
15
+        if (info.file.status === 'uploading') {
16 16
             this.setState({ loading: true });
17 17
             return;
18 18
         }
@@ -54,42 +54,49 @@ class ImageUpload extends React.Component {
54 54
     render() {
55 55
         const uploadButton = (
56 56
             <div>
57
-                <Icon style={{ fontSize: '2em', color: '#aaa' }} type={this.state.loading ? "loading" : "plus"} />
57
+                <Icon style={{ fontSize: '2em', color: '#aaa' }} type={this.state.loading ? 'loading' : 'plus'} />
58 58
             </div>
59 59
         );
60
-
60
+        // width: 150px;
61
+        // height: 241px;
61 62
         const value = this.props.value;
62 63
         return (
63 64
             <>
64
-                {!(this.state.imageUrl || value) && <Upload
65
+                {!(this.state.imageUrl || value) && <div style={{ width: '150px', height: '241px', marginTop: '10px' }}> <Upload
65 66
                     listType="picture-card"
66
-                    className="avatar-uploader"
67
+                    className="avatar-uploader avatar-newupdate"
67 68
                     showUploadList={false}
68 69
                     beforeUpload={this.props.beforeUpload}
69 70
                     onChange={this.handleChange}
70 71
                     {...uploaderProps}
71 72
                     disabled={this.props.disabled}
72 73
                     onSuccess={this.handleUploadSucess}
74
+
73 75
                 >
74 76
                     {uploadButton}
75 77
                 </Upload>
78
+                </div>
76 79
                 }
77
-                {(this.state.imageUrl || value) && <Upload
78
-                    listType="picture-card"
79
-                    className="avatar-uploader"
80
-                    showUploadList={false}
81
-                    beforeUpload={this.props.beforeUpload}
82
-                    onChange={this.handleChange}
83
-                    {...uploaderProps}
84
-                    disabled={this.props.disabled}
85
-                    onSuccess={this.handleUploadSucess}
86
-                >
87
-                    <img src={this.state.imageUrl || value} alt="avatar" style={{ width: '100%' }} />
80
+                {(this.state.imageUrl || value) && <div className="uploadbox">
81
+                    <img className="img" src={this.state.imageUrl || value} alt="avatar" style={{ width: '100%' }} ></img>
82
+
83
+                    <Upload
84
+                        listType="picture-card"
85
+                        // className={}
86
+                        className="avatar-uploader avatar-update"
87
+                        showUploadList={false}
88
+                        beforeUpload={this.props.beforeUpload}
89
+                        onChange={this.handleChange}
90
+                        {...uploaderProps}
91
+                        disabled={this.props.disabled}
92
+                        onSuccess={this.handleUploadSucess}
93
+                    >
94
+                        更换
88 95
                 </Upload>
89
-                }
96
+                </div>}
97
+
90 98
             </>
91 99
         );
92
-
93 100
     }
94 101
 }
95 102
 

+ 49
- 21
src/pages/activity/drainage/components/Ranking.jsx Bestand weergeven

@@ -7,18 +7,19 @@ import request from '../../../../utils/request';
7 7
 
8 8
 function Ranking(props) {
9 9
 
10
+    const { id } = props
10 11
     // const [taNoticeList, setTaNoticeList] = useState([])
11
-    const [data, setData] = useState([])
12
+    const [data, setData] = useState({})
12 13
 
13 14
     useEffect(() => {
14
-        // getList({ pageNum: 1, pageSize: 10 });
15
+        getList({ pageNum: 1, pageSize: 10 });
15 16
     }, [])
16 17
     // 查询列表
17 18
 
18 19
     const getList = params => {
19
-        // request({ ...apis.relatedOrganization.get, params: { ...params } }).then(data => {
20
-        //     setData(data)
21
-        // })
20
+        request({ ...apis.redPacket.getRedPacketRankingList, params: { ...params, activityId: id } }).then(data => {
21
+            setData(data)
22
+        })
22 23
     }
23 24
 
24 25
     function handleSubmit(e) {
@@ -27,7 +28,14 @@ function Ranking(props) {
27 28
             if (!err) {
28 29
                 // eslint-disable-next-line no-console
29 30
                 console.log('提交数据: ', values)
31
+            }
32
+        });
33
+    }
30 34
 
35
+    const changePageNum = pageNumber => {
36
+        props.form.validateFields((err, values) => {
37
+            if (!err) {
38
+                getList({ pageNum: pageNumber, pageSize: 10, ...values })
31 39
             }
32 40
         });
33 41
     }
@@ -35,37 +43,37 @@ function Ranking(props) {
35 43
     function handleReset() {
36 44
         props.form.resetFields();
37 45
 
38
-        // getList({ pageNum: 1, pageSize: 10 })
46
+        getList({ pageNum: 1, pageSize: 10 })
39 47
     }
40 48
 
41 49
     const columns = [
42 50
         {
43 51
             title: '头像',
44
-            dataIndex: 'targetName',
45
-            key: 'targetName',
52
+            dataIndex: 'avatarurl',
53
+            key: 'avatarurl',
46 54
             align: 'center',
47 55
             render: (x, row) => <img src={row.qrCodeUrl} alt="" width="100px"></img >,
48 56
         },
49 57
         {
50 58
             title: '昵称',
51
-            dataIndex: 'targetName',
52
-            key: 'targetName',
59
+            dataIndex: 'nickname',
60
+            key: 'nickname',
53 61
             align: 'center',
54 62
         },
55 63
         {
56 64
             title: '姓名',
57
-            dataIndex: 'targetName',
58
-            key: 'targetName',
65
+            dataIndex: 'name',
66
+            key: 'name',
59 67
             align: 'center',
60 68
         },
61 69
         {
62 70
             title: '手机号',
63
-            dataIndex: 'targetName',
64
-            key: 'targetName',
71
+            dataIndex: 'phone',
72
+            key: 'phone',
65 73
             align: 'center',
66 74
         },
67 75
         {
68
-            title: '发时间',
76
+            title: '发时间',
69 77
             dataIndex: 'targetName',
70 78
             key: 'targetName',
71 79
             align: 'center',
@@ -79,6 +87,26 @@ function Ranking(props) {
79 87
         },
80 88
     ]
81 89
 
90
+    function download(data) {
91
+        // if (!data) {
92
+        //     console.log('234')
93
+        //     return
94
+        // }
95
+        const url = window.URL.createObjectURL(new Blob([data]))
96
+        const link = document.createElement('a')
97
+        link.style.display = 'none'
98
+        link.href = url
99
+        link.setAttribute('download', '排行榜.xlsx')
100
+        document.body.append(link)
101
+        link.click()
102
+    }
103
+
104
+    const exportReport = () => {
105
+
106
+        request({ ...apis.redPacket.exportRedPacketRankingList, responseType: 'blob', params: { ...props.form.getFieldsValue(), activityId: id } }).then(data => {
107
+            download(data)
108
+        }).catch()
109
+    }
82 110
     const { getFieldDecorator } = props.form
83 111
 
84 112
     return (
@@ -86,7 +114,7 @@ function Ranking(props) {
86 114
         <>
87 115
             <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
88 116
                 <Form.Item>
89
-                    {getFieldDecorator('tel')(
117
+                    {getFieldDecorator('phone')(
90 118
                         <Input
91 119
                             placeholder="手机号"
92 120
                         />,
@@ -98,15 +126,15 @@ function Ranking(props) {
98 126
                 </Form.Item>
99 127
             </Form>
100 128
             <div style={{ marginTop: '20px' }}>
101
-                <span style={{ lineHeight: '32px' }}>共筛选出XX条数据</span>
102
-                <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
129
+                <span style={{ lineHeight: '32px' }}>共筛选出{data.total}条数据</span>
130
+                <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
103 131
             </div>
104
-            <Table dataSource={data} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
132
+            <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
105 133
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
106
-                {/* <Pagination
134
+                <Pagination
107 135
                     showQuickJumper
108 136
                     defaultCurrent={1}
109
-                    total={data.total} onChange={e => changePageNum(e)} current={data.current} /> */}
137
+                    total={data.total} onChange={e => changePageNum(e)} current={data.current} />
110 138
             </div>
111 139
         </>
112 140
 

+ 58
- 29
src/pages/activity/drainage/components/RedPacket.jsx Bestand weergeven

@@ -7,20 +7,31 @@ import apis from '../../../../services/apis';
7 7
 import request from '../../../../utils/request';
8 8
 import Styles from './styles.less';
9 9
 
10
+
10 11
 function RedPacket(props) {
11 12
 
13
+    const { id, name } = props
12 14
     // const [taNoticeList, setTaNoticeList] = useState([])
13
-    // const [data, setData] = useState({})
15
+    const [data, setData] = useState({})
14 16
 
15 17
     useEffect(() => {
18
+        getMoneyDetail()
16 19
         // getList({ pageNum: 1, pageSize: 10 });
17 20
     }, [])
18 21
     // 查询列表
22
+    //     moneyDetail
23
+    // updateMoney
24
+
25
+    const getMoneyDetail = () => {
26
+        request({ ...apis.redPacket.moneyDetail, urlData: { id } }).then(data => {
27
+            setData(data)
28
+        })
29
+    }
19 30
 
20
-    const getList = params => {
21
-        // request({ ...apis.relatedOrganization.get, params: { ...params } }).then(data => {
22
-        //     setData(data)
23
-        // })
31
+    const updateRedPacket = data => {
32
+        request({ ...apis.redPacket.updateMoney, urlData: { id }, data: { ...data } }).then(data => {
33
+            // setData(data)
34
+        })
24 35
     }
25 36
 
26 37
     function handleSubmit(e) {
@@ -28,31 +39,41 @@ function RedPacket(props) {
28 39
         props.form.validateFields((err, values) => {
29 40
             if (!err) {
30 41
                 console.log(values, '------222-------')
42
+                updateRedPacket(values)
31 43
             }
32 44
         },
33 45
         )
34 46
     }
35 47
 
48
+    const toRecharge = () => {
49
+
50
+        router.push({
51
+            pathname: '/funds/accountfunds',
52
+        })
53
+    }
54
+
36 55
 
37 56
     const { getFieldDecorator } = props.form
57
+    const { taRedPacketClient } = data
38 58
 
39 59
     return (
40 60
 
41 61
         <>
42 62
             <Row style={{ marginBottom: '40px' }}>
43
-                <Col span={8} >
63
+                <Col span={8} style={{ paddingRight: '30px' }}>
44 64
                     <div className={Styles.redHeader}>
45
-                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>账户余额/元</span><span className={Styles.redHeaderTopNum}>1000</span></div>
46
-                        <div className={Styles.redHeaderBottom}> <Navigate>去充值</Navigate></div>
65
+                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>账户余额/元</span><span className={Styles.redHeaderTopNum}>{data.balance}</span></div>
66
+                        <div className={Styles.redHeaderBottom}> <Navigate onClick={() => toRecharge()}>去充值</Navigate></div>
47 67
                     </div>
48 68
                 </Col>
49
-                <Col span={8} style={{ padding: '0 40px' }}>
69
+                <Col span={8} style={{ padding: '0 10px' }}>
50 70
                     <div className={Styles.redHeader}>
51
-                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包总数量/个</span><span className={Styles.redHeaderTopNum}>1000</span></div>
71
+                        {/* packetSendedNum */}
72
+                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包总数量/个</span><span className={Styles.redHeaderTopNum}>{}</span></div>
52 73
                         <div className={Styles.redHeaderBottom}><Navigate onClick={() => props.toDetail()}>查看详情</Navigate></div>
53 74
                     </div>
54 75
                 </Col>
55
-                <Col span={8} >
76
+                <Col span={8} style={{ paddingLeft: '30px' }}>
56 77
                     <div className={Styles.redHeader}>
57 78
                         <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包金额/元</span><span className={Styles.redHeaderTopNum}>1000</span></div>
58 79
                         <div className={Styles.redHeaderBottom}><Navigate onClick={() => props.toDetail(1)}>查看详情</Navigate></div>
@@ -61,7 +82,8 @@ function RedPacket(props) {
61 82
             </Row>
62 83
             <Form labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
63 84
                 <Form.Item label="本次红包预算/元">
64
-                    {getFieldDecorator('groupsuccess', {
85
+                    {getFieldDecorator('budget', {
86
+                        initialValue: data.budget,
65 87
                         // rules: [
66 88
                         //     {
67 89
                         //         type: 'number', message: '123'
@@ -73,55 +95,62 @@ function RedPacket(props) {
73 95
                     )}
74 96
                 </Form.Item>
75 97
                 <Form.Item label="单个红包金额范围/元">
76
-                    {getFieldDecorator('minNumber', {
77
-                        initialValue: '3',
98
+                    {getFieldDecorator('minPacket', {
99
+                        initialValue: data.minPacket || 3,
78 100
                     })(
79 101
                         <InputNumber min={1} max={1000} />,
80 102
                     )}~
81
-                     {getFieldDecorator('maxNumber', {
82
-                        initialValue: '3',
103
+                     {getFieldDecorator('maxPacket', {
104
+                        initialValue: data.maxPacket || 3,
83 105
                     })(
84 106
                         <InputNumber min={1} max={1000} />,
85 107
                     )}
86 108
                 </Form.Item>
87 109
                 <Form.Item label="发放红包个数上限">
88
-                    {getFieldDecorator('text', {
89
-
110
+                    {getFieldDecorator('limitPacketNum', {
111
+                        initialValue: data.limitPacketNum,
90 112
                     })(
91 113
                         <Input type="number" />,
92 114
                     )}
93 115
                 </Form.Item>
94 116
                 <Form.Item label="余额或预算不足时提示文案">
95
-                    {getFieldDecorator('one', {
96
-
117
+                    {getFieldDecorator('insufficientBalanceTip', {
118
+                        initialValue: data.insufficientBalanceTip || '红包已发送完毕,谢谢您的参与',
97 119
                     })(
98 120
                         <Input placeholder="红包已发送完毕,谢谢您的参与" />,
99 121
                     )}
100 122
                 </Form.Item>
101
-                <Form.Item label="商品名称">
102
-                    {getFieldDecorator('text', {
103
-
123
+                {/* font-size:22px;
124
+font-family:PingFangSC-Medium,PingFang SC;
125
+font-weight:500;
126
+color:rgba(102,102,102,1); */}
127
+                <Row>
128
+                    <Col span={8} style={{ textAlign: 'end', fontSize: '0.13rem', fontWeight: '500', color: 'rgba(102,102,102,1)', padding: '0 0.076rem' }}>配置消息</Col>
129
+                </Row>
130
+                <Form.Item label="商品名称" >
131
+                    {getFieldDecorator('mchName', {
132
+                        // initialValue: taRedPacketClient.mchName,
104 133
                     })(
105 134
                         <Input placeholder="{小程序名}" />,
106 135
                     )}
107 136
                 </Form.Item>
108 137
                 <Form.Item label="红包祝福语">
109
-                    {getFieldDecorator('one', {
110
-
138
+                    {getFieldDecorator('blessing', {
139
+                        // initialValue: taRedPacketClient.blessing,
111 140
                     })(
112 141
                         <Input placeholder="祝您中个大红包!" />,
113 142
                     )}
114 143
                 </Form.Item>
115 144
                 <Form.Item label="活动名称">
116
-                    {getFieldDecorator('text', {
117
-
145
+                    {getFieldDecorator('activityName', {
146
+                        // initialValue: taRedPacketClient.activityName,
118 147
                     })(
119 148
                         <Input placeholder="{活动标题}" />,
120 149
                     )}
121 150
                 </Form.Item>
122 151
                 <Form.Item label="备注">
123
-                    {getFieldDecorator('text', {
124
-
152
+                    {getFieldDecorator('remark', {
153
+                        // initialValue: taRedPacketClient.remark,
125 154
                     })(
126 155
                         <Input placeholder="点我拆红包" />,
127 156
                     )}

+ 34
- 24
src/pages/activity/drainage/components/RedPacketRecord.jsx Bestand weergeven

@@ -8,17 +8,19 @@ import request from '../../../../utils/request';
8 8
 function RedPacketRecord(props) {
9 9
 
10 10
     // const [taNoticeList, setTaNoticeList] = useState([])
11
-    const [data, setData] = useState([])
11
+
12
+    const { id, name } = props
13
+    const [data, setData] = useState({})
12 14
 
13 15
     useEffect(() => {
14
-        // getList({ pageNum: 1, pageSize: 10 });
16
+        getList({ pageNum: 1, pageSize: 10 });
15 17
     }, [])
16 18
     // 查询列表
17 19
 
18 20
     const getList = params => {
19
-        // request({ ...apis.relatedOrganization.get, params: { ...params } }).then(data => {
20
-        //     setData(data)
21
-        // })
21
+        request({ ...apis.redPacket.listSendRecord, params: { ...params, activityId: id } }).then(data => {
22
+            setData(data)
23
+        })
22 24
     }
23 25
 
24 26
     function handleSubmit(e) {
@@ -35,33 +37,41 @@ function RedPacketRecord(props) {
35 37
     function handleReset() {
36 38
         props.form.resetFields();
37 39
 
38
-        // getList({ pageNum: 1, pageSize: 10 })
40
+        getList({ pageNum: 1, pageSize: 10 })
39 41
     }
40 42
 
43
+    const changePageNum = pageNumber => {
44
+        props.form.validateFields((err, values) => {
45
+          if (!err) {
46
+            getList({ pageNum: pageNumber, pageSize: 10, ...values })
47
+          }
48
+        });
49
+      }
50
+
41 51
     const columns = [
42 52
         {
43 53
             title: '微信订单号',
44
-            dataIndex: 'targetName',
45
-            key: 'targetName',
54
+            dataIndex: 'wxOrderId',
55
+            key: 'wxOrderId',
46 56
             align: 'center',
47 57
         },
48 58
         {
49 59
             title: '用户昵称',
50
-            dataIndex: 'targetName',
51
-            key: 'targetName',
60
+            dataIndex: 'nickname',
61
+            key: 'nickname',
52 62
             align: 'center',
53 63
         },
54 64
         {
55 65
             title: '头像',
56
-            dataIndex: 'targetName',
57
-            key: 'targetName',
66
+            dataIndex: 'avatarurl',
67
+            key: 'avatarurl',
58 68
             align: 'center',
59 69
             render: (x, row) => <img src={row.qrCodeUrl} alt="" width="100px"></img >,
60 70
         },
61 71
         {
62 72
             title: '手机号',
63
-            dataIndex: 'targetName',
64
-            key: 'targetName',
73
+            dataIndex: 'phone',
74
+            key: 'phone',
65 75
             align: 'center',
66 76
         },
67 77
         {
@@ -73,14 +83,14 @@ function RedPacketRecord(props) {
73 83
         },
74 84
         {
75 85
             title: '金额(元)',
76
-            dataIndex: 'targetName',
77
-            key: 'targetName',
86
+            dataIndex: 'packetAmount',
87
+            key: 'packetAmount',
78 88
             align: 'center',
79 89
         },
80 90
         {
81 91
             title: '发送状态',
82
-            dataIndex: 'targetName',
83
-            key: 'targetName',
92
+            dataIndex: 'packetStatus',
93
+            key: 'packetStatus',
84 94
             align: 'center',
85 95
         },
86 96
     ]
@@ -92,21 +102,21 @@ function RedPacketRecord(props) {
92 102
         <>
93 103
             <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
94 104
                 <Form.Item>
95
-                    {getFieldDecorator('code')(
105
+                    {getFieldDecorator('wxOrderId')(
96 106
                         <Input
97 107
                             placeholder="订单号"
98 108
                         />,
99 109
                     )}
100 110
                 </Form.Item>
101 111
                 <Form.Item>
102
-                    {getFieldDecorator('tel')(
112
+                    {getFieldDecorator('phone')(
103 113
                         <Input
104 114
                             placeholder="手机号"
105 115
                         />,
106 116
                     )}
107 117
                 </Form.Item>
108 118
                 <Form.Item>
109
-                    {getFieldDecorator('code')(
119
+                    {getFieldDecorator('packetStatus')(
110 120
                         <Select style={{ width: '180px' }} placeholder="发送状态">
111 121
                             <option value="">全部</option>
112 122
                             <option value="1">成功</option>
@@ -120,12 +130,12 @@ function RedPacketRecord(props) {
120 130
                 </Form.Item>
121 131
             </Form>
122 132
 
123
-            <Table dataSource={data} columns={columns} pagination={false} rowKey={r => r.qrCodeId} style={{ marginTop: '20px' }} />
133
+            <Table dataSource={data.records} columns={columns} pagination={false} rowKey={r => r.qrCodeId} style={{ marginTop: '20px' }} />
124 134
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
125
-                {/* <Pagination
135
+                <Pagination
126 136
                     showQuickJumper
127 137
                     defaultCurrent={1}
128
-                    total={data.total} onChange={e => changePageNum(e)} current={data.current} /> */}
138
+                    total={data.total} onChange={e => changePageNum(e)} current={data.current} />
129 139
             </div>
130 140
         </>
131 141
 

+ 88
- 3
src/pages/activity/drainage/components/style.less Bestand weergeven

@@ -1,13 +1,71 @@
1 1
 :global {
2
-  .avatar-uploader {
2
+  .avatar-newupdate{
3
+    width: 100%;
4
+    height: 100%;
3 5
     & > .ant-upload {
4
-      // width: 128px;
5
-      // height: 128px;
6
+      width: 100%;
7
+        height: 100%;
6 8
     }
9
+    
7 10
   }
11
+  
12
+  // > .ant-upload{
13
+  //   width: 100%;
14
+  //   height: 100%;
15
+  // }
16
+  .avatar-update {
17
+    & > .ant-upload {
18
+      width:36px;
19
+      height:25px;
20
+      border: none;
21
+      font-size:18px;
22
+      // font-family:PingFangSC-Medium,PingFang SC;
23
+      font-weight:500;
24
+      color:rgba(255,255,255,1);
25
+      line-height:25px;
26
+      padding: 0;
27
+      margin: 0;
28
+      border: none;
29
+      background: none;
30
+      // position: absolute;
31
+     .ant-upload{
32
+        padding: 0;
33
+        color:#fff;
34
+        // position: relative;
35
+      }
36
+    }
37
+  }
38
+ .uploadbox {
39
+   margin-top: 10px;
40
+  position: relative;
41
+  width: 150px;
42
+  height: 241px;
43
+ 
44
+  .img{
45
+    position: absolute;
46
+    width: 100%;
47
+    height: 100%;
48
+    border-radius:7px;
49
+    border:1px solid rgba(156,156,156,1);
50
+  }
51
+  .avatar-update{
52
+    width: 36px;
53
+    position: absolute;
54
+    bottom: 0;
55
+    left: 50%;
56
+    transform: translate(-50%, 0);
57
+    // margin: 0 auto;
58
+  }
59
+}
60
+}
61
+
62
+.avatar-uploader{
63
+  width: 100%;
64
+  height: 100%;
8 65
 }
9 66
 
10 67
 
68
+
11 69
 /* you can make up upload button and sample style by using stylesheets */
12 70
 .ant-upload-select-picture-card i {
13 71
   font-size: 32px;
@@ -26,3 +84,30 @@
26 84
 .Checkboxs {
27 85
   background-color: #EF273A !important;
28 86
 }
87
+
88
+.img {
89
+  position: absolute;
90
+}
91
+
92
+.avatar-update > .ant-upload {
93
+  width:36px;
94
+height:25px;
95
+border: none;
96
+font-size:18px;
97
+// font-family:PingFangSC-Medium,PingFang SC;
98
+font-weight:500;
99
+color:rgba(255,255,255,1);
100
+line-height:25px;
101
+padding: 0;
102
+}
103
+
104
+.avatar-update{
105
+  
106
+  width:36px;
107
+height:25px !important;
108
+// font-size:18px;
109
+// font-family:PingFangSC-Medium,PingFang SC;
110
+// font-weight:500;
111
+// color:rgba(255,255,255,1);
112
+// line-height:25px;
113
+}

+ 5
- 4
src/pages/activity/drainage/detailDrainage.jsx Bestand weergeven

@@ -26,7 +26,8 @@ const BasicForm = props => {
26 26
     router.push({
27 27
       pathname: '/activity/drainage/h5edit',
28 28
       query: {
29
-        id: drainageId,
29
+        id: data.activityId,
30
+        name: data.name,
30 31
       },
31 32
     });
32 33
   }
@@ -58,12 +59,12 @@ const BasicForm = props => {
58 59
             <span>{data.h5Address}</span>
59 60
           </Form.Item>
60 61
         )}
61
-        {data.isMiniapp && (
62
+        {data.activityId && (
62 63
           <Form.Item label="扫码查看">
63
-            <img src="" alt></img>
64
+            <img src={data.qrCode} alt="" width="200"></img>
64 65
           </Form.Item>
65 66
         )}
66
-        {data.isMiniapp && (
67
+        {data.activityId && (
67 68
           <Form.Item label="配置H5">
68 69
             <Navigate onClick={toDrainageDetail}>修改配置</Navigate>
69 70
           </Form.Item>

+ 9
- 9
src/pages/activity/drainage/h5edit.jsx Bestand weergeven

@@ -1,11 +1,11 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Radio, Menu, Dropdown, Button, Icon, Modal, message, Table, Divider, Tabs, Tag, Select, Pagination } from 'antd';
2
+import { Radio } from 'antd';
3 3
 import router from 'umi/router';
4 4
 import moment from 'moment';
5 5
 import apis from '../../../services/apis';
6 6
 import request from '../../../utils/request';
7 7
 import Basic from './components/Basic';
8
-import Group from './components/Group';
8
+import Help from './components/Help';
9 9
 import RedPacket from './components/RedPacket';
10 10
 import RedPacketRecord from './components/RedPacketRecord';
11 11
 import CustomerData from './components/CustomerData';
@@ -17,7 +17,7 @@ const H5configuration = props => {
17 17
     const [tab, setTab] = useState('5')
18 18
     const [data, setData] = useState({})
19 19
 
20
-    const id = props.location.query.id
20
+    const { id, name } = props.location.query
21 21
     // const type = props.activeType
22 22
 
23 23
 
@@ -67,17 +67,17 @@ const H5configuration = props => {
67 67
             </Tabs> */}
68 68
             <div style={{ marginTop: '20px' }}>
69 69
                 {/* 基础配置 */}
70
-                {(tab === '1' && <Basic id={id} />)}
70
+                {(tab === '1' && <Basic id={id} name={name} />)}
71 71
                 {/* 助力配置 */}
72
-                {(tab === '2' && <Group />)}
72
+                {(tab === '2' && <Help id={id} name={name} />)}
73 73
                 {/* 红包配置 */}
74
-                {(tab === '3' && <RedPacket toDetail={ onDetai} />)}
74
+                {(tab === '3' && <RedPacket toDetail={onDetai} id={id} name={name} />)}
75 75
                 {/* 红包记录 */}
76
-                {(tab === '4' && <RedPacketRecord />)}
76
+                {(tab === '4' && <RedPacketRecord id={id} />)}
77 77
                 {/* 客户数据 */}
78
-                {(tab === '5' && <CustomerData />)}
78
+                {(tab === '5' && <CustomerData id={id} />)}
79 79
                 {/* 排行榜 */}
80
-                {(tab === '6' && <Ranking />)}
80
+                {(tab === '6' && <Ranking id={id} />)}
81 81
             </div>
82 82
         </div>
83 83
     </>

+ 174
- 0
src/pages/funds/accountfunds/components/Basic.jsx Bestand weergeven

@@ -0,0 +1,174 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Button, Modal, Input, Row, Col, message } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import Navigate from '@/components/Navigate';
6
+import apis from '../../../../services/apis';
7
+import request from '../../../../utils/request';
8
+import Styles from './styles.less';
9
+import Recharge from './Recharge'
10
+import Refund from './Refund'
11
+import Pay from './Pay'
12
+import Contact from './Contact'
13
+
14
+function Basic(props) {
15
+
16
+    // const [taNoticeList, setTaNoticeList] = useState([])
17
+    const [data, setData] = useState({})
18
+    const [visible, setvisiblea] = useState(false)
19
+    const [confirmLoading, setConfirmLoading] = useState(false)
20
+    const [title, setTitle] = useState()
21
+    const [amount, setAmount] = useState()
22
+    useEffect(() => {
23
+        getData();
24
+    }, [])
25
+    // 查询列表
26
+
27
+    const getData = params => {
28
+        request({ ...apis.funds.get, params: { ...params } }).then(data => {
29
+            setData(data)
30
+        })
31
+    }
32
+
33
+    const handleOkRecharge = e => {
34
+        console.log(e, '123123')
35
+        if (e) {
36
+
37
+            request({ ...apis.funds.saveOrder, data: { amount: e } }).then(data => {
38
+                setAmount(data)
39
+                showModal('pay')
40
+            }).catch(err => {
41
+                console.log(err)
42
+            })
43
+
44
+        }
45
+
46
+
47
+    };
48
+    // data: { amount: e }
49
+    const handleOkRefund = e => {
50
+        console.log(e, '123123')
51
+
52
+        if (e) {
53
+            request({ ...apis.funds.saveRefundOrder, data: { amount: e } }).then(data => {
54
+                message.info('申请退款成功')
55
+                setvisiblea(false)
56
+            }).catch(err => {
57
+                console.log(err)
58
+                message.err('申请退款失败')
59
+            })
60
+        }
61
+        // setConfirmLoading(true)
62
+        // setTimeout(() => {
63
+        //   this.setState({
64
+        //     visible: false,
65
+        //     confirmLoading: false,
66
+        //   });
67
+        // }, 2000);
68
+        // setvisiblea(false)
69
+    };
70
+
71
+    const handleOkRepay = e => {
72
+        console.log(e, '123123')
73
+        if (e === 'success') {
74
+            showModal('contact')
75
+        } else {
76
+            showModal()
77
+        }
78
+        // setConfirmLoading(true)
79
+        // setTimeout(() => {
80
+        //   this.setState({
81
+        //     visible: false,
82
+        //     confirmLoading: false,
83
+        //   });
84
+        // }, 2000);
85
+
86
+    };
87
+
88
+    const toNewContact = () => {
89
+
90
+        router.push({
91
+            pathname: '/funds/financialContact',
92
+            // query: {
93
+            //   id: rowData.raiseId,
94
+            //   buildingId: rowData.buildingId,
95
+            //   salesBatchId: rowData.salesBatchId,
96
+        })
97
+        
98
+    }
99
+
100
+
101
+    const showModal = value => {
102
+        if (value === 'recharge') {
103
+            setTitle('线上充值')
104
+        }
105
+        if (value === 'refund') {
106
+            setTitle('申请退款')
107
+        }
108
+        if (value === 'pay') {
109
+            setTitle('扫码支付')
110
+        }
111
+        if (value === 'contact') {
112
+            setTitle('联系我们')
113
+        }
114
+        setvisiblea(true)
115
+    };
116
+
117
+    const handleCancel = () => {
118
+        console.log('Clicked cancel button');
119
+        setvisiblea(false)
120
+    };
121
+
122
+    return (
123
+
124
+        <>
125
+            对资金有疑问? <Navigate onClick={() => toNewContact()}>请联系我们</Navigate>
126
+            <div style={{ display: 'flex', margin: '20px 0 40px' }}>
127
+                <div className={Styles.redHeader}>
128
+                    <div className={Styles.redHeaderTop}><div className={Styles.redHeaderTopText}>总充值金额/元</div><div className={Styles.redHeaderTopNum}>{data.totalRechargeAmount / 100 || 0}</div></div>
129
+                    <div className={Styles.redHeaderBottom}> 对账请在充值订单中查看充值状态为“已支付”的充值记录</div>
130
+                </div>
131
+                <div className={Styles.redHeader} style={{ margin: '0 40px' }}>
132
+                    <div className={Styles.redHeaderTop}><div className={Styles.redHeaderTopText}>已消费金额/元</div><div className={Styles.redHeaderTopNum}>{data.purchaseAmount / 100 || 0}</div></div>
133
+                    <div className={Styles.redHeaderBottom}>对账请在消费订单中查看消费状态为“成功”的消费记录</div>
134
+                </div>
135
+                <div className={Styles.redHeader}>
136
+                    <div className={Styles.redHeaderTop}><div className={Styles.redHeaderTopText}>已退款额/元</div><div className={Styles.redHeaderTopNum}>{data.totalRechargeAmounttotalRefund / 100 || 0}</div></div>
137
+                    <div className={Styles.redHeaderBottom}>对账请在退款订单中查看退款状态为“已退款”的退款记录</div>
138
+                </div>
139
+
140
+                <div className={Styles.redHeader} style={{ margin: '0 40px' }}>
141
+                    <div className={Styles.redHeaderTop}><div className={Styles.redHeaderTopText}>退款冻结额/元</div><div className={Styles.redHeaderTopNum}>{data.refundBlockedAmount / 100 || 0}</div></div>
142
+                    <div className={Styles.redHeaderBottom}>对账请在退款订单中查看退款状态为“已申请”的退款记录</div>
143
+                </div>
144
+                <div className={Styles.redHeader}>
145
+                    <div className={Styles.redHeaderTop}><div className={Styles.redHeaderTopText}>账户余额/元</div><div className={Styles.redHeaderTopNum}>{data.realBalance / 100 || 0}</div></div>
146
+                    <div className={Styles.redHeaderBottom}>账户余额=总充值金额-已消费金额-已退款额-退款冻结额</div>
147
+                </div>
148
+            </div>
149
+            <div style={{ textAlign: 'center', marginTop: '272px' }}>
150
+                <Button className={Styles.btn} type="primary" htmlType="submit" onClick={() => showModal('recharge')}>充值</Button>
151
+                <Button className={Styles.btn} style={{ marginLeft: '80px' }} onClick={() => showModal('refund')}>退款</Button>
152
+            </div>
153
+
154
+            <Modal
155
+                title={title}
156
+                visible={visible}
157
+                // onOk={handleOk}
158
+                confirmLoading={confirmLoading}
159
+                onCancel={handleCancel}
160
+                footer={null}
161
+                width="1000px"
162
+                maskClosable={false}
163
+            >
164
+                {title === '线上充值' && <Recharge value={e => handleOkRecharge(e)}></Recharge>}
165
+                {title === '申请退款' && <Refund balance={data.realBalance / 100 || 0} value={e => handleOkRefund(e)}></Refund>}
166
+                {title === '扫码支付' && visible && <Pay amount={amount} visible={visible} value={e => handleOkRepay(e)}></Pay>}
167
+                {title === '联系我们' && <Contact></Contact>}
168
+
169
+            </Modal>
170
+        </>
171
+    )
172
+}
173
+
174
+export default Basic

+ 236
- 0
src/pages/funds/accountfunds/components/ConsumerOrder.jsx Bestand weergeven

@@ -0,0 +1,236 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import apis from '../../../../services/apis';
6
+import request from '../../../../utils/request';
7
+import Navigate from '@/components/Navigate';
8
+
9
+const { Option } = Select
10
+
11
+function RechargeOrder(props) {
12
+
13
+    // const [taNoticeList, setTaNoticeList] = useState([])
14
+    const [data, setData] = useState({})
15
+    const [modalData, setModalData] = useState([])
16
+    const [visible, setvisiblea] = useState(false)
17
+
18
+    useEffect(() => {
19
+        getList({ pageNum: 1, pageSize: 10 });
20
+    }, [])
21
+    // 查询列表
22
+
23
+    const getList = params => {
24
+        request({ ...apis.funds.consumeOrderByConditionlist, params: { ...params, consumeType: 'redPackage' } }).then(data => {
25
+            setData(data)
26
+        })
27
+    }
28
+
29
+    function handleSubmit(e) {
30
+        e.preventDefault();
31
+        props.form.validateFields((err, values) => {
32
+            if (!err) {
33
+                // eslint-disable-next-line no-console
34
+                console.log('提交数据: ', values)
35
+                getList({ pageNum: 1, pageSize: 10 });
36
+            }
37
+        });
38
+    }
39
+
40
+    function handleReset() {
41
+        props.form.resetFields();
42
+
43
+        getList({ pageNum: 1, pageSize: 10 })
44
+    }
45
+
46
+    const showModal = (row) => {
47
+        setvisiblea(true)
48
+        setModalData(row)
49
+    }
50
+
51
+    const changePageNum = e => {
52
+        props.form.validateFields((err, values) => {
53
+            if (!err) {
54
+                // eslint-disable-next-line no-console
55
+                console.log('提交数据: ', values)
56
+                getList({ pageNum: e, pageSize: 10, ...values })
57
+            }
58
+        });
59
+
60
+    }
61
+
62
+    const columns = [
63
+        {
64
+            title: '订单编号',
65
+            dataIndex: 'tradeNo',
66
+            key: 'tradeNo',
67
+            align: 'center',
68
+        },
69
+        {
70
+            title: '消费金额',
71
+            dataIndex: 'amount',
72
+            key: 'amount',
73
+            align: 'center',
74
+        },
75
+        {
76
+            title: '消费方式',
77
+            dataIndex: 'targetName',
78
+            key: 'targetName',
79
+            align: 'center',
80
+            render: () => <><span>红包</span></>,
81
+        },
82
+        {
83
+            title: '活动名称',
84
+            dataIndex: 'activityName',
85
+            key: 'activityName',
86
+            align: 'center',
87
+        },
88
+        {
89
+            title: '消费下单时间',
90
+            dataIndex: 'expiryDate',
91
+            key: 'expiryDate',
92
+            align: 'center',
93
+            render: (x, row) => <><span>{`${moment(row.expiryDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
94
+        },
95
+        {
96
+            title: '接收人手机号',
97
+            dataIndex: 'phone',
98
+            key: 'phone',
99
+            align: 'center',
100
+            render: (x, row) => <><Navigate onClick={() => showModal(row)}>{x}</Navigate> </>,
101
+        },
102
+        {
103
+            title: '消费状态',
104
+            dataIndex: 'auditStatus',
105
+            key: 'auditStatus',
106
+            align: 'center',
107
+            render: (x, row) => <><span>{x === 1 ? '成功' : '失败'}</span></>,
108
+        },
109
+    ]
110
+
111
+    function download(data) {
112
+        // if (!data) {
113
+        //     console.log('234')
114
+        //     return
115
+        // }
116
+        const url = window.URL.createObjectURL(new Blob([data]))
117
+        const link = document.createElement('a')
118
+        link.style.display = 'none'
119
+        link.href = url
120
+        link.setAttribute('download', '消费订单.xlsx')
121
+        document.body.append(link)
122
+        link.click()
123
+    }
124
+
125
+    const exportReport = () => {
126
+
127
+        request({ ...apis.funds.exportConsumeOrderByCondition, responseType: 'blob', params: { ...props.form.getFieldsValue(), consumeType: 'redPackage' } }).then(data => {
128
+            download(data)
129
+        }).catch()
130
+    }
131
+
132
+    const { getFieldDecorator } = props.form
133
+
134
+    return (
135
+
136
+        <>
137
+            <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
138
+                <Form.Item>
139
+                    {getFieldDecorator('tradeNo')(
140
+                        <Input
141
+                            placeholder="订单编号"
142
+                        />,
143
+                    )}
144
+                </Form.Item>
145
+                <Form.Item>
146
+                    {getFieldDecorator('startTime')(
147
+                        <DatePicker placeholder="消费开始时间" />,
148
+                    )}
149
+                </Form.Item>
150
+                <Form.Item>
151
+                    {getFieldDecorator('endTime')(
152
+                        <DatePicker placeholder="消费结束时间" />,
153
+                    )}
154
+                </Form.Item>
155
+                <Form.Item>
156
+                    {getFieldDecorator('auditStatus')(
157
+                        <Select style={{ width: '180px' }} placeholder="消费状态">
158
+                            <Option value="">全部</Option>
159
+                            <Option value="1">成功</Option>
160
+                            <Option value="0">失败</Option>
161
+                        </Select>,
162
+                    )}
163
+                </Form.Item>
164
+                <Form.Item>
165
+                    {getFieldDecorator('consumeType')(
166
+                        <Select style={{ width: '180px' }} placeholder="消费状态">
167
+                            <Option value="">全部</Option>
168
+                            <Option value="redPackage">红包</Option>
169
+                        </Select>,
170
+                    )}
171
+                </Form.Item>
172
+                <Form.Item>
173
+                    {getFieldDecorator('phone')(
174
+                        <Input
175
+                            placeholder="接收人手机号"
176
+                        />,
177
+                    )}
178
+                </Form.Item>
179
+                <Form.Item>
180
+                    <Button type="primary" htmlType="submit"> 搜索</Button>
181
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
182
+                </Form.Item>
183
+            </Form>
184
+            <div style={{ marginTop: '20px' }}>
185
+                <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
186
+            </div>
187
+            <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
188
+            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
189
+                <Pagination
190
+                    showQuickJumper
191
+                    defaultCurrent={1}
192
+                    total={data.total} onChange={e => changePageNum(e)} current={data.current} />
193
+            </div>
194
+            <Modal
195
+                title="接收人信息"
196
+                visible={visible}
197
+                // onOk={handleOk}
198
+                // confirmLoading={confirmLoading}
199
+                onCancel={() => setvisiblea(false)}
200
+                footer={null}
201
+            // width="1000px"
202
+            // maskClosable={false}
203
+            >
204
+                <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }}>
205
+                    <Form.Item label="昵称">
206
+
207
+                        <span>{modalData.nickName}</span>
208
+
209
+                    </Form.Item>
210
+                    <Form.Item label="头像">
211
+
212
+                        <img src={modalData.avatarurl} alt="" />
213
+
214
+                    </Form.Item>
215
+                    <Form.Item label="姓名">
216
+
217
+                        <span>{modalData.name}</span>
218
+
219
+                    </Form.Item>
220
+                    <Form.Item label="手机号">
221
+
222
+                        <span>{modalData.phone}</span>
223
+
224
+                    </Form.Item>
225
+                </Form>
226
+            </Modal>
227
+        </>
228
+
229
+    )
230
+}
231
+
232
+
233
+const WrappedRechargeOrder = Form.create({ name: 'RechargeOrder' })(RechargeOrder);
234
+
235
+export default WrappedRechargeOrder
236
+

+ 19
- 0
src/pages/funds/accountfunds/components/Contact.jsx Bestand weergeven

@@ -0,0 +1,19 @@
1
+import React, { useState } from 'react';
2
+import { Button, Input, Row, Col } from 'antd';
3
+import Styles from './styles.less';
4
+import Navigate from '@/components/Navigate';
5
+
6
+const Recharge = props => {
7
+
8
+    const [value, setValue] = useState()
9
+
10
+    return (
11
+        <>
12
+            <span style={{ fontSize: '22px', color: '#979797', lineHeight: '30px' }}>重要说明:</span>
13
+            <div style={{ fontSize: '18px', color: '#333', lineHeight: '34px', marginTop: '20px' }}>
14
+                您已充值成功,微信充值到账为T+7,因此,充值金额7日后才能到账,为不影响客户使用,实际活动金额由橙蕉预先充值垫付,需要在使用预算前和运营人员确认橙蕉余额是否充足, <Navigate>请联系我们</Navigate>
15
+            </div>
16
+        </>
17
+    )
18
+}
19
+export default Recharge

+ 104
- 0
src/pages/funds/accountfunds/components/Pay.jsx Bestand weergeven

@@ -0,0 +1,104 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Button, Input, Row, Col, message } from 'antd';
3
+import QRCode from 'qrcode.react';
4
+import Styles from './styles.less';
5
+import apis from '../../../../services/apis';
6
+import request from '../../../../utils/request';
7
+
8
+const Recharge = props => {
9
+
10
+    const { amount, visible } = props
11
+    console.log(amount, visible, 'amount')
12
+    const { orderInfo } = amount
13
+    console.log(orderInfo, 'orderInfo')
14
+    useEffect(() => {
15
+        getByInfo
16
+        // setTimeout(() => { getByInfo() }, 1000)
17
+    }, [])
18
+
19
+
20
+    const getByInfo = setInterval(() => {
21
+
22
+
23
+
24
+        request({ ...apis.funds.getByInfo, params: { orderId: orderInfo.orderId } }).then(data => {
25
+            if (data.tradingStatus === 'processing') {
26
+
27
+                // clearInterval(getByInfo)
28
+                // props.value()
29
+                if (!visible) { clearInterval(getByInfo) }
30
+            } else if (data.tradingStatus === 'success') {
31
+                mmessage.info('充值成功')
32
+                
33
+                props.value('success')
34
+                clearInterval(getByInfo)
35
+            } else {
36
+                mmessage.info('充值失败')
37
+                
38
+                props.value('fail')
39
+                clearInterval(getByInfo)
40
+            }
41
+            // tradingStatus
42
+            // setTimeout(() => { getByInfo() }, 1000)
43
+        }).catch(err => {
44
+            console.log(err)
45
+            clearInterval(getByInfo)
46
+        })
47
+    }, 1000)
48
+
49
+
50
+    // {
51
+    //     request({ ...apis.funds.getByInfo, params: { orderId: orderInfo.orderId } }).then(data => {
52
+    //         if (data.tradingStatus === 'processing') {
53
+    //             setTimeout(() => { getByInfo() }, 1000)
54
+    //         } else if (data.tradingStatus === 'success') {
55
+    //             mmessage.info('充值成功')
56
+    //         } else {
57
+    //             mmessage.info('充值失败')
58
+    //         }
59
+
60
+    //         // tradingStatus
61
+    //         // setTimeout(() => { getByInfo() }, 1000)
62
+    //     }).catch(err => {
63
+    //         console.log(err)
64
+    //     })
65
+    // }
66
+    // getByInfo
67
+
68
+
69
+    // const [value, setValue] = useState()
70
+
71
+    // function onChange(e) {
72
+    //     if (e.target.value <= 0) return
73
+    //     if (e.target.value > 99999.99) { setValue(99999.99); return }
74
+    //     console.log('changed', e.target.value);
75
+    //     setValue(e.target.value)
76
+
77
+    // }
78
+    return (
79
+        <>
80
+            <div style={{ fontSize: '18px', fontWeight: '400', color: '#333333' }}>
81
+                <span onClick={props.value}>充值金额{amount.amount}元</span><span style={{ marginLeft: '80px' }}>微信商户手续费率{amount.mchPayRate}</span><span style={{ marginLeft: '80px' }}>手续费{amount.serviceFee}元</span>
82
+                {/* <img src="" alt="" width:/> */}
83
+            </div>
84
+            <div style={{ height: '278px', borderRadius: '12px', border: '1px solid rgba(218,218,218,1', margin: '40px 0', display: 'flex' }}>
85
+                <div className={Styles.box}>
86
+                    <QRCode
87
+                        value={amount.payQrCode}  //value参数为生成二维码的链接
88
+                        size={194} //二维码的宽高尺寸
89
+                        fgColor="#000000"  //二维码的颜色
90
+                    />
91
+                    {/* <img src={amount.payQrCode} alt="" /> */}
92
+                </div>
93
+                <div className={Styles.boxRight}>
94
+                    <div className={Styles.child}>
95
+                        <p style={{ lineHeight: '43px', height: '43px', marginBottom: '5px' }}><span style={{ fontSize: '32px', fontWeight: '600', color: '#EF273A' }}>¥{amount.realAmount}</span><span style={{ marginLeft: '5px' }}>应付金额</span></p>
96
+                        <p>仅支持微信支付</p>
97
+                    </div>
98
+
99
+                </div>
100
+            </div>
101
+        </>
102
+    )
103
+}
104
+export default Recharge

+ 38
- 0
src/pages/funds/accountfunds/components/Recharge.jsx Bestand weergeven

@@ -0,0 +1,38 @@
1
+import React, { useState } from 'react';
2
+import { Button, Input, Row, Col } from 'antd';
3
+import Styles from './styles.less';
4
+import Navigate from '@/components/Navigate';
5
+import ContactText from './contactText'
6
+
7
+const Recharge = props => {
8
+
9
+    const [value, setValue] = useState()
10
+
11
+    function onChange(e) {
12
+        if (e.target.value <= 0) return
13
+        if (e.target.value > 99999.99) { setValue(99999.99); return }
14
+        console.log('changed', e.target.value);
15
+        setValue(e.target.value)
16
+
17
+    }
18
+    return (
19
+        <>
20
+            <Row>
21
+                <Col span={3}> <span style={{ fontSize: '20px', color: '#666' }}>充值金额/元</span></Col>
22
+                <Col span={17} offset={1}>
23
+                    <Input type="number" min={0} step={0.01} value={value} onChange={onChange} style={{ marginBottom: '40px' }}></Input>
24
+                    <span style={{ fontSize: '20px', color: '#979797', lineHeight: '30px' }}>重要说明:</span>
25
+                    <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px', marginTop: '20px' }}>1.充值流程:输入充值金额-点击确定-扫码支付-支付成功。</p>
26
+                    <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px' }}>2.因微信限制,微信充值有手续费,因此充值金额中应包含手续费,费率1%。</p>
27
+                    <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px' }}>3.微信充值到账为T+7,因此,充值金额7日后才能到账,为不影响客户使用,实际活动金额由橙蕉预先充值垫付,需要在使用预算前和运营人员确认橙蕉余额是否充足。充值后请联系我们。</p>
28
+                    <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px' }}>4.您也可使用银行卡转账/支付宝支付/对公账户打款/现金支付等方式充值,具体方式请<ContactText /></p>
29
+                </Col>
30
+            </Row>
31
+            <div style={{ textAlign: 'center', marginTop: '40px' }}>
32
+                <Button className={Styles.btn} type="primary" htmlType="submit" onClick={() => props.value(value)}>充值</Button>
33
+
34
+            </div>
35
+        </>
36
+    )
37
+}
38
+export default Recharge

+ 226
- 0
src/pages/funds/accountfunds/components/RechargeOrder.jsx Bestand weergeven

@@ -0,0 +1,226 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import Navigate from '@/components/Navigate'
6
+import apis from '../../../../services/apis';
7
+import request from '../../../../utils/request';
8
+import ShowVoucher from './ShowVoucher';
9
+
10
+
11
+const { Option } = Select
12
+
13
+function RechargeOrder(props) {
14
+
15
+    // const [taNoticeList, setTaNoticeList] = useState([])
16
+    const [data, setData] = useState({})
17
+
18
+    const [showVoucher, setShowVoucher] = useState({})
19
+    //     {
20
+    //         visible: false,
21
+    //         bannerList: ['//njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1591609582282-1584614514971-504167f68a5d43ee693949b26498ef21.jpg', '//njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1591609582282-1584614514971-504167f68a5d43ee693949b26498ef21.jpg'],
22
+    //     },
23
+    // )
24
+
25
+    useEffect(() => {
26
+        getList({ pageNum: 1, pageSize: 10 });
27
+    }, [])
28
+    // 查询列表
29
+
30
+    const getList = params => {
31
+        request({ ...apis.funds.czlist, params: { ...params } }).then(data => {
32
+            setData(data)
33
+        })
34
+    }
35
+    const openImg = data => {
36
+        setShowVoucher(
37
+            {
38
+                visible: true,
39
+                bannerList: data,
40
+            },
41
+        )
42
+    }
43
+
44
+    const changePageNum = e => {
45
+        props.form.validateFields((err, values) => {
46
+            if (!err) {
47
+                // eslint-disable-next-line no-console
48
+                console.log('提交数据: ', values)
49
+                getList({ pageNum: e, pageSize: 10, ...values })
50
+            }
51
+        });
52
+
53
+    }
54
+
55
+
56
+    function handleSubmit(e) {
57
+        e.preventDefault();
58
+        props.form.validateFields((err, values) => {
59
+            if (!err) {
60
+                // eslint-disable-next-line no-console
61
+                console.log('提交数据: ', values)
62
+                getList({ pageNum: 1, pageSize: 10, ...values })
63
+            }
64
+        });
65
+    }
66
+
67
+    function handleReset() {
68
+        props.form.resetFields();
69
+
70
+        getList({ pageNum: 1, pageSize: 10 })
71
+    }
72
+
73
+    const columns = [
74
+        {
75
+            title: '订单编号',
76
+            dataIndex: 'tradeNo',
77
+            key: 'tradeNo',
78
+            align: 'center',
79
+        },
80
+        {
81
+            title: '充值金额',
82
+            dataIndex: 'amount',
83
+            key: 'amount',
84
+            align: 'center',
85
+        },
86
+        {
87
+            title: '充值方式',
88
+            dataIndex: 'isOffline',
89
+            key: 'isOffline',
90
+            align: 'center',
91
+            render: x => <><span>{x ? '运营手工充值' : '业务线上充值'}</span></>,
92
+        },
93
+        {
94
+            title: '下单时间',
95
+            dataIndex: 'createDate',
96
+            key: 'createDate',
97
+            align: 'center',
98
+            render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
99
+        },
100
+        {
101
+            title: '充值凭证',
102
+            dataIndex: 'certificateList',
103
+            key: 'certificateList',
104
+            align: 'center',
105
+            render: (x, row) => <><Navigate onClick={() => openImg(x)}>查看</Navigate> </>,
106
+        },
107
+        {
108
+            title: '充值状态',
109
+            dataIndex: 'tradingStatus',
110
+            key: 'tradingStatus',
111
+            align: 'center',
112
+            render: x => <><span>{x ? '运营手工充值' : '业务线上充值'}</span></>,
113
+        },
114
+        {
115
+            title: '支付时间',
116
+            dataIndex: 'payDate',
117
+            key: 'payDate',
118
+            align: 'center',
119
+            render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
120
+        },
121
+    ]
122
+
123
+    const { getFieldDecorator } = props.form
124
+
125
+    function download(data) {
126
+        // if (!data) {
127
+        //     console.log('234')
128
+        //     return
129
+        // }
130
+        const url = window.URL.createObjectURL(new Blob([data]))
131
+        const link = document.createElement('a')
132
+        link.style.display = 'none'
133
+        link.href = url
134
+        link.setAttribute('download', '充值订单.xlsx')
135
+        document.body.append(link)
136
+        link.click()
137
+    }
138
+
139
+    const exportReport = () => {
140
+
141
+        request({ ...apis.funds.czexportList, responseType: 'blob', params: { ...props.form.getFieldsValue() } }).then(data => {
142
+            download(data)
143
+        }).catch()
144
+    }
145
+
146
+    return (
147
+
148
+        <>
149
+            <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
150
+                <Form.Item>
151
+                    {getFieldDecorator('tradeNo')(
152
+                        <Input
153
+                            placeholder="订单编号"
154
+                        />,
155
+                    )}
156
+                </Form.Item>
157
+                <Form.Item>
158
+                    {getFieldDecorator('payStartTime')(
159
+                        <DatePicker placeholder="支付开始时间" />,
160
+                    )}
161
+                </Form.Item>
162
+                <Form.Item>
163
+                    {getFieldDecorator('payEndTime')(
164
+                        <DatePicker placeholder="支付结束时间" />,
165
+                    )}
166
+                </Form.Item>
167
+                <Form.Item>
168
+                    {getFieldDecorator('isOffline')(
169
+                        <Select style={{ width: '180px' }} placeholder="充值方式">
170
+                            <Option value="">全部</Option>
171
+                            <Option value={0}>业务线上充值</Option>
172
+                            <Option value={1}>运营手工充值</Option>
173
+                        </Select>,
174
+                    )}
175
+                </Form.Item>
176
+                <Form.Item>
177
+                    {getFieldDecorator('tradingStatus')(
178
+                        <Select style={{ width: '180px' }} placeholder="充值状态">
179
+                            <Option value="">全部</Option>
180
+                            <Option value="1">待支付</Option>
181
+                            <Option value="2">已支付</Option>
182
+                            <Option value="3">已超时</Option>
183
+                        </Select>,
184
+                    )}
185
+                </Form.Item>
186
+                {/* <Form.Item>
187
+                    {getFieldDecorator('tel')(
188
+                        <Input
189
+                            placeholder="充值方式"
190
+                        />,
191
+                    )}
192
+                </Form.Item>
193
+                <Form.Item>
194
+                    {getFieldDecorator('tel')(
195
+                        <Input
196
+                            placeholder="充值状态"
197
+                        />,
198
+                    )}
199
+                </Form.Item> */}
200
+                <Form.Item>
201
+                    <Button type="primary" htmlType="submit"> 搜索</Button>
202
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
203
+                </Form.Item>
204
+            </Form>
205
+            <div style={{ marginTop: '20px' }}>
206
+                <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
207
+            </div>
208
+            <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
209
+            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
210
+                <Pagination
211
+                    showQuickJumper
212
+                    defaultCurrent={1}
213
+                    total={data.total} onChange={e => changePageNum(e)} current={data.current} />
214
+            </div>
215
+
216
+            {showVoucher.visible && <ShowVoucher bannerList={showVoucher.bannerList} closeSwiper={() => setShowVoucher({ visible: false })} />}
217
+        </>
218
+
219
+    )
220
+}
221
+
222
+
223
+const WrappedRechargeOrder = Form.create({ name: 'RechargeOrder' })(RechargeOrder);
224
+
225
+export default WrappedRechargeOrder
226
+

+ 36
- 0
src/pages/funds/accountfunds/components/Refund.jsx Bestand weergeven

@@ -0,0 +1,36 @@
1
+import React, { useState } from 'react';
2
+import { Button, Input, Row, Col } from 'antd';
3
+import Styles from './styles.less';
4
+import Navigate from '@/components/Navigate';
5
+
6
+const Recharge = props => {
7
+
8
+    const { balance } = props
9
+
10
+    const [value, setValue] = useState()
11
+
12
+    function onChange(e) {
13
+        // if (e.target.value <= 0) return
14
+        // if (e.target.value > balance) { setValue(balance); return }
15
+        console.log('changed', e.target.value);
16
+        setValue(e.target.value)
17
+
18
+    }
19
+    return (
20
+        <>
21
+            <Row>
22
+                <Col span={3}> <span style={{ fontSize: '20px', color: '#666' }}>退款金额/元</span></Col>
23
+                <Col span={17} offset={1}>
24
+                    <Input type="number" min={0} step={0.01} value={value} onChange={onChange} style={{ marginBottom: '40px' }}></Input>
25
+                    <span style={{ fontSize: '20px', color: '#979797', lineHeight: '30px' }}>账户余额:{balance}元</span>
26
+                    <p style={{ fontSize: '18px', color: '#333', marginBottom: '8px', marginTop: '20px' }}>因微信商户平台限制,需先提交退款申请,提交后会冻结退款额对应余额资金,冻结金额无法使用,若您的平台有正在举办的活动等需要消费的地方,请预留充足的余额。如有疑问, <Navigate>请联系我们</Navigate></p>
27
+                </Col>
28
+            </Row>
29
+            <div style={{ textAlign: 'center', marginTop: '40px' }}>
30
+                <Button className={Styles.btn} type="primary" htmlType="submit" onClick={() => props.value(value)}>确认申请</Button>
31
+
32
+            </div>
33
+        </>
34
+    )
35
+}
36
+export default Recharge

+ 209
- 0
src/pages/funds/accountfunds/components/RefundOrder.jsx Bestand weergeven

@@ -0,0 +1,209 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import withActions from '@/components/ActionList';
6
+import EditIcon from '@/components/EditIcon';
7
+import apis from '../../../../services/apis';
8
+import request from '../../../../utils/request';
9
+import Navigate from '@/components/Navigate'
10
+import ShowVoucher from './ShowVoucher';
11
+
12
+const { Option } = Select
13
+
14
+function RechargeOrder(props) {
15
+
16
+    // const [taNoticeList, setTaNoticeList] = useState([])
17
+    const [data, setData] = useState({})
18
+
19
+    const [showVoucher, setShowVoucher] = useState({})
20
+
21
+    useEffect(() => {
22
+        getList({ pageNum: 1, pageSize: 10 });
23
+    }, [])
24
+    // 查询列表
25
+
26
+    const getList = params => {
27
+        request({ ...apis.funds.refundlist, params: { ...params } }).then(data => {
28
+            setData(data)
29
+        })
30
+    }
31
+
32
+    function handleSubmit(e) {
33
+        e.preventDefault();
34
+        props.form.validateFields((err, values) => {
35
+            if (!err) {
36
+                // eslint-disable-next-line no-console
37
+                console.log('提交数据: ', values)
38
+                getList({ pageNum: 1, pageSize: 10, ...values })
39
+            }
40
+        });
41
+    }
42
+
43
+    const openImg = data => {
44
+        setShowVoucher(
45
+            {
46
+                visible: true,
47
+                bannerList: data,
48
+            },
49
+        )
50
+    }
51
+
52
+    function handleReset() {
53
+        props.form.resetFields();
54
+
55
+        getList({ pageNum: 1, pageSize: 10 })
56
+    }
57
+
58
+    const changePageNum = e => {
59
+        props.form.validateFields((err, values) => {
60
+            if (!err) {
61
+                // eslint-disable-next-line no-console
62
+                console.log('提交数据: ', values)
63
+                getList({ pageNum: e, pageSize: 10, ...values })
64
+            }
65
+        });
66
+
67
+    }
68
+
69
+    const columns = [
70
+        {
71
+            title: '订单编号',
72
+            dataIndex: 'tradeNo',
73
+            key: 'tradeNo',
74
+            align: 'center',
75
+        },
76
+        {
77
+            title: '退款金额(元)',
78
+            dataIndex: 'amount',
79
+            key: 'amount',
80
+            align: 'center',
81
+        },
82
+        {
83
+            title: '退款创建时间',
84
+            dataIndex: 'createDate',
85
+            key: 'createDate',
86
+            align: 'center',
87
+            render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
88
+        },
89
+        {
90
+            title: '退款状态',
91
+            dataIndex: 'auditStatus',
92
+            key: 'auditStatus',
93
+            align: 'center',
94
+        },
95
+        {
96
+            title: '驳回原因',
97
+            dataIndex: 'auditResult',
98
+            key: 'auditResult',
99
+            align: 'center',
100
+        },
101
+
102
+        {
103
+            title: '退款凭证',
104
+            dataIndex: 'certificateList',
105
+            key: 'certificateList',
106
+            align: 'center',
107
+            render: (x, row) => <><Navigate onClick={() => openImg(x)}>查看</Navigate> </>,
108
+        },
109
+        {
110
+            title: '操作',
111
+            dataIndex: 'num',
112
+            key: 'num',
113
+            align: 'center',
114
+            render: withActions((text, row) => [
115
+
116
+                <EditIcon type="look" text="查看联系人" > </EditIcon>,
117
+
118
+
119
+            ]),
120
+        },
121
+    ]
122
+
123
+    function download(data) {
124
+        // if (!data) {
125
+        //     console.log('234')
126
+        //     return
127
+        // }
128
+        const url = window.URL.createObjectURL(new Blob([data]))
129
+        const link = document.createElement('a')
130
+        link.style.display = 'none'
131
+        link.href = url
132
+        link.setAttribute('download', '退款订单.xlsx')
133
+        document.body.append(link)
134
+        link.click()
135
+    }
136
+
137
+    const exportReport = () => {
138
+
139
+        request({ ...apis.funds.refundexportList, responseType: 'blob', params: { ...props.form.getFieldsValue() } }).then(data => {
140
+            download(data)
141
+        }).catch()
142
+    }
143
+
144
+    const { getFieldDecorator } = props.form
145
+
146
+    return (
147
+
148
+        <>
149
+            <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
150
+                <Form.Item>
151
+                    {getFieldDecorator('tradeNo')(
152
+                        <Input
153
+                            placeholder="订单编号"
154
+                        />,
155
+                    )}
156
+                </Form.Item>
157
+                <Form.Item>
158
+                    {getFieldDecorator('startTime')(
159
+                        <DatePicker placeholder="退款开始时间" />,
160
+                    )}
161
+                </Form.Item>
162
+                <Form.Item>
163
+                    {getFieldDecorator('endTime')(
164
+                        <DatePicker placeholder="退款结束时间" />,
165
+                    )}
166
+                </Form.Item>
167
+                <Form.Item>
168
+                    {getFieldDecorator('auditStatus')(
169
+                        <Select style={{ width: '180px' }} placeholder="退款状态">
170
+                            <Option value="">全部</Option>
171
+                            <Option value="1">已申请</Option>
172
+                            <Option value="2">已驳回</Option>
173
+                            <Option value="3">已退款</Option>
174
+                        </Select>,
175
+                    )}
176
+                </Form.Item>
177
+                <Form.Item>
178
+                    {getFieldDecorator('phone')(
179
+                        <Input
180
+                            placeholder="接收人手机号"
181
+                        />,
182
+                    )}
183
+                </Form.Item>
184
+                <Form.Item>
185
+                    <Button type="primary" htmlType="submit"> 搜索</Button>
186
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
187
+                </Form.Item>
188
+            </Form>
189
+            <div style={{ marginTop: '20px' }}>
190
+                <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
191
+            </div>
192
+            <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
193
+            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
194
+                <Pagination
195
+                    showQuickJumper
196
+                    defaultCurrent={1}
197
+                    total={data.total} onChange={e => changePageNum(e)} current={data.current} />
198
+            </div>
199
+            {showVoucher.visible && <ShowVoucher bannerList={showVoucher.bannerList} closeSwiper={() => setShowVoucher({ visible: false })} />}
200
+        </>
201
+
202
+    )
203
+}
204
+
205
+
206
+const WrappedRechargeOrder = Form.create({ name: 'RechargeOrder' })(RechargeOrder);
207
+
208
+export default WrappedRechargeOrder
209
+

+ 115
- 0
src/pages/funds/accountfunds/components/ShowVoucher.jsx Bestand weergeven

@@ -0,0 +1,115 @@
1
+import React, { useState, useRef, useEffect } from "react";
2
+import { Alert, message } from 'antd';
3
+import Swiper from 'swiper';
4
+import router from 'umi/router';
5
+// import request from '../../utils/request'
6
+import styles from './styles.less'
7
+import closeImg from '../../../../assets/close.png';
8
+import classNames from 'classnames';
9
+import 'swiper/css/swiper.min.css';
10
+
11
+const storageKey = 'showSwiperIndex';
12
+
13
+// const ShowVoucher = props => {
14
+
15
+
16
+//     useEffect(()={
17
+
18
+//     },[])
19
+
20
+//     return <>
21
+//         <div className={styles.content}>
22
+//             <img src={closeImg} alt="" className={styles.close} onClick={() => props.closeSwiper} />
23
+//             <div className={classNames(['swiper-container', styles.carousel])}  >
24
+//                 <div className={classNames(['swiper-wrapper', styles.carousel])} >
25
+//                     {props.data.bannerList.map((item, index) =>
26
+//                         <div key={'swiper' + index} className={classNames(['swiper-slide', styles.carouselItem])} >
27
+//                             <img style={{ width: '100%', height: '100%', borderRadius: '10px' }} src={item.noticeImg} alt="" />
28
+//                         </div>,
29
+//                     )}
30
+//                 </div>
31
+//                 <div className={classNames(['swiper-pagination', styles.dots])}  ></div>
32
+//             </div>
33
+//             {/* 123 */}
34
+//         </div>
35
+//     </>
36
+// }
37
+
38
+class ShowVoucher extends React.Component {
39
+    constructor(props) {
40
+        super(props);
41
+        this.state = {
42
+            bannerList: this.props.bannerList,
43
+        }
44
+
45
+        console.log(this.props, ' props.bannerList')
46
+
47
+        this.slider = null
48
+    }
49
+
50
+    componentDidMount() {
51
+        console.log(this.props, ' props.bannerList')
52
+        this.showSwiper()
53
+
54
+
55
+    }
56
+
57
+
58
+    showSwiper() {
59
+        //swiper初始化
60
+        const { bannerList } = this.state
61
+        if (bannerList.length > 1) {
62
+            this.swiper = new Swiper('.swiper-container', {
63
+                slidesPerView: 1,
64
+                loop: true,
65
+                autoplay: {
66
+                    disableOnInteraction: false,
67
+                },
68
+                touchRatio: 1.5,
69
+                pagination: {
70
+                    el: '.swiper-pagination',
71
+                    bulletElement: 'li',
72
+                    clickable: true,
73
+                    bulletActiveClass: 'antd-pro-pages-swiper-style-active',
74
+                },
75
+                observer: true,
76
+                observeParents: true,
77
+            })
78
+        } else {
79
+            this.swiper = new Swiper('.swiper-container', {
80
+                loop: false,
81
+                observer: true,
82
+                observeParents: true,
83
+            })
84
+        }
85
+    }
86
+
87
+    render() {
88
+
89
+        const { bannerList } = this.state
90
+        // const showSwiper = window.localStorage.getItem(storageKey)
91
+        return (
92
+            <>
93
+                {bannerList.length > 0 && <div className={styles.mask}>
94
+                    <div className={styles.content}>
95
+                        <img src={closeImg} alt="" className={styles.close} onClick={() => this.props.closeSwiper()} />
96
+                        <div className={classNames(['swiper-container', styles.carousel])} >
97
+                            <div className={classNames(['swiper-wrapper', styles.carousel])} >
98
+                                {bannerList.map((item, index) =>
99
+                                    <div key={'swiper' + index} className={classNames(['swiper-slide', styles.carouselItem])} onClick={() => this.handleSwiperItem(item)}>
100
+                                        <img style={{ width: '100%', height: '100%', borderRadius: '10px' }} src={item} alt="" />
101
+                                    </div>,
102
+                                )}
103
+                            </div>
104
+                            <div className={classNames(['swiper-pagination', styles.dots])} ></div>
105
+                        </div>
106
+                    </div>
107
+                </div>}
108
+                11
109
+            </>
110
+        )
111
+    }
112
+}
113
+
114
+
115
+export default ShowVoucher

+ 17
- 0
src/pages/funds/accountfunds/components/contactText.jsx Bestand weergeven

@@ -0,0 +1,17 @@
1
+import React from 'react'
2
+import Navigate from '@/components/Navigate';
3
+
4
+const ContactText = () => {
5
+    // const toNewContact = () => {
6
+    //     const aTag = document.createElement('a')
7
+
8
+    //     aTag.setAttribute('href', `${window.location.origin}${window.location.pathname}#/funds/financialContact`);
9
+    //     aTag.setAttribute('target', '_blank')
10
+    //     document.body.appendChild(aTag)
11
+    //     aTag.click();
12
+    // }
13
+    return <a href={`${window.location.origin}${window.location.pathname}#/funds/financialContact`} style={{ color: '#1D74D9' }} target="_blank">请联系我们</a>
14
+
15
+}
16
+
17
+export default ContactText

+ 100
- 0
src/pages/funds/accountfunds/components/styles.less Bestand weergeven

@@ -0,0 +1,100 @@
1
+
2
+  .redHeader{
3
+    width: 20%;
4
+    // height: 217px;
5
+    background:rgba(249,249,249,1);
6
+    border-radius:12px;
7
+    padding: 20px 24px;
8
+    .redHeaderTop{
9
+      text-align: center;
10
+      height: 122px;
11
+      font-family:PingFangSC-Regular,PingFang SC;
12
+      font-size:18px;
13
+      font-weight:400;
14
+      color:rgba(51,51,51,1);
15
+      .redHeaderTopText{
16
+        font-size:18px;
17
+        color:rgba(51,51,51,1);
18
+      }
19
+      .redHeaderTopNum{
20
+        font-size:48px;
21
+        font-weight:500;
22
+        color:rgba(255,126,72,1);
23
+line-height: 97px;
24
+      }
25
+    }
26
+    .redHeaderBottom{
27
+      padding-top: 10px;
28
+      border-top:1px solid rgba(216,216,216,1);
29
+      font-size:16px;
30
+      font-weight:400;
31
+      color:rgba(153,153,153,1);
32
+      // line-height:22px;
33
+    }
34
+  }
35
+
36
+  .btn {
37
+    width: 140px;
38
+    height: 45px;
39
+  }
40
+
41
+  .box{
42
+    height: 204px;
43
+    width: 204px;
44
+    // background-color:red;
45
+    margin: 37px 40px 40px 249px;
46
+    // borderRadius: '12px', border: '1px solid rgba(218,218,218,1', margin: '40px 0' 
47
+      // width: 100px; 
48
+      // height: 100px;
49
+      // border-radius:5px;
50
+      background: linear-gradient(to left, #1D74D9, #1D74D9) left top no-repeat, 
51
+            linear-gradient(to bottom, #1D74D9, #1D74D9) left top no-repeat, 
52
+            linear-gradient(to left, #1D74D9, #1D74D9) right top no-repeat,
53
+            linear-gradient(to bottom, #1D74D9, #1D74D9) right top no-repeat, 
54
+            linear-gradient(to left, #1D74D9, #1D74D9) left bottom no-repeat,
55
+            linear-gradient(to bottom, #1D74D9, #1D74D9) left bottom no-repeat,
56
+            linear-gradient(to left, #1D74D9, #1D74D9) right bottom no-repeat,
57
+            linear-gradient(to left, #1D74D9, #1D74D9) right bottom no-repeat;
58
+      background-size: 2px 10px, 10px 2px, 2px 10px, 10px 2px; 
59
+      padding: 5px;
60
+      // background-color:#aaaaaa
61
+    
62
+  }
63
+  .boxRight{
64
+    width: 400px;
65
+    margin: 40px 0;
66
+    // position: absolute;
67
+    // top: 50%;
68
+    // transform: translate(50%,-50%);
69
+    position:relative;
70
+    .child{
71
+      position: absolute;
72
+    top: 50%;
73
+    transform: translate(0,-50%);
74
+    font-size:18px;
75
+font-weight:400;
76
+color:rgba(102,102,102,1);
77
+float: left;
78
+// line-height:25px;
79
+    }
80
+  }
81
+
82
+  .content{
83
+    width: 32vw;
84
+    min-width: 757px;
85
+    height: 21.3vw;
86
+    min-height: 504px;
87
+    position: absolute;
88
+    left: 50%;
89
+    top: 110px;
90
+    transform: translateX(-50%);
91
+    border-radius: 10px;
92
+    .close{
93
+        width: 40px;
94
+        height: 40px;
95
+        position: absolute;
96
+        top: -22px;
97
+        right: -22px;
98
+        z-index: 9;
99
+    }
100
+}

+ 68
- 0
src/pages/funds/accountfunds/index.jsx Bestand weergeven

@@ -0,0 +1,68 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Radio } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import apis from '../../../services/apis';
6
+import request from '../../../utils/request';
7
+import Basic from './components/Basic';
8
+import RechargeOrder from './components/RechargeOrder'
9
+import ConsumerOrder from './components/ConsumerOrder'
10
+import RefundOrder from './components/RefundOrder'
11
+
12
+const H5configuration = props => {
13
+
14
+    const [tab, setTab] = useState('1')
15
+    const [data, setData] = useState({})
16
+
17
+    const id = props.location.query.id
18
+    // const type = props.activeType
19
+
20
+
21
+    useEffect(() => {
22
+        console.log(props)
23
+        // getData({ id: id, type: type })
24
+
25
+    }, [])
26
+
27
+    const getData = (params) => {
28
+
29
+        // request({ ...apis.activityDataStatis.getStatisticData, params: { ...params, } }).then((data) => {
30
+        //     console.log(data)
31
+        //     setData(data || {})
32
+        // })
33
+    }
34
+
35
+    function tabsCallback(e) {
36
+
37
+        setTab(e.target.value)
38
+    }
39
+    const onDetai = (e) => {
40
+        console.log(e)
41
+        setTab('4')
42
+    }
43
+
44
+
45
+    return <>
46
+
47
+        <div>
48
+            <Radio.Group value={tab} buttonStyle="solid" onChange={e => tabsCallback(e)}>
49
+                <Radio.Button value="1">基本信息</Radio.Button>
50
+                <Radio.Button value="2">充值订单</Radio.Button>
51
+                <Radio.Button value="3">消费订单</Radio.Button>
52
+                <Radio.Button value="4">退款订单</Radio.Button>
53
+            </Radio.Group>
54
+            <div style={{ marginTop: '20px' }}>
55
+                {/* 基本信息 */}
56
+                {(tab === '1' && <Basic />)}
57
+                {/* 充值订单 */}
58
+                {(tab === '2' && <RechargeOrder />)}
59
+                {/* 消费订单 */}
60
+                {(tab === '3' && <ConsumerOrder />)}
61
+                {/* 退款订单 */}
62
+                {(tab === '4' && <RefundOrder />)}
63
+            </div>
64
+        </div>
65
+    </>
66
+}
67
+
68
+export default H5configuration

+ 141
- 0
src/pages/funds/financialContact/index.jsx Bestand weergeven

@@ -0,0 +1,141 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import apis from '../../../services/apis';
6
+import request from '../../../utils/request';
7
+
8
+function financialContact(props) {
9
+
10
+    // const [taNoticeList, setTaNoticeList] = useState([])
11
+    const [data, setData] = useState({})
12
+
13
+    useEffect(() => {
14
+        getList({ pageNum: 1, pageSize: 10 });
15
+    }, [])
16
+    // 查询列表
17
+
18
+    const getList = params => {
19
+        request({ ...apis.funds.list, params: { ...params } }).then(data => {
20
+            setData(data)
21
+        })
22
+    }
23
+
24
+    function handleSubmit(e) {
25
+        e.preventDefault();
26
+        props.form.validateFields((err, values) => {
27
+            if (!err) {
28
+                // eslint-disable-next-line no-console
29
+                console.log('提交数据: ', values)
30
+                getList({ ...values })
31
+            }
32
+        });
33
+    }
34
+
35
+    function handleReset() {
36
+        props.form.resetFields();
37
+
38
+        getList({ pageNum: 1, pageSize: 10 })
39
+    }
40
+
41
+    const columns = [
42
+        {
43
+            title: '姓名',
44
+            dataIndex: 'contactName',
45
+            key: 'contactName',
46
+            align: 'center',
47
+        },
48
+        {
49
+            title: '性别',
50
+            dataIndex: 'sex',
51
+            key: 'sex',
52
+            align: 'center',
53
+        },
54
+        {
55
+            title: '头像',
56
+            dataIndex: 'avatar',
57
+            key: 'avatar',
58
+            align: 'center',
59
+            render: (x, row) => <img src={row.qrCodeUrl} alt="" width="100px"></img >,
60
+        },
61
+        {
62
+            title: '固话',
63
+            dataIndex: 'telephone',
64
+            key: 'telephone',
65
+            align: 'center',
66
+        },
67
+        {
68
+            title: '手机号',
69
+            dataIndex: 'phone',
70
+            key: 'phone',
71
+            align: 'center',
72
+        },
73
+        {
74
+            title: '头衔',
75
+            dataIndex: 'appellation',
76
+            key: 'appellation',
77
+            align: 'center',
78
+        },
79
+    ]
80
+
81
+    const changePageNum = pageNumber => {
82
+        props.form.validateFields((err, values) => {
83
+            if (!err) {
84
+                getList({ pageNum: pageNumber, pageSize: 10, ...values })
85
+            }
86
+        });
87
+    }
88
+
89
+
90
+    const { getFieldDecorator } = props.form
91
+
92
+    return (
93
+
94
+        <>
95
+            <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
96
+                <Form.Item>
97
+                    {getFieldDecorator('contactName')(
98
+                        <Input
99
+                            placeholder="姓名"
100
+                        />,
101
+                    )}
102
+                </Form.Item>
103
+                <Form.Item>
104
+                    {getFieldDecorator('telephone')(
105
+                        <Input
106
+                            placeholder="固话"
107
+                        />,
108
+                    )}
109
+                </Form.Item>
110
+                <Form.Item>
111
+                    {getFieldDecorator('phone')(
112
+                        <Input
113
+                            placeholder="手机号"
114
+                        />,
115
+                    )}
116
+                </Form.Item>
117
+                <Form.Item>
118
+                    <Button type="primary" htmlType="submit"> 搜索</Button>
119
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
120
+                </Form.Item>
121
+            </Form>
122
+            {/* <div style={{ marginTop: '20px' }}>
123
+                <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} >导出</Button>
124
+            </div> */}
125
+            <Table dataSource={data.records} columns={columns} pagination={false} style={{ marginTop: '20px' }} />
126
+            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
127
+                <Pagination
128
+                    showQuickJumper
129
+                    defaultCurrent={1}
130
+                    total={data.total} onChange={e => changePageNum(e)} current={data.current} />
131
+            </div>
132
+        </>
133
+
134
+    )
135
+}
136
+
137
+
138
+const WrappedFinancialContact = Form.create({ name: 'financialContact' })(financialContact);
139
+
140
+export default WrappedFinancialContact
141
+

+ 139
- 0
src/pages/h5SampleManager/h5Sample/addH5.jsx Bestand weergeven

@@ -0,0 +1,139 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, InputNumber, Checkbox, Row, Col } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import apis from '../../../services/apis';
7
+import request from '../../../utils/request';
8
+import AuthButton from '@/components/AuthButton';
9
+import ImageUploader from '../../../components/XForm/ImageUpload';
10
+
11
+const { Option } = Select;
12
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
13
+
14
+
15
+const header = props => {
16
+    const sampleId = props.location.query.id;
17
+    // const sampleName = props.location.query.sampleName;
18
+    // const [sampleData, setSampleData] = useState({})
19
+
20
+    //   useEffect(() => {
21
+    //     getSampleData(sampleId);
22
+    //   },[])
23
+
24
+    //   // 查询列表
25
+    //   const getSampleData = (demandId) => {
26
+    //       request({ ...apis.taH5SampleManager.taH5DemandById, urlData: {id: demandId} }).then((data) => {
27
+    //           setDemandData(data)
28
+    //           props.form.setFieldsValue(data)
29
+    //       })
30
+    //   }
31
+
32
+    // 跳转到编辑
33
+    const toDetail = rowData => () => {
34
+        if (rowData) {
35
+            router.push({
36
+                pathname: '/h5SampleManager/h5Demand/edit',
37
+                query: {
38
+                    id: demandId,
39
+                },
40
+            });
41
+            return
42
+        }
43
+    }
44
+
45
+    function handleSubmit(e) {
46
+        e.preventDefault();
47
+        props.form.validateFields((err, values) => {
48
+            if (!err) {
49
+                values.h5SampleId = sampleId
50
+                values.endDate = moment(values.endDate._d).format('YYYY-MM-DD HH:mm:ss')
51
+                values.isMiniapp = 1
52
+                values.fromH5Sample = true
53
+                request({ ...apis.activity.addtaDrainage, data: { ...values } }).then(data => {
54
+                    message.info('操作成功')
55
+
56
+                }).catch(err => {
57
+                    message.error(err.msg || err.message)
58
+                })
59
+
60
+                // values.sampleName = sampleName
61
+                // request({ ...apis.taH5SampleManager.addTaH5Demand, data: { ...values } }).then(() => {
62
+                //     message.info('保存成功')
63
+                //     // router.go(-1);
64
+                // }).catch((err) => {
65
+                //     message.info(err.msg || err.message)
66
+                // })
67
+            }
68
+        });
69
+    }
70
+
71
+    const { getFieldDecorator } = props.form;
72
+
73
+    return (
74
+        <>
75
+            <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
76
+                <Form.Item label="H5活动名称">
77
+                    {getFieldDecorator('name', {
78
+                        rules: [
79
+                            {
80
+                                required: true,
81
+                                message: '请填写活动名称',
82
+                            },
83
+                        ],
84
+                    })(<Input placeholder="H5活动名称" />)}
85
+                </Form.Item>
86
+                <Form.Item label="下架时间">
87
+                    {getFieldDecorator('endDate', {
88
+                        // initialValue: formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm:ss') : null,
89
+                        rules: [
90
+                            { required: true, message: '请输入下架时间' },
91
+                        ]
92
+                    })(
93
+                        <DatePicker
94
+                            showTime={{ format: 'HH:mm:ss' }}
95
+                        />,
96
+                    )}
97
+                </Form.Item>
98
+                <Form.Item label="分享设置" help="建议图片尺寸:750*600px,比例5:4,格式:jpg">
99
+                    {getFieldDecorator('shareImg', {
100
+                        // initialValue: formsDate.shareImg,
101
+                        rules: [
102
+                            { required: true, message: '请选择分享图片' },
103
+                        ]
104
+                    })(<ImageUploader />)}
105
+                </Form.Item>
106
+                <Form.Item label="活动分享语">
107
+                    {getFieldDecorator('shareTitle', {
108
+                        // initialValue: formsDate.shareTitle,
109
+                        rules: [
110
+                            { required: true, message: '请输入活动分享语' },
111
+                        ]
112
+                    })(
113
+                        <Input
114
+                            placeholder="分享语,不超过15个字"
115
+                            maxLength="15"
116
+                        />,
117
+                    )}
118
+                </Form.Item>
119
+                <Form.Item label="中间页飞机图" help="建议图片尺寸:750*1667px,比例9:20,格式:jpg。图片底部不要放置关键信息。">
120
+                    {getFieldDecorator('middleImg', {
121
+                        // initialValue: formsDate.middleImg,
122
+                        rules: [
123
+                            { required: true, message: '请选择中间页飞机图' },
124
+                        ]
125
+                    })(<ImageUploader />)}
126
+                </Form.Item>
127
+                <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
128
+                    <Button type="primary" htmlType="submit">保存</Button>
129
+            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
130
+            <Button onClick={() => router.go(-1)}>取消</Button>
131
+                </Form.Item>
132
+            </Form>
133
+        </>
134
+    )
135
+}
136
+
137
+const WrappedHeader = Form.create({ name: 'header' })(header);
138
+
139
+export default WrappedHeader

+ 23
- 3
src/pages/h5SampleManager/h5Sample/detail.jsx Bestand weergeven

@@ -54,7 +54,19 @@ const header = props => {
54 54
       message.info("该H5样例已取消发布或已删除")
55 55
     })
56 56
 
57
-    
57
+
58
+  }
59
+
60
+  const toAddH5 = rowData => () => {
61
+    router.push({
62
+      pathname: '/h5SampleManager/h5Sample/addH5',
63
+      query: {
64
+        id: sampleId,
65
+        sampleName: demandData.sampleName
66
+      },
67
+    });
68
+
69
+
58 70
   }
59 71
   const toCancel = () => {
60 72
     router.go(-1)
@@ -104,11 +116,14 @@ const header = props => {
104 116
           <DragableUploadImageList sampleId={sampleId}></DragableUploadImageList>
105 117
         </Form.Item>}
106 118
         <Form.Item label="样例内容">
107
-          {demandData.sampleType === 'link' && <div><span style={{ color: 'rgba(0, 0, 0, 0.45)', fontSize: '14px' }}>点击链接查看内容</span><br/></div>}
108
-          {demandData.sampleType === 'rich' ? getFieldDecorator('sampleContent')(<div dangerouslySetInnerHTML={{ __html: demandData.sampleContent}}></div>) : getFieldDecorator('sampleContentLink')(<Navigate to={demandData.sampleContentLink}>{demandData.sampleContentLink}</Navigate>)}
119
+          {demandData.sampleType === 'link' && <div><span style={{ color: 'rgba(0, 0, 0, 0.45)', fontSize: '14px' }}>点击链接查看内容</span><br /></div>}
120
+          {demandData.sampleType === 'rich' ? getFieldDecorator('sampleContent')(<div dangerouslySetInnerHTML={{ __html: demandData.sampleContent }}></div>) : getFieldDecorator('sampleContentLink')(<Navigate to={demandData.sampleContentLink}>{demandData.sampleContentLink}</Navigate>)}
109 121
         </Form.Item>
110 122
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
111 123
           <div style={{ margin: '0.16rem 0 0.06rem' }}>
124
+            <Button type="primary" onClick={toAddH5(sampleId)} style={{ marginRight: '20px' }}>
125
+              创建H5活动
126
+          </Button>
112 127
             <Button type="primary" onClick={toDetail(sampleId)} style={{ marginRight: '20px' }}>
113 128
               提交需求
114 129
           </Button>
@@ -118,6 +133,11 @@ const header = props => {
118 133
           </div>
119 134
         </Form.Item>
120 135
         <div style={{ position: 'fixed', right: '0.4rem', bottom: '6%' }}>
136
+          <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between', marginBottom: '20px' }}>样例可直接使用 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
137
+            <Button type="primary" onClick={toAddH5(sampleId)} >
138
+              创建H5活动
139
+              </Button>
140
+          </div>
121 141
           <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between' }}>我想办类似活动 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
122 142
             <Button type="primary" onClick={toDetail(sampleId)} >
123 143
               提交需求

+ 131
- 0
src/services/apis.js Bestand weergeven

@@ -1867,4 +1867,135 @@ export default {
1867 1867
       action: 'admin.qrcode.getStatisticRecordExport.get',
1868 1868
     },
1869 1869
   },
1870
+  redPacket: {
1871
+    update: {
1872
+      method: 'put',
1873
+      url: `${prefix}/redPacket/update`,
1874
+      action: 'admin.redPacket.put',
1875
+    },
1876
+    detail: {
1877
+      method: 'GET',
1878
+      url: `${prefix}/redPacket/:id`,
1879
+      action: 'admin.redPacket.id.get',
1880
+    },
1881
+    helpDetail: {
1882
+      method: 'GET',
1883
+      url: `${prefix}/redPacket/help/:id`,
1884
+      action: 'admin.redPacket.help.id.get',
1885
+    },
1886
+    updateHelp: {
1887
+      method: 'put',
1888
+      url: `${prefix}/redPacket/help/:id`,
1889
+      action: 'admin.redPacket.help.put',
1890
+    },
1891
+    moneyDetail: {
1892
+      method: 'GET',
1893
+      url: `${prefix}/redPacket/money/:id`,
1894
+      action: 'admin.redPacket.money/id.get',
1895
+    },
1896
+    updateMoney: {
1897
+      method: 'put',
1898
+      url: `${prefix}/redPacket/money/:id`,
1899
+      action: 'admin.redPacket.money.put',
1900
+    },
1901
+    listSendRecord: {
1902
+      method: 'GET',
1903
+      url: `${prefix}/redPacket/listSendRecord`,
1904
+      action: 'admin.redPacket.listSendRecord.get',
1905
+    },
1906
+    getRedPacketRankingList: {
1907
+      method: 'GET',
1908
+      url: `${prefix}/redPacket/getRedPacketRankingList`,
1909
+      action: 'admin.redPacket.getRedPacketRankingList.get',
1910
+    },
1911
+    getRecordByConditionList: {
1912
+      method: 'GET',
1913
+      url: `${prefix}/redPacket/listVisitRecordByCondition`,
1914
+      action: 'admin.redPacket.getRecordByConditionList.get',
1915
+    },
1916
+    exportRedPacketRankingList: {
1917
+      method: 'GET',
1918
+      url: `${prefix}/redPacket/exportRedPacketRankingList`,
1919
+      action: 'admin.redPacket.exportRedPacketRankingList.get',
1920
+    },
1921
+    getConsumeOrderByConditionList: {
1922
+      method: 'GET',
1923
+      url: `${prefix}/redPacket/listConsumeOrderByCondition`,
1924
+      action: 'admin.redPacket.getConsumeOrderByConditionList.get',
1925
+    },
1926
+    exportVisitRecordByCondition: {
1927
+      method: 'GET',
1928
+      url: `${prefix}/redPacket/exportVisitRecordByCondition`,
1929
+      action: 'admin.redPacket.exportVisitRecordByCondition.get',
1930
+    },
1931
+    // /redPacket/listVisitRecordByCondition
1932
+    // redPacket/exportVisitRecordByCondition
1933
+  },
1934
+  funds: {
1935
+    get: {
1936
+      method: 'GET',
1937
+      url: `${prefix}/orgAccount/get`,
1938
+      action: 'admin.funds.listContactByCondition.get',
1939
+    },
1940
+    saveOrder: {
1941
+      method: 'put',
1942
+      url: `${prefix}/orgOrder/cz/saveOrder`,
1943
+      action: 'admin.funds.listContactByCondition.put',
1944
+    },
1945
+    saveRefundOrder: {
1946
+      method: 'put',
1947
+      url: `${prefix}/orgOrder/refund/saveOrder`,
1948
+      action: 'admin.funds.refund.put',
1949
+    },
1950
+
1951
+    // /admin/orgOrder/cz/saveOrder
1952
+    czlist: {
1953
+      method: 'GET',
1954
+      url: `${prefix}/orgOrder/cz/list`,
1955
+      action: 'admin.funds.orgOrder.cz.list.get',
1956
+    },
1957
+    czexportList: {
1958
+      method: 'GET',
1959
+      url: `${prefix}/orgOrder/cz/exportList`,
1960
+      action: 'admin.funds.orgOrder.cz.list.get',
1961
+    },
1962
+    consumeOrderByConditionlist: {
1963
+      method: 'GET',
1964
+      url: `${prefix}/orgOrder/listConsumeOrderByCondition`,
1965
+      action: 'admin.funds.orgOrder.listConsumeOrderByCondition.get',
1966
+    },
1967
+    exportConsumeOrderByCondition: {
1968
+      method: 'GET',
1969
+      url: `${prefix}/orgOrder/exportConsumeOrderByCondition`,
1970
+      action: 'admin.funds.orgOrder.exportConsumeOrderByCondition.get',
1971
+    },
1972
+    refundlist: {
1973
+      method: 'GET',
1974
+      url: `${prefix}/orgOrder/refund/list`,
1975
+      action: 'admin.funds.orgOrder.refund.list.get',
1976
+    },
1977
+    refundexportList: {
1978
+      method: 'GET',
1979
+      url: `${prefix}/orgOrder/refund/exportList`,
1980
+      action: 'admin.funds.orgOrder.refund.list.get',
1981
+    },
1982
+//     /admin/orgOrder/refund/list
1983
+// 13.导出退款订单接口:/admin/orgOrder/refund/exportList
1984
+    // listConsumeOrderByCondition
1985
+    // /admin/orgOrder/cz/exportList
1986
+    // /admin/orgOrder/cz/list
1987
+    getByInfo: {
1988
+      method: 'GET',
1989
+      url: `${prefix}/orgOrder/getByInfo`,
1990
+      action: 'admin.funds.orgOrder.getByInfo.get',
1991
+    },
1992
+
1993
+    // /admin/orgOrder/getByInfo
1994
+    list: {
1995
+      method: 'GET',
1996
+      url: `${prefix}/listContactByCondition`,
1997
+      action: 'admin.funds.listContactByCondition.get',
1998
+    },
1999
+  },
2000
+  // admin/redPacket/money/{id}
1870 2001
 }