提交 4edbeb73 编写于 作者: 杜庆泉's avatar 杜庆泉

截屏插件 android用法代码调整

上级 3ed223b2
......@@ -31,24 +31,41 @@
var that = this;
onUserCaptureScreen(function(res) {
console.log(res);
if(res.code == -1){
// 启动失败
return ;
}else if(res.code == 0){
uni.showToast({
icon:"none",
title:'截屏监听已开启'
})
}else {
if (uni.getSystemInfoSync().platform == "android") {
// 除android 之外的平台,不需要判断返回状态码
if(res.code == -1){
// 启动失败
return ;
}else if(res.code == 0){
uni.showToast({
icon:"none",
title:'截屏监听已开启'
})
}else {
uni.showToast({
icon:"none",
title:'捕获截屏事件'
})
that.screenImage = res.image
}
}else{
// 除android 之外的平台,不需要判断返回状态码
uni.showToast({
icon:"none",
title:'捕获截屏事件'
})
if (uni.getSystemInfoSync().platform == "android") {
that.screenImage = res.image
}
}
});
if (uni.getSystemInfoSync().platform != "android") {
// 除android 之外的平台,直接提示监听已开启
uni.showToast({
icon:"none",
title:'截屏监听已开启'
})
}
},
testScreenShotOff() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册