JMApp/app.js
2024-03-20 11:39:05 +08:00

54 lines
1.7 KiB
JavaScript

var t = require("./utils/login.js");
App({
onLaunch: function(e) {
console.log("options", e), this.globalData.options = e, t.getLogin(this, !0);
try {
var o = wx.getSystemInfoSync();
this.computeNavigateBarHeight(o);
} catch (t) {
this.setData({
windowHeight: 812,
totalTopHeight: 68,
statusBarHeight: 20,
titleBarHeight: 48
});
}
},
onShow: function(e) {
console.log("onshowwwwwwwoptions", e);
var o = e.scene;
[ 1011, 1012, 1013, 1024, 1047, 1048, 1049 ].indexOf(o) > -1 && (console.log("扫码进入的"),
t.getDevicecode(this, e));
},
computeNavigateBarHeight: function(t) {
var e = wx.getMenuButtonBoundingClientRect(), o = e.bottom + 6, i = t.windowHeight, n = e.top, a = e.height;
i < 10 && (i = t.windowHeight, a = o - (n = t.statusBarHeight)), o < 10 && (console.log("更新"),
o = 68, /iPhone X|MI 8|PAAM00|COR-AL00/.test(t.model) ? o = 88 : /iPhone/.test(t.model) && (o = 64));
var s = t.windowWidth;
this.globalData.screen_data = {
windowWidth: s,
windowHeight: i,
totalTopHeight: o,
statusBarHeight: n,
titleBarHeight: a,
titleWidth: e.width
};
},
globalData: {
userInfo: null,
canGetData: !1,
screen_data: {},
options: {},
route: {},
user: {},
isUserAuthorization: 0,
servicetel: "",
code: "",
isneedUpload: !1,
needJumpUrl: !1,
devicecode: "",
protocol: {},
tips: ""
}
});