1.1.64 • Published 5 years ago

autobots-framework v1.1.64

Weekly downloads
2
License
ISC
Repository
github
Last release
5 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

5 years ago

1.1.63

5 years ago

1.1.62

5 years ago

1.1.61

5 years ago

1.1.60

5 years ago

1.1.58

5 years ago

1.1.57

5 years ago

1.1.56

5 years ago

1.1.55

5 years ago

1.1.54

5 years ago

1.1.53

6 years ago

1.1.51

6 years ago

1.1.50

6 years ago

1.1.49

6 years ago

1.1.48

6 years ago

1.1.47

6 years ago

1.1.46

6 years ago

1.1.45

7 years ago

1.1.44

7 years ago

1.1.43

7 years ago

1.1.42

7 years ago

1.1.41

7 years ago

1.1.40

7 years ago

1.1.39

7 years ago

1.1.38

7 years ago

1.1.37

7 years ago

1.1.36

7 years ago

1.1.35

7 years ago

1.1.34

7 years ago

1.1.33

7 years ago

1.1.32

7 years ago

1.1.31

7 years ago

1.1.30

7 years ago

1.1.29

7 years ago

1.1.28

7 years ago

1.1.27

7 years ago

1.1.26

7 years ago

1.1.25

7 years ago

1.1.24

7 years ago

1.1.23

7 years ago

1.1.22

7 years ago

1.1.21

7 years ago

1.1.20

7 years ago

1.1.19

7 years ago

1.1.18

7 years ago

1.1.17

7 years ago

1.1.16

7 years ago

1.1.15

7 years ago

1.1.14

7 years ago

1.1.13

7 years ago

1.1.12

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.0

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago