article-author.vue
1.61 KB
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
<template>
<div class="article-item-header">
<div class="avatar" @click="goAuthor">
<WidgetAvatar class="widget-avatar" :src="data.avatar" :width="70" :height="70"></WidgetAvatar>
<span class="name">{{data.name}}</span>
</div>
<div class="opts">
<WidgetFollow v-bind="data"></WidgetFollow>
</div>
</div>
</template>
<script>
import YAS from 'utils/yas-constants';
export default {
name: 'ArticleAuthor',
props: {
data: {
type: Object,
default() {
return {};
}
},
posId: Number
},
methods: {
goAuthor() {
this.$router.push({
name: 'author',
params: {
type: this.data.authorType,
id: this.data.authorUid
}
});
this.reportClickAvatar();
},
reportClickAvatar() {
this.$store.dispatch('reportYas', {
params: {
appop: YAS.eventName.avatar,
param: {
AUTH_ID: this.data.authorUid,
POS_ID: this.posId
}
}
});
}
}
};
</script>
<style lang="scss" scoped>
.article-item-header {
display: flex;
border-bottom: 4px solid #f0f0f0;
height: 44PX;
}
.avatar {
display: flex;
align-items: center;
padding: 16px 30px;
width: 400px;
overflow: hidden;
background-color: #fff;
.name {
font-size: 24px;
margin-left: 20px;
}
.widget-avatar {
width: 70px;
height: 70px;
}
}
.opts {
flex: 1;
padding-right: 30px;
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
}
</style>