dialog.js 836 字节
Newer Older
B
initial  
bearyan 已提交
1
Page({
X
xushengni 已提交
2 3 4 5
    data: {
        showDialog: false
    },
     openConfirm: function () {
B
initial  
bearyan 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
        wx.showModal({
            title: '弹窗标题',
            content: '弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内',
            confirmText: "主操作",
            cancelText: "辅助操作",
            success: function (res) {
                console.log(res);
                if (res.confirm) {
                    console.log('用户点击主操作')
                }else{
                    console.log('用户点击辅助操作')
                }
            }
        });
    },
X
xushengni 已提交
21 22 23 24 25 26 27 28 29
    openDialog: function () {
        this.setData({
            istrue: true
        })
    },
    closeDialog: function () {
        this.setData({
            istrue: false
        })
B
initial  
bearyan 已提交
30
    }
X
xushengni 已提交
31
});