首页 > 其他分享 >直播软件app开发,自定义展示弹窗的方式

直播软件app开发,自定义展示弹窗的方式

时间:2022-10-27 14:23:59浏览次数:67  
标签:showToast 自定义 app 直播 弹窗 wx

直播软件app开发,自定义展示弹窗的方式

1.showToast

 


<!-- index.wxml -->
<!-- wx.showToast(消息提示框) -->
<button bindtap="handleShowToast">ShowToast</button>
// index.js
Page({
  handleShowToast() {
    wx.showToast({
      title: '内容', //提示的内容
      duration: 2000, //持续的时间
      icon: 'loading', //图标有success、error、loading、none四种
      mask: true //显示透明蒙层 防止触摸穿透
    })
  }
  })

showLoading 和 wx.showToast 同时只能显示一个

showToast 应与 wx.hideToast 配对使用

2.showModal

 


<!-- index.wxml -->
<!-- wx.showModal(模态对话框) -->
<button bindtap="handleShowModal">ShowModal</button>
// index.js
Page({
  handleShowModal() {
    wx.showModal({
      title: '我是标题', //提示的标题
      content: '我是内容', //提示的内容
      success: function(res) {
        if(res.confirm) {
          console.log('用户点击了确定')
        }
        if(res.cancel) {
          console.log('用户点击了取消')
        }
      }
    })
  }
  })

 

以上就是 直播软件app开发,自定义展示弹窗的方式,更多内容欢迎关注之后的文章

 

标签:showToast,自定义,app,直播,弹窗,wx
From: https://www.cnblogs.com/yunbaomengnan/p/16832052.html

相关文章