user-list.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 src="https://picsum.photos/100/100?random=2" class="user-head"></image> </view>
  7. </view>
  8. </template>
  9. <script></script>
  10. <style lang="scss" scoped>
  11. .flex-center-box {
  12. display: flex;
  13. justify-content: center;
  14. align-items: center;
  15. }
  16. .user-list {
  17. @extend .flex-center-box;
  18. .user {
  19. @extend .flex-center-box;
  20. position: relative;
  21. width: 100rpx;
  22. height: 100rpx;
  23. border-radius: 50%;
  24. border: 2rpx dashed #cccccc;
  25. border-radius: 50%;
  26. box-sizing: border-box;
  27. &::before {
  28. content: '?';
  29. font-size: 36rpx;
  30. color: #999999;
  31. }
  32. &.first {
  33. margin-right: 32rpx;
  34. }
  35. .user-head {
  36. position: absolute;
  37. left: -2rpx;
  38. top: -2rpx;
  39. z-index: 1;
  40. display: block;
  41. width: 100rpx;
  42. height: 100rpx;
  43. border-radius: 50%;
  44. }
  45. text {
  46. @extend .flex-center-box;
  47. position: absolute;
  48. left: -20rpx;
  49. top: 0;
  50. z-index: 2;
  51. width: 56rpx;
  52. height: 28rpx;
  53. background: #ff457b;
  54. border: 1rpx solid #ffffff;
  55. border-radius: 14rpx;
  56. font-size: 20rpx;
  57. color: #ffffff;
  58. }
  59. }
  60. }
  61. </style>