1.带对号弹窗 小程序把开头uni换成wx即可
uni.showToast({
title: '标题',
duration: 5000
});
2.无icon弹窗
uni.showToast({
title: '标题',
icon:'none',
duration: 5000
});
3.加载弹窗
uni.showLoading({
title: '加载中',
duration: 5000
});
以上都可以去除时间 使用uni.hideToast();关闭
uni.hideToast();
4.只有确认提示
wx.showModal({
title: '提示',
content: '只有确认!',
showCancel: false,
success: function(res) {
console.log('用户点击了确认')
})
5.带取消 确认交互弹窗
uni.showModal({
title: '提示',
content: '这是一个模态弹窗',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});