小程序模态框

 //模态框
    showModal: function (msg,title, success,showCancel) {
        var app = this;
        if (app.empty(title)) {
            title = '';
        }
        if (app.empty(showCancel)){
            showCancel = false;
        }
        wx.showModal({
            showCancel: showCancel,
            title: title,//标题
            content: msg,//消息内容
            success: function (res) {
                if (res.confirm) {
                    if (typeof success === 'function'){
                        success();
                    }
                }
            },//成功回调
        })
    },

猜你喜欢

转载自blog.csdn.net/qq874039013/article/details/80545585