time 5 years ago
parent
commit
de0063e724

+ 52 - 3
units/components/commons/bi/BIChartsItem.js

@@ -115,17 +115,66 @@ export  default  class BIChartsItem extends Component {
             ]
         };
 
-
+         const pieOptions = {
+             title:{
+                 text:'水果对比',
+                 top:'0',
+                 left:'10',
+                 font:10,
+                 textStyle:{
+
+                     fontSize: 18,
+                     color:'darkGray',
+
+
+                 }
+
+             },
+             legend: {
+                 orient: 'horizontal',
+                 type:'scroll',
+                 data: ['直接访问','邮件营销','联盟广告','视频广告','搜索引擎'],
+                 padding:[
+
+                     240,
+                     100,
+                     100,
+                     100,
+                 ],
+             },
+             series : [
+                 {
+                     name: '访问来源',
+                     type: 'pie',
+                     radius : '55%',
+                     center: ['50%', '50%'],
+                     data:[
+                         {value:335, name:'直接访问'},
+                         {value:310, name:'邮件营销'},
+                         {value:334, name:'联盟广告'},
+                         {value:135, name:'视频广告'},
+                         {value:548, name:'搜索引擎'}
+                     ],
+                     itemStyle: {
+                         emphasis: {
+                             shadowBlur: 10,
+                             shadowOffsetX: 0,
+                             shadowColor: 'rgba(0, 0, 0, 0.5)'
+                         }
+                     }
+                 }
+             ]
+         };
 
         this.state = {
 
-            options:option,
+            options: typeTitle === 'pie' ? pieOptions:option,
         }
     }
 
 
     _onPressAllScreen(){
-        
+
 
         NavigationUtil.goPage(this.state.options,'AllScreenChart',)
 

+ 31 - 0
units/components/pages/BasePage.js

@@ -0,0 +1,31 @@
+import React, { Component } from 'react';
+import {
+    View,
+    Image,
+} from 'react-native';
+
+export default class BasePage extends Component {
+
+
+    static navigationOptions = {
+
+        headerBackImage:(
+
+            <View style={{marginLeft:18}}>
+
+                <Image
+                    source={{uri: 'uu_back-icon'}}
+                    style={{ width: 12, height: 20,marginRight:6}}
+                />
+
+            </View>
+
+
+        ), //使用组件
+
+
+    }
+
+}
+
+

+ 2 - 1
units/components/pages/CodePushPage.js

@@ -7,8 +7,9 @@ import {
     View,
 } from 'react-native';
 import CodePush from "react-native-code-push";
+import BasePage from "./BasePage";
 
-class CodePushPa extends Component {
+class CodePushPa extends BasePage {
 
 
     constructor(props) {

+ 16 - 2
units/components/pages/DetailsScreen.js

@@ -2,12 +2,26 @@
  * Created by Arison on 2019/6/11.
  */
 import React from "react";
-import { View, Button,Text } from "react-native";
+import {View, Button, Text, Image} from "react-native";
+import BasePage from "./BasePage";
 
-export class DetailsScreen extends React.Component {
+export class DetailsScreen extends BasePage {
     static navigationOptions = {
         title: 'DetailsScreen',
         headerBackTitle:'返回',//设置返回此页面的返回按钮文案,有长度限制
+        headerBackImage:(
+
+            <View style={{marginLeft:18}}>
+
+                <Image
+                    source={{uri: 'uu_back-icon'}}
+                    style={{ width: 12, height: 20,marginRight:6}}
+                />
+
+            </View>
+
+
+        ), //使用组件
     }
 
 

+ 4 - 2
units/components/pages/EChartsPage.js

@@ -5,8 +5,9 @@ import {
     FlatList, Image,
 } from 'react-native';
 import BIChartsItem from "../commons/bi/BIChartsItem";
+import BasePage from "./BasePage";
 
-export default class EChartsPage extends Component {
+export default class EChartsPage extends BasePage {
 
 
     static navigationOptions = {
@@ -35,7 +36,7 @@ export default class EChartsPage extends Component {
 
         this.state={
 
-            dataArray:['line','bar','line'],
+            dataArray:['line','bar','pie'],
 
         }
 
@@ -62,6 +63,7 @@ export default class EChartsPage extends Component {
                 <FlatList
 
                     data={this.state.dataArray}
+                    keyExtractor={item => "" + (item.item)}
                     renderItem = {data=>this.renderItem(data)}
 
                 />