article-footer.vue
1.69 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
<template>
<div class="article-footer-wrapper">
<div class="tool-bar">
<WidgetIconBtn class="item" type="fav" :pos-id="sceneId" :text="praiseCount" :articleId="articleId" :option="optionPraise"></WidgetIconBtn>
<WidgetIconBtn class="item" type="star" :pos-id="sceneId" :text="favoriteCount" :articleId="articleId" :option="optionFav" ></WidgetIconBtn>
<WidgetIconBtn class="item" type="msg" :text="commentCount" :option="optionComment" @click="onComment"></WidgetIconBtn>
</div>
<div class="close ml20" @click="onClose">
<slot>收起</slot>
</div>
</div>
</template>
<script>
import YAS from 'utils/yas-constants';
export default {
name: 'ArticleFooter',
props: ['favoriteCount', 'praiseCount', 'commentCount', 'hasFavor', 'hasPraise', 'articleId'],
data() {
return {
optionPraise: {
selected: this.hasPraise === 'Y'
},
optionFav: {
selected: this.hasFavor === 'Y'
},
optionComment: {
emitName: 'click',
canSelect: false
},
sceneId: YAS.scene.newsDetail
};
},
computed: {
},
mounted() {
},
methods: {
onComment() {
this.$emit('on-comment-click');
},
onClose() {
this.$emit('on-close');
}
},
};
</script>
<style lang="scss" scoped>
.article-footer-wrapper {
display: flex;
height: 100px;
border-top: 1px solid #e0e0e0;
background-color: white;
}
.tool-bar {
flex: 1;
display: flex;
align-items: center;
justify-content: space-around;
}
.close {
width: 200px;
color: white;
font-size: 32px;
line-height: 100px;
font-weight: 300;
background-color: #d0021b;
text-align: center;
}
.ml20 {
margin-left: 20px;
}
</style>