BillingView.js
4.47 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
/**
* Created by DEV005 on 2017/11/13.
*/
/**
* Created by tdzl2003 on 12/18/16.
*/
import React, {Component} from "react";
import {
Image,
ListView,
NativeModules,
StyleSheet,
Text,
TextInput,
TouchableOpacity,
View,
Platform,
RefreshControl,
ActivityIndicator,
ScrollView,
Dimensions,
Modal,
} from "react-native";
import { observable, useStrict, action } from 'mobx';
import { observer } from 'mobx-react';
import Orientation from 'react-native-orientation';
import {xnToast,getHeaderHeight,getHeaderPadding,getFooterBottom,xnBorderWidth} from "../utils/utils";
import AppService from "../service/AppService";
export default class BillingView extends Component {
static navigationOptions = ({ navigation, screenProps })=>({
header:null
});
constructor(props) {
super(props);
this.state = {
legalentityName:"",
creditCode:"",
bankAccountName:"",
bankAccountNumber:"",
legalentityAddress:"",
phoneNumber:"",
};
}
componentDidMount(){
let _this=this;
//设置头部
Orientation.addOrientationListener(v=>console.log(v))
const initial = Orientation.getInitialOrientation();
Orientation.lockToLandscapeLeft();
if (initial === 'PORTRAIT') {
// Orientation.lockToLandscapeLeft()
} else {
// do something else
}
let item=_this.props.navigation.state.params.item;
_this.setState({
legalentityName:item.legalentityName,
creditCode:item.creditCode,
bankAccountName:item.bankAccountName,
bankAccountNumber:item.bankAccountNumber,
legalentityAddress:item.legalentityAddress,
phoneNumber:item.phoneNumber,
})
};
componentWillUnmount() {
Orientation.lockToPortrait();
};
_goBack=()=> {
this.props.navigation.goBack();
}
read=(data)=> {
let _this=this;
NativeModules.system.readText(data).then((result) => {} ).catch((error) => {
console.log(error)
});
}
render() {
return (
<View style={styles.body}>
<View style={styles.layout} >
<TouchableOpacity onPress={()=>{this.read(this.state.legalentityName)}}><Text style={styles.title}>{this.state.legalentityName}</Text></TouchableOpacity>
<TouchableOpacity onPress={()=>{this.read(this.state.creditCode+"")}}><Text style={styles.infoCode}>{this.state.creditCode}</Text></TouchableOpacity>
<Text style={styles.info}>账户名称:{this.state.bankAccountName}</Text>
<Text style={styles.info}>银行账号:{this.state.bankAccountNumber}</Text>
<Text style={styles.info}>代为地址:{this.state.legalentityAddress}</Text>
<Text style={styles.info}>电话号码:{this.state.phoneNumber}</Text>
</View >
<View style={styles.operating}>
<TouchableOpacity style={styles.operatingBtn} onPress={()=>{this._goBack ()}}>
<Image style={styles.operatingImg} source={require('../img/billingBack.png')} resizeMode="contain"/>
</TouchableOpacity>
<TouchableOpacity style={styles.operatingBtn} onPress={()=>{this.read(this.state.legalentityName+","+this.state.creditCode)}}>
<Image style={styles.operatingImg} source={require('../img/read.png')} resizeMode="contain"/>
</TouchableOpacity>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
body:{
flex:1,
flexDirection:"column",
backgroundColor:"#333",
justifyContent:"center",
alignItems:"center",
},
layout:{
paddingLeft:50,
paddingRight:50,
},
title:{
fontSize:40,
color:"#fff"
},
infoCode:{
fontSize:30,
color:"#fff",
paddingTop:5,
paddingBottom:10,
},
info:{
fontSize:16,
color:"#fff"
},
operating:{
position:"absolute",
right:40,
bottom:40,
// width:100,
flexDirection:"row",
},
operatingBtn:{
width:50,
height:50,
marginLeft:30,
},
operatingImg:{
width:50,
height:50,
}
});