App.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <script>
  2. export default {
  3. globalData: {
  4. baseUrl: '',
  5. token: '',
  6. version: '', // 当前版本号
  7. buildType: 'uat', // 打包环境对应类型,pro 生产 uat 预发布 dev 本地开发
  8. envTips: '', // 环境文字提示
  9. theme: 'default', // 主题,default
  10. isIphoneXup: false //是否iphonex以及以上的版本
  11. },
  12. mounted() {
  13. // 非V3模式
  14. if (this.$scope) {
  15. this.$scope.globalData.token = this.$store.state.vuex_token;
  16. } else {
  17. // V3模式
  18. getApp({ allowDefault: true }).globalData.token = this.$store.state.vuex_token;
  19. }
  20. this.$config('init');
  21. },
  22. onLaunch: function() {
  23. const theme = getApp().globalData.theme
  24. uni.setTabBarStyle({
  25. color: this.$config("topBarTitleColors"),
  26. selectedColor: this.$config("primaryColor"),
  27. borderStyle: 'white'
  28. })
  29. uni.setTabBarItem({
  30. "index": 0,
  31. "iconPath": "static/"+theme+"/tabbar/record.png",
  32. "selectedIconPath": "static/"+theme+"/tabbar/record-active.png",
  33. })
  34. uni.setTabBarItem({
  35. "index": 1,
  36. "iconPath": "static/"+theme+"/tabbar/user.png",
  37. "selectedIconPath": "static/"+theme+"/tabbar/user-active.png",
  38. })
  39. },
  40. onShow: function() {
  41. console.log('App Show')
  42. },
  43. onHide: function() {
  44. console.log('App Hide')
  45. },
  46. }
  47. </script>
  48. <style lang="scss">
  49. @import "uview-ui/index.scss";
  50. /*每个页面公共css */
  51. page {
  52. min-height: 100%;
  53. display: flex;
  54. background-color: #F8F8F8;
  55. }
  56. /* 登录页是否记住密码多选框样式 */
  57. uni-checkbox.login-form-checkbox .uni-checkbox-input{
  58. width: 24upx !important;
  59. height: 24upx !important;
  60. }
  61. </style>