Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suncj1314
unidocs-zh
提交
fb7ef7d3
U
unidocs-zh
项目概览
suncj1314
/
unidocs-zh
与 Fork 源项目一致
Fork自
DCloud / unidocs-zh
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
fb7ef7d3
编写于
3月 24, 2023
作者:
lizhongyi_
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: update capture-screen
上级
2ae68582
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
65 addition
and
0 deletion
+65
-0
docs/api/system/capture-screen.md
docs/api/system/capture-screen.md
+65
-0
未找到文件。
docs/api/system/capture-screen.md
浏览文件 @
fb7ef7d3
...
...
@@ -9,6 +9,7 @@
|√|x|√|√|√|√|√|√|√|
> 在 App 平台本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)
> 需要HBuilder X 3.7.7+版本
**CALLBACK返回参数:**
...
...
@@ -40,9 +41,73 @@ Android的截屏监听原理是监听相册中截屏目录的文件新增,需
|√|x|√|√|√|√|x|√|√|
> 在 App 平台本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)
> 需要HBuilder X 3.7.7+版本
**参数**
|属性 | 类型|说明|
|-- |-- |-- |
|回调函数| Function|用户主动截屏事件的回调函数|
### uni.setUserCaptureScreen(OBJECT)
开启/关闭防截屏
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序、飞书小程序|QQ小程序|快手小程序|京东小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|√|x|x|x|x|x|x|x|x|
> 在 App 平台本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)
> 需要HBuilder X 3.7.7+版本
**OBJECT 参数说明**
|参数名|类型|必填|说明|
|:-|:-|:-|:-|
|enable|Boolean|是|是否允许用户截屏,ture: 允许用户截屏, false: 不允许用户截屏,防止用户截屏到应用页面内容|
|success|Function|否|接口调用成功的回调|
|fail|Function|否|接口调用失败的回调函数|
|complete|Function|否|接口调用结束的回调函数(调用成功、失败都会执行)|
**返回参数说明**
|参数|类型|说明|
|:-|:-|:-|
|errCode|Number|调用结果|
|errMsg|String|调用结果描述|
|errSubject|String|调用模块|
**注意**
+
iOS平台该API在iOS 13.0及以上系统支持,在iOS 13.0以下系统调用该API会返回12001:system not support的错误。
+
因iOS 15.1系统bug,在该系统上调用此API会返回12010:system internal error的错误。
+
Android平台在某些页面暂不支持(如:图片选择、图片预览、一键登录等页面以及App原生插件内部原生页面)。
**代码示例**
```
javascript
uni
.
setUserCaptureScreen
({
enable
:
false
,
success
:
(
res
)
=>
{
console
.
log
(
"
setUserCaptureScreen success:
"
+
JSON
.
stringify
(
res
));
},
fail
:
(
res
)
=>
{
console
.
log
(
"
setUserCaptureScreen fail:
"
+
JSON
.
stringify
(
res
));
},
complete
:
(
res
)
=>
{
console
.
log
(
"
setUserCaptureScreen complete:
"
+
JSON
.
stringify
(
res
));
}
});
```
### 错误码
|错误码 |错误信息 |说明 |
|--- |---- |------ |
|12001 |system not support |当前系统不支持相关能力 |
|12010 |system internal error |系统错误 |
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录