friend-item.vue 1.5 KB

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