var t = require("../../provider/dataApi.js"), e = (require("../../provider/pipe.js"), 
getApp());

Page({
    data: {
        statusBarHeight: "",
        titleBarHeight: "",
        windowHeight: 0,
        knowledgeList: [],
        knowledgeIndex: 0,
        pay_open: "",
        title: "",
        isBool: !0,
        isloading: !0,
        userInfo: {}
    },
    onLoad: function(t) {
        wx.getStorageSync("uid") ? (t = wx.getSystemInfoSync().windowHeight, this.setData({
            statusBarHeight: getApp().globalData.statusBarHeight,
            titleBarHeight: getApp().globalData.titleBarHeight,
            windowHeight: t,
            title: e.globalData.title
        })) : wx.navigateTo({
            url: "/pages/login/login"
        });
    },
    goBack: function() {
        wx.navigateBack({
            delta: 1
        });
    },
    onReady: function() {},
    getUserInfo: function() {
        var e = this;
        t.userinfo({
            uid: wx.getStorageSync("uid"),
            op: "getinfo"
        }).then(function(t) {
            console.log(t), e.setData({
                userInfo: t.data.info
            });
        }).catch(function(t) {
            console.log(t);
        });
    },
    onShow: function() {
        this.getUserInfo(), this.knowledge();
    },
    knowledge: function() {
        var o = this;
        t.knowledge({
            op: "cate",
            type: e.globalData.type,
            uid: wx.getStorageSync("uid")
        }).then(function(t) {
            console.log(t);
            var e = !1;
            0 < t.data.list.length && (e = !0), o.setData({
                knowledgeList: t.data.list,
                pay_open: t.data.pay_open,
                isBool: e,
                isloading: !1
            });
        }).catch(function(t) {
            console.log(t);
        });
    },
    ltChoose: function(t) {
        this.setData({
            knowledgeIndex: t.currentTarget.dataset.i
        });
    },
    rtChoose: function(t) {
        var o = t.currentTarget.dataset.chapterid;
        console.log(t), t = t.currentTarget.dataset.oitem, this.setData({
            item: t
        }), t.chapterId = o, e.globalData.oItem = t, wx.navigateTo({
            url: "../knowledgePoints-list/knowledgePoints-list"
        });
    },
    closePayPopup: function() {
        this.setData({
            showPay: !1
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});