zxl
2025-05-23 5d5b0f7ab0f34019e11901ddcd59cd8b51ea9ff9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<template>
  <div class="visit-card-message">
    <div class="user flex-center">
      <div class="avatar flex-center">
        <el-avatar :size="28" :src="avatar" />
      </div>
      <div class="content flex-center">
        <p class="ellipsis">{{ nickname }}</p>
      </div>
      <div class="tools flex-center">
        <span class="flex-center pointer">
          <i class="el-icon-plus" /> 加好友
        </span>
      </div>
    </div>
    <div class="sign"><span>个性签名 : </span>{{ sign }}</div>
    <div class="share no-select ellipsis">
      <a class="pointer" @click="openVisitCard(friendId)">你是谁?</a>
      分享了用户名片,可点击添加好友 ...
    </div>
  </div>
</template>
<script>
export default {
  name: 'VisitCardMessage',
  data() {
    return {
      userId: 0,
      friendId: 0,
      avatar:
        'http://im-serve0.gzydong.club/static/image/sys-head/2019012107542668696.jpg',
      sign:
        '这个社会,是赢家通吃,输者一无所有,社会,永远都是只以成败论英雄。',
      nickname:
        '氨基酸纳氨基酸纳氨基酸纳氨基酸纳氨基酸纳氨基酸纳氨基酸纳氨基酸纳',
    }
  },
  created() {},
  methods: {
    openVisitCard(user_id) {
      this.$emit('openVisitCard', user_id)
    },
  },
}
</script>
<style lang="less" scoped>
.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
.visit-card-message {
  min-height: 130px;
  min-width: 100px;
  max-width: 300px;
  border-radius: 5px;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #ece5e5;
  transition: all 0.5s;
 
  &:hover {
    box-shadow: 0 0 8px #e2d3d3;
    transform: scale(1.01);
  }
 
  .user {
    height: 40px;
    overflow: hidden;
    box-sizing: border-box;
    > div {
      height: inherit;
    }
 
    .avatar {
      flex-basis: 30px;
      flex-shrink: 0;
    }
 
    .content {
      flex: 1 1;
      margin: 0 10px;
      font-size: 14px;
      justify-content: flex-start;
      overflow: hidden;
    }
 
    .tools {
      flex-basis: 60px;
      flex-shrink: 0;
 
      span {
        width: 65px;
        height: 30px;
        background: #409eff;
        color: white;
        font-size: 13px;
        border-radius: 20px;
        padding: 0 8px;
        transform: scale(0.8);
        user-select: none;
 
        &:active {
          background: #83b0f3;
          transform: scale(0.83);
        }
      }
    }
  }
 
  .sign {
    min-height: 22px;
    line-height: 22px;
    border-radius: 3px;
    padding: 5px 8px;
    background: #f3f5f7;
    color: #7d7d7d;
    font-size: 12px;
    margin: 10px 0;
    span {
      font-weight: bold;
    }
  }
 
  .share {
    font-size: 12px;
    color: #7d7d7d;
    a {
      color: #4cabf7;
    }
  }
}
</style>