|
@@ -0,0 +1,128 @@
|
|
1
|
+import React, { useState, useEffect } from 'react';
|
|
2
|
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
|
|
3
|
+import { FormattedMessage } from 'umi-plugin-react/locale';
|
|
4
|
+import styles from '../style/GoodsList.less';
|
|
5
|
+import router from 'umi/router';
|
|
6
|
+import moment from 'moment';
|
|
7
|
+
|
|
8
|
+import request from '../../utils/request'
|
|
9
|
+
|
|
10
|
+const { Option } = Select;
|
|
11
|
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
|
12
|
+
|
|
13
|
+const header = (props) => {
|
|
14
|
+ const [ data, setData ] = useState({})
|
|
15
|
+
|
|
16
|
+ useEffect(() => {
|
|
17
|
+ getVerifyList({pageNum: 1,pageSize: 10, phone: props.location.query.telValue });
|
|
18
|
+ },[])
|
|
19
|
+
|
|
20
|
+ // 查询列表
|
|
21
|
+ const getVerifyList = (params) => {
|
|
22
|
+ request({
|
|
23
|
+ url: '/api/admin/taPointsExchange',
|
|
24
|
+ method: 'GET',
|
|
25
|
+ params: { ...params },
|
|
26
|
+ }).then((data) => {
|
|
27
|
+ setData(data)
|
|
28
|
+ })
|
|
29
|
+ }
|
|
30
|
+
|
|
31
|
+ const changePageNum = (pageNumber) => {
|
|
32
|
+ getVerifyList({ pageNum: 1, pageSize: 10, phone: props.location.query.telValue })
|
|
33
|
+ }
|
|
34
|
+
|
|
35
|
+ const toBack = () => {
|
|
36
|
+ router.push({
|
|
37
|
+ pathname: '/integralMall/writeOff',
|
|
38
|
+ });
|
|
39
|
+ }
|
|
40
|
+
|
|
41
|
+ const changeStatus = (row) => () => {
|
|
42
|
+ request({
|
|
43
|
+ url: '/api/admin/taPointsExchange/change',
|
|
44
|
+ method: 'PUT',
|
|
45
|
+ data: row
|
|
46
|
+ }).then((data) => {
|
|
47
|
+ message.info("操作成功")
|
|
48
|
+ getVerifyList({ pageNum: pageNumber, pageSize: 10, phone: props.location.query.telValue })
|
|
49
|
+ })
|
|
50
|
+ }
|
|
51
|
+
|
|
52
|
+ const columns = [
|
|
53
|
+ {
|
|
54
|
+ title: '用户姓名',
|
|
55
|
+ dataIndex: 'personName',
|
|
56
|
+ key: 'personName',
|
|
57
|
+ align: 'center',
|
|
58
|
+ },
|
|
59
|
+ {
|
|
60
|
+ title: '用户类型',
|
|
61
|
+ dataIndex: 'personType',
|
|
62
|
+ key: 'personType',
|
|
63
|
+ align: 'center',
|
|
64
|
+ render: (personType)=> <><span>{personType === 'Realty Consultant' ? '置业顾问' : personType === 'Sales Executive' ? '销售主管' : personType === 'estate agent' ? '经纪人' : ''}</span></>
|
|
65
|
+ },
|
|
66
|
+ {
|
|
67
|
+ title: '手机号',
|
|
68
|
+ dataIndex: 'phone',
|
|
69
|
+ key: 'phone',
|
|
70
|
+ align: 'center',
|
|
71
|
+ },
|
|
72
|
+ {
|
|
73
|
+ title: '商品图片',
|
|
74
|
+ dataIndex: 'image',
|
|
75
|
+ key: 'image',
|
|
76
|
+ align: 'center',
|
|
77
|
+ render: (text, record) => <img src={record.image} className={styles.touxiang} />,
|
|
78
|
+ },
|
|
79
|
+ {
|
|
80
|
+ title: '商品名称',
|
|
81
|
+ dataIndex: 'targetName',
|
|
82
|
+ key: 'targetName',
|
|
83
|
+ align: 'center',
|
|
84
|
+ },
|
|
85
|
+ {
|
|
86
|
+ title: '兑换时间',
|
|
87
|
+ dataIndex: 'createDate',
|
|
88
|
+ key: 'createDate',
|
|
89
|
+ align: 'center',
|
|
90
|
+ render: (createDate) => <><span>{moment(createDate).format('YYYY-MM-DD HH:mm')}</span></>
|
|
91
|
+ },
|
|
92
|
+ {
|
|
93
|
+ title: '领取时间',
|
|
94
|
+ dataIndex: 'verifyDate',
|
|
95
|
+ key: 'verifyDate',
|
|
96
|
+ align: 'center',
|
|
97
|
+ render: (verifyDate) => <><span>{verifyDate != null ? moment(verifyDate).format('YYYY-MM-DD HH:mm') : ''}</span></>
|
|
98
|
+ },
|
|
99
|
+ {
|
|
100
|
+ title: '状态',
|
|
101
|
+ dataIndex: 'status',
|
|
102
|
+ key: 'status',
|
|
103
|
+ align: 'center',
|
|
104
|
+ render: (status)=> <><span>{status == 1 ? '已领取' : '未领取'}</span></>
|
|
105
|
+ },
|
|
106
|
+ {
|
|
107
|
+ title: '操作',
|
|
108
|
+ dataIndex: 'handle',
|
|
109
|
+ key: 'handle',
|
|
110
|
+ align: 'center',
|
|
111
|
+ render: (x,row) => <span style={{ color: '#1990FF' }} onClick={changeStatus(row)}>{ row.status == 1?'':'核销' }</span>
|
|
112
|
+
|
|
113
|
+ },
|
|
114
|
+ ];
|
|
115
|
+
|
|
116
|
+ return (
|
|
117
|
+ <>
|
|
118
|
+ <Button type="primary" className={styles.addBtn} onClick={toBack}>返回</Button>
|
|
119
|
+ <Table dataSource={data.records} columns={columns} pagination={false} />
|
|
120
|
+ <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
|
|
121
|
+ <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
|
|
122
|
+ </div>
|
|
123
|
+ </>
|
|
124
|
+ )
|
|
125
|
+}
|
|
126
|
+const WrappedHeader = Form.create({ name: 'header' })(header);
|
|
127
|
+
|
|
128
|
+export default WrappedHeader
|