var e = getApp(), t = wx.cloud.database();

t.command;

Page({
    data: {
        activeNames: [ "1" ]
    },
    onLoad: function(o) {
        var a = this;
        wx.hideShareMenu(), t.collection("_config").where({
            _id: "config"
        }).field({
            v: !0,
            button: !0
        }).get().then(function(t) {
            a.setData({
                c: e.globalData.c,
                v: t.data[0].v
            });
        }).catch(function(e) {
            console.error(e);
        });
    },
    onChange: function(e) {
        this.setData({
            activeNames: e.detail
        });
    },
    openGuide: function(e) {
        wx.showLoading({
            title: "正在加载",
            mask: !0
        }), wx.downloadFile({
            url: "https://7265-release-bu5dc-1301069672.tcb.qcloud.la/guide.pdf?sign=5e44ccbff65bf0b1bef6ba76341f3d7e&t=1645775927",
            success: function(e) {
                if (200 === e.statusCode) {
                    var t = e.tempFilePath;
                    wx.openDocument({
                        filePath: t,
                        fileType: "pdf",
                        showMenu: !0,
                        success: function(e) {
                            wx.hideLoading();
                        }
                    });
                } else wx.showToast({
                    title: "下载出了点问题稍后再试！",
                    icon: "none",
                    duration: 1500
                });
            }
        });
    },
    downloadGuide: function(e) {
        wx.showModal({
            showCancel: !1,
            content: "点击【复制链接】后黏贴到手机或电脑浏览器下载使用指南",
            confirmColor: "#FF5A5F",
            confirmText: "复制链接",
            success: function(e) {
                wx.setClipboardData({
                    data: "https://7265-release-bu5dc-1301069672.tcb.qcloud.la/guide.pdf?sign=5e44ccbff65bf0b1bef6ba76341f3d7e&t=1645775927",
                    success: function(e) {
                        wx.getClipboardData({
                            success: function(e) {}
                        });
                    }
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    }
});