RepayDetail.js
5.59 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
'use strict';
import React from 'react';
import ReactNative, {
View,
Text,
Image,
StyleSheet,
Dimensions,
PixelRatio,
TouchableOpacity,
ListView,
} from 'react-native';
import Immutable, {Map} from 'immutable';
import Prompt from '../../../coupon/components/coupon/Prompt';
import LoadingIndicator from '../../../common/components/LoadingIndicator';
export default class RepayList extends React.Component {
constructor(props) {
super(props);
}
render() {
let {repayList,tipMessage,isFetching} = this.props.dataSource;
repayList = repayList.toJS();
let curRepayInfo = repayList[0];
if (!curRepayInfo) {
return null;
}
let styleStatusEnable ={backgroundColor:'#444444'};
let styleStatusDisable ={backgroundColor:'#444444'};
let isTwo = curRepayInfo.isTwo ? styleStatusEnable : styleStatusDisable;
let isThree = curRepayInfo.isThree ? styleStatusEnable : styleStatusDisable;
return(
<View style={styles.container}>
<View style={styles.repayAmtContianer}>
<Text style={[styles.repayAmtText,{marginLeft:100*DEVICE_WIDTH_RATIO}]}>本次还款</Text>
<Text style={[styles.repayAmtText,{color:'#d0021b',marginLeft:5*DEVICE_WIDTH_RATIO}]}>¥{curRepayInfo.amt?curRepayInfo.amt:'0.00'}</Text>
</View>
<View style={{
width: width,
height: 15 * DEVICE_WIDTH_RATIO,
backgroundColor: '#e5e5e5',
}}/>
<View style={styles.repayStatusContianer}>
<View style={styles.repayStatusTextContianer}>
<Text style={[styles.repayStatusText,{left:-15*DEVICE_WIDTH_RATIO}]}>付款</Text>
<Text style={[styles.repayStatusText,{left:70*DEVICE_WIDTH_RATIO}]}>银行处理</Text>
<Text style={[styles.repayStatusText,{right:-30*DEVICE_WIDTH_RATIO}]}>还款结果</Text>
</View>
<View style={styles.repayStatusLineContianer}>
<View style={[{
width: 100*DEVICE_WIDTH_RATIO,
height: 1 * DEVICE_WIDTH_RATIO,
backgroundColor: 'red',
},isTwo]}/>
<View style={[{
width: 100*DEVICE_WIDTH_RATIO,
height: 1 * DEVICE_WIDTH_RATIO,
backgroundColor: 'blue',
},isThree]}/>
<View style={[styles.circle,{left:-5*DEVICE_WIDTH_RATIO}]}/>
<View style={[styles.circle,{left:95*DEVICE_WIDTH_RATIO},isTwo]}/>
<View style={[styles.circle,{right:-5*DEVICE_WIDTH_RATIO},isThree]}/>
</View>
<Text style={styles.repayResult}>{curRepayInfo.txt?curRepayInfo.txt:''}</Text>
</View>
<View style={styles.questionContianer}>
<Text style={styles.question}>如有问题请联系客服</Text>
</View>
{tipMessage !== '' ? <Prompt
text={tipMessage}
duration={800}
onPromptHidden={this.props.clearTipMessage}
/> : null}
<LoadingIndicator
isVisible={isFetching}
/>
</View>
);
}
};
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 320;
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#e5e5e5',
alignItems: 'center',
width: width,
height: 61 * DEVICE_WIDTH_RATIO,
position: 'relative',
},
repayAmtContianer: {
width: width,
height: 60 * DEVICE_WIDTH_RATIO,
alignItems: 'center',
backgroundColor: 'white',
flexDirection: 'row',
},
repayAmtText: {
lineHeight: Math.ceil(29 * DEVICE_WIDTH_RATIO),
fontSize:15*DEVICE_WIDTH_RATIO,
},
repayStatusContianer: {
width: width,
height: 150 * DEVICE_WIDTH_RATIO,
alignItems: 'center',
backgroundColor: 'white',
marginBottom: 15 * DEVICE_WIDTH_RATIO,
},
repayStatusTextContianer: {
height: 50 * DEVICE_WIDTH_RATIO,
flexDirection: 'row',
width: 200 * DEVICE_WIDTH_RATIO,
position: 'relative',
},
repayStatusLineContianer: {
height: 1 * DEVICE_WIDTH_RATIO,
width: 200 * DEVICE_WIDTH_RATIO,
flexDirection: 'row',
position: 'relative',
},
repayStatusText: {
marginTop: 15 * DEVICE_WIDTH_RATIO,
fontSize: 15 * DEVICE_WIDTH_RATIO,
position: 'absolute',
},
circle: {
width: 10 * DEVICE_WIDTH_RATIO,
height: 10 * DEVICE_WIDTH_RATIO,
borderRadius: 5 * DEVICE_WIDTH_RATIO,
backgroundColor: '#444444',
position: 'absolute',
top: -5 * DEVICE_WIDTH_RATIO,
},
repayResult: {
marginTop: 40 * DEVICE_WIDTH_RATIO,
color: '#b0b0b0',
fontSize: 12 * DEVICE_WIDTH_RATIO,
lineHeight: Math.ceil(15 * DEVICE_WIDTH_RATIO),
},
questionContianer: {
borderBottomWidth: 1*DEVICE_WIDTH_RATIO,
borderBottomColor:'#444444',
position:'absolute',
bottom:25*DEVICE_WIDTH_RATIO,
marginLeft: 100 * DEVICE_WIDTH_RATIO,
},
question: {
fontSize: 14 * DEVICE_WIDTH_RATIO,
color: '#444444',
},
});