1.不带图标的信息提示
wx.showToast({
title: '弹出框',
icon: 'none',
duration: 2000
})
2.带图标得提示:加载中、提示成功
显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({ title: '加载中', })
setTimeout(function () { wx.hideLoading() }, 2000)
wx.showToast({
title: '成功',
icon: 'success',
duration: 2000
})
3.显示模态对话框
https://developers.weixin.qq.com/miniprogram/dev/api/wx.showModal.html
wx.showModal({
title: '提示',
content: '这是一个模态弹窗',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
});
4.自定义弹窗
<view>
<view class='dialog-container' hi