1.1.64 • Published 7 years ago

autobots-framework v1.1.64

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

RN开发框架说明

组件

Nav

使用导航器可以让你在应用的不同场景(页面)间进行切换。导航器通过路由对象来分辨不同的场景。

调用方式

  import {Nav} from 'autobots-framework';
  import HomePage from './pages/HomePage';
  
  Nav.pop();//返回上一页面
  
  //跳转至页面
  Nav.push({
              name: 'HomePage', 
              component: HomePage,
              params: {
              }
        });
  //你也可以调用Nav.navigator对象来使用RN的完整路由功能
  Nav.navigator.popToTop()
  ...
  //更多可查看RN帮助文档

Native

提供RN与原生交互功能。

调用方式

  import {Native} from 'autobots-framework';
  //回到汽车人首页
  Native.gotoHomePage();
  
  //...后续回有更多接口加入
   

Http

通用网络请求。

调用方式

import {Http} from 'autobots-framework';
  
Http.request("http://xxx.com",{name:""}).then(function(data){
          if(data)
          {
	          //成功
	          ...
          }else
          {
	          //失败
	          ...
          }
      });

   

Components

包含一些基础RN组件。

Navbar

  import {Components} from 'autobots-framework';
  const {Navbar} = Components;
  
  ...
  render(){
	return(<Navbar title="xxx" onLeftButtonPress={()=>{
		  //左侧返回按钮点击事件
          ...
      }}  />)
  }
  ...
   

ImagesPicker

  import {Components} from 'autobots-framework';
  const {ImagesPicker} = Components;
  
  ...
  <ImagesPicker ref={imgPicker=>this.imgPicker=imgPicker} onPicked={(data)=>{
		   //返回值
			  单选返回图片url
			  多选返回图片url数组
 }} />

 this.imgPicker.MutiPick(); //多选
 this.imgPicker.SinglePick(); //单选
 ...
   

CameraPicker

  import {Components} from 'autobots-framework';
  const {CameraPicker} = Components;
  
  ...
  <CameraPicker ref={caPicker=>this.caPicker=caPicker} onPicked={(data)=>{
		   //返回值
		   返回图片url
 }} />

 this.caPicker.Pick(); //拍照


 ...
   

EmployeePicker

  import {Components} from 'autobots-framework';
  const {EmployeePicker} = Components;
  
  ...
  <EmployeePicker ref={empPicker=>this.empPicker=empPicker} onPicked={(data)=>{
		   //返回值
		   返回图片url
 }} />

 this.empPicker.MutiPick("选择出差人","最近选择出差人"); //多选
 this.empPicker.SinglePick("选择出差人","最近选择出差人");//单选

 ...
   

Loading

调用汽车人统一loading。

  import {Components} from 'autobots-framework';
  const {MainLoading} = Components;
  //短文本
  MainLoading.Show();
  //超长文本
  MainLoading.ShowLong();

Config

提供系统内的一些配置参数。

调用方式

  import {Config} from 'autobots-framework';
  //获取参数对象
  var c = Config.get();
  
  console.log(c);
  //输出结果
   {
	  name:"xxx",
	  homeTitle:"xxx", 
	  startApp:object,//首页对象
	  employee:{empCode:"xxx",empName:"xxx"},//当前登录人信息	
	  urlParams:"xxx",//从原生获取的网页传递参数
	}
   

Toast

toast功能。

调用方式

  import {Toast} from 'autobots-framework';
  //短文本
  Toast.Show('xxx');
  //超长文本
  Toast.ShowLong('xxx');
1.1.64

7 years ago

1.1.63

7 years ago

1.1.62

7 years ago

1.1.61

7 years ago

1.1.60

7 years ago

1.1.58

8 years ago

1.1.57

8 years ago

1.1.56

8 years ago

1.1.55

8 years ago

1.1.54

8 years ago

1.1.53

8 years ago

1.1.51

8 years ago

1.1.50

8 years ago

1.1.49

8 years ago

1.1.48

8 years ago

1.1.47

8 years ago

1.1.46

9 years ago

1.1.45

9 years ago

1.1.44

9 years ago

1.1.43

9 years ago

1.1.42

9 years ago

1.1.41

9 years ago

1.1.40

9 years ago

1.1.39

9 years ago

1.1.38

9 years ago

1.1.37

9 years ago

1.1.36

9 years ago

1.1.35

9 years ago

1.1.34

9 years ago

1.1.33

9 years ago

1.1.32

9 years ago

1.1.31

9 years ago

1.1.30

9 years ago

1.1.29

9 years ago

1.1.28

9 years ago

1.1.27

9 years ago

1.1.26

9 years ago

1.1.25

9 years ago

1.1.24

9 years ago

1.1.23

9 years ago

1.1.22

9 years ago

1.1.21

9 years ago

1.1.20

9 years ago

1.1.19

9 years ago

1.1.18

9 years ago

1.1.17

9 years ago

1.1.16

9 years ago

1.1.15

9 years ago

1.1.14

10 years ago

1.1.13

10 years ago

1.1.12

10 years ago

1.1.11

10 years ago

1.1.10

10 years ago

1.1.9

10 years ago

1.1.8

10 years ago

1.1.7

10 years ago

1.1.6

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.0

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago