示例一:显示标题和内容,按钮默认
wx.showModal({
title: '标题',
content: '内容',
success: function (res) {
if (res.confirm) {
//点击确定按钮
} else if (res.cancel) {
//点击取消按钮
}
}
})
示例二:不显示“取消”按钮,不显示内容,修改“确定”按钮名称
wx.showModal({
title: '您没有授权,无法保存到相册',
confirmText: "知道了",
showCancel: false,
success: function (res) {
if (res.confirm) {
//点击确定按钮
} else if (res.cancel) {
//点击取消按钮
}
}
})