service_provider.js 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. import React, {Component} from 'react';
  2. import {
  3. View,
  4. Image,
  5. TouchableHighlight,
  6. Text,
  7. StyleSheet,
  8. TextInput,
  9. TouchableOpacity,
  10. Dimensions,
  11. ScrollView,
  12. KeyboardAvoidingView,
  13. DeviceEventEmitter,
  14. } from 'react-native';
  15. import login_css from '../login/login_css';
  16. import public_css from '../../source/css/public_css';
  17. import loading_css from '../../source/css/loading_css';
  18. import Spinner from 'react-native-loading-spinner-overlay';
  19. import {GetDataPost} from '../../data/encryption';
  20. import {ShowToast} from '../../components/rootToast/root_toast';
  21. import {RetrieveData, StorageData} from '../../data/storage';
  22. export default class service_provider extends Component {
  23. constructor(props) {
  24. super(props);
  25. this.props.navigation.dangerouslyGetParent().setOptions({
  26. tabBarVisible: false,
  27. });
  28. this.service = this.props.route.params.service;
  29. this.state = {
  30. name: this.service.name,
  31. contactPhone: this.service.contactPhone,
  32. contactName: this.service.contactName,
  33. address: this.service.address,
  34. ispId: this.service.ispId,
  35. joinDate: this.service.joinDate,
  36. machineCnt: 0,
  37. onlineEnCut: 0,
  38. allEntCnt: 0,
  39. monthInvoiceAmt: 0,
  40. monthInvoiceCnt: 0,
  41. monthNewInitCnt: 0,
  42. avaiableEntCnt: 0,
  43. };
  44. console.log(this);
  45. }
  46. render() {
  47. return (
  48. <KeyboardAvoidingView enabled style={{flex: 1}}>
  49. <ScrollView>
  50. <View>
  51. <View style={login_css.inputView}>
  52. <View style={[public_css.view, public_css.lineTopBottom]}>
  53. <Text
  54. style={[
  55. public_css.text,
  56. {fontFamily: 'PingFang-SC-Regular', color: '#333333'},
  57. ]}>
  58. 服务商名称:
  59. </Text>
  60. <TextInput
  61. style={public_css.textInputStyle}
  62. value={this.state.name}
  63. clearButtonMode="while-editing"
  64. secureTextEntry={false}
  65. editable={false}
  66. />
  67. </View>
  68. <View style={[public_css.view, public_css.lineTopBottom]}>
  69. <Text
  70. style={[
  71. public_css.text,
  72. {fontFamily: 'PingFang-SC-Regular', color: '#333333'},
  73. ]}>
  74. 联系电话:
  75. </Text>
  76. <TextInput
  77. style={public_css.textInputStyle}
  78. value={this.state.contactPhone}
  79. clearButtonMode="while-editing"
  80. secureTextEntry={false}
  81. editable={false}
  82. onChangeText={(text) => {
  83. this.setState({
  84. contactPhone: text,
  85. });
  86. }}
  87. />
  88. </View>
  89. <View style={[public_css.view, public_css.lineTopBottom]}>
  90. <Text
  91. style={[
  92. public_css.text,
  93. {fontFamily: 'PingFang-SC-Regular', color: '#333333'},
  94. ]}>
  95. 地址:
  96. </Text>
  97. <TextInput
  98. style={public_css.textInputStyle}
  99. value={this.state.address}
  100. clearButtonMode="while-editing"
  101. secureTextEntry={false}
  102. editable={false}
  103. onChangeText={(text) => {
  104. this.setState({
  105. address: text,
  106. });
  107. }}
  108. />
  109. </View>
  110. <View style={[public_css.view, public_css.lineTopBottom]}>
  111. <Text style={public_css.text}>接入日期:</Text>
  112. <TextInput
  113. style={public_css.textInputStyle}
  114. value={this.state.joinDate}
  115. clearButtonMode="while-editing"
  116. secureTextEntry={false}
  117. editable={false}
  118. onChangeText={(text) => {
  119. this.setState({
  120. joinDate: text,
  121. });
  122. }}
  123. />
  124. </View>
  125. </View>
  126. </View>
  127. <View style={[login_css.inputView, {marginTop: 10}]}>
  128. <View style={[public_css.view, public_css.lineTopBottom]}>
  129. <Text style={public_css.text}>服务器数量:</Text>
  130. <TextInput
  131. style={public_css.textInputStyle}
  132. value={this.state.bankAccountName}
  133. clearButtonMode="while-editing"
  134. secureTextEntry={false}
  135. editable={false}
  136. onChangeText={(text) => {
  137. this.setState({
  138. bankAccountName: text,
  139. });
  140. }}
  141. />
  142. </View>
  143. <View style={[public_css.view, public_css.lineTopBottom]}>
  144. <Text style={public_css.text}>在线企业数:</Text>
  145. <TextInput
  146. style={public_css.textInputStyle}
  147. value={this.state.onlineEnCut}
  148. clearButtonMode="while-editing"
  149. secureTextEntry={false}
  150. editable={false}
  151. onChangeText={(text) => {
  152. this.setState({
  153. onlineEnCut: text,
  154. });
  155. }}
  156. />
  157. </View>
  158. <View
  159. style={[
  160. public_css.view,
  161. public_css.lineTopBottom,
  162. {alignItems: 'center'},
  163. ]}>
  164. <Text style={public_css.text}>所有企业数:</Text>
  165. <TextInput
  166. style={public_css.textInputStyle}
  167. clearButtonMode="while-editing"
  168. secureTextEntry={false}
  169. value={this.state.payees}
  170. editable={false}
  171. />
  172. </View>
  173. <View
  174. style={[
  175. public_css.view,
  176. public_css.lineTopBottom,
  177. {alignItems: 'center'},
  178. ]}>
  179. <Text style={public_css.text}>月累计开票金额:</Text>
  180. <TextInput
  181. style={public_css.textInputStyle}
  182. clearButtonMode="while-editing"
  183. secureTextEntry={false}
  184. value={this.state.reviewers}
  185. editable={false}
  186. />
  187. </View>
  188. <View
  189. style={[
  190. public_css.view,
  191. public_css.lineTopBottom,
  192. {alignItems: 'center'},
  193. ]}>
  194. <Text style={public_css.text}>月累计开票数量:</Text>
  195. <TextInput
  196. style={public_css.textInputStyle}
  197. clearButtonMode="while-editing"
  198. secureTextEntry={false}
  199. value={this.state.reviewers}
  200. editable={false}
  201. />
  202. </View>
  203. <View
  204. style={[
  205. public_css.view,
  206. public_css.lineTopBottom,
  207. {alignItems: 'center'},
  208. ]}>
  209. <Text style={public_css.text}>月新增上架企业数:</Text>
  210. <TextInput
  211. style={public_css.textInputStyle}
  212. clearButtonMode="while-editing"
  213. secureTextEntry={false}
  214. value={this.state.reviewers}
  215. editable={false}
  216. />
  217. </View>
  218. </View>
  219. </ScrollView>
  220. </KeyboardAvoidingView>
  221. );
  222. }
  223. //加载页面时显示数据
  224. componentDidMount(): void {
  225. this.getServiceInfo();
  226. }
  227. //获取服务商列表
  228. getServiceInfo = async () => {
  229. let account = await RetrieveData('account');
  230. let token = await RetrieveData('token');
  231. if (token && account) {
  232. account = account.substring(1, account.length - 1);
  233. token = token.substring(1, token.length - 1);
  234. const url = 'https://app.taxbk.cn:9443/auth/isp/info/findDetail';
  235. let response = await GetDataPost(
  236. url,
  237. token,
  238. {
  239. ispId: this.state.ispId,
  240. },
  241. false,
  242. 2,
  243. );
  244. if (response) {
  245. if (response.code == 0) {
  246. this.setState({
  247. name: response.data.name,
  248. contactPhone: response.data.contactPhone,
  249. contactName: response.data.contactName,
  250. address: response.data.address,
  251. ispId: response.data.ispId,
  252. joinDate: response.data.joinDate,
  253. machineCnt: response.data.machineCnt,
  254. onlineEnCut: response.data.onlineEnCut,
  255. allEntCnt: response.data.allEntCnt,
  256. monthInvoiceAmt: response.data.monthInvoiceAmt,
  257. monthInvoiceCnt: response.data.monthInvoiceCnt,
  258. monthNewInitCnt: response.data.monthNewInitCnt,
  259. avaiableEntCnt: response.data.avaiableEntCnt,
  260. });
  261. }
  262. }
  263. }
  264. };
  265. }