ReconciliationDetail.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  1. import React, { Component } from 'react'
  2. import {
  3. StyleSheet,
  4. View,
  5. Text,
  6. ActivityIndicator,
  7. Dimensions,
  8. StatusBar,
  9. TouchableOpacity,
  10. PixelRatio,
  11. FlatList,
  12. DatePickerAndroid,
  13. RefreshControl,
  14. Platform,
  15. } from 'react-native'
  16. import { connect } from 'react-redux'
  17. import Input from '../../../components/input/index'
  18. import Icon from '../../../components/Iconfont/Iconfont'
  19. import { NavigationActions, createAction } from '../../../utils'
  20. import { accAdd, ReturnDate } from '../../../utils/utils'
  21. import Collapsible from 'react-native-collapsible'
  22. import SelectTime from '../../common/SelectTime'
  23. const { width, height } = Dimensions.get('window')
  24. @connect(({ theme, mine_header, mine_payment }) => ({
  25. ...theme,
  26. ...mine_header,
  27. ...mine_payment,
  28. }))
  29. class ReconciliationDetail extends Component {
  30. constructor(props) {
  31. const date = new Date()
  32. super(props)
  33. this.state = {
  34. dateActive: true,
  35. listActive: 'asdasd',
  36. showSearch: false,
  37. detailList: [],
  38. // 开始时间
  39. startTime: props.navigation.state.params.startTime,
  40. // 结束时间
  41. endTime: props.navigation.state.params.endTime,
  42. // 财务组织
  43. Search_FinaOrg: props.navigation.state.params.Search_FinaOrg,
  44. saleId: props.navigation.state.params.saleId,
  45. }
  46. this.page = 0
  47. this.size = 5
  48. }
  49. componentDidMount = () => {
  50. this.props.navigation.state.params.comeFrom == 'Cost'
  51. ? this.props.dispatch(
  52. createAction('mine_header/CastAmountSaga')({
  53. pageInfo: { size: 5, page: 0 },
  54. searchInfo: this.searchInfo(),
  55. castAmt: [],
  56. })
  57. )
  58. : this.props.dispatch(
  59. createAction('mine_payment/PayDetailListSagas')({
  60. payActionData: [],
  61. pageInfo: { page: this.page, size: this.size },
  62. searchInfo: this.statsticInfo(),
  63. })
  64. )
  65. }
  66. // 费用对账请求参数
  67. searchInfo() {
  68. postInfo = {
  69. search_IN_financeOrg: this.state.Search_FinaOrg,
  70. search_IN_customer: CUSTOMERINFO.id,
  71. // search_GTE_billDate_date: new Date(this.state.startTime).getTime(),
  72. // search_LT_billDate_date: new Date(this.state.endTime).getTime()
  73. }
  74. if (this.state.startTime) {
  75. postInfo.search_GTE_billDate_date = new Date(
  76. this.state.startTime
  77. ).getTime()
  78. }
  79. if (this.state.endTime) {
  80. postInfo.search_LT_billDate_date = new Date(this.state.endTime).getTime()
  81. }
  82. return postInfo
  83. }
  84. // 应付对账请求参数
  85. statsticInfo() {
  86. let search = {
  87. search_EQ_financeOrg: this.state.Search_FinaOrg,
  88. }
  89. if (this.state.saleId) {
  90. search.search_EQ_saleOrg = this.state.saleId
  91. }
  92. if (this.state.startTime && this.state.endTime) {
  93. search.search_GTE_creationTime_date = this.state.startTime
  94. search.search_LT_creationTime_date = this.state.endTime
  95. }
  96. // if (this.state.searchText) {
  97. // search.search_LIKE_code = this.state.searchText;
  98. // }
  99. return search
  100. }
  101. onRefresh() {
  102. this.props.dispatch(
  103. createAction('mine_header/CastAmountSaga')({
  104. castAmt: [],
  105. pageInfo: { page: 0, size: this.size },
  106. searchInfo: this.searchInfo(),
  107. })
  108. )
  109. this.page = 0
  110. }
  111. // 头部
  112. header() {
  113. return (
  114. <View
  115. style={{
  116. height: HEADERSTYLE.height,
  117. paddingTop: HEADERSTYLE.paddingTop + 5,
  118. backgroundColor: '#fff',
  119. borderBottomColor: '#eee',
  120. borderBottomWidth: 1 / PixelRatio.get(),
  121. }}
  122. >
  123. <View
  124. style={{
  125. flex: 1,
  126. justifyContent: 'center',
  127. }}
  128. >
  129. <TouchableOpacity
  130. style={{ position: 'absolute', left: 10, flexDirection: 'row' }}
  131. onPress={() => this.props.dispatch(NavigationActions.back())}
  132. >
  133. <Icon
  134. name="icon-icon-fanhui"
  135. size={20}
  136. color={'#666'}
  137. style={{ marginTop: 4 }}
  138. />
  139. <Text
  140. style={{
  141. fontSize: 14,
  142. lineHeight: 20,
  143. color: '#666',
  144. alignSelf: 'center',
  145. }}
  146. >
  147. 返回
  148. </Text>
  149. </TouchableOpacity>
  150. {this.props.navigation.state.params.comeFrom == 'Cost' ? (
  151. <Text
  152. style={{
  153. alignSelf: 'center',
  154. fontSize: 18,
  155. lineHeight: 25,
  156. letterSpacing: 0.19,
  157. color: '#333',
  158. }}
  159. >
  160. 费用对账
  161. </Text>
  162. ) : this.state.showSearch ? (
  163. <Input
  164. autoFocus={this.state.showSearch}
  165. style={{
  166. marginLeft: 25,
  167. marginTop: 8,
  168. height: 28,
  169. width: width / 1.6,
  170. borderRadius: width / 2,
  171. alignSelf: 'center',
  172. marginBottom: 8,
  173. paddingLeft: 14,
  174. }}
  175. textStyle={{
  176. paddingLeft: 10,
  177. height: 32,
  178. fontSize: 11,
  179. padding: 0,
  180. }}
  181. iconSize={14}
  182. blurOnSubmit={true}
  183. textInputBacg={'#F5F5F5'}
  184. iconColor={'#CCC'}
  185. placeholderTextColor={'#CCC'}
  186. placeholderSize={8}
  187. onchangeFn={e => {
  188. this.setState({ activeSection: true })
  189. }}
  190. />
  191. ) : (
  192. <Text
  193. style={{
  194. alignSelf: 'center',
  195. fontSize: 18,
  196. lineHeight: 25,
  197. letterSpacing: 0.19,
  198. color: '#333',
  199. }}
  200. >
  201. 应付对账
  202. </Text>
  203. )}
  204. {/* {this.props.navigation.state.params == "Cost" ? (
  205. <View
  206. style={{ position: "absolute", right: 10, flexDirection: "row" }}
  207. >
  208. <TouchableOpacity
  209. onPress={() =>
  210. this.setState({ dateActive: !this.state.dateActive })
  211. }
  212. >
  213. <Icon name="icon-icon-rili" size={24} color={"#666"} />
  214. </TouchableOpacity>
  215. </View>
  216. ) : this.state.showSearch ? (
  217. <TouchableOpacity
  218. onPress={() =>
  219. this.setState({ showSearch: false, activeSection: true })
  220. }
  221. style={{ position: "absolute", right: 10, flexDirection: "row" }}
  222. >
  223. <Text style={{ fontSize: 14, lineHeight: 20, color: "#666" }}>
  224. 取消
  225. </Text>
  226. </TouchableOpacity>
  227. ) : (
  228. <View
  229. style={{ position: "absolute", right: 10, flexDirection: "row" }}
  230. >
  231. <TouchableOpacity
  232. style={{ marginRight: 10 }}
  233. onPress={() =>
  234. this.setState({ showSearch: true, activeSection: true })
  235. }
  236. >
  237. <Icon name="icon-icon-sousuo" size={24} color={"#666"} />
  238. </TouchableOpacity>
  239. <TouchableOpacity
  240. onPress={() =>
  241. this.setState({ dateActive: !this.state.dateActive })
  242. }
  243. >
  244. <Icon name="icon-icon-rili" size={24} color={"#666"} />
  245. </TouchableOpacity>
  246. </View>
  247. )} */}
  248. </View>
  249. </View>
  250. )
  251. }
  252. async TimeAndroid(mark) {
  253. const { action, year, month, day } = await DatePickerAndroid.open({
  254. date: new Date(),
  255. // minDate: new Date(),
  256. mode: 'spinner',
  257. })
  258. if (action !== DatePickerAndroid.dismissedAction) {
  259. let newDate = `${year}-${month + 1}-${day}`
  260. if (mark == 'start') {
  261. if (newDate <= this.state.endTime) {
  262. this.setState({
  263. startTime: newDate,
  264. })
  265. }
  266. } else if (mark == 'end') {
  267. if (this.state.startTime <= newDate) {
  268. this.setState({
  269. endTime: newDate,
  270. })
  271. }
  272. }
  273. // 这里开始可以处理用户选好的年月日三个参数:year, month (0-11), day
  274. }
  275. }
  276. ReconciliationList(item, index) {
  277. return (
  278. <View>
  279. <TouchableOpacity
  280. onPress={() => {
  281. if (this.state.listActive == index) {
  282. this.setState({ listActive: 'asdasd' })
  283. } else {
  284. this.props.dispatch(
  285. createAction('mine_header/CastDetailSaga')({ id: item.id })
  286. )
  287. this.setState({ listActive: index })
  288. }
  289. }}
  290. style={{ marginTop: 10, padding: 10, backgroundColor: '#FFF' }}
  291. >
  292. <View
  293. style={{
  294. flexDirection: 'row',
  295. justifyContent: 'space-between',
  296. }}
  297. >
  298. <View style={{ flexDirection: 'row' }}>
  299. <Text
  300. style={{
  301. fontSize: 13,
  302. lineHeight: 18,
  303. letterSpacing: 0.16,
  304. color: '#333',
  305. marginRight: 10,
  306. }}
  307. >
  308. {item.billCode || item.code}
  309. </Text>
  310. {this.props.navigation.state.params.comeFrom == 'Cost' ? (
  311. <Text
  312. style={{
  313. fontSize: 13,
  314. lineHeight: 18,
  315. letterSpacing: 0.16,
  316. color: '#333',
  317. }}
  318. >
  319. {item.castTypeName}
  320. </Text>
  321. ) : null}
  322. </View>
  323. <Text style={{ fontSize: 12, lineHeight: 17, color: '#999' }}>
  324. {ReturnDate(item.billDate || item.creationTime, true)}
  325. </Text>
  326. </View>
  327. <View
  328. style={{
  329. marginTop: 5,
  330. paddingBottom: 5,
  331. borderBottomColor: '#DDD',
  332. borderBottomWidth: 1 / PixelRatio.get(),
  333. }}
  334. >
  335. <Text
  336. style={{
  337. fontSize: 14,
  338. lineHeight: 20,
  339. letterSpacing: 0.17,
  340. color: '#333',
  341. }}
  342. >
  343. {item.customerName || item.saleOrgName}
  344. </Text>
  345. </View>
  346. {this.props.navigation.state.params.comeFrom == 'Cost' ? (
  347. <View style={{ flexDirection: 'row', paddingTop: 10 }}>
  348. <View style={{ flex: 1 }}>
  349. <Text
  350. style={{
  351. fontSize: 13,
  352. lineHeight: 18,
  353. letterSpacing: 0.16,
  354. color: '#999',
  355. }}
  356. >
  357. 费用金额
  358. </Text>
  359. <Text
  360. style={{
  361. fontSize: 15,
  362. lineHeight: 21,
  363. letterSpacing: 0.16,
  364. color: '#333',
  365. marginTop: 10,
  366. }}
  367. >
  368. {item.castAmount}
  369. </Text>
  370. </View>
  371. <View style={{ flex: 1 }}>
  372. <Text
  373. style={{
  374. fontSize: 13,
  375. lineHeight: 18,
  376. letterSpacing: 0.16,
  377. color: '#999',
  378. }}
  379. >
  380. 订单冲抵
  381. </Text>
  382. <Text
  383. style={{
  384. fontSize: 15,
  385. lineHeight: 21,
  386. letterSpacing: 0.16,
  387. color: '#333',
  388. marginTop: 10,
  389. }}
  390. >
  391. {accAdd(
  392. item.actualFlushAmount,
  393. item.actualGoodssupplementAmount
  394. )}
  395. </Text>
  396. </View>
  397. <View style={{ flex: 1 }}>
  398. <Text
  399. style={{
  400. fontSize: 13,
  401. lineHeight: 18,
  402. letterSpacing: 0.16,
  403. color: '#999',
  404. }}
  405. >
  406. 余额
  407. </Text>
  408. <Text
  409. style={{
  410. fontSize: 15,
  411. lineHeight: 21,
  412. letterSpacing: 0.16,
  413. color: '#E70013',
  414. marginTop: 10,
  415. }}
  416. >
  417. {item.castBalance}
  418. </Text>
  419. </View>
  420. </View>
  421. ) : (
  422. <View style={{ flexDirection: 'row', paddingTop: 10 }}>
  423. <View style={{ flex: 1 }}>
  424. <Text
  425. style={{
  426. fontSize: 13,
  427. lineHeight: 18,
  428. letterSpacing: 0.16,
  429. color: '#999',
  430. }}
  431. >
  432. 应付金额
  433. </Text>
  434. <Text
  435. style={{
  436. fontSize: 15,
  437. lineHeight: 21,
  438. letterSpacing: 0.16,
  439. color: '#333',
  440. marginTop: 10,
  441. }}
  442. >
  443. {item.receivableMoney}
  444. </Text>
  445. </View>
  446. <View style={{ flex: 1 }}>
  447. <Text
  448. style={{
  449. fontSize: 13,
  450. lineHeight: 18,
  451. letterSpacing: 0.16,
  452. color: '#999',
  453. }}
  454. >
  455. 核销金额
  456. </Text>
  457. <Text
  458. style={{
  459. fontSize: 15,
  460. lineHeight: 21,
  461. letterSpacing: 0.16,
  462. color: '#333',
  463. marginTop: 10,
  464. }}
  465. >
  466. {item.cancellationMoney}
  467. </Text>
  468. </View>
  469. <View style={{ flex: 1 }}>
  470. <Text
  471. style={{
  472. fontSize: 13,
  473. lineHeight: 18,
  474. letterSpacing: 0.16,
  475. color: '#999',
  476. }}
  477. >
  478. 付款核销额
  479. </Text>
  480. <Text
  481. style={{
  482. fontSize: 15,
  483. lineHeight: 21,
  484. letterSpacing: 0.16,
  485. color: '#333',
  486. marginTop: 10,
  487. }}
  488. >
  489. {item.payMoney}
  490. </Text>
  491. </View>
  492. <View style={{ flex: 1 }}>
  493. <Text
  494. style={{
  495. fontSize: 13,
  496. lineHeight: 18,
  497. letterSpacing: 0.16,
  498. color: '#999',
  499. }}
  500. >
  501. 退款核销额
  502. </Text>
  503. <Text
  504. style={{
  505. fontSize: 15,
  506. lineHeight: 21,
  507. letterSpacing: 0.16,
  508. color: '#333',
  509. marginTop: 10,
  510. }}
  511. >
  512. {item.backMoney}
  513. </Text>
  514. </View>
  515. </View>
  516. )}
  517. </TouchableOpacity>
  518. <Collapsible collapsed={index !== this.state.listActive}>
  519. <View
  520. style={{
  521. marginHorizontal: 10,
  522. marginBottom: 10,
  523. backgroundColor: '#FFFBF2',
  524. padding: 10,
  525. }}
  526. >
  527. {this.props.navigation.state.params.comeFrom == 'Cost' ? (
  528. <View style={{ flexDirection: 'row' }}>
  529. <View style={{ flex: 1 }}>
  530. <Text style={{ fontSize: 13, lineHeight: 18, color: '#666' }}>
  531. 订货单编码
  532. </Text>
  533. </View>
  534. <View style={{ flex: 1 }}>
  535. <Text style={{ fontSize: 13, lineHeight: 18, color: '#666' }}>
  536. 订单日期
  537. </Text>
  538. </View>
  539. <View style={{ flex: 1 }}>
  540. <Text style={{ fontSize: 13, lineHeight: 18, color: '#666' }}>
  541. 冲抵金额
  542. </Text>
  543. </View>
  544. </View>
  545. ) : (
  546. <View>
  547. <View
  548. style={{
  549. paddingBottom: 10,
  550. borderBottomColor: '#DDD',
  551. borderBottomWidth: 1,
  552. }}
  553. >
  554. <Text style={{ fontSize: 13, lineHeight: 22, color: '#666' }}>
  555. 核销金额:{CURRENCY.currencySign}
  556. {item.cancellationMoney}
  557. </Text>
  558. <Text style={{ fontSize: 13, lineHeight: 22, color: '#666' }}>
  559. 关联订单号:{item.srcOrderCode}
  560. </Text>
  561. <Text style={{ fontSize: 13, lineHeight: 22, color: '#666' }}>
  562. 关联出库单号:{item.srcBillcode}
  563. </Text>
  564. </View>
  565. <View style={{ flexDirection: 'row', paddingTop: 10 }}>
  566. <View style={{ flex: 1 }}>
  567. <Text
  568. style={{ fontSize: 13, lineHeight: 18, color: '#666' }}
  569. >
  570. 收款单号
  571. </Text>
  572. </View>
  573. <View style={{ flex: 1, alignItems: 'center' }}>
  574. <Text
  575. style={{ fontSize: 13, lineHeight: 18, color: '#666' }}
  576. >
  577. 收款核销日
  578. </Text>
  579. </View>
  580. <View style={{ flex: 1 }}>
  581. <Text
  582. style={{ fontSize: 13, lineHeight: 18, color: '#666' }}
  583. >
  584. 收款核销额
  585. </Text>
  586. </View>
  587. </View>
  588. </View>
  589. )}
  590. {this.props.navigation.state.params.comeFrom == 'Cost'
  591. ? this.props.castDetail.map((item, key) => (
  592. <View key={key} style={{ flexDirection: 'row' }}>
  593. <View style={{ flex: 1 }}>
  594. <Text
  595. numberOfLines={1}
  596. style={{ fontSize: 13, lineHeight: 22, color: '#666' }}
  597. >
  598. {item.customerOrderCode}
  599. </Text>
  600. </View>
  601. <View style={{ flex: 1 }}>
  602. <Text
  603. style={{ fontSize: 13, lineHeight: 22, color: '#666' }}
  604. >
  605. {ReturnDate(item.billDate, true)}
  606. </Text>
  607. </View>
  608. <View style={{ flex: 1 }}>
  609. <Text
  610. style={{ fontSize: 13, lineHeight: 22, color: '#666' }}
  611. >
  612. {item.flushAmount}
  613. </Text>
  614. </View>
  615. </View>
  616. ))
  617. : item.billlistPaymentAccount.map((itempay, key) => (
  618. <View key={key} style={{ flexDirection: 'row' }}>
  619. <View style={{ flex: 1 }}>
  620. <Text
  621. numberOfLines={1}
  622. style={{
  623. fontSize: 13,
  624. lineHeight: 22,
  625. color: '#666',
  626. }}
  627. >
  628. {itempay.paymentCode}
  629. </Text>
  630. </View>
  631. <View style={{ flex: 1, alignItems: 'center' }}>
  632. <Text
  633. style={{
  634. fontSize: 13,
  635. lineHeight: 22,
  636. color: '#666',
  637. }}
  638. >
  639. {ReturnDate(itempay.paymentTime, true)}
  640. </Text>
  641. </View>
  642. <View style={{ flex: 1 }}>
  643. <Text
  644. style={{
  645. fontSize: 13,
  646. lineHeight: 22,
  647. color: '#666',
  648. }}
  649. >
  650. {itempay.paymentMoney}
  651. </Text>
  652. </View>
  653. </View>
  654. ))}
  655. {this.props.navigation.state.params.comeFrom == 'Cost' ? null : (
  656. <View
  657. style={{
  658. marginTop: 10,
  659. paddingTop: 10,
  660. borderTopColor: '#DDD',
  661. borderTopWidth: 1,
  662. }}
  663. >
  664. <View style={{ flexDirection: 'row' }}>
  665. <View style={{ flex: 1 }}>
  666. <Text
  667. style={{ fontSize: 13, lineHeight: 18, color: '#666' }}
  668. >
  669. 退款单号
  670. </Text>
  671. </View>
  672. <View style={{ flex: 1, alignItems: 'center' }}>
  673. <Text
  674. style={{ fontSize: 13, lineHeight: 18, color: '#666' }}
  675. >
  676. 退款核销日期
  677. </Text>
  678. </View>
  679. <View style={{ flex: 1 }}>
  680. <Text
  681. style={{ fontSize: 13, lineHeight: 18, color: '#666' }}
  682. >
  683. 退款核销额
  684. </Text>
  685. </View>
  686. </View>
  687. {item.billlistRefundAccount.map((itemrefund, key) => (
  688. <View key={key} style={{ flexDirection: 'row' }}>
  689. <View style={{ flex: 1 }}>
  690. <Text
  691. numberOfLines={1}
  692. style={{
  693. fontSize: 13,
  694. lineHeight: 22,
  695. color: '#666',
  696. }}
  697. >
  698. {itemrefund.refundCode}
  699. </Text>
  700. </View>
  701. <View style={{ flex: 1, alignItems: 'center' }}>
  702. <Text
  703. style={{
  704. fontSize: 13,
  705. lineHeight: 22,
  706. color: '#666',
  707. }}
  708. >
  709. {itemrefund.refundTime}
  710. </Text>
  711. </View>
  712. <View style={{ flex: 1 }}>
  713. <Text
  714. style={{
  715. fontSize: 13,
  716. lineHeight: 22,
  717. color: '#666',
  718. }}
  719. >
  720. {itemrefund.refundMoney}
  721. </Text>
  722. </View>
  723. </View>
  724. ))}
  725. </View>
  726. )}
  727. </View>
  728. </Collapsible>
  729. </View>
  730. )
  731. }
  732. // 底部
  733. footerCom() {
  734. if (this.props.showFoot == 0) {
  735. return <View />
  736. } else if (this.props.showFoot == 1) {
  737. return (
  738. <View style={styles.footer}>
  739. <Text
  740. style={{
  741. fontSize: 14,
  742. lineHeight: 20,
  743. letterSpacing: 0.17,
  744. color: '#999',
  745. }}
  746. >
  747. 没有更多数据
  748. </Text>
  749. </View>
  750. )
  751. } else if (this.props.showFoot == 2) {
  752. return (
  753. <View style={styles.footer}>
  754. <ActivityIndicator />
  755. <Text>正在加载更多数据...</Text>
  756. </View>
  757. )
  758. }
  759. }
  760. render() {
  761. const { appTheme, castAmtContent, totalPages, payDetailData } = this.props
  762. return (
  763. <View
  764. style={[
  765. styles.container,
  766. { backgroundColor: appTheme.backgroundColor },
  767. ]}
  768. >
  769. <StatusBar
  770. animated={true}
  771. barStyle={appTheme.barStyle}
  772. // barStyle={"dark-content"}
  773. backgroundColor={'transparent'}
  774. translucent={true}
  775. />
  776. {this.header()}
  777. {/* 列表 */}
  778. <FlatList
  779. keyExtractor={item => item.id}
  780. data={
  781. this.props.navigation.state.params.comeFrom == 'Cost'
  782. ? castAmtContent
  783. : payDetailData
  784. }
  785. extraData={this.state.listActive}
  786. renderItem={({ item, index }) => this.ReconciliationList(item, index)}
  787. ListFooterComponent={this.footerCom.bind(this)}
  788. // initialNumToRender={5}
  789. onEndReachedThreshold={0.1}
  790. onEndReached={e => {
  791. if (this.props.showFoot != 0) {
  792. return
  793. }
  794. if (this.page != 1 && this.page >= totalPages) {
  795. return
  796. } else {
  797. this.page++
  798. }
  799. this.props.navigation.state.params.comeFrom == 'Cost'
  800. ? this.props.dispatch(
  801. createAction('mine_header/CastAmountSaga')({
  802. castAmt: castAmtContent,
  803. pageInfo: { page: this.page, size: this.size },
  804. searchInfo: this.searchInfo(),
  805. forUse: 'slipOn',
  806. })
  807. )
  808. : this.props.dispatch(
  809. createAction('mine_payment/PayDetailListSagas')({
  810. payActionData: payDetailData,
  811. pageInfo: { page: this.page, size: this.size },
  812. searchInfo: this.statsticInfo(),
  813. forUse: 'slipOn',
  814. })
  815. )
  816. }}
  817. refreshControl={
  818. <RefreshControl
  819. refreshing={this.props.isRefreshing}
  820. onRefresh={this.onRefresh.bind(this)} //(()=>this.onRefresh)或者通过bind来绑定this引用来调用方法
  821. tintColor="red"
  822. title={this.props.isRefreshing ? '刷新中....' : '下拉刷新'}
  823. />
  824. }
  825. />
  826. {/* 下拉遮罩 */}
  827. {!this.state.dateActive ? (
  828. <View
  829. style={{
  830. position: 'absolute',
  831. width: width,
  832. height: height,
  833. backgroundColor: '#000',
  834. opacity: 0.5,
  835. top: 101,
  836. }}
  837. />
  838. ) : null}
  839. </View>
  840. )
  841. }
  842. }
  843. const styles = StyleSheet.create({
  844. container: {
  845. flex: 1,
  846. },
  847. footer: {
  848. flexDirection: 'row',
  849. height: 24,
  850. justifyContent: 'center',
  851. alignItems: 'center',
  852. marginBottom: 10,
  853. marginTop: 10,
  854. },
  855. })
  856. export default ReconciliationDetail