最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

微信小程序自定義模態(tài)框

 更新時(shí)間:2022年07月05日 09:31:02   作者:A~小鯨喜  
這篇文章主要為大家詳細(xì)介紹了微信小程序自定義模態(tài)框,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了微信小程序自定義模態(tài)框的具體代碼,供大家參考,具體內(nèi)容如下

效果展示

可在模態(tài)框中添加圖片輸入框

代碼展示-wxml

<button class="show-btn" bindtap="showDialogBtn">彈窗</button>
? ? <view
? ? ? class="modal-mask"
? ? ? bindtap="hideModal"
? ? ? catchtouchmove="preventTouchMove"
? ? ? wx:if="{{showModal}}"
? ? ></view>
? ? <!-- 成功 -->
? ? <view class="modal-dialog" wx:if="{{showModal && ses}}">
? ? ? <view class="modal-img">
? ? ? ? <image src="/image/indexImg/sesImg.png" mode="widthFix" />
? ? ? </view>
? ? ? <view class="modal-title">恭喜你,成功加入班級(jí)</view>
? ? ? <view class="modal-footer">
? ? ? ? <view
? ? ? ? ? class="btn-confirms"
? ? ? ? ? bindtap="onConfirm"
? ? ? ? ? data-status="confirm"
? ? ? ? ? data-name="{{name}}"
? ? ? ? >確定
? ? ? ? </view>
? ? ? </view>
</view>

代碼展示-wxss

/**index.wxss**/
? ? .show-btn {
? ? ? ? margin-top: 100rpx;
? ? ? ? color: #22cc22;
? ? }
?
? ? .modal-mask {
? ? ? ? width: 100%;
? ? ? ? height: 100%;
? ? ? ? position: fixed;
? ? ? ? top: 0;
? ? ? ? left: 0;
? ? ? ? background: #000;
? ? ? ? opacity: 0.5;
? ? ? ? overflow: hidden;
? ? ? ? z-index: 9000;
? ? ? ? color: #fff;
? ? }
?
? ? .modal-dialog {
? ? ? ? width: 540rpx;
? ? ? ? overflow: hidden;
? ? ? ? position: fixed;
? ? ? ? top: 50%;
? ? ? ? left: 0;
? ? ? ? z-index: 9999;
? ? ? ? background: #f9f9f9;
? ? ? ? margin: -180rpx 105rpx;
? ? ? ? border-radius: 8px;
? ? }
?
? ? .modal-title {
? ? ? ? padding-top: 30rpx;
? ? ? ? padding-bottom: 30rpx;
? ? ? ? font-size: 14px;
? ? ? ? color: #030303;
? ? ? ? text-align: center;
? ? }
?
? ? .modal-img {
? ? ? ? width: 40px;
? ? ? ? height: 40px;
? ? ? ? margin: 0 auto;
? ? ? ? margin-top: 20rpx;
?
? ? ? ? image {
? ? ? ? ? ? width: 100%;
? ? ? ? ? ? height: 100%;
? ? ? ? }
? ? }
?
?
? ? .modal-footer {
? ? ? ? display: flex;
? ? ? ? flex-direction: row;
? ? ? ? height: 86rpx;
? ? ? ? border-top: 1px solid #dedede;
? ? ? ? font-size: 34rpx;
? ? ? ? line-height: 86rpx;
? ? }
?
? ? .btn-cancel {
? ? ? ? width: 50%;
? ? ? ? color: #8f8f8f;
? ? ? ? background-color: #f2f2f2;
? ? ? ? text-align: center;
? ? ? ? border-right: 1px solid #dedede;
? ? }
?
? ? .btn-confirm {
? ? ? ? width: 50%;
? ? ? ? color: #8f8f8f;
? ? ? ? background-color: #f2f2f2;
? ? ? ? text-align: center;
? ? }
?
? ? .btn-confirms {
? ? ? ? width: 100%;
? ? ? ? background-color: #f2f2f2;
? ? ? ? color: #8f8f8f;
? ? ? ? text-align: center;
? ? }

代碼展示-js

var app = getApp()
Page({
? data: {
? ? showModal: false,
? ? // 成功
? ? ses:true,
? },
? onLoad: function () {},
? /**
? ?* 彈窗
? ?*/
?
? showDialogBtn: function () {
? ? this.setData({
? ? ? showModal: true
? ? })
? },
? /**
? ?* 彈出框蒙層截?cái)鄑ouchmove事件
? ?*/
? preventTouchMove: function () {},
? /**
? ?* 隱藏模態(tài)對(duì)話框
? ?*/
? hideModal: function () {
? ? this.setData({
? ? ? showModal: false
? ? });
? },
? /**
? ?* 對(duì)話框取消按鈕點(diǎn)擊事件
? ?*/
? onCancel: function () {
? ? this.hideModal();
? },
? /**
? ?* 對(duì)話框確認(rèn)按鈕點(diǎn)擊事件
? ?*/
? onConfirm: function (e) {
? ? console.log(e.currentTarget.dataset.name);
? ? this.hideModal();
? }
})

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

香格里拉县| 辽阳县| 抚顺市| 成武县| 富源县| 武宣县| 东明县| 泰州市| 会昌县| 大余县| 镇远县| 东阳市| 留坝县| 剑河县| 桂平市| 塔河县| 泸水县| 沙河市| 叶城县| 龙陵县| 延长县| 谷城县| 长顺县| 囊谦县| 平舆县| 深水埗区| 安庆市| 土默特右旗| 尤溪县| 阿拉善盟| 定安县| 丘北县| 福建省| 鹤岗市| 嘉义市| 威海市| 本溪| 聂拉木县| 东莞市| 垣曲县| 禄劝|