当前位置:网站首页>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 !!!!
边栏推荐
- sqlplus乱码问题,求解答
- Deep understanding of UDP, TCP
- esp8266使用TF卡并读写数据(基于arduino)
- liunx命令
- In fact, it's very simple. It teaches you to easily realize the cool data visualization big screen
- Difference between process and thread
- 第十四次试验
- Unity uses mesh to realize real-time point cloud (II)
- Upload taro pictures to Base64
- Sqlplus garbled code problem, find the solution
猜你喜欢
Unity uses mesh to realize real-time point cloud (I)
Netease Cloud Wechat applet
Information Security Experiment 3: the use of PGP email encryption software
20排位赛3
CSDN salary increase technology - learn about the use of several common logic controllers of JMeter
VSCode+mingw64
EXT2 file system
NATAPP内网穿透
面试被问到了解哪些开发模型?看这一篇就够了
章鱼未来之星获得25万美金奖励|章鱼加速器2022夏季创业营圆满落幕
随机推荐
flink. CDC sqlserver. 可以再次写入sqlserver中么 有连接器的 dem
EXT2 file system
Lecture 1: stack containing min function
ComputeShader
JS inheritance prototype
Database multi table Association query problem
高斯消元
Lesson 1: hardness of eggs
Selenium+bs4 parsing +mysql capturing BiliBili Tarot data
sqlplus乱码问题,求解答
How to become a senior digital IC Design Engineer (5-3) theory: ULP low power design technology (Part 2)
Detailed explanation of diffusion model
What development models did you know during the interview? Just read this one
ViewPager2和VIewPager的區別以及ViewPager2實現輪播圖
Unity shader (learn more about vertex fragment shaders)
[4g/5g/6g topic foundation-146]: Interpretation of white paper on 6G overall vision and potential key technologies-1-overall vision
Unity shader (data type in cghlsl)
How to use Mongo shake to realize bidirectional synchronization of mongodb in shake database?
Natapp intranet penetration
数据库多表关联查询问题