autobots-commonlib 1.2.8 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/jump.js CHANGED
@@ -1,76 +1,76 @@
1
- 'use strict';
2
-
3
- import React from 'react-native';
4
- import Native from '../native';
5
- import Toast from './toast';
6
-
7
- const {
8
- ToastAndroid,
9
- Platform,
10
- } = React;
11
-
12
- /**
13
- *
14
- * @param code 模块名
15
- * @param level 安全等级 加载webview的时候填写
16
- * @param url webview链接地址
17
- * @param type 模块类型 1-原生 2-webview 3-Rn
18
- * @param callback 回调
19
- */
20
- let openNative = function(code,level,url,type,callback){
21
- let u = 'autobots://rn/jump?code='+code+'&level='+level+'&url='+url+'&type='+type;
22
- // if(isShowLoading){
23
- // url = url +"?isShowLoading=true";
24
- // }else {
25
- // url = url +"?isShowLoading=false";
26
- // }
27
- // if(shadeHeight>0)
28
- // {
29
- // url = url +"&shadeHeight="+shadeHeight;
30
- // }
31
- Native.callNative(u,function(result,data){
32
- if(callback)
33
- {
34
- callback(result,data);
35
- }
36
- });
37
- }
38
-
39
- let initOpenNative = function(code,level,url,type,rnInitParams,callback){
40
- let initParams = JSON.stringify(rnInitParams);
41
- initParams = initParams.replace(/&/g,'%26');
42
- let u = 'autobots://rn/jump?code='+code+'&level='+level+'&url='+url+'&type='+type+'&rnInitParams='+initParams;
43
- Native.callNative(u,function(result,data){
44
- if(callback)
45
- {
46
- callback(result,data);
47
- }
48
- });
49
- }
50
-
51
- let richOpenNative = function(code,level,url,type,rnInitParams,tools,supportedOrientations,useWebKit,needPin,callback){
52
- let initParams = JSON.stringify(rnInitParams);
53
- initParams = initParams.replace(/&/g,'%26');
54
- let u = 'autobots://rn/jump?code='+code+'&level='+level+'&url='+url+'&type='+type+'&rnInitParams='+initParams+'&tools='+tools+'&supportedOrientations='+supportedOrientations+'&useWebKit='+useWebKit+'&needPin='+needPin;
55
- Native.callNative(u,function(result,data){
56
- if(callback)
57
- {
58
- callback(result,data);
59
- }
60
- });
61
- }
62
-
63
- var jump = {
64
- Open:function(code,level,url,type,callback)
65
- {
66
- openNative(code,level,url,type,callback);
67
- },
68
- InitOpen:function(code,level,url,type,rnInitParams,callback){
69
- initOpenNative(code,level,url,type,rnInitParams,callback);
70
- },
71
- RichOpen:function(code,level,url,type,rnInitParams,tools,supportedOrientations,useWebKit,needPin,callback){
72
- richOpenNative(code,level,url,type,rnInitParams,tools,supportedOrientations,useWebKit,needPin,callback);
73
- }
74
- }
75
-
1
+ 'use strict';
2
+
3
+ import React from 'react-native';
4
+ import Native from '../native';
5
+ import Toast from './toast';
6
+
7
+ const {
8
+ ToastAndroid,
9
+ Platform,
10
+ } = React;
11
+
12
+ /**
13
+ *
14
+ * @param code 模块名
15
+ * @param level 安全等级 加载webview的时候填写
16
+ * @param url webview链接地址
17
+ * @param type 模块类型 1-原生 2-webview 3-Rn
18
+ * @param callback 回调
19
+ */
20
+ let openNative = function(code,level,url,type,callback){
21
+ let u = 'autobots://rn/jump?code='+code+'&level='+level+'&url='+url+'&type='+type;
22
+ // if(isShowLoading){
23
+ // url = url +"?isShowLoading=true";
24
+ // }else {
25
+ // url = url +"?isShowLoading=false";
26
+ // }
27
+ // if(shadeHeight>0)
28
+ // {
29
+ // url = url +"&shadeHeight="+shadeHeight;
30
+ // }
31
+ Native.callNative(u,function(result,data){
32
+ if(callback)
33
+ {
34
+ callback(result,data);
35
+ }
36
+ });
37
+ }
38
+
39
+ let initOpenNative = function(code,level,url,type,rnInitParams,callback){
40
+ let initParams = JSON.stringify(rnInitParams);
41
+ initParams = initParams.replace(/&/g,'%26');
42
+ let u = 'autobots://rn/jump?code='+code+'&level='+level+'&url='+url+'&type='+type+'&rnInitParams='+initParams;
43
+ Native.callNative(u,function(result,data){
44
+ if(callback)
45
+ {
46
+ callback(result,data);
47
+ }
48
+ });
49
+ }
50
+
51
+ let richOpenNative = function(code,level,url,type,rnInitParams,tools,supportedOrientations,useWebKit,needPin,callback){
52
+ let initParams = JSON.stringify(rnInitParams);
53
+ initParams = initParams.replace(/&/g,'%26');
54
+ let u = 'autobots://rn/jump?code='+code+'&level='+level+'&url='+url+'&type='+type+'&rnInitParams='+initParams+'&tools='+tools+'&supportedOrientations='+supportedOrientations+'&useWebKit='+useWebKit+'&needPin='+needPin;
55
+ Native.callNative(u,function(result,data){
56
+ if(callback)
57
+ {
58
+ callback(result,data);
59
+ }
60
+ });
61
+ }
62
+
63
+ var jump = {
64
+ Open:function(code,level,url,type,callback)
65
+ {
66
+ openNative(code,level,url,type,callback);
67
+ },
68
+ InitOpen:function(code,level,url,type,rnInitParams,callback){
69
+ initOpenNative(code,level,url,type,rnInitParams,callback);
70
+ },
71
+ RichOpen:function(code,level,url,type,rnInitParams,tools,supportedOrientations,useWebKit,needPin,callback){
72
+ richOpenNative(code,level,url,type,rnInitParams,tools,supportedOrientations,useWebKit,needPin,callback);
73
+ }
74
+ }
75
+
76
76
  module.exports = jump;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autobots-commonlib",
3
- "version": "1.2.8",
3
+ "version": "1.3.2",
4
4
  "description": "autobots common lib",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/.npmignore DELETED
@@ -1,13 +0,0 @@
1
- # OSX
2
- #
3
- .DS_Store
4
-
5
- # node.js
6
- #
7
- node_modules/
8
- npm-debug.log
9
-
10
- *.keystore
11
- bundle/
12
- .update
13
- .update/