App.vue 998 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. const that = this
  5. // 存储手机信息
  6. uni.getSystemInfo({
  7. success(res) {
  8. that.$store.commit('SET_SYSTEMINFO', res)
  9. }
  10. })
  11. if (this.$platform === 'APP-PLUS') {
  12. const {
  13. osName, // 操作系统
  14. osVersion // 操作系统版本号
  15. } = that.$store.state.info.systemInfo
  16. plus.runtime.getProperty(plus.runtime.appid, (info) => {
  17. //版本号
  18. const {
  19. version,
  20. versionCode,
  21. } = info
  22. that.$store.commit('SET_VERSIONINFO', {
  23. version: version,
  24. versionCode: versionCode,
  25. osName: osName,
  26. osVersion: osVersion
  27. })
  28. })
  29. }
  30. },
  31. onShow: function() {
  32. console.log('App Show')
  33. },
  34. onHide: function() {
  35. console.log('App Hide')
  36. }
  37. }
  38. </script>
  39. <style lang="scss">
  40. @import '@/static/icon/iconfont.css';
  41. @import '@/static/style/common.scss';
  42. /*每个页面公共css */
  43. page {
  44. height: 100%;
  45. background-color: $bg-color-main;
  46. }
  47. </style>