my.vue 962 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view>
  3. <!-- 用户未登录时,显示登录组件 -->
  4. <my-login v-if="!token && token === ''"></my-login>
  5. <!-- 用户登录后,显示用户信息组件 -->
  6. <my-userinfo v-else></my-userinfo>
  7. </view>
  8. </template>
  9. <script>
  10. import badgeMix from '@/mixins/tabbar-badge.js'
  11. import { mapState, mapMutations } from 'vuex'
  12. export default {
  13. mixins: [badgeMix],
  14. computed: {
  15. ...mapState('m_user', ['token'])
  16. },
  17. data() {
  18. return {
  19. };
  20. },
  21. onReady() {
  22. this.findVerifyStatus()
  23. },
  24. onHide() {
  25. this.findVerifyStatus()
  26. },
  27. methods: {
  28. ...mapMutations('m_user', ['updateAuthentication']),
  29. // 查询是否通过了老师认证
  30. async findVerifyStatus() {
  31. const { data: result } = await uni.$http.get('/education/teacher-certifications/findVerifyStatus')
  32. const message = result.message
  33. // console.log("fff")
  34. this.updateAuthentication(message)
  35. },
  36. }
  37. }
  38. </script>
  39. <style lang="scss">
  40. </style>