App.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <script>
  2. export default {
  3. globalData: {
  4. //全局配置参数
  5. barHeight: 0,
  6. screenWidth: 0,
  7. screenHeight: 0,
  8. viewHeight: 0,
  9. },
  10. onLaunch: function(options) {
  11. console.log("APP----onLaunch", options);
  12. if (options.query.code) {
  13. uni.setStorageSync('code', options.query.code)
  14. }
  15. // #ifdef APP-PLUS
  16. // App平台检测升级,服务端代码是通过uniCloud的云函数实现的,详情可参考:https://ext.dcloud.net.cn/plugin?id=2226
  17. // #endif
  18. //获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
  19. uni.getSystemInfo({
  20. success: (res) => {
  21. this.globalData.barHeight = res.statusBarHeight;
  22. this.globalData.screenWidth = res.screenWidth;
  23. this.globalData.screenHeight = res.screenHeight;
  24. this.globalData.viewHeight = res.windowHeight
  25. }
  26. });
  27. },
  28. onShow: function() {
  29. console.log('App Show')
  30. },
  31. onHide: function() {
  32. console.log('App Hide')
  33. },
  34. globalData: {
  35. test: ''
  36. }
  37. }
  38. </script>
  39. <style lang="scss">
  40. @import "uview-ui/index.scss";
  41. /* #ifndef APP-PLUS-NVUE */
  42. /* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */
  43. @import './common/style/uni.css';
  44. /* #endif*/
  45. /*每个页面公共css */
  46. @import '@/common/style/common.scss';
  47. uni-radio .uni-radio-input .uni-radio-input-checked {
  48. background: #FF0000 !important;
  49. }
  50. </style>