App.vue 718 B

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