friend-item.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="friend-item" @click="showFriendInfo()">
  3. <head-image :name="friend.nickName" :online="friend.online" :url="friend.headImage" size="small"></head-image>
  4. <view class="friend-info">
  5. <view class="friend-name">{{ friend.nickName }}</view>
  6. <view class="friend-online">
  7. <image v-show="friend.onlineWeb" class="online" src="/static/image/online_web.png" title="电脑设备在线" />
  8. <image v-show="friend.onlineApp" class="online" src="/static/image/online_app.png" title="移动设备在线" />
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. name: "frined-item",
  16. data() {
  17. return {}
  18. },
  19. methods: {
  20. showFriendInfo() {
  21. uni.navigateTo({
  22. url: "/pages/common/user-info?id=" + this.friend.id
  23. })
  24. },
  25. },
  26. props: {
  27. friend: {
  28. type: Object
  29. }
  30. }
  31. }
  32. </script>
  33. <style scope lang="scss">
  34. .friend-item {
  35. height: 90rpx;
  36. display: flex;
  37. margin-bottom: 1rpx;
  38. position: relative;
  39. padding: 10rpx;
  40. padding-left: 20rpx;
  41. align-items: center;
  42. background-color: white;
  43. white-space: nowrap;
  44. &:hover {
  45. background-color: $im-bg;
  46. }
  47. .friend-info {
  48. flex: 1;
  49. display: flex;
  50. flex-direction: column;
  51. padding-left: 20rpx;
  52. text-align: left;
  53. .friend-name {
  54. font-size: $im-font-size;
  55. white-space: nowrap;
  56. overflow: hidden;
  57. }
  58. .friend-online {
  59. margin-top: 4rpx;
  60. .online {
  61. padding-right: 4rpx;
  62. width: 24rpx;
  63. height: 24rpx;
  64. }
  65. }
  66. }
  67. }
  68. </style>