App.vue 834 B

12345678910111213141516171819202122232425262728293031323334
  1. <script>
  2. export default {
  3. globalData: {
  4. // 用户信息
  5. userInfo: {},
  6. // 状态栏
  7. statusBarHeight: 20,
  8. // 设备信息
  9. deviceInfo: {}
  10. },
  11. onLaunch() {
  12. // 获取App方法
  13. getUserInfo.postMessage('获取用户信息')
  14. getDeviceInfo.postMessage('获取设备信息')
  15. getMWDeviceInfo.postMessage('获取音响信息')
  16. // 暴露setUserInfo方法给APP
  17. window['setUserInfo'] = res => {
  18. this.globalData.userInfo = JSON.parse(res)
  19. }
  20. window['setDeviceInfo'] = res => {
  21. this.globalData.statusBarHeight = JSON.parse(res).statusHeight
  22. }
  23. window['setMWDeviceInfo'] = res => {
  24. this.globalData.deviceInfo = JSON.parse(res)
  25. }
  26. }
  27. }
  28. </script>
  29. <style>
  30. /*每个页面公共css */
  31. @import url('@/common/main.scss');
  32. @import url('@/common/button.scss');
  33. </style>