import React, { Component } from 'react' import { StyleSheet, View, Text, SectionList, Dimensions, StatusBar, TouchableOpacity, PixelRatio, ActivityIndicator, } from 'react-native' import { connect } from 'react-redux' import Icon from '../../../components/Iconfont/Iconfont' import { NavigationActions, createAction } from '../../../utils' import Echarts from '../../../components/echarts/EchartsComponent' import { ScaleUtil } from '../../../utils/utils' import { isIphoneX } from '../../common/theme/config' import { HeaderView } from '../../common/HeaderView' const { width, height } = Dimensions.get('window') @connect(({ theme, mine_header }) => ({ ...theme, ...mine_header })) class Credit extends Component { constructor(props) { super(props) this.state = { data: [] } // console.disableYellowBox = true; } listHeader(section) { return ( {section.financialOrg} {section.saleOrg} ) } listItemRender(item, index) { return ( {item.productGroupName} 额度 {CURRENCY.currencySign} {ScaleUtil(item.creditLimit, CURRENCY.currencyAmountScale)} 占用 {/* 预占 */} {/* {CURRENCY.currencySign}{item.preoccupyLimit} */} {/* 占用 */} {CURRENCY.currencySign} {ScaleUtil(item.occupyLimit, CURRENCY.currencyAmountScale)} ) } render() { const { appTheme, creditData } = this.props return ( {HeaderView(this.props.dispatch, '信用余额')} {creditData ? ( index} stickySectionHeadersEnabled={true} renderSectionHeader={({ section }) => this.listHeader(section)} renderItem={({ item, index }) => this.listItemRender(item, index)} style={{ marginTop: -10 }} sections={creditData} /> ) : ( )} ) } } const styles = StyleSheet.create({ container: { flex: 1, }, }) export default Credit