12345678910111213141516171819202122 |
- //app.js
- var http = require("utils/http.js");
- App({
- onLaunch: function () {
- http.getToken();
- //自定义导航栏 获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
- const windowInfo = wx.getWindowInfo()
- let custom = wx.getMenuButtonBoundingClientRect()
- this.globalData.statusBarHeight = windowInfo.statusBarHeight
- this.globalData.navBarHeight = custom.height + (custom.top - windowInfo.statusBarHeight) * 2
- },
- globalData: {
- // 定义全局请求队列
- requestQueue: [],
- // 是否正在进行登陆
- isLanding: false,
- // 购物车商品数量
- totalCartCount: 0,
- statusBarHeight: 0,
- navBarHeight: 0,
- }
- })
|