微信小程序组件 自定义弹出框

<!-- 点击立即抢拼弹出框 -->
<view class='add-rob' bindtap="setModalStatus" data-status="0" wx:if="{{showModalStatus}}"></view>
<view class='rob-box' wx:if="{{showModalStatus}}">
<view class='rob-top'>
</view>
<!-- 底部按钮 -->
<view class='rob-bottom flex'>
</view>
</view>
 
 
//------------------------------------------------------------------------------------------------------
 
// 弹窗
setModalStatus: function (e) {
var that = this;
// console.log(e.currentTarget.dataset.all);
// var parrv = this.data.parrv;
//数据初始化分界-------------------------
var animation = wx.createAnimation({
duration: 200,
timingFunction: "linear",
delay: 0
})

this.animation = animation
animation.translateY(300).step();

this.setData({
animationData: animation.export(),
vidchange: false
})

if (e.currentTarget.dataset.status == 1) {
that.setData(
{
showModalStatus: true,
vidchange: true
}
);
}
setTimeout(function () {
animation.translateY(0).step()
this.setData({
animationData: animation
})
if (e.currentTarget.dataset.status == 0) {
this.setData(
{
showModalStatus: false
}
);
}
}.bind(this), 200)
},
 
 
//------------------------------------------------------------------------------------------------------
/* 点击立即抢拼弹出框 */
.add-rob{
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 100%;
">rgba(0,0,0,0.5);
overflow: hidden;
z-index: 60;
}
.rob-box{
width: 100%;
min-height: 200rpx;
">rgba(247,247,247,0.8);
position: fixed;
left: 0;
bottom: 0;
overflow: hidden;
z-index: 80;
}
/* .merch-stepper{
display: flex;
} */
.merch-stepper-symbol{
width: 75rpx;
height: 48rpx;
">white;
border-radius: 8rpx;
}
.merch-stepper .nownum{
width: 50rpx;
text-align: center;
margin: 0 20rpx;
}

/* 底部按钮 */
.rob-bottom{
width: 100%;
height: 100rpx;
">#f7f7f7;
padding: 15rpx 24rpx;
position: absolute;
left: 0;
bottom: 0;
box-sizing: border-box;
}

转载于:https://www.cnblogs.com/dianzan/p/7921041.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值