Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-api
提交
ce930e42
U
uni-api
项目概览
DCloud
/
uni-api
通知
670
Star
23
Fork
12
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-api
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ce930e42
编写于
9月 07, 2023
作者:
lizhongyi_
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
uni-getbatteryinfo、uni-usercapturescreen 插件中错误回调改为UniError
上级
15db17d5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
57 deletion
+31
-57
uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts
uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts
+8
-7
uni_modules/uni-getbatteryinfo/utssdk/interface.uts
uni_modules/uni-getbatteryinfo/utssdk/interface.uts
+19
-19
uni_modules/uni-usercapturescreen/utssdk/app-ios/index.uts
uni_modules/uni-usercapturescreen/utssdk/app-ios/index.uts
+3
-11
uni_modules/uni-usercapturescreen/utssdk/interface.uts
uni_modules/uni-usercapturescreen/utssdk/interface.uts
+1
-20
未找到文件。
uni_modules/uni-getbatteryinfo/utssdk/app-android/index.uts
浏览文件 @
ce930e42
...
...
@@ -2,7 +2,7 @@ import Context from "android.content.Context";
import BatteryManager from "android.os.BatteryManager";
import { UTSAndroid } from "io.dcloud.uts";
import { GetBatteryInfo, GetBatteryInfoSuccess, GetBatteryInfo
Fail, GetBatteryInfo
Result,GetBatteryInfoSync } from '../interface.uts'
import { GetBatteryInfo, GetBatteryInfoSuccess, GetBatteryInfoResult,GetBatteryInfoSync } from '../interface.uts'
/**
* 异步获取电量
* @param {Object} options
...
...
@@ -24,12 +24,13 @@ export const getBatteryInfo : GetBatteryInfo = function (options) {
options.success?.(res)
options.complete?.(res)
} else {
const res : GetBatteryInfoFail = {
errSubject: "uni-getBatteryInfo",
errCode: 1001,
errMsg: 'getBatteryInfo:fail getAppContext is null',
cause: null
}
// const res : GetBatteryInfoFail = {
// errSubject: "uni-getBatteryInfo",
// errCode: 1001,
// errMsg: 'getBatteryInfo:fail getAppContext is null',
// cause: null
// }
const res = new UniError("uni-getBatteryInfo", 1001, "getBatteryInfo:fail getAppContext is null")
options.fail?.(res)
options.complete?.(res)
}
...
...
uni_modules/uni-getbatteryinfo/utssdk/interface.uts
浏览文件 @
ce930e42
...
...
@@ -10,24 +10,24 @@ export type GetBatteryInfoSuccess = {
isCharging : boolean
}
export type GetBatteryInfoFail = {
/**
* 错误码
*/
errCode : number,
/**
* 调用API的名称
*/
errSubject : string,
/**
* 错误的详细信息
*/
errMsg : string,
/**
* 错误来源
*/
cause : any | null
}
//
export type GetBatteryInfoFail = {
//
/**
//
* 错误码
//
*/
//
errCode : number,
//
/**
//
* 调用API的名称
//
*/
//
errSubject : string,
//
/**
//
* 错误的详细信息
//
*/
//
errMsg : string,
//
/**
//
* 错误来源
//
*/
//
cause : any | null
//
}
...
...
@@ -39,7 +39,7 @@ export type GetBatteryInfoOptions = {
/**
* 接口调用失败的回调函数
*/
fail ?: (res :
GetBatteryInfoFail
) => void
fail ?: (res :
UniError
) => void
/**
* 接口调用成功的回调
*/
...
...
uni_modules/uni-usercapturescreen/utssdk/app-ios/index.uts
浏览文件 @
ce930e42
...
...
@@ -3,7 +3,7 @@ import { CGRect } from "CoreFoundation";
import { UIApplication, UIView, UITextField, UIScreen, UIDevice } from "UIKit"
import { UTSiOS } from "DCloudUTSFoundation"
import { DispatchQueue } from 'Dispatch';
import { SetUserCaptureScreenOptions, OnUserCaptureScreenCallbackResult, OnUserCaptureScreen, OffUserCaptureScreen, SetUserCaptureScreen, UserCaptureScreenCallback, SetUserCaptureScreenSuccess
, SetUserCaptureScreenFail
} from "../interface.uts"
import { SetUserCaptureScreenOptions, OnUserCaptureScreenCallbackResult, OnUserCaptureScreen, OffUserCaptureScreen, SetUserCaptureScreen, UserCaptureScreenCallback, SetUserCaptureScreenSuccess } from "../interface.uts"
/**
* 定义监听截屏事件工具类
...
...
@@ -119,20 +119,12 @@ export const offUserCaptureScreen : OffUserCaptureScreen = function (callback :
*/
export const setUserCaptureScreen : SetUserCaptureScreen = function (options : SetUserCaptureScreenOptions) {
if (UIDevice.current.systemVersion < "13.0") {
let res: SetUserCaptureScreenFail = {
errCode: 12001,
errSubject: "uni-usercapturescreen",
errMsg: "setUserCaptureScreen:system not support"
}
let res = new UniError("uni-usercapturescreen", 12001, "setUserCaptureScreen:system not support")
options.fail?.(res);
options.complete?.(res);
} else if (UIDevice.current.systemVersion == "15.1") {
let res: SetUserCaptureScreenFail = {
errCode: 12010,
errSubject: "uni-usercapturescreen",
errMsg: "setUserCaptureScreen:system internal error"
}
let res = new UniError("uni-usercapturescreen", 12010, "setUserCaptureScreen:system internal error")
options.fail?.(res);
options.complete?.(res);
} else {
...
...
uni_modules/uni-usercapturescreen/utssdk/interface.uts
浏览文件 @
ce930e42
...
...
@@ -23,25 +23,6 @@ export type OffUserCaptureScreen = (callback : UserCaptureScreenCallback | null)
export type SetUserCaptureScreenSuccess = {
}
/**
* uni.setUserCaptureScreen失败回调参数
*/
export type SetUserCaptureScreenFail = {
/**
* 错误码
* 12001:system not support
* 12010:system internal error
*/
errCode : number,
/**
* 调用API的名称
*/
errSubject : string,
/**
* 错误的详细信息
*/
errMsg : string,
}
/**
* uni.setUserCaptureScreen成功回调函数定义
...
...
@@ -51,7 +32,7 @@ export type SetUserCaptureScreenSuccessCallback = (res : SetUserCaptureScreenSuc
/**
* uni.setUserCaptureScreen失败回调函数定义
*/
export type SetUserCaptureScreenFailCallback = (res :
SetUserCaptureScreenFail
) => void
export type SetUserCaptureScreenFailCallback = (res :
UniError
) => void
/**
* uni.setUserCaptureScreen完成回调函数定义
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录