当前位置:网站首页>Applet popup half angle mask layer
Applet popup half angle mask layer
2022-07-07 09:48:00 【Dehong demon king】
️️️️️️ 🥳🥳🥳 Thousands of people , Thank you for reading my article at this moment , Thanks for watching , Hello, everyone , Welcome to the artificial intelligence exchange group ( Watch my news ), More peripheral benefits are waiting for you 🥳🥳🥳
Welcome to subscribe to this column or follow me , Let's work together to solve an algorithm problem every day
️️️ Last , I hope my article can be helpful to your !
I wish myself and you in the future , Keep learning , Keep improving , Keep loving , Go to the mountains and seas ! ️️️
Catalog
The applet pops up the half angle mask layer style code , The effect is as follows :
This is nonsense : A simple case of a small program , adopt wx:if You can trigger the click event to pop up the mask layer , Only need view Write your other requirements in it
Basic code :
wxml
<!--pages/index/components/buy/index.wxml-->
<view class="box" >
<view class="empty-box" bindtap="hideModal" id="empty-box"></view>
<scroll-view scroll-y style="max-height:80vh;">
<view class="content" style="transform:translateY({
{translateY}}px);" animation="{
{animate}}">
<!-- boll -->
<view style="height: 700rpx;"></view>
<!-- Button -->
<view class="button" bindtap="confirm">
<view> confirm </view>
</view>
</view>
</scroll-view>
</view>
css
/* pages/index/components/buy/index.wxss */
.flex {
display: flex;
align-items: center;
}
.box {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1000;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
}
.empty-box {
flex: 1;
background-color: transparent;
}
/* Content view */
.content {
width: 100vw;
background: rgba(255, 255, 255, 1);
opacity: 1;
border-radius: 20px 20px 0px 0px;
z-index: 1001;
}
/* Head */
.header {
position: relative;
height: 80rpx;
width: 100vw;
}
.header > view {
position: absolute;
top: 26rpx;
left: calc(50vw - 30rpx);
width: 60rpx;
height: 10rpx;
background: rgba(161, 166, 175, 1);
opacity: 0.6;
border-radius: 6rpx;
}
/* Courier */
.item {
display: flex;
align-items: center;
justify-content: space-between;
width: calc(100vw - 80rpx);
padding: 0 40rpx;
height: 100rpx;
background: rgba(255, 255, 255, 1);
opacity: 1;
}
.item-no-selected {
width: 36rpx;
height: 36rpx;
background: rgba(255, 255, 255, 1);
border: 2rpx solid rgba(112, 112, 112, 1);
border-radius: 50%;
opacity: 0.5;
}
.item-selected {
width: 40rpx;
height: 40rpx;
}
/* Button */
.button {
width: 100vw;
padding: 80rpx 40rpx 20rpx 40rpx;
}
.button >view {
width: calc(100% - 80rpx);
height: 98rpx;
border-radius: 50rpx;
line-height: 98rpx;
text-align: center;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(255, 255, 255, 1);
background: rgba(237, 58, 74, 1);
opacity: 1;
}
Click to display
The above is the basic code , Convenient for everyone to quickly copy and paste , Next, show the pop-up mask layer through the button
The new button
<view style="background-color: yellowgreen;width: 190rpx;height: 70rpx;margin-right: 5rpx;margin-left: 5rpx;justify-content: center;display: flex;flex-direction: row;align-items: center;border-radius: 10rpx;color: white;" bindtap="show_hideModal"> Get authorization code </view>
newly build js event :
show_hideModal:function(){
let that=this;
that.setData({
hideModal:true
})
},
Test after clicking the button :
Then how to close it ? At this time, we can click the shadow part , Or add a button × Call method to close , Same thing , take hideModal Change it to false that will do
Click the shadow part to close
hideModal:function(){
let that=this;
that.setData({
hideModal:false
})
},
summary
The above is a small case today , Because of the reason of development , Can only briefly describe , If it works for you , Welcome to your favorite articles See you next time !!!!
边栏推荐
- CMD startup software passes in parameters with spaces
- Natapp intranet penetration
- 印象笔记终于支持默认markdown预览模式
- C# Socke 服务器,客户端,UDP
- 小程序弹出半角遮罩层
- CodeForces - 1324D Pair of Topics(二分或双指针)
- 小程序滑动、点击切换简洁UI
- 4、 Fundamentals of machine learning
- What development models did you know during the interview? Just read this one
- 用flinksql的方式 写进 sr的表,发现需要删除的数据没有删除,参照文档https://do
猜你喜欢
Information Security Experiment 1: implementation of DES encryption algorithm
印象笔记终于支持默认markdown预览模式
Basic use of JMeter to proficiency (I) creation and testing of the first task thread from installation
战略合作|SubQuery 成为章鱼网络浏览器的秘密武器
使用BigDecimal的坑
EXT2 file system
MongoDB怎么实现创建删除数据库、创建删除表、数据增删改查
Netease cloud wechat applet
【原创】程序员团队管理的核心是什么?
Elaborate on MySQL mvcc multi version control
随机推荐
In fact, it's very simple. It teaches you to easily realize the cool data visualization big screen
小程序滑动、点击切换简洁UI
Information Security Experiment 3: the use of PGP email encryption software
flinkcdc采集oracle在snapshot阶段一直失败,这个得怎么调整啊?
Information Security Experiment 2: using x-scanner scanning tool
HCIP 第一天 笔记整理
asp. How to call vb DLL function in net project
软件建模与分析
沙龙预告|GameFi 领域的瓶颈和解决方案
C# Socke 服务器,客户端,UDP
thinkphp数据库的增删改查
[Frida practice] "one line" code teaches you to obtain all Lua scripts in wegame platform
Gym - 102219j kitchen plates (violent or topological sequence)
牛客网——华为题库(61~70)
[4G/5G/6G专题基础-147]: 6G总体愿景与潜在关键技术白皮书解读-2-6G发展的宏观驱动力
Impression notes finally support the default markdown preview mode
Pit using BigDecimal
消费互联网的产业链其实是很短的,它仅仅承接平台上下游的对接和撮合的角色
flinkcdc 用sqlclient可以指定mysqlbinlog id执行任务吗
根据热门面试题分析Android事件分发机制(一)