Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-api
提交
340a84c0
U
uni-api
项目概览
DCloud
/
uni-api
通知
776
Star
31
Fork
22
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
5
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-api
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
5
Issue
5
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
340a84c0
编写于
3月 02, 2025
作者:
DCloud-yyl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新uni.getBatteryInfo描述信息及平台兼容性信息格式
(cherry picked from commit
27889ea1
) (cherry picked from commit
38f288c5
)
上级
2376e688
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
144 addition
and
91 deletion
+144
-91
uni_modules/uni-getbatteryinfo/utssdk/interface.uts
uni_modules/uni-getbatteryinfo/utssdk/interface.uts
+144
-91
未找到文件。
uni_modules/uni-getbatteryinfo/utssdk/interface.uts
浏览文件 @
340a84c0
...
...
@@ -12,7 +12,7 @@ export type GetBatteryInfoSuccess = {
export type GetBatteryInfoOptions = {
/**
* 接口调用
结束的回调函数(调用成功、失败都会执行)
* 接口调用
成功的回调
*/
success?: (res: GetBatteryInfoSuccess) => void
/**
...
...
@@ -20,7 +20,7 @@ export type GetBatteryInfoOptions = {
*/
fail?: (res: UniError) => void
/**
* 接口调用
成功的回调
* 接口调用
结束的回调函数(调用成功、失败都会执行)
*/
complete?: (res: any) => void
}
...
...
@@ -80,107 +80,160 @@ interface Uni {
* ```
* @remark
* - 该接口需要同步调用
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.6.11",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "3.6.11",
* "unixVer": "4.11"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "mp": {
* "weixin": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "4.35"
* },
* "alipay": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "baidu": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "toutiao": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "lark": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "qq": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "kuaishou": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "jd": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "3.6.11",
* "unixVer": "4.0"
* }
* }
* @uniPlatform
{
"app": {
"android": {
"osVer": "5.0",
"uniVer": "3.6.11",
"uniUtsPlugin": "x",
"unixVer": "3.9",
"unixUtsPlugin": "3.9"
},
"ios": {
"osVer": "12.0",
"uniVer": "3.6.11",
"uniUtsPlugin": "x",
"unixVer": "4.11",
"unixUtsPlugin": "4.11"
},
"harmony": {
"osVer": "3.0",
"uniVer": "4.23",
"unixVer": "x"
}
},
"mp": {
"weixin": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "4.35"
},
"alipay": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"baidu": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"toutiao": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"lark": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"qq": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"kuaishou": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"jd": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
}
},
"web": {
"uniVer": "3.6.11",
"unixVer": "4.0"
}
}
* @uniVueVersion 2,3 //支持的vue版本
*
*/
getBatteryInfo(options: GetBatteryInfoOptions): void,
/**
* 同步获取电池电量信息
*
* @example
* ```typescript
*
uni.getBatteryInfo
()
*
let batteryInfo = uni.getBatteryInfoSync
()
* ```
* @remark
* - 该接口需要同步调用
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.6.11",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "3.6.11",
* "unixVer": "4.11"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "3.6.11",
* "unixVer": "4.0"
* }
* }
* @uniPlatform
{
"app": {
"android": {
"osVer": "5.0",
"uniVer": "3.6.11",
"uniUtsPlugin": "x",
"unixVer": "3.9",
"unixUtsPlugin": "3.9"
},
"ios": {
"osVer": "12.0",
"uniVer": "3.6.11",
"uniUtsPlugin": "x",
"unixVer": "4.11",
"unixUtsPlugin": "4.11"
},
"harmony": {
"osVer": "3.0",
"uniVer": "4.23",
"unixVer": "x"
}
},
"mp": {
"weixin": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "4.35"
},
"alipay": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"baidu": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"toutiao": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"lark": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"qq": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"kuaishou": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
},
"jd": {
"hostVer": "√",
"uniVer": "√",
"unixVer": "x"
}
},
"web": {
"uniVer": "3.6.11",
"unixVer": "4.0"
}
}
* @uniVueVersion 2,3 //支持的vue版本
*
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录