user-list.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <view class="user-list">
  3. <view class="user first">
  4. <image src="https://picsum.photos/100/100?random=1" class="user-head"></image> <text>拼主</text>
  5. </view>
  6. <view class="user"> <image v-if="status" src="https://picsum.photos/100/100?random=2" class="user-head"></image> </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. props: {
  12. userList: {
  13. type: Object,
  14. default: () => ({})
  15. },
  16. status: {
  17. type: Boolean,
  18. default: false
  19. }
  20. }
  21. }
  22. </script>
  23. <style lang="scss" scoped>
  24. .flex-center-box {
  25. display: flex;
  26. justify-content: center;
  27. align-items: center;
  28. }
  29. .user-list {
  30. @extend .flex-center-box;
  31. .user {
  32. @extend .flex-center-box;
  33. position: relative;
  34. width: 100rpx;
  35. height: 100rpx;
  36. border-radius: 50%;
  37. border: 2rpx dashed #cccccc;
  38. border-radius: 50%;
  39. box-sizing: border-box;
  40. &::before {
  41. content: '?';
  42. font-size: 36rpx;
  43. color: #999999;
  44. }
  45. &.first {
  46. margin-right: 32rpx;
  47. }
  48. .user-head {
  49. position: absolute;
  50. left: -2rpx;
  51. top: -2rpx;
  52. z-index: 1;
  53. display: block;
  54. width: 100rpx;
  55. height: 100rpx;
  56. border-radius: 50%;
  57. }
  58. text {
  59. @extend .flex-center-box;
  60. position: absolute;
  61. left: -20rpx;
  62. top: 0;
  63. z-index: 2;
  64. width: 56rpx;
  65. height: 28rpx;
  66. background: #ff457b;
  67. border: 1rpx solid #ffffff;
  68. border-radius: 14rpx;
  69. font-size: 20rpx;
  70. color: #ffffff;
  71. }
  72. }
  73. }
  74. </style>