欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序?qū)崿F(xiàn)底部彈窗

 更新時間:2022年07月06日 14:38:55   作者:小雅雅家的小凱凱吖  
這篇文章主要為大家詳細介紹了微信小程序?qū)崿F(xiàn)底部彈窗,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了微信小程序?qū)崿F(xiàn)底部彈窗的具體代碼,供大家參考,具體內(nèi)容如下                    

xml:

<view bindtap="clickme">點擊我可以看到底部彈框的出現(xiàn)</view>
?
<!--屏幕背景變暗的背景 ?-->
<view class="commodity_screen" bindtap="hideModal" wx:if="{{showModalStatus}}"></view>
<!--彈出框 ?-->
<view animation="{{animationData}}" class="commodity_attr_box" wx:if="{{showModalStatus}}">
<!--自定義彈窗內(nèi)容-->
</view>

css:

/*使屏幕變暗 ?*/
.commodity_screen {
? width: 100%;
? height: 100%;
? position: fixed;
? top: 0;
? left: 0;
? background: #000;
? opacity: 0.2;
? overflow: hidden;
? z-index: 1000;
? color: #fff;
}
/*對話框 */
.commodity_attr_box {
? height: 50%;
? width: 100%;
? overflow: hidden;
? position: fixed;
? bottom: 0;
? left: 0;
? z-index: 2000;
? background: #fff;
? padding-top: 20rpx;
}

js: 

//點擊我顯示底部彈出框
? clickme: function () {
? ? this.showModal();
? },
?
? //顯示對話框
? showModal: function () {
? ? // 顯示遮罩層
? ? var animation = wx.createAnimation({
? ? ? duration: 200,
? ? ? timingFunction: "linear",
? ? ? delay: 0
? ? })
? ? this.animation = animation
? ? animation.translateY(300).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(300).step()
? ? this.setData({
? ? ? animationData: animation.export(),
? ? })
? ? setTimeout(function () {
? ? ? animation.translateY(0).step()
? ? ? this.setData({
? ? ? ? animationData: animation.export(),
? ? ? ? showModalStatus: false
? ? ? })
? ? }.bind(this), 200)
? },

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

最新評論