0.5.2 • Published 25 days ago

paradise-bridge v0.5.2

Weekly downloads
-
License
ISC
Repository
-
Last release
25 days ago

介绍

本库为ParadiseApp的接口库,用于提供原生APP的接口调用。抹平了纯H5、UNIAPP H5和UNIAPP APP-PLUS的差异,提供统一的接口调用方式。

注意

为了尽可能不侵入现有UNIAPP H5工程的代码,请时刻铭记ParadiseBridge提供的接口实现都是基于原生环境,要了解浏览器环境和原生环境的一些差异,否则在遇到诸如文件系统路径的差异上可能会造成不必要的困扰。原先在H5环境上正常使用的uniapp接口可以继续使用,无需刻意改成ParadiseBridge提供的接口。

安装

npm install paradise-bridge

使用

import Bridge from 'paradise-bridge'
// 在应用初始化时调用init方法,例如在App.vue中
// #ifdef APP-PLUS
Bridge.init("app-plus")
// #endif
// #ifdef H5
Bridge.init("h5")
// #endif

接口说明

如果没有特殊说明,接口参数参照UNIAPP, 例如:

import { Api } from 'paradise-bridge'
Api.setTitle({
  title: '标题'
}).then(res => {
  console.log(res)
})
接口名说明参数返回值
setTitle设置导航栏标题title: string
takePicture拍照-base64: string, path: string
getPicture从相册选择图片-base64: string, path: string
compressImage | 压缩图片--
scanCode扫码scanType: stringresult: string
getDeviceInfo获取设备信息--
setStorage设置本地存储key: string, data: any-
getStorage获取本地存储key: stringdata: any
openSysBrowser打开系统浏览器url: string-
operURL打开内部浏览器url: string-
getBase64FromUri从文件路径获取base64uri: stringbase64: string
quitApp退出app--
setUserInfo设置用户信息token: string-
getUserInfo获取用户信息-token: string
0.5.0

25 days ago

0.5.2

25 days ago

0.5.1

25 days ago

0.3.0

2 months ago

0.4.1

2 months ago

0.4.0

2 months ago

0.2.5

2 months ago

0.2.3

3 months ago

0.2.4

3 months ago

0.2.1

3 months ago

0.2.0

3 months ago

0.2.2

3 months ago

0.0.37

3 months ago

0.1.0

3 months ago

0.0.33

4 months ago

0.0.34

4 months ago

0.0.35

4 months ago

0.0.36

4 months ago

0.0.32

4 months ago

0.0.25

4 months ago

0.0.30

4 months ago

0.0.26

4 months ago

0.0.27

4 months ago

0.0.28

4 months ago

0.0.29

4 months ago

0.0.23

4 months ago

0.0.24

4 months ago

0.0.21

4 months ago

0.0.22

4 months ago

0.0.20

5 months ago

0.0.14

5 months ago

0.0.15

5 months ago

0.0.16

5 months ago

0.0.17

5 months ago

0.0.18

5 months ago

0.0.19

5 months ago

0.0.10

5 months ago

0.0.11

5 months ago

0.0.12

5 months ago

0.0.13

5 months ago

0.0.9

5 months ago

0.0.8

5 months ago

0.0.7

5 months ago

0.0.6

5 months ago

0.0.5

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago