微信小程序的弹窗提示

第一种:弹出提示框,用户可以选择确定或者取消,且都带有回调

success:(data)=>{
                wx.showModal({
                  title: ‘提示’,
                  content: res.data,    //显示服务器端返回的数据。
                  success: function(res){
                        if(res.confirm){
                                //干你想干的事。
                        }else{
                                //干你想干的事。
                        }
                  }
                })
            }
第二种直接弹出成功的 用户无法选择确定与取消
wx.showToast({
   title: ‘成功选择’,          //提示内容
    icon:’success’,
    duration:2000            //持续显示多长时间
})
第三种:等待中…
wx.showToast({
   title: ‘等待中…’,          //提示内容
    icon:’loading’,
    duration:2000            //持续显示多长时间
})
第四种:无任何图标仅仅只是展示
wx.showToast({
   title: ‘您好,加油~’,          //提示内容
    icon:’none’,
    duration:2000            //持续显示多长时间
})
第五种:弹窗提示选项
wx.showActionSheet({
   itemList:[‘A’,’B’,’C’],
   success:function(res){
      if(!res.cancel){
          console.log(res.tapIndex)   //这里是被点击按钮的下标
       }
   }
})

微信小程序的弹窗提示》有2个想法

回复 匿名 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注