App.vue 771 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <script>
  2. export default {
  3. methods: {
  4. copmareVersion(version) {
  5. let versionArr = version.split('.')
  6. if(versionArr[0] < 8) {
  7. return false
  8. }
  9. if(versionArr[2] < 16) {
  10. return false
  11. }
  12. return true
  13. }
  14. },
  15. onLaunch: function() {
  16. let res = uni.getSystemInfoSync()
  17. console.log('手机信息',res);
  18. if(!this.copmareVersion(res.version)) {
  19. uni.showToast({
  20. title: '请更新到最新的微信版本,否则可能导致无法登录!',
  21. icon: 'none',
  22. duration: 5000
  23. })
  24. }
  25. uni.hideShareMenu()
  26. },
  27. onShow: function() {
  28. console.log('App Show')
  29. },
  30. onHide: function() {
  31. console.log('App Hide')
  32. }
  33. }
  34. </script>
  35. <style>
  36. /*每个页面公共css */
  37. @import url("static/css/reset.css");
  38. </style>