<template> <view class="module-container"> <view class="personInfo" :style="{opacity: reportModel.opacity,transform: `scale(${reportModel.scale})`,display:reportModel.display }"> <view class="personinfo-head">设置点数</view> <view class="personinfo-input"><input placeholder="请输入点数"></view> <view class="person-btn"> <view class="btn1">取消</view> <view class="btn2">确认</view> </view> </view> <view v-if="showMask" class="mask" @click="handleCloseMask"></view> <view class="btn" @click="handleItem">打开弹框</view> </view> </template>
JS
<script> export default{ data() { return{ showMask:false, reportModel:{ scale:'0.6', opacity:'0', display:'none' }, } }, methods:{ handleItem() { this.showMask = true this.reportModel.opacity = '1' this.reportModel.scale = '1' this.reportModel.display = 'block' }, // 关闭遮罩层 handleCloseMask() { this.showMask = false this.reportModel.opacity = '0' this.reportModel.scale = '0.9' this.reportModel.display = 'none' }, } } </script>
CSS
<style lang="scss" scoped> .module-container{ .personInfo{ transform-origin:center center; width: 600rpx; height: 300rpx; background-color: #fff; border-radius: 25rpx; position: fixed; top: 40%; left: 10%; transform: translate(-300rpx, -150rpx); z-index: 2000; transition: all .3s; .personinfo-head{ width: 100%; padding: 20rpx 0; color: #333; font-size: 30rpx; text-align: center; } .personinfo-input{ width: 85%; height: 80rpx; background-color: #f4f1f1; border-radius: 10rpx; margin: 20rpx auto; input{ padding: 20rpx; } } .person-btn{ width: 100%; height: 80rpx; display: flex; align-items: center; font-size: 28rpx; border-top: 1px solid #f4f1f1; position: fixed; bottom: 0; left: 0; .btn1{ flex: 1; color: #333; text-align: center; } .btn2{ flex: 1; color: #007AFF; text-align: center; border-left: 1px solid #f4f1f1; } } } .mask{ position: fixed; left: 0; top: 0; z-index: 1999; width: 100vw; height: 100vh; background-color: rgba(0,0,0,0.5); } } </style>
分类:
uni-app、微信小程序
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了