欧美日韩国产一区,亚洲一区视频,色综合久久久久,私密按摩师舌头伸进去了,99re6这里只有精品,夜夜性日日交xxx性hd

modal顯示模態彈窗

本文編輯: 揚 揚瀏覽 6281 版權所有,嚴禁轉載

組件說明:

顯示模態彈窗
wx.showModal(OBJECT)

組件用法:

modal

wxml

<view class="page">
  <view class="page__hd">
    <text class="page__title">modal</text>
    <text class="page__desc">模式對話框</text>
  </view>
  <view class="page__bd">
    <view class="btn-area">
      <button type="default" bindtap="showModel1">簡單設定的modal</button>
      <button type="default" bindtap="showModel2">全部自定義設定的modal2</button>
    </view>
  </view>
</view>

js

Page({
  data: {
  },
  showModel1:function(){
    wx.showModal({
      title: '提示',
      content: '這是一個簡單設置的彈窗',
      success: function(res) {
        if (res.confirm) {
          console.log('用戶點擊確定')
        }
      }
    })
  },
  showModel2:function(){
    wx.showModal({
      title: '提示',
      content: '這是一個設定過全部屬性模態彈窗',
      showCancel: true,
      confirmText:'好的',
      confirmColor:'#FF0000',
      cancelText: '算了',
      cancelColor:'#999999',
      success: function(res) {
        if (res.confirm) {
          console.log('用戶點擊確定');
        }else{
          console.log('用戶點擊取消');
        }
      },
      fail:function(){
        console.log('接口調用失敗');
      },
      complete:function(){
        console.log('接口調用結束')
      }
    })
  },

})

wxss

.page {
    min-height: 100%;
    flex: 1;
    background-color: #FBF9FE;
    font-size: 32rpx;
    font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
    overflow: hidden;
}

.page__hd{
    padding: 50rpx 50rpx 100rpx 50rpx;
    text-align: center;
}
.page__title{
    display: inline-block;
    padding: 20rpx 40rpx;
    font-size: 32rpx;
    color: #AAAAAA;
    border-bottom: 1px solid #CCCCCC;
}
.page__desc{
    display: none;
    margin-top: 20rpx;
    font-size: 26rpx;
    color: #BBBBBB;
}
.btn-area{
    padding: 0 30px;
}
.btn-area button{
    margin-top: 20rpx;
    margin-bottom: 20rpx;
}

主要屬性:

參數 類型 必填 說明
title String 提示的標題
content String 提示的內容
showCancel Boolean 是否顯示取消按鈕,默認為 true
cancelText String 取消按鈕的文字,默認為”取消”,最多 4 個字符
cancelColor HexColor 取消按鈕的文字顏色,默認為”#000000”
confirmText String 確定按鈕的文字,默認為”確定”,最多 4 個字符
confirmColor HexColor 確定按鈕的文字顏色,默認為”#3CC51F”
success Function 接口調用成功的回調函數,返回res.confirm為true時,表示用戶點擊確定按鈕
fail Function 接口調用失敗的回調函數
complete Function 接口調用結束的回調函數(調用成功、失敗都會執行)
如有技術問題或對本文有反饋,請加入QQ群:
微信小程序實戰5營: 微信小程序Club實戰5營