Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mehaotian
unidocs-zh
提交
b276f13d
U
unidocs-zh
项目概览
mehaotian
/
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 搜索 >>
提交
b276f13d
编写于
3月 01, 2023
作者:
lizhongyi_
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: update capture-screen.md
上级
5103ce38
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
55 addition
and
0 deletion
+55
-0
docs/api/system/capture-screen.md
docs/api/system/capture-screen.md
+55
-0
未找到文件。
docs/api/system/capture-screen.md
浏览文件 @
b276f13d
...
...
@@ -44,3 +44,58 @@ Android的截屏监听原理是监听相册中截屏目录的文件新增,需
|属性 | 类型|说明|
|-- |-- |-- |
|回调函数| 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)
**OBJECT 参数说明**
|参数名|类型|必填|说明|
|:-|:-|:-|:-|
|open|Boolean|是|是否打开防截屏|
|success|Function|否|接口调用成功的回调|
|fail|Function|否|接口调用失败的回调函数|
|complete|Function|否|接口调用结束的回调函数(调用成功、失败都会执行)|
**返回参数说明**
|参数|类型|说明|
|:-|:-|:-|
|errCode|Number|调用结果|
|errMsg|String|调用结果描述|
|errSubject|String|调用模块|
**注意**
iOS防截屏功能在iOS 13及以上系统支持。另外,因为系统原因,在iOS 15.1系统上会触发错误,因此该api在iOS 15.1系统上暂不可用。
**代码示例**
```
javascript
let
flag
=
this
.
setUserCaptureScreenFlag
;
uni
.
setUserCaptureScreen
({
open
:
flag
,
success
:
(
res
)
=>
{
console
.
log
(
"
setUserCaptureScreen open:
"
+
flag
+
"
success:
"
+
JSON
.
stringify
(
res
));
},
fail
:
(
res
)
=>
{
console
.
log
(
"
setUserCaptureScreen open:
"
+
flag
+
"
fail:
"
+
JSON
.
stringify
(
res
));
},
complete
:
(
res
)
=>
{
console
.
log
(
"
setUserCaptureScreen open:
"
+
flag
+
"
complete:
"
+
JSON
.
stringify
(
res
));
}
});
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录