top-box.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view>
  3. <view class="no-login" v-if="!token">
  4. <view class="avatar"><image src="../../static/no-login.png"></image></view>
  5. <view class="context">您好,请授权登录</view>
  6. </view>
  7. <view class="login" v-else>
  8. <view class="avatar"><image :src="userinfo.avatarUrl ? userinfo.avatarUrl : userinfo.avatar"></image></view>
  9. <view class="info">
  10. <view class="name">{{userinfo.nickName}}</view>
  11. <view class="phone">
  12. <view><image src="../../static/ucenter/icon2.png"></image></view>
  13. <view>{{userinfo.mobile || userinfo.telephone}}</view>
  14. </view>
  15. </view>
  16. <view class="join">
  17. <image src="../../static/ucenter/icon1.png"></image>
  18. <view class="days">已加入156天</view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. name:"top-box",
  26. props:['token','userinfo'],
  27. }
  28. </script>
  29. <style lang="scss" scoped>
  30. .no-login{
  31. margin-top: 15rpx;
  32. display: flex;
  33. .avatar image{
  34. width: 70rpx;
  35. height: 70rpx;
  36. margin: 0 20rpx;
  37. }
  38. .context{
  39. color: #58be6b;
  40. font-size: 32rpx;
  41. font-weight: bold;
  42. line-height: 70rpx;
  43. }
  44. }
  45. .login{
  46. margin-top: 15rpx;
  47. display: flex;
  48. .avatar image{
  49. width: 110rpx;
  50. height: 110rpx;
  51. margin: 0 30rpx;
  52. border-radius: 50%;
  53. }
  54. .info{
  55. display: flex;
  56. flex-direction: column;
  57. height: 100rpx;
  58. justify-content: space-around;
  59. padding-top: 10rpx;
  60. margin-left: 5rpx;
  61. .name{
  62. color: #1d2129;
  63. font-size: 36rpx;
  64. font-weight: bold;
  65. }
  66. .phone{
  67. display: flex;
  68. font-size: 24rpx;
  69. color: #86909c;
  70. line-height: 36rpx;
  71. image{
  72. width: 36rpx;
  73. height: 36rpx;
  74. }
  75. }
  76. }
  77. .join{
  78. display: flex;
  79. padding-top: 15rpx;
  80. margin-left: 20rpx;
  81. position: relative;
  82. image{
  83. width: 42rpx;
  84. height: 48rpx;
  85. position: absolute;
  86. }
  87. .days{
  88. background-color: #f5f5f5;
  89. height: 44rpx;
  90. padding: 0 20rpx;
  91. margin-left: 20rpx;
  92. margin-top: 5rpx;
  93. border-top-right-radius:20rpx;
  94. border-bottom-right-radius:20rpx;
  95. font-size: 24rpx;
  96. color: #86909c;
  97. line-height: 44rpx;
  98. }
  99. }
  100. }
  101. </style>