Authored by 于良

Merge branch 'local' into develop

... ... @@ -4,8 +4,11 @@ import Immutable, {List, Record} from 'immutable';
import React, {Component} from 'react';
import {
View,
ScrollView,
Dimensions,
Platform,
StyleSheet,
} from 'react-native';
import TrendTextSection from './TrendTextSection';
... ... @@ -90,7 +93,7 @@ export default class RefoundStatistics extends Component {
render() {
return (
<ScrollView contentContainerStyle={{flex: 1}}>
<ScrollView contentContainerStyle={styles.contentContainer}>
<CalendarTrigger date={this.state.selectdDate} toogleSelector={this.toogleSelector} />
<Placeholder />
<TrendTextSection content={this.props.section1} />
... ... @@ -109,3 +112,18 @@ export default class RefoundStatistics extends Component {
);
}
}
let {width, height} = Dimensions.get('window');
let navbarHeight = (Platform.OS === 'android') ? 50 : 64;
let contentHeight = height - navbarHeight;
const chartRatio = 320 / 320;
const chartHeight = Math.ceil(width / chartRatio);
let scrollHeight = 45 + 15 + 81 * 3 + 15 + chartHeight;
scrollHeight = scrollHeight > height ? scrollHeight : height;
let styles = StyleSheet.create({
contentContainer: {
height: scrollHeight
},
});
... ...
... ... @@ -17,6 +17,8 @@ const {
Text,
ScrollView,
Platform,
Dimensions,
StyleSheet
} = ReactNative;
export default class SaleStatistics extends Component {
... ... @@ -108,7 +110,7 @@ export default class SaleStatistics extends Component {
render() {
return (
<ScrollView contentContainerStyle={{flex: 1}}>
<ScrollView contentContainerStyle={styles.contentContainer}>
<CalendarTrigger date={this.state.selectdDate} toogleSelector={this.toogleSelector} />
<Placeholder />
<TrendTextSection content={this.props.section1} />
... ... @@ -127,3 +129,18 @@ export default class SaleStatistics extends Component {
}
}
let {width, height} = Dimensions.get('window');
let navbarHeight = (Platform.OS === 'android') ? 50 : 64;
let contentHeight = height - navbarHeight;
const chartRatio = 320 / 320;
const chartHeight = Math.ceil(width / chartRatio);
let scrollHeight = 45 + 15 + 101 + 81 + 15 + chartHeight;
scrollHeight = scrollHeight > height ? scrollHeight : height;
let styles = StyleSheet.create({
contentContainer: {
height: scrollHeight
},
});
... ...
... ... @@ -45,13 +45,19 @@ export default class ChartView extends Component {
scalesPageToFit={true}
startInLoadingState={false}
javaScriptEnabled={true}
scrollEnabled={false}
/>
</View>
);
}
}
const chartHeight = (Platform.OS === 'android') ? 250 : 250;
const fontSize = (Platform.OS === 'android') ? 14 : 14;
const width = Dimensions.get('window').width;
const initRatio = 465 / 250;
const height = width / initRatio;
const chartHeight = height + 75;
const styles = StyleSheet.create({
container: {
... ... @@ -65,25 +71,24 @@ const styles = StyleSheet.create({
},
chartStyle: {
height: chartHeight,
marginLeft: -45,
marginRight: -45,
// marginLeft: -45,
// marginRight: -45,
marginBottom: 15,
},
});
const fontSize = (Platform.OS === 'android') ? 14 : 14;
const width = Dimensions.get('window').width;
function getHTMLString(xData, yData, jsPath) {
const HTML = `
<!DOCTYPE html>
<html style="width: ` + width + `; height: 100%; margin: 0px;">
<html style="width: ` + width + `; height: ` + height + `; margin: 0px;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"/>
<meta name="viewport" content="width=` + width + `,initial-scale=1.0,user-scalable=no"/>
</head>
<body style="width: ` + width + `; height: 100%; margin: 0px;">
<div id="container" style="width: ` + width + `; height: 100%; margin: 0px; min-height: 250px;"></div>
<body style="width: ` + width + `; height: ` + height + `; margin: 0px;">
<div id="container" style="width: ` + width + `; height: ` + height + `; margin: 0px; min-height: 250px;"></div>
<script type="text/javascript" src="`+ jsPath +`"></script>
<script type="text/javascript">
var dom = document.getElementById("container");
... ... @@ -95,10 +100,10 @@ function getHTMLString(xData, yData, jsPath) {
show: false,
},
grid: {
left: '5%',
left: 0,
top: 60,
right: '8%',
width: '90%',
right: 0,
width: ` + width + `,
height: '65%',
},
xAxis: {
... ... @@ -107,10 +112,6 @@ function getHTMLString(xData, yData, jsPath) {
axisLine: {
show: true,
onZero: false,
lineStyle: {
width: 1,
color: 'gray',
},
},
axisTick: {
show:false,
... ... @@ -138,6 +139,9 @@ function getHTMLString(xData, yData, jsPath) {
axisLabel: {
show: false,
},
splitLine: {
show: true,
},
},
tooltip: {
show: true,
... ...