login.vue 851 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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="!userInfo" class="no-login">
  7. 登录/注册
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. name: 'loginComponents',
  14. data() {
  15. return {
  16. userInfo: true
  17. };
  18. },
  19. methods: {
  20. getUserInfo() {
  21. if (this.userInfo) {
  22. uni.navigateTo({
  23. url: '/pages/content/mine'
  24. });
  25. } else {
  26. uni.navigateTo({
  27. url: '/pages/login/index'
  28. });
  29. }
  30. }
  31. }
  32. }
  33. </script>
  34. <style lang="scss" scoped>
  35. .login-status {
  36. display: flex;
  37. align-items: center;
  38. .no-login {
  39. padding-left: 3px;
  40. font-size: 28rpx;
  41. font-family: PingFang SC, PingFang SC-Bold;
  42. font-weight: 700;
  43. color: #1a1a1a;
  44. }
  45. }
  46. </style>