模态对话框
示例代码1
效果
代码
wx.showModal({
title: '确认下单',
content: '是否确认下单?',
showCancel:true, //不写会导致手机端无法正常展示取消按钮
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
}
}
})
cancelColor: 'cancelColor'会使取消按钮在手机上显示不出来
示例代码2
效果
代码
wx.showModal({
title: '提示',
content: '请输入商品名',
showCancel: false
})