AccountSettlementContainer.js 2.65 KB

'use strict';

import React, { Component } from 'react';

import AccountSettlement from '../components/AccountSettlement'

import {
    StyleSheet,
    View,
    Text,
    ListView,
}
from 'react-native';

export default class AccountSettlementContainer extends Component {

	constructor(props) {
		super(props);
		this.dataSource = new ListView.DataSource({
			rowHasChanged:(r1,r2)=>r1!==r2,
			sectionHeaderHasChanged: (s1, s2) => s1 !== s2
		});

		this.dataBlob = {
			'SECTION_HEADER':[{title:'累计结算金额(元)',content:'12567.00'}],
			'SECTION_SEPORATOR':[{}],
			'SECTION_TITLE':[{}],
			'SECTION_CONTENT':[
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
				{
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},

			],
		};

		this.fetchNextPage = this.fetchNextPage.bind(this);
		this.state = {dataBlob:this.dataBlob};
	}


	componentDidMount() {

	}
	fetchNextPage(){
		for (var i = 0; i < 15; i++) {
			this.dataBlob.SECTION_CONTENT.push({
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				},
                {
					brand:'vans',
					date: '2016-01-23',
					status: '已出账单',
					bill:'923.00'
				});
		}
		console.log(this.dataBlob.SECTION_CONTENT);
		this.setState({dataBlob:this.dataBlob});
	}
	render() {
		return (
            <AccountSettlement
                dataBlob={this.state.dataBlob}
                fetchNextPage={this.fetchNextPage}
            />

		);
	}
}