麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 課堂 > 小程序 > 正文

微信小程序自定義對話框彈出和隱藏動畫

2020-03-21 16:13:17
字體:
供稿:網(wǎng)友

本文實例為大家分享了微信小程序自定義對話框彈出和隱藏動畫的具體代碼,供大家參考,具體內(nèi)容如下

index.js

//index.jsvar app = getApp(); let animationShowHeight = 300; Page({ data:{ animationData:"", showModalStatus:false, imageHeight:0, imageWidth:0 }, imageLoad: function (e) {  this.setData({imageHeight:e.detail.height,imageWidth:e.detail.width});  }, showModal: function () { // 顯示遮罩層 var animation = wx.createAnimation({  duration: 200,  timingFunction: "linear",  delay: 0 }) this.animation = animation animation.translateY(animationShowHeight).step() this.setData({  animationData: animation.export(),  showModalStatus: true }) setTimeout(function () {  animation.translateY(0).step()  this.setData({  animationData: animation.export()  }) }.bind(this), 200) }, hideModal: function () { // 隱藏遮罩層 var animation = wx.createAnimation({  duration: 200,  timingFunction: "linear",  delay: 0 }) this.animation = animation; animation.translateY(animationShowHeight).step() this.setData({  animationData: animation.export(), }) setTimeout(function () { animation.translateY(0).step() this.setData({  animationData: animation.export(),  showModalStatus: false }) }.bind(this), 200) }, onShow:function(){  let that = this;  wx.getSystemInfo({  success: function(res) {  animationShowHeight = res.windowHeight;  } }) }, })

index.wxml

<!--index.wxml--><view class="container-column">  <view animation="{{animationData}}" class="container-column buydes-dialog-container" wx:if="{{showModalStatus}}"> <view class="buydes-dialog-container-top" bindtap="hideModal"></view> <view class="container-column buydes-dialog-container-bottom">  <block wx:for="{{['操作1','操作2','操作3','取消']}}" wx:for-index="index" wx:key="key" wx:for-item="item">  <view bindtap="hideModal" class="buydes-dialog-container-bottom-item" >{{item}}</view>  </block> </view> </view>  <image bindtap="showModal" bindload="imageLoad" style="width:{{imageWidth}}px;;height:{{imageHeight}}px;" src="../pro1.jpg"/> </view>

index.wxss

.buydes-dialog-container{ width: 100%; height: 100%; justify-content: space-between; background-color:rgba(15, 15, 26, 0.7); position: fixed; z-index: 999;} .buydes-dialog-container-top{ flex-grow: 1;} .buydes-dialog-container-bottom{ display: flex; flex-grow: 0;} .buydes-dialog-container-bottom-item{ padding:24rpx; display: flex; justify-content: center; border-bottom: 1rpx solid #eeeeee;}

效果圖:

微信小程序,對話框

下面是實際開發(fā)中的效果圖,沒有源碼,但是原理和上面的是一樣的,通過上面的DEMO學習加上平常的CSS基礎(chǔ),完全可以做出下面的效果

微信小程序,對話框

源碼下載:微信小程序自定義對話框彈出和隱藏動畫

 

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持VEVB武林網(wǎng)。


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 国产99久久精品一区二区300 | 免费黄色欧美视频 | 中国免费一级毛片 | 亚洲日本韩国在线观看 | 日本欧美一区二区三区视频麻豆 | 国产亚洲精品久久久久婷婷瑜伽 | 黄在线免费看 | 亚洲成人免费视频在线 | 日日噜噜噜噜久久久精品毛片 | 国产精品一区二区手机在线观看 | 久久久成人999亚洲区美女 | 国产91精品一区二区麻豆亚洲 | 羞羞视频免费观看网站 | 欧美精品免费一区二区三区 | 99精品电影 | xnxx 美女19 | 日韩美香港a一级毛片免费 日韩激情 | 18欧美性xxxx极品hd | 久久久久久中文字幕 | 蜜桃网在线观看 | 国产人成精品综合欧美成人 | 精品爱爱| 婷婷久久久久久 | 日韩av在线网址 | 日日艹夜夜艹 | 日韩视频一区二区三区四区 | 一级一级一级一级毛片 | 91精品国产综合久久婷婷香 | 精品成人国产在线观看男人呻吟 | 今井夏帆av一区二区 | 深夜福利视频绿巨人视频在线观看 | 天天碰天天操 | 国产91九色视频 | 羞羞的动漫在线观看 | 999久久久国产999久久久 | 国产精品久久久久无码av | 亚洲人成网站免费播放 | 精品一区二区电影 | 欧美一级鲁丝片免费看 | 久久久久免费电影 | 日本精品久久久一区二区三区 |