Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
Hello UTS
提交
3df5c928
H
Hello UTS
项目概览
DCloud
/
Hello UTS
通知
1598
Star
27
Fork
9
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
Hello UTS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
3df5c928
编写于
9月 01, 2022
作者:
杜庆泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
battery plugin release done
上级
4bc52919
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
48 addition
and
27 deletion
+48
-27
pages/SystemAPI/SystemAPI.vue
pages/SystemAPI/SystemAPI.vue
+1
-1
uni_modules/uni-getbatteryinfo/changelog.md
uni_modules/uni-getbatteryinfo/changelog.md
+2
-0
uni_modules/uni-getbatteryinfo/package.json
uni_modules/uni-getbatteryinfo/package.json
+23
-21
uni_modules/uni-getbatteryinfo/readme.md
uni_modules/uni-getbatteryinfo/readme.md
+19
-5
uni_modules/uni-getbatteryinfo/utssdk/app-android/config.json
...modules/uni-getbatteryinfo/utssdk/app-android/config.json
+3
-0
未找到文件。
pages/SystemAPI/SystemAPI.vue
浏览文件 @
3df5c928
...
...
@@ -7,7 +7,7 @@
</view>
</
template
>
<
script
>
import
getBatteryInfo
from
"
../..
/uni_modules/uni-getbatteryinfo
"
;
import
getBatteryInfo
from
"
@
/uni_modules/uni-getbatteryinfo
"
;
export
default
{
data
()
{
...
...
uni_modules/uni-getbatteryinfo/changelog.md
浏览文件 @
3df5c928
## 1.0.0(2022-09-01)
实现android/web/微信小程序平台获取电量
uni_modules/uni-getbatteryinfo/package.json
浏览文件 @
3df5c928
...
...
@@ -2,9 +2,9 @@
"id"
:
"uni-getbatteryinfo"
,
"displayName"
:
"uni-getbatteryinfo"
,
"version"
:
"1.0.0"
,
"description"
:
"
uni-getbatteryinfo
"
,
"description"
:
"
使用uts开发,实现在多个平台获取电量信息
"
,
"keywords"
:
[
"
uni-getbatteryinfo
"
"
battery
"
],
"repository"
:
""
,
"engines"
:
{
...
...
@@ -24,9 +24,9 @@
"qq"
:
""
},
"declaration"
:
{
"ads"
:
""
,
"data"
:
""
,
"permissions"
:
""
"ads"
:
"
无
"
,
"data"
:
"
插件不采集任何数据
"
,
"permissions"
:
"
无
"
},
"npmurl"
:
""
},
...
...
@@ -35,33 +35,35 @@
"encrypt"
:
[],
"platforms"
:
{
"cloud"
:
{
"tcb"
:
"
u
"
,
"aliyun"
:
"
u
"
"tcb"
:
"
y
"
,
"aliyun"
:
"
y
"
},
"client"
:
{
"Vue"
:
{
"vue2"
:
"
u
"
,
"vue3"
:
"
u
"
"vue2"
:
"
n
"
,
"vue3"
:
"
y
"
},
"App"
:
{
"app-android"
:
"u"
,
"app-ios"
:
"u"
"app-android"
:
{
"minVersion"
:
"21"
},
"app-ios"
:
"n"
},
"H5-mobile"
:
{
"Safari"
:
"
u
"
,
"Android Browser"
:
"
u
"
,
"微信浏览器(Android)"
:
"
u
"
,
"QQ浏览器(Android)"
:
"
u
"
"Safari"
:
"
y
"
,
"Android Browser"
:
"
y
"
,
"微信浏览器(Android)"
:
"
y
"
,
"QQ浏览器(Android)"
:
"
y
"
},
"H5-pc"
:
{
"Chrome"
:
"
u
"
,
"IE"
:
"
u
"
,
"Edge"
:
"
u
"
,
"Firefox"
:
"
u
"
,
"Safari"
:
"
u
"
"Chrome"
:
"
y
"
,
"IE"
:
"
y
"
,
"Edge"
:
"
y
"
,
"Firefox"
:
"
y
"
,
"Safari"
:
"
y
"
},
"小程序"
:
{
"微信"
:
"
u
"
,
"微信"
:
"
y
"
,
"阿里"
:
"u"
,
"百度"
:
"u"
,
"字节跳动"
:
"u"
,
...
...
uni_modules/uni-getbatteryinfo/readme.md
浏览文件 @
3df5c928
# uts-batteryinfo
### 开发文档
[
UTS 语法
](
https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html
)
[
UTS 原生插件
](
https://uniapp.dcloud.net.cn/plugin/uts-plugin.html
)
[
Hello UTS
](
https://gitcode.net/dcloud/hello-uts/-/tree/dev
)
\ No newline at end of file
# uni-getbatteryinfo
## 使用文档
```
ts
// 引用插件
import
getBatteryInfo
from
"
@/uni_modules/uni-getbatteryinfo
"
;
// 获取电量信息
getBatteryInfo
({
success
(
res
)
{
console
.
log
(
res
);
uni
.
showToast
({
title
:
"
当前电量:
"
+
res
.
level
+
'
%
'
,
icon
:
'
none
'
});
}
})
```
uni_modules/uni-getbatteryinfo/utssdk/app-android/config.json
0 → 100644
浏览文件 @
3df5c928
{
"minSdkVersion"
:
"21"
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录