App.vue 877 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <script>
  2. import system_util from './until/system_util'
  3. import ttsUtils from './until/tts/ttsUtils'
  4. export default {
  5. onLaunch: function() {
  6. console.log('App Launch')
  7. },
  8. onShow: async function() {
  9. console.log('App Show')
  10. await system_util.getCurrentPlatform()
  11. ttsUtils.init()
  12. var screenWidth = 0
  13. var screenHeight = 0
  14. uni.getSystemInfo({
  15. success: (res) => {
  16. screenHeight = res.screenHeight
  17. screenWidth = res.screenWidth
  18. console.log(screenHeight, screenWidth)
  19. }
  20. })
  21. if (screenHeight == 768 && screenWidth == 1024) {
  22. uni.redirectTo({
  23. url: '/pages/index15/index15'
  24. })
  25. }
  26. if (screenHeight == 1920 && screenWidth == 1080) {
  27. uni.redirectTo({
  28. url: '/pages/index32/index32'
  29. })
  30. }
  31. },
  32. onHide: function() {
  33. console.log('App Hide')
  34. }
  35. }
  36. </script>
  37. <style>
  38. /*每个页面公共css */
  39. </style>