WithdrawalRecord.js
8.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
'use strict';
import React, {Component} from 'react';
import {DeviceEventEmitter, Dimensions, ListView, StyleSheet, Text, View, Image, TouchableOpacity} from 'react-native';
import {Immutable} from 'immutable';
export default class WithdrawalRecord extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this._renderHeader = this._renderHeader.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
}
componentDidMount() {
this.subscription = DeviceEventEmitter.addListener('IdentityCardBindSuccessEvent', () => {
this.props.refreshIdentityCardInfo && this.props.refreshIdentityCardInfo();
});
}
componentWillUnmount() {
this.subscription.remove();
}
_renderHeader() {
let uploadStatus = this.props.identityCardInfo.data;
return (<View>
<View style={{width: width, height: 0.5, backgroundColor: '#e0e0e0'}}/>
{ uploadStatus ?
null
:
<View style={styles.uploadContainer}>
<Text style={styles.loadStyle}>{'结算收益时需按照国家规定预扣个税,因此需先上传身份证信息 。若未提供正确有效的身份信息将导致扣税失败而影响提现。'}</Text>
<TouchableOpacity style={styles.uploadButton} onPress={()=> {
this.props.jumpWithUrl && this.props.jumpWithUrl('我的身份证', 'nameAuthen');
}}>
<Text style={styles.buttonText}>{'去上传'}</Text>
</TouchableOpacity>
</View>
}
{ uploadStatus ?
<View style={styles.withdrawContainer}>
<Text style={[styles.tipStyle, {lineHeight: 40}]}>{'每月20日结算上个月预估佣金并预扣个税'}</Text>
<TouchableOpacity activeOpacity={1} style={{flexDirection: 'row', alignItems: 'center'}} onPress={()=> {
this.props.jumpWithActivityUrl && this.props.jumpWithActivityUrl();
}}>
<Text style={styles.tipStyle}>{'结算说明 '}</Text>
<Image source={require('../images/more.png')}/>
</TouchableOpacity>
</View>
:
<View style={styles.withdrawContainer}>
<Text style={[styles.tipStyle, {marginTop: 15, height: 17}]}>{'每月20日结算上个月预估佣金并预扣个税'}</Text>
<TouchableOpacity activeOpacity={1} style={{flexDirection: 'row', alignItems: 'center', height: 17, marginTop: 15}} onPress={()=> {
this.props.jumpWithActivityUrl && this.props.jumpWithActivityUrl();
}}>
<Text style={styles.tipStyle}>{'结算说明 '}</Text>
<Image style={{width: 11, height: 11}} source={require('../images/more.png')}/>
</TouchableOpacity>
</View>
}
</View>
)
}
_renderRow(rowData, sectionID, rowID) {
let showSpace = rowID === rowData.length ? false : true;
return (
<View>
<View style={styles.rowView}>
<Text style={styles.numberText}>处理编号:{rowData.get("settlementCode")}</Text>
<Text style={styles.statusText}>{rowData.get("settlementStatus")}</Text>
</View>
<View style={{width: width, height: 0.5, backgroundColor: '#e0e0e0'}}></View>
<View style={styles.detailView}>
<Text>
<Text style={styles.priceText}>税后总收益:</Text>
<Text style={styles.allPriceText}>{rowData.get("afterTaxAmountStr")}</Text>
</Text>
<Text style={styles.priceText}>提现总金额:{rowData.get("settlementAmountStr")}</Text>
<Text style={styles.priceText}>扣税总金额:{rowData.get("taxAmountStr")}</Text>
<Text style={styles.timeText}>{rowData.get("settlementTimeStr")}</Text>
</View>
{showSpace? <View style={{width: width, height: 10, backgroundColor: '#f0f0f0'}}></View> : null}
</View>
);
}
render() {
let {
settlementRecordList,
} = this.props;
let recordList = settlementRecordList.list ? settlementRecordList.list.toArray() : [];
return (
<View style={styles.container}>
<ListView
ref={(c) => {
this.listView = c;
}}
// yh_viewVisible={true}
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRows(recordList)}
renderHeader={this._renderHeader}
renderRow={this._renderRow}
onEndReached={() => {
if (recordList.size !== 0) {
this.props.onEndReached && this.props.onEndReached();
}
}}/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
alignItems: 'center'
},
contentContainer: {
width: width,
backgroundColor: 'white'
},
rowView: {
width: width,
height: 50,
flexDirection: 'row',
paddingLeft: 15,
paddingRight: 15,
alignItems: 'center',
justifyContent: 'space-between'
},
lineView: {
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
},
detailView: {
width: width,
paddingTop: 15,
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 20,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'flex-start',
},
allPriceText:{
fontFamily: 'PingFang-SC-Medium',
fontSize: 14,
color: '#D0021B',
},
numberText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
},
priceText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
marginTop: 6,
},
timeText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#B0B0B0',
marginTop: 15,
},
statusText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#D0021B',
},
uploadContainer: {
width: width,
backgroundColor: 'transparent',
flexDirection: 'column',
alignItems: 'center',
paddingTop: 20,
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 20,
},
loadStyle: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
backgroundColor: 'transparent',
textAlign: 'left',
lineHeight: 23,
},
uploadButton: {
width: 80,
height: 30,
marginTop: 10,
borderRadius: 4,
backgroundColor: '#D0021B',
alignItems: 'center',
justifyContent: 'center',
},
buttonText: {
color: 'white',
fontSize: 14,
fontWeight: 'bold',
},
withdrawContainer: {
width: width,
height: 40,
paddingLeft: 15,
paddingRight: 15,
backgroundColor: '#f0f0f0',
flexDirection: 'row',
justifyContent: 'space-between',
},
tipStyle: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 12,
color: '#B0B0B0',
backgroundColor: 'transparent',
textAlign: 'center',
},
});