MyOrderDetailPayListCell.js
5.39 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
'use strict';
import React from 'react';
import ReactNative, {
View,
Text,
Image,
StyleSheet,
Dimensions,
TouchableOpacity,
Alert,
} from 'react-native';
import Immutable, {Map} from 'immutable';
export default class MyOrderDetailPayListCell extends React.Component {
constructor(props) {
super(props);
this.onPressDelayQuestion = this.onPressDelayQuestion.bind(this);
}
onPressDelayQuestion() {
Alert.alert('逾期服务费信息','如果您到期未还款:需要加收逾期利息费和延迟还款费\n逾期利息费:待还本金 *利息率*延迟还款天数,利息率=0.025%/天\n延迟还款费:逾期3天内还款免收延迟还款服务费,逾期4天,从第一天逾期开始算,500元之内,加收1元/天延迟还款服务费。每500元增加1元/天。',
[{text: '我知道了'},]);
}
render() {
let data = this.props.data;
if(!data)
return;
let sort = data.get("sort_id");
let currentTotalAmount = data.get("curr_amt");
let currentDate = data.get("curr_date");
let currentPAmount = data.get("curr_principal_amt");
let currentFee = data.get("curr_fee_amt");
let currentDelayFee = data.get("curr_dealy_fee_amt");
let desc = data.get("desc");
let status = data.get("status"); //1-还款中 2-结清 3-已逾期 4-已退货5-已取消
let isDelay = (status == 3);
let isPayable = (status == 1 || status == 3);
let checked = data.get("isChecked");
let checkboxIcon = require('../../image/uncheck_icon.png');
if (checked) {
checkboxIcon = require('../../image/check_icon.png');
}
return(
<View style={styles.container} >
<View style={styles.sortContainer}>
{
isPayable ?
<TouchableOpacity activeOpacity={1} onPress={() => this.props.onPressCheckboxCell && this.props.onPressCheckboxCell(this.props.rowIndex)}>
<Image style={styles.checkboxIcon} source={checkboxIcon}/>
</TouchableOpacity>
: <Text style={styles.sortText} numberOfLines={1}>{sort}</Text>
}
</View>
<Text style={styles.totalAmount} numberOfLines={1}>{currentTotalAmount}</Text>
<View style={styles.amountDetailContainer}>
<Text style={styles.amountText}>{currentDate}</Text>
<Text style={styles.amountText}>{"本金:" + currentPAmount}</Text>
<Text style={styles.amountText}>{"服务费:" + currentFee}</Text>
{
isDelay ? <Text style={styles.amountText}>{"逾期服务费:" + currentDelayFee}</Text> : null
}
</View>
{
isDelay ?
<View style={styles.delayDescContainer}>
<Text style={styles.delayDesc} numberOfLines={1}>{desc}</Text>
<TouchableOpacity onPress={() => { this.onPressDelayQuestion && this.onPressDelayQuestion();}}>
<Image style={styles.question} source={require("../../image/red_question_icon.png")}/>
</TouchableOpacity>
</View>
:
<Text style={styles.desc} numberOfLines={1}>{desc}</Text>
}
</View>
);
}
};
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 320;
let styles = StyleSheet.create({
container: {
flex: 1,
width: width,
height: 60 * DEVICE_WIDTH_RATIO,
borderBottomColor: '#e0e0e0',
borderBottomWidth: 0.5,
},
sortContainer:{
position: 'absolute',
top: 0,
left: 0,
width: 50 * DEVICE_WIDTH_RATIO,
height: 60 * DEVICE_WIDTH_RATIO,
justifyContent: 'center',
alignItems: 'center',
},
checkboxIcon:{
width: 20 * DEVICE_WIDTH_RATIO,
height: 20 * DEVICE_WIDTH_RATIO,
},
sortText:{
color: "#444444",
fontSize: 14 * DEVICE_WIDTH_RATIO,
},
totalAmount:{
position: 'absolute',
top: 15 * DEVICE_WIDTH_RATIO,
left: 50 * DEVICE_WIDTH_RATIO,
color: "#444444",
fontSize: 14 * DEVICE_WIDTH_RATIO,
},
amountDetailContainer:{
position: 'absolute',
top: 36 * DEVICE_WIDTH_RATIO,
left: 50 * DEVICE_WIDTH_RATIO,
flexDirection: 'row',
},
amountText:{
color: "#444444",
fontSize: 12,
marginRight: 5 * DEVICE_WIDTH_RATIO,
},
desc:{
position: 'absolute',
top: 15 * DEVICE_WIDTH_RATIO,
right: 15 * DEVICE_WIDTH_RATIO,
fontSize: 12 * DEVICE_WIDTH_RATIO,
},
delayDescContainer:{
position: 'absolute',
top: 15 * DEVICE_WIDTH_RATIO,
right: 15 * DEVICE_WIDTH_RATIO,
flexDirection: 'row',
},
delayDesc:{
color: "#ff0000",
fontSize: 12 * DEVICE_WIDTH_RATIO,
},
question: {
width: 14 * DEVICE_WIDTH_RATIO,
height: 14 * DEVICE_WIDTH_RATIO,
marginTop: 2 * DEVICE_WIDTH_RATIO,
marginLeft: 3 * DEVICE_WIDTH_RATIO,
},
});