mine.vue 1.4 KB

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