App.vue 642 B

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