var a, e;

a = getApp(), e = require("../../utils/util.js"), Page({
    data: {
        list: a.globalData.sxdata,
        mhei: a.globalData.sheight,
        infodata: "",
        male: 1,
        female: 1,
        malename: "鼠",
        femalename: "鼠",
        userInfo: "",
        iscollect: !1,
        sharelayer: !1,
        modalHidden: !1,
        showModalStatus: !1,
        mengshow: !1,
        bottom: "-100%",
        openSettingBtnHidden: !0,
        hide_qcode: 1,
        id: ""
    },
    onLoad: function(t) {
        var o = this, n = this, s = e.GetCxId(t.id, 4);
        console.log(t.id, s), n.setData({
            male: s[0] - 1,
            female: s[1] - 1
        }), console.log(n.data);
        var i = decodeURIComponent(this.options.scene);
        if (i) {
            var l = a._get(i, "id");
            l && (s = l);
            var d = s[0] - 1, r = s[1] - 1;
            n.setData({
                id: s,
                male: d,
                female: r
            });
        }
        e.getPairData(n, "sx", function() {
            parseInt(d), parseInt(r), encodeURIComponent("id=" + s), console.log("数据", n.data.infodata);
        }), a.globalData.userInfo ? this.setData({
            userInfo: a.globalData.userInfo,
            hasUserInfo: !0
        }) : this.data.canIUse ? a.userInfoReadyCallback = function(a) {
            o.setData({
                userInfo: a.userInfo,
                hasUserInfo: !0
            });
        } : wx.getUserInfo({
            success: function(e) {
                a.globalData.userInfo = e.userInfo, o.setData({
                    userInfo: e.userInfo,
                    hasUserInfo: !0
                });
            }
        }), n.data.infodata, n.data.userInfo && n.data.userInfo.avatarUrl;
    },
    share: function(a) {
        this.hideModal(), this.setData({
            hide_qcode: 0
        });
    },
    showModal: function(a) {
        e.showModal(this);
    },
    hideModal: function(a) {
        e.hideModal(this);
    },
    getUserInfo: function(e) {
        console.log(e), a.globalData.userInfo = e.detail.userInfo, this.setData({
            userInfo: e.detail.userInfo,
            hasUserInfo: !0
        });
    },
    closeQcode: function() {
        this.setData({
            hide_qcode: 1
        });
    },
    test: function() {
        var a = encodeURIComponent("id=4_7");
        wx.navigateTo({
            url: "/pages/sxpair_info/sxpair_info?scene=" + a
        });
    },
    handleSetting: function(a) {
        a.detail.authSetting["scope.writePhotosAlbum"] && (this.setData({
            openSettingBtnHidden: !0
        }), drawImg.save_file(this));
    },
    goback: function(a) {
        wx.navigateBack({
            delta: 1
        });
    },
    navigateToPair: function(a) {
        wx.navigateTo({
            url: "/pages/pair_sx/index"
        });
    },
    onShareAppMessage: function(a) {
        "button" === a.from && console.log(a.target);
        var t = e.formatCxLink(4, [ this.data.male + 1, this.data.female + 1 ]);
        return console.log(t), {
            title: "生肖配对详情",
            path: "/pages/pair_sx/sxpair_info?id=" + t
        };
    }
});