dianzan
// 模态框控制弹出按钮
<view class=\'btn-right-btn flexca\' bindtap="setModalStatus" data-status="1">立即抢拼</view>
 
//模态弹出框外包裹
<view class=\'add-rob\' bindtap="setModalStatus" data-status="0" wx:if="{{showModalStatus}}">
 
JS函数 
//-----------------------------------------
// 弹窗
setModalStatus: function (e) {
var animation = wx.createAnimation({
duration: 200,
timingFunction: "linear",
delay: 0
})

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

this.setData({
animationData: animation.export()
})

if (e.currentTarget.dataset.status == 1) {

this.setData(
{
showModalStatus: true
}
);
}
setTimeout(function () {
animation.translateY(0).step()
this.setData({
animationData: animation
})
if (e.currentTarget.dataset.status == 0) {
this.setData(
{
showModalStatus: false
}
);
}
}.bind(this), 200)
},

分类:

技术点:

相关文章:

  • 2021-12-01
  • 2021-11-20
  • 2021-07-05
  • 2022-01-08
  • 2021-08-18
  • 2021-09-29
  • 2021-12-20
  • 2021-11-25
猜你喜欢
  • 2021-12-10
  • 2021-12-20
  • 2021-12-20
  • 2021-08-02
  • 2021-12-20
  • 2022-01-19
  • 2021-11-11
相关资源
相似解决方案