|
@@ -76,7 +76,7 @@ class ModalIntegralRecord extends React.Component {
|
76
|
76
|
}
|
77
|
77
|
|
78
|
78
|
// 积分类型
|
79
|
|
- showChangeType(str) {
|
|
79
|
+ showChangeType(str) {
|
80
|
80
|
switch (str) {
|
81
|
81
|
case 'goods':
|
82
|
82
|
return '兑换商品'
|
|
@@ -88,56 +88,62 @@ class ModalIntegralRecord extends React.Component {
|
88
|
88
|
return '注册经纪人'
|
89
|
89
|
case 'recommend-customer':
|
90
|
90
|
return '推荐客户'
|
|
91
|
+ case 'group':
|
|
92
|
+ return '拼团'
|
|
93
|
+ case 'recommend-customer':
|
|
94
|
+ return '推荐客户'
|
91
|
95
|
default:
|
92
|
96
|
return '未知类型'
|
93
|
97
|
}
|
94
|
98
|
}
|
95
|
|
-
|
|
99
|
+
|
96
|
100
|
// 判断是否是 - 开头
|
97
|
|
- subPoints(points) {
|
98
|
|
- let subStr = points.toString().substring(0, 1)
|
|
101
|
+ subPoints(points) {
|
|
102
|
+ const subStr = points.toString().substring(0, 1)
|
99
|
103
|
if (subStr === '-') {
|
100
|
104
|
return true
|
101
|
105
|
}
|
102
|
106
|
return false
|
103
|
107
|
}
|
104
|
108
|
|
|
109
|
+// eslint-disable-next-line class-methods-use-this
|
105
|
110
|
render() {
|
106
|
111
|
const columns = [
|
107
|
112
|
{
|
108
|
113
|
title: '序号',
|
109
|
114
|
dataIndex: 'index',
|
110
|
115
|
key: 'index',
|
|
116
|
+ render: (text, record, index) => <span>{(this.state.dataSource.result.total - this.state.dataSource.result.records.length) * 1 + index + 1}</span>,
|
111
|
117
|
},
|
112
|
118
|
{
|
113
|
119
|
title: '积分类型',
|
114
|
120
|
dataIndex: 'changeType',
|
115
|
121
|
key: 'changeType',
|
116
|
|
- render: (_, record) => { this.showChangeType(record.changeType) },
|
|
122
|
+ render: (_, record) => <span>{this.showChangeType(record.changeType) }</span>,
|
117
|
123
|
},
|
118
|
124
|
{
|
119
|
125
|
title: '积分变化',
|
120
|
126
|
dataIndex: 'pointsAmount',
|
121
|
127
|
key: 'pointsAmount',
|
122
|
|
- render: (_, record) => { <span style={this.subPoints(record.pointsAmount) && {color: 'red'}}>{ record.pointsAmount }</span> },
|
|
128
|
+ // render: (pointsAmount, record) => { <span style={this.subPoints(pointsAmount) && {color: 'red'}}>{ pointsAmount }</span> },
|
123
|
129
|
},
|
124
|
130
|
{
|
125
|
131
|
title: '发生时间',
|
126
|
132
|
dataIndex: 'createDate',
|
127
|
133
|
key: 'createDate',
|
128
|
|
- render: (text, records) => { moment(records.createDate).format('YYYY-MM-DD') },
|
|
134
|
+ render: (createDate, records) => <span> {moment(createDate).format('YYYY-MM-DD')}</span>,
|
129
|
135
|
},
|
130
|
136
|
]
|
131
|
137
|
return (
|
132
|
138
|
<>
|
133
|
139
|
<Modal
|
134
|
|
- title={ "当前可用积分:" + this.state.dataSource.totalPoints }
|
|
140
|
+ title={ '当前可用积分:' + this.state.dataSource.totalPoints }
|
135
|
141
|
width={800}
|
136
|
142
|
destroyOnClose="true"
|
137
|
143
|
footer={null}
|
138
|
144
|
visible={this.state.visibleData.visible}
|
139
|
145
|
// onOk={() => this.handleOk()}
|
140
|
|
- onCancel={(e) => this.handleCancel(e)}
|
|
146
|
+ onCancel={e => this.handleCancel(e)}
|
141
|
147
|
>
|
142
|
148
|
<Table dataSource={this.state.dataSource.result.records} columns={columns} pagination={{ total: this.state.dataSource.result.total, onChange: e => this.onChange(e) }} />
|
143
|
149
|
</Modal>
|