postCountModel.vue
1.31 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
<!--
* @Date: 2025-12-11 17:26:25
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-16 11:22:13
* @FilePath: /mlaj/src/components/count/postCountModel.vue
* @Description: 发布作业统计模型(包括感恩次数和感恩对象)
-->
<template>
<div class="post-count-model">
<div class="flex justify-between items-center mb-2">
<div class="text-gray-500">感恩次数: </div>
<div class="font-bold">{{ countData.gratitude_count }} 次</div>
</div>
<div class="flex justify-between items-center">
<div class="text-gray-500">感恩对象: </div>
<div class="font-bold">{{ countData.gratitude_people.map(item => item.name).join('、') }}</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
const props = defineProps({
postData: {
type: Object,
default: () => ({})
}
})
// mock count data
const countData = ref({
gratitude_count: 3,
gratitude_people: [{id: 1, name: '张三'}, {id: 2, name: '李四'}, {id: 3, name: '王五'}]
})
</script>
<style lang="less">
.post-count-model {
color: #4caf50;
padding: 0.5rem 1rem;
// border: 1px solid #eaeaea;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
border-radius: 10px;
font-size: 0.85rem;
margin-bottom: 1rem;
}
</style>