第一种:弹出提示框,用户可以选择确定或者取消,且都带有回调。
wx.showModal({title: '提示',content: '这是一个模态弹窗',success: function (res) {if (res.confirm) { //这里是点击了确定以后console.log('用户点击确定')} else { //这里是点击了取消以后console.log('用户点击取消')}}})
第二种直接弹出成功的 用户无法选择确定与取消
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) //这里是点击了那个按钮的下标}}})