openPop(val, lotno) {  
                // #ifdef APP-PLUS  
                let that = this;  
                uni.getScreenBrightness({  
                    success(res) {  
                        that.brightValue = res.value;  
                    }  
                })  
                // #endif  
                this.show = true;  
                this.val = val;  
                this.lotno = lotno;  
                setTimeout(() => {  
                    // #ifdef APP-PLUS  
                    let value = 0.8;  
                    if (this.brightValue >= 0.8) {  
                        value = this.brightValue;  
                    }  
                    uni.setScreenBrightness({  
                        value: value,  
                        success() {  
                        }  
                    })  
                    uni.setKeepScreenOn({  
                        keepScreenOn: false,  
                        success() {  
                            console.log('已取消屏幕亮度锁定');  
                        }  
                    });  
                    // #endif  
                    this.qrshow = true;  
                }, 100)  
            },  
            closePop() {  
                // #ifdef APP-PLUS  
                uni.setScreenBrightness({  
                    value: this.brightValue,  
                    success() {  
                    }  
                })  
                uni.setKeepScreenOn({  
                    keepScreenOn: false,  
                    success() {  
                        console.log('已取消屏幕亮度锁定');  
                    }  
                });  
                // #endif  
                this.qrshow = false;  
                setTimeout(() => {  
                    this.show = false;  
                }, 100)  
            },  
 
                                        
                                    
                                    - 发布:2024-01-18 17:28
- 更新:2024-01-18 18:27
- 阅读:407
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 11 家庭中文版
HBuilderX类型: 正式
HBuilderX版本号: 3.99
手机系统: Android
手机系统版本号: Android 10
手机厂商: OPPO
手机机型: oppoR17
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
                                    
                                    
                                         
                                
                                                                                                操作步骤:
                                    
                                        打开弹窗  获取亮度并缓存  set亮度为0.8  关闭弹窗 set亮度为获取值
                                     
                                
                                                                                                打开弹窗 获取亮度并缓存 set亮度为0.8 关闭弹窗 set亮度为获取值
预期结果:
                                    
                                    
                                        回复到之前的亮度
                                     
                                
                                                                                                回复到之前的亮度
实际结果:
                                    
                                    
                                        整体亮度 变暗 且 手机不可调节
                                     
                                
                                                            整体亮度 变暗 且 手机不可调节
bug描述:
打开弹窗 获取亮度 并且 调节亮度 为0.8 关闭弹窗 设置亮度为 获取值 情况:关闭后手机不可调节亮度
 
             
             
             
			 
            
1 个回复
喜欢技术的前端 - QQ---445849201
这个文档官方有个回答 https://ask.dcloud.net.cn/question/132234