app.js 1015 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // app.js
  2. App({
  3. data:{
  4. type:null,//判断二维码类型 1常客码
  5. // (过审专用,禁止删除)- start
  6. fake:true,
  7. // (过审专用,禁止删除)- end
  8. disinfectAreaId:null,//区域码id
  9. },
  10. onLaunch() {
  11. // 展示本地存储能力
  12. const logs = wx.getStorageSync('logs') || []
  13. logs.unshift(Date.now())
  14. wx.setStorageSync('logs', logs)
  15. // 登录
  16. wx.login({
  17. success: res => {
  18. wx.setStorageSync('wxCode', res.code)
  19. }
  20. })
  21. //获取胶囊按钮位置信息
  22. wx.getSystemInfo({
  23. success: e => {
  24. this.globalData.StatusBar = e.statusBarHeight;
  25. let capsule = wx.getMenuButtonBoundingClientRect();
  26. if (capsule) {
  27. this.globalData.Custom = capsule;
  28. this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
  29. } else {
  30. this.globalData.CustomBar = e.statusBarHeight + 50;
  31. }
  32. }
  33. })
  34. },
  35. globalData: {
  36. userInfo: null
  37. }
  38. })