var t = getApp(), e = require("../../utils/login.js");

Page({
    data: {
        showLoding: !0,
        urlList: [],
        user: {}
    },
    onLoad: function(n) {
        var o = this;
        e.pageStart(t).then(function(t) {
            o.getContent();
        });
    },
    onShow: function() {
        this.refresh && this.getContent();
    },
    onPullDownRefresh: function() {},
    onShareAppMessage: function() {},
    getContent: function() {
        var n = this;
        wx.showLoading({
            title: ""
        }), e.request(t.globalData.config.user.log, {}, !0).then(function(t) {
            if (wx.hideLoading(), 200 != t.code) return wx.showModal({
                title: "提示",
                content: t.message
            }), !1;
            n.setData({
                showLoding: !1,
                user: t.data.user,
                urlList: t.data.menu
            }, function() {});
        }).catch(function(t) {
            wx.hideLoading();
        });
    },
    islogin: function() {
        wx.showLoading({
            title: "加载中"
        });
    },
    refresh: 0,
    toPage: function(t) {
        var e = t.currentTarget.dataset, n = (e.refresh, e.url);
        n ? wx.navigateTo({
            url: "/pages/".concat(n)
        }) : wx.showToast({
            title: "页面开发中~",
            icon: "none",
            duration: 2e3
        }), this.refresh = 1;
    },
    callUs: function() {
        if (!t.globalData.servicetel) return !1;
        wx.makePhoneCall({
            phoneNumber: "" + t.globalData.servicetel
        });
    }
});