App.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!--
  2. http://t-oss-mbh5.colormaprun.com/actMgt/
  3. https://oss-mbh5.colormaprun.com/actMgt/
  4. -->
  5. <script>
  6. export default {
  7. globalData: {
  8. // 默认赛事LOGO
  9. defaultMatchLogo: "https://oss-mbh5.colormaprun.com/static/logo/default.png",
  10. // 默认赛事BANNER
  11. defaultMatchBanner: "https://oss-mbh5.colormaprun.com/static/banner/banner1.png"
  12. },
  13. onLaunch: function() {
  14. console.log('App Launch')
  15. this.$global.getWindowInfo()
  16. const style = document.documentElement.style;
  17. // 通过JS设置CSS变量值
  18. const defaultMatchLogoUrl = `url("${this.globalData.defaultMatchLogo}")`;
  19. style.setProperty('--default-matchLogo-url', defaultMatchLogoUrl);
  20. const defaultMatchBannerUrl = `url("${this.globalData.defaultMatchBanner}")`;
  21. style.setProperty('--default-matchBanner-url', defaultMatchBannerUrl);
  22. // 通过JS获取CSS变量值
  23. // console.log("--default-matchLogo-url:", style.getPropertyValue('--default-matchLogo-url'));
  24. // console.log("--default-matchBanner-url:", style.getPropertyValue('--default-matchBanner-url'));
  25. // uni.onWindowResize(res => {
  26. // // console.log('[APP onWindowResize]', res)
  27. // this.$global.getWindowInfo(res.size)
  28. // uni.$emit('windowResize')
  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>
  40. /*每个页面公共css */
  41. @import "global.css";
  42. </style>