微信小程序弹出对话框和隐藏对话框开发实例

作者:小飞燕 发布时间:2021-04-17 10:57:12

导语本文整理了全网深受用户关注的个微信小程序弹出对话框和隐藏对话框开发实例经验知识,可以帮助您全面了解代理怎么做,小白也能成为高手,跟随小编一起来看一看吧!

要实现微信小程序的弹出对话框,涉及到小程序开发技术,所以相关的小程序代码是必不可少的。小编给大家带来了微信小程序弹出对话框和隐藏对话框的开发教程。

微信小程序自定义对话框中弹出隐藏动画的详细说明

index.js

微信小程序弹出输入框

[javascript]查看普通副本//index.js

var app=getapp

让animationshowheight=300

页面({

数据:{

animationdata: ' ',showmodalstatus:false,imageheight:0,imagewidth:0

},

imageload:函数(e) {

this . set data({ imageheight : e . detail . height,imagewidth : e . detail . width });

},

showmodal:函数{

//显示遮罩层

var animation=wx . create animation({

工期: 200,timingfunction: '线性',延迟: 0

})

this.animation=动画

animation . translatey(animation show height)。步骤

this.setdata({

animation data : animation . export,showmodalstatus: true

})

settimeout(函数{

animation.translatey(0)。步骤

this.setdata({

animation data : animation . export

})

}.装订(这个),200)

},

hidemodal:函数{

//隐藏遮罩层

var animation=wx . create animation({

工期: 200,timingfunction: '线性',延迟: 0

})

this.animation=动画;

animation . translatey(animation show height)。步骤

this.setdata({

animation data : animation . export,})

settimeout(函数{

animation.translatey(0)。步骤

this.setdata({

animation data : animation . export,showmodalstatus: false

})

}.装订(这个),200)

},

onshow:function{

让那个=这个;

wx.getsysteminfo({

成功:功能(res) {

animation show height=res . window height;

}

})

},

})

index.wxml

[java]查看普通副本

{{item}}

index.wxss

[javascript]查看普通副本. buydes-dialog-container{

宽度:;

高度:;

justice-content :空格;

背景-color:rgba(15,15,26,0.7);

位置:固定;

z-index : 999;

}。buydes-dialog-container-top{

flex-grow : 1;

}。buy des-dialog-container-bottom {

display: flex

flex-grow : 0;

}。buy des-dialog-container-bottom-item {

padding:24rpx

display: flex

justice-content : center;

border-bottom : 1 rpx solid # eeee;

}

效果图:

以下是实际开发的小程序效果图,没有源代码,但是原理同上。通过微信小程序商店的演示学习和平时的css基础,可以做出以下效果

以上是微信小程序的弹出对话框和隐藏对话框的开发实例的详细说明。参考上面的流程,复制相应的代码,就可以成功开发了。很简单吗?

下面是题目的开头。微信小程序的标题栏怎么设置?标题到此结束

微信小程序的标题栏怎么设置?微信小程序的标题栏怎么设置?下面的小系列将说明如何设置微信小程序的标题栏。

设置标题栏

标题栏窗口

在app.json文件中,它是通过窗口对象中的属性设置的

示例:

app.json:

运行:

以上是小编为大家整理的关于如何设置微信小程序标题栏的内容。更多精彩内容,请关注源社网小节目频道。

这是第一段的结尾。下面是如何在比较后设置微信小程序的标题栏。目前已经获得了737网友的青睐!正文到此结束

查看全文

猜你喜欢

微商怎么找货源

频道查询入口

微商代理怎么做