App.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <script>
  2. var globalEvent = uni.requireNativePlugin('globalEvent');
  3. export default {
  4. onLaunch: function() {
  5. console.log('App Launch')
  6. //版本判断
  7. // this.$A.update()
  8. //启动界面判断缓存里面有没有token,没有跳转到登录页
  9. const token=uni.getStorageSync('token')
  10. if (token) {
  11. uni.reLaunch({
  12. url:"/pages/index/index"
  13. })
  14. }else{
  15. uni.reLaunch({
  16. url:"/pages/login/login"
  17. })
  18. }
  19. let info=uni.getSystemInfoSync()
  20. this.$store.commit('SAVE_SYSTEMINFO',info)
  21. // this.brand=info.brand
  22. },
  23. onShow: function() {
  24. console.log('App Show')
  25. },
  26. onHide: function() {
  27. console.log('App Hide')
  28. globalEvent.removeEventListener('iDataBarcodeEvent',()=>{})
  29. }
  30. }
  31. </script>
  32. <style lang="scss">
  33. /*每个页面公共css */
  34. @import url("@/common/styles/uni.css");
  35. @import url("@/common/styles/iconfont.css");
  36. @import url("@/common/styles/animate.css");
  37. @import url("@/common/styles/free.css");
  38. @import url("@/common/styles/common.css");
  39. page{
  40. background-color: var(--whiteMuted);
  41. color:var(--dark);
  42. min-height: 100vh;
  43. }
  44. .page{padding-left: 20rpx;padding-right: 20rpx;padding-bottom:20rpx;padding-top:1px;}
  45. .form-item-icon{ // btn-page 组件
  46. font-size:40rpx;
  47. width:100rpx;
  48. line-height: 100rpx;
  49. text-align: center;
  50. }
  51. .form-item-input{
  52. height:100rpx;
  53. line-height:100rpx;
  54. }
  55. .form-item-textarea{
  56. min-height:150rpx;
  57. }
  58. .form-item-textarea-blur{
  59. line-height:150rpx;
  60. }
  61. .form-item-input-minh{
  62. min-height:100rpx;
  63. }
  64. .list-input{
  65. min-height:80rpx;
  66. }
  67. .scan-icon{ //scan-input 组件
  68. width:44px;
  69. text-align: center;
  70. }
  71. .barcode-pic{
  72. width:100%;
  73. height:200rpx;
  74. }
  75. </style>