From 500078714411487af00161e01bd7e0b5efdc3414 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期四, 07 八月 2025 13:32:32 +0800
Subject: [PATCH] add:热门景点
---
components/comment/comment-sub-item.vue | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/components/comment/comment-sub-item.vue b/components/comment/comment-sub-item.vue
index 22f6188..e36c47d 100644
--- a/components/comment/comment-sub-item.vue
+++ b/components/comment/comment-sub-item.vue
@@ -19,7 +19,12 @@
</view>
</view>
<view class="comment-opeartor">
- <up-icon name="heart" size="30rpx" />
+ <up-icon
+ name="heart"
+ size="30rpx"
+ :color="isLiked ? '#FF0000' : '#B9B9B9'"
+ @click="() => handleLike(props.id)"
+ />
<view class="comment-opeartor-heart-number">{{ likes }}</view>
</view>
</view>
@@ -28,8 +33,7 @@
</template>
<script setup lang="ts">
-import { defineProps, defineEmits } from 'vue'
-
+import { CommentDTO } from '@/types/index'
const props = defineProps<{
avatar: string
nickname: string
@@ -39,14 +43,24 @@
date: string
address: string
likes: number
+ filmInfo: CommentDTO
+ isLiked: boolean
+ id: number
}>()
const emit = defineEmits<{
- (e: 'reply'): void
+ (e: 'reply', id: number): void
+ (e: 'like', id: number): void
}>()
const onReply = () => {
- emit('reply')
+ console.log("onReply",props)
+ emit('reply', props.id)
+}
+
+const handleLike = (id: number) => { // 添加参数
+ console.log("handleLike", id)
+ emit('like', id)
}
</script>
--
Gitblit v1.9.3