提交 2a6d5e5b 编写于 作者: DCloud_iOS_XHY's avatar DCloud_iOS_XHY

UTS 中定义的 callback 返回的类型由 UTSJSONObject 改为 object

上级 fa71d2a8
{
"deploymentTarget": "9"
"deploymentTarget": "9.0"
}
\ No newline at end of file
......@@ -5,9 +5,9 @@ import { UIDevice } from "UIKit";
* 定义 接口参数
*/
type GetBatteryInfoOptions = {
success?: (res: UTSJSONObject) => void;
fail?: (res: UTSJSONObject) => void;
complete?: (res: UTSJSONObject) => void;
success?: (res: object) => void;
fail?: (res: object) => void;
complete?: (res: object) => void;
};
/**
......@@ -21,7 +21,7 @@ export default function getBatteryInfo(options: GetBatteryInfoOptions) {
// 返回数据
const res = {
errMsg: "getBatteryInfo:ok",
level: Number(UIDevice.current.batteryLevel * 100),
level: Number(UIDevice.current.batteryLevel * 10),
isCharging: UIDevice.current.batteryState == UIDevice.BatteryState.charging,
};
options.success?.(res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册