App.vue 873 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. console.log('App Launch')
  5. },
  6. onShow: function() {
  7. console.log('App Show')
  8. this.$nextTick(()=>{
  9. this.init();
  10. })
  11. },
  12. onHide: function() {
  13. console.log('App Hide')
  14. },
  15. methods: {
  16. init(){
  17. let accountInfo=uni.getStorageSync('accountInfo');
  18. if(accountInfo.userType===1){
  19. uni.setTabBarItem({
  20. "index": 0,
  21. "iconPath": "static/tabBar/diagnose.png",
  22. "selectedIconPath": "static/tabBar/diagnoseEd.png",
  23. "text": "诊断"
  24. })
  25. uni.setTabBarItem({
  26. "index": 1,
  27. "iconPath": "static/tabBar/therapy.png",
  28. "selectedIconPath": "static/tabBar/therapyEd.png",
  29. "text": "治疗"
  30. })
  31. }
  32. }
  33. }
  34. }
  35. </script>
  36. <style>
  37. /*每个页面公共css */
  38. @import url('~@/static/icon/iconfont.css');
  39. @import url('./styles/index.css');
  40. </style>