personal.js 1.81 KB
var n = function(n) {
    return n && n.__esModule ? n : {
        default: n
    };
}(require("../../../utils/restapi.js")), e = (require("../../../utils/util.js"), 
require("../../../utils/filter.js")), t = getApp();

require("../index/restapi.js");

Page(e.identityFilter({
    data: {
        accountName: "",
        phone: "",
        merchantName: ""
    },
    logout: function() {
        wx.showModal({
            content: "退出登录后将不能使用嘀加智慧门店相关的小程序,确认退出?",
            confirmText: "退出",
            success: function(e) {
                wx.getSetting({
                    success: function(e) {
                        wx.login({
                            success: function(e) {
                                t.globalData.code = e.code, n.default.logout(function(n) {
                                    t.globalData.userInfo = null, console.log(n), wx.reLaunch({
                                        url: "../../../pages/index/index"
                                    });
                                });
                            }
                        });
                    }
                });
            }
        });
    },
    onLoad: function(n) {
        if (null != t.globalData.userInfo) {
            var e = t.globalData.userInfo.merchant.shortName;
            wx.setNavigationBarTitle({
                title: e
            });
        }
    },
    onReady: function() {},
    onLogin: function() {
        var n = t.globalData.userInfo;
        console.log(n), this.setData({
            accountName: n.nickName,
            merchantName: n.merchant.merchantName
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {}
}));