login.vue 893 B

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