小程序 显示对话框 确定-取消

详细参数见小程序API: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('用户点击取消')
                }
           }  

总结: 类似相关功能都在小程序 api 的  界面 -->  交互  大目录下

原文地址:https://www.cnblogs.com/taohuaya/p/10668932.html