How to customize dialog box pop-up in WeChat Mini Programs
Today, the editor will share with you the relevant knowledge points about how to customize the dialog box in WeChat Mini Programs. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article, let's take a look at it.
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 () {/ / display mask layer 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)} HideModal: function () {/ / hide mask layer 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), onShow:function () {let that = this; wx.getSystemInfo ({success: function (res) {animationShowHeight = res.windowHeight;})},})
Index.wxml
{{item}}
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 } these are all the contents of the article "how to customize the dialog box pop-up in WeChat Mini Programs". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.