WeChat applet prompt and pop-up window: wx.showToast,wx.showModal,wx.showActionSheet

wx.showToast,wx.showModal,wx.showActionSheet

wx.showToast

There are three types of icons, success, loading, or no icon

wx.showToast({
    
    
    title: '操作成功!',  // 标题
    icon: 'success',   // 图标类型,默认success
    duration: 1500   // 提示窗停留时间,默认1500ms
})
wx.showToast({
    
    
    title: '加载中...',
    icon: 'loading',
    duration: 1500
})
wx.showToast({
    
    
    title: '稍后再试',
    icon: 'none',
    duration: 1500
})

wx.showModal

wx.showModal({
    
    
      title: '提示标题',
      content: '提示内容',
      showCancel: false,   //不显示取消按钮
      confirmText: '确认',
      success(res) {
    
    
        if (res.confirm) {
    
    
			//
		else{
    
    
		   //
		}
      }
  })

Insert picture description here

wx.showActionSheet

wx.showActionSheet({
    
    
         itemList: ['从相册中选择','拍照'],//显示的列表项
         success: function (res) {
    
    //res.tapIndex点击的列表项
            console.log("点击了列表项:" + that[res.tapIndex])
         },
         fail: function (res) {
    
     },
         complete:function(res){
    
     }
      })

Can make this effect
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_43263320/article/details/113756455