帖子
帖子
用户
博客
课程
显示全部楼层
85
帖子
6
勋章
5828
Y币

[多端开发] api.closeFrame 方法 两个点击事件只有一个有效吗?代码如下

[复制链接]
发表于 2021-7-16 14:17:11
            <view class="confirmbox">
                <view class="btnconfirm" @click="btnconfirm">
                    <text class="confirmtext" >确定</text>
                </view>
            </view>
            <view class="closebox">
                <view class="closeimgbox" @click="close" >
                    <img style="width:100%;height:100%" src="../../images/reward/tk_gb@2x.png" alt="">
                </view>
            </view>


methods: {
        btnconfirm() {
            console.log("btnconfirm");
            api.closeFrame({
            });
        },
        close() {
            console.log("close");
            api.closeFrame({
            });
        },
    }



.confirmbox {
    width: 375px;
    height: 46px;
    position: absolute;
    bottom: 6%;
    left: 0;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}
.btnconfirm {
    width: 156px;
    height: 37px;
    margin: 0 auto 0;
    background-image: linear-gradient(to bottom, #fff589ff, #ff9351ff);
    box-shadow: 0px 3px 1px rgba(141, 24, 0, 0.24);
    opacity: 1;
    border-radius: 35px;
}
.confirmtext {
    font-size: 20px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 37px;
    color: #b83f00;
    opacity: 1;
    text-align: center;
}
.closebox {
    width: 375px;
    height: 46px;
    position: absolute;
    bottom: -10%;
    left: 0;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}
.closeimgbox {
    width: 25px;
    height: 25px;
}


点击确定(@click="btnconfirm")这个是可以关闭窗口的,点击这个图片(@click="close") 没反应,能打印“close”,但是关闭不了窗口








85
帖子
6
勋章
5828
Y币
解决了,api.closeFrame 方法 都有效的,样式问题,bottom: -10%
380
帖子
4
勋章
6
Y币
OK
您需要登录后才可以回帖 登录

本版积分规则