app.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import * as httpUtil from "./utils/httpUtil";
  2. const app = getApp();
  3. App({
  4. onLaunch() {
  5. // 展示本地存储能力
  6. const logs = wx.getStorageSync('logs') || []
  7. logs.unshift(Date.now())
  8. wx.setStorageSync('logs', logs)
  9. //获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度
  10. wx.getSystemInfo({
  11. success: (res) => {
  12. let data = res;
  13. data.getMenu = wx.getMenuButtonBoundingClientRect();
  14. this.globalData.client = data;
  15. }
  16. })
  17. },
  18. globalData: {
  19. // 用户信息
  20. userInfo: {},
  21. // 微信用户openid,sessionKey
  22. wxInfo: {},
  23. // 当前设备信息
  24. client: {},
  25. // 地图,地图key,长春市坐标
  26. mapInfo: {
  27. key: "IORBZ-AWV3K-GX4JE-AMZVL-B3P52-XZBW6",
  28. latitude: 43.88,
  29. longitude: 125.35,
  30. referer: 'VCOO生鲜购物'
  31. },
  32. // 数据请求接口域名
  33. publicUrl: 'https://broadcast.waityou24.cn',//http://192.168.1.197:14001 https://broadcast.waityou24.cn
  34. //图片请求接口域名
  35. fileUrl: "http://broadcast.waityou24.cn",
  36. },
  37. ...httpUtil
  38. })