mine.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!-- 我的 -->
  2. <template>
  3. <view id="mine">
  4. <teacherMine class="flex-box-page" ref="teacherMine" v-if="userType==1"></teacherMine>
  5. <pupilMine class="flex-box-page" ref="pupilMine" v-if="userType==2"></pupilMine>
  6. </view>
  7. </template>
  8. <script>
  9. import {
  10. teacherMine
  11. } from '@/pages/views/teacherPage/teacherMine'
  12. import {
  13. pupilMine
  14. } from '@/pages/views/pupilPage/pupilMine'
  15. export default {
  16. onShareAppMessage(res) {
  17. return {
  18. title: '实验室安全智慧化管控系统',
  19. path: '/pages/views/login/login'
  20. }
  21. },
  22. components: {
  23. teacherMine,
  24. pupilMine,
  25. },
  26. data() {
  27. return {
  28. userType: 0,
  29. }
  30. },
  31. onLoad() {
  32. },
  33. onShow() {
  34. this.userType = uni.getStorageSync('userType')
  35. this.$nextTick(()=>{
  36. if(this.userType == 1){
  37. this.$refs.teacherMine.initialize();
  38. }else if(this.userType == 2){
  39. this.$refs.pupilMine.initialize();
  40. }
  41. })
  42. },
  43. methods: {
  44. },
  45. }
  46. </script>
  47. <style lang="stylus" scoped>
  48. #mine {
  49. height: 100%;
  50. display: flex;
  51. flex-direction: column;
  52. .flex-box-page{
  53. flex:1;
  54. display: flex;
  55. flex-direction: column;
  56. }
  57. }
  58. </style>