本文实例为大家分享了微信小程序实现签到弹窗的具体代码,供大家参考,具体内容如下
效果图如下所示
图片素材:
.wxml
1
2
3
4
5
6
7
8
9
10
|
< button bindtap = "popup" >签到</ button >
< view class = "load" style = "{{sign?'':'top:calc((100vh - 750rpx)/2);opacity: 0;z-index:-1;'}}" >
< image class = "loadingpic" src = "/images/light.png" ></ image >
< image class = "load-imagae" src = "/images/register.png" ></ image >
< view class = "load-centent" >
< view >签到成功</ view >
< view >获得0积分</ view >
< view bindtap = "popup" >好的</ view >
</ view >
</ view >
|
.wxss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
page{
background-color : #ccc ;
}
view{
box-sizing: border-box;
}
button{
margin-top : 50 rpx;
}
.load{
width : 80% ;
height : 600 rpx;
position : fixed ;
top :calc(( 100 vh - 800 rpx)/ 2 );
left : 10% ;
transition: all 0.3 s ease-in-out 0 s;
-webkit-transition: all 0.3 s ease-in-out 0 s;
opacity: 1 ;
z-index : 10 ;
}
.loadingpic {
width : 100% ;
height : 93% ;
position : absolute ;
animation: load 3 s linear 1 s infinite;
z-index : 10 ;
margin-top : 7% ;
}
@keyframes load{
0% {
webkit-transform: rotate( 0 deg);
transform: rotate( 0 deg);
}
100% {
webkit-transform: rotate( 360 deg);
transform: rotate( 360 deg);
}
}
.load-imagae{
width : 400 rpx;
height : 400 rpx;
margin : 100 rpx calc(( 100% - 400 rpx)/ 2 );
position : absolute ;
z-index : 11 ;
}
.load-centent{
width : 400 rpx;
height : 400 rpx;
margin : 100 rpx calc(( 100% - 400 rpx)/ 2 );
position : relative ;
z-index : 12 ;
text-align : center ;
padding : 25% 10% 5% 10% ;
}
.load-centent>view:nth-child( 1 ){
font-size : 34 rpx;
color : #fff ;
}
.load-centent>view:nth-child( 2 ){
color : #fff ;
opacity: 0.7 ;
margin : 20 rpx 0 ;
font-size : 24 rpx;
}
.load-centent>view:nth-child( 3 ){
width : 85% ;
margin : 30 rpx 7.5% 0 7.5% ;
height : 70 rpx;
line-height : 70 rpx;
border-radius: 40 rpx;
background-color : #F8D168 ;
color : #EB4331 ;
font-size : 30 rpx;
}
|
.js
1
2
3
4
5
6
7
8
9
10
|
Page({
data: {
sign: false ,
},
popup: function (e){
this .setData({
sign:! this .data.sign
})
},
})
|
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。
原文链接:https://blog.csdn.net/qq_43764578/article/details/105854829