137-3385-8848(同微信)

wx.hideToast(),小程序?显示模态弹窗

2022-04-21 管理员

?显示模态弹窗

OBJECT参数说明:

参数 类型 必填 说明
title String 提示的标题
content String 提示的内容
showCancel Boolean 是否显示取消按钮,默认为 true
cancelText String 取消按钮的文字,默认为"取消",最多 4 个字符
cancelColor HexColor 取消按钮的文字颜色,默认为"#000000"
confirmText String 确定按钮的文字,默认为"确定",最多 4 个字符
confirmColor HexColor 确定按钮的文字颜色,默认为"#3CC51F"
success Function 接口调用成功的回调函数
fail Function 接口调用失败的回调函数
complete Function 接口调用结束的回调函数(调用成功、失败都会执行)

success返回参数说明:

参数 类型 说明 最低版本
confirm Boolean 为 true 时,表示用户点击了确定按钮  
cancel Boolean 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) 1.1.0

示例代码:

wx.showModal({
  title: '提示',
  content: '这是一个模态弹窗',
  success: function(res) {
    if (res.confirm) {
      console.log('用户点击确定')
    } else if (res.cancel) {
      console.log('用户点击取消')
    }
  }
})

更多微信小程序开发教程,关注。

上一篇:wx.hideLoading(),小程序?显示操作菜单
下一篇:wx.showLoading(OBJECT),小程序显示 loading 提示框,
相关资讯 Releva ntnews
解决方案 Solutions
相关热点 Hot spot
郑州做排名中正确使用关键词优化的方法
  1. 我们的优势
  2. 我们的实力
  3. 选择我们的理由
咨询电话(微信同号)

137-3385-8848(同微信)

豫ICP备16014343号-1

Copyright © 2017-2022 版权所有 酷微科技 Rights Reserved

电话咨询 在线咨询 服务项目 SEO优化