login.vue 842 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="login-status" @click.stop="getUserInfo()">
  3. <view class="head-icon">
  4. <image src="../../static/images/logo.png" mode="aspectFit"></image>
  5. </view>
  6. <view v-if="!token" class="no-login">
  7. 登录/注册
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import {
  13. mapGetters
  14. } from 'vuex'
  15. // token
  16. export default {
  17. name: 'loginComponents',
  18. data() {
  19. return {
  20. userInfo: false
  21. };
  22. },
  23. computed: {
  24. ...mapGetters([
  25. 'token'
  26. ]),
  27. },
  28. methods: {
  29. getUserInfo() {
  30. uni.navigateTo({
  31. url: '/pages/content/mine'
  32. });
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .login-status {
  39. display: flex;
  40. align-items: center;
  41. .no-login {
  42. padding-left: 3px;
  43. font-size: 28rpx;
  44. font-family: PingFang SC, PingFang SC-Bold;
  45. font-weight: 700;
  46. color: #1a1a1a;
  47. }
  48. }
  49. </style>