3***@qq.com
3***@qq.com
  • 发布:2022-05-06 20:53
  • 更新:2022-05-07 10:33
  • 阅读:446

【报Bug】cover-view 跟web-view组件共用 v-if由true转false,没有完全隐藏

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 专业版 20H2

HBuilderX类型: 正式

HBuilderX版本号: 3.4.8

手机系统: Android

手机系统版本号: Android 11

手机厂商: 华为

手机机型: nova3

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

<template>
<view class="container">
<!-- 观看倒计时 -->
<cover-view class="countdown" >
<cover-view>您还需观看</cover-view>
<cover-view style="color:#E60000;margin-left:10px;">{{countDownInterval}}{{isVerifyFace}}
</cover-view>
</cover-view>
<!-- pdf文件 -->
<web-view :src="pdfSrc"></web-view>
<!-- 蒙版弹窗 -->
<cover-view class="mask" v-if="isVerifyFace">
<cover-view class="mask-content">
测试
</cover-view>
</cover-view>
</view>
</template>

<script>
export default {
data() {
return {
isVerifyFace: false, // 是否检测人脸
countDownInterval: 0, // 定时器
pdfSrc: '', // pdf文件地址
}
},
onShow() {
},
onLoad(option) {
this.isVerifyFace=true
setTimeout(()=>{
this.isVerifyFace=false
},2000)

    },  
    beforeDestroy() {  
    },  
    methods: {  

    },  
}  

</script>

<style>
.container {
position: relative;
}

.countdown {  
    width: 100%;  
    background-color: #ffffff;  
    text-align: center;  
    display: flex;  
    position: fixed;  
    left: 0;  
    top: -40px;  
    justify-content: center;  
    align-items: center;  
}  

.mask {  
    width: 100%;  
    height: 100%;  
    display: flex;  
    justify-content: center;  
    align-items: center;  
    position: fixed;  
    /* top: -70px; */  
    left: 0;  
    background-color: rgba(0, 0, 0, 0.9);  
    filter: alpha(opacity=90);  
}  

.mask-content {  
    display: flex;  
    width: 200px;  
    border-radius: 20rpx;  
    justify-content: center;  
    align-items: center;  
    padding: 40rpx;  
    background-color: #ffffff;  
}  

</style>

操作步骤:

cover-view 跟web-view组件共用 v-if由true转false,没有完全隐藏

预期结果:

全部隐藏

实际结果:

内容隐藏了,最外层cover-view蒙版没有隐藏

bug描述:

cover-view 跟web-view组件共用 v-if由true转false,没有完全隐藏

2022-05-06 20:53 负责人:无 分享
已邀请:
FullStack

FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866

提供可以复现的demo,方便排查

  • 3***@qq.com (作者)

    <template>

    <view class="container">

    <!-- 观看倒计时 -->

    <cover-view class="countdown" v-if="studyFinish!=1">

    <cover-view>您还需观看</cover-view>

    <cover-view style="color:#E60000;margin-left:10px;">{{formatSeconds(this.usedSecond)}}{{isVerifyFace}}

    </cover-view>

    </cover-view>

    <!-- pdf文件 -->

    <web-view :src="pdfSrc"></web-view>

    <!-- 蒙版弹窗 -->

    <cover-view class="mask" v-if="isVerifyFace">

    <cover-view class="mask-content">

    测试

    </cover-view>

    </cover-view>

    </view>

    </template>


    <script>

    export default {

    data() {

    return {

    isVerifyFace: false, // 是否检测人脸

    countDownInterval: 0, // 定时器

    pdfSrc: '', // pdf文件地址

    }

    },

    onShow() {

    },

    onLoad(option) {

    this.isVerifyFace=true

    setTimeout(()=>{

    this.isVerifyFace=false

    },2000)


        },  
    beforeDestroy() {
    },
    methods: {

    },
    }

    </script>


    <style>

    .container {

    position: relative;

    }


    .countdown {  
    width: 100%;
    background-color: #ffffff;
    text-align: center;
    display: flex;
    position: fixed;
    left: 0;
    top: -40px;
    justify-content: center;
    align-items: center;
    }

    .mask {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    /* top: -70px; */
    left: 0;
    background-color: rgba(0, 0, 0, 0.9);
    filter: alpha(opacity=90);
    }

    .mask-content {
    display: flex;
    width: 200px;
    border-radius: 20rpx;
    justify-content: center;
    align-items: center;
    padding: 40rpx;
    background-color: #ffffff;
    }

    </style>

    2022-05-07 10:27

3***@qq.com

3***@qq.com (作者)

11111

该问题目前已经被锁定, 无法添加新回复