postCountModel.vue 1.21 KB
<!--
 * @Date: 2025-12-11 17:26:25
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2025-12-18 20:57:49
 * @FilePath: /mlaj/src/components/count/postCountModel.vue
 * @Description: 发布作业统计模型(包括感恩次数和感恩对象)
-->
<template>
  <div v-if="postData.gratitude_count" class="post-count-model">
    <div class="flex justify-between items-center mb-2">
      <div class="text-gray-500">感恩次数: </div>
      <div class="font-bold text-gray-600">{{ postData.gratitude_count }} 次</div>
    </div>
    <div class="flex justify-between items-center">
      <div class="text-gray-500">感恩对象: </div>
      <div class="font-bold text-gray-600">{{ postData.gratitude_form_list?.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: () => ({})
  }
})
</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>