|
@@ -12,6 +12,7 @@ import {
|
|
|
createCircleReview,
|
|
|
getCircle,
|
|
|
getCircleReviews,
|
|
|
+ getCircleUpvotes,
|
|
|
shareCircle,
|
|
|
} from '../../../core/libs/requests'
|
|
|
import { handleUpvoteClick } from '../../../core/libs/actions'
|
|
@@ -21,6 +22,8 @@ import AvatarGroupCasual from '@/components/avatar-group-casual/avatar-group-cas
|
|
|
import { useUserStore } from '../../../store'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import { isImageOrVideo } from '../../../core/utils/common'
|
|
|
+import { list } from 'radash'
|
|
|
+import dayjs from 'dayjs'
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
const { userInfo } = storeToRefs(userStore)
|
|
@@ -34,7 +37,10 @@ const { data: reviews, run: runGetReviews } = useRequest(
|
|
|
},
|
|
|
},
|
|
|
)
|
|
|
-const current = ref(0)
|
|
|
+const { data: circleUpvotes, run: setCircleUpvotes } = useRequest(
|
|
|
+ () => getCircleUpvotes(id.value),
|
|
|
+ { initialData: { list: [], count: 0 } },
|
|
|
+)
|
|
|
const swiperSizes = ref()
|
|
|
const swiperStyle = ref()
|
|
|
const reviewContent = ref('')
|
|
@@ -69,6 +75,7 @@ const handleSend = async () => {
|
|
|
} else {
|
|
|
reviewContent.value = ''
|
|
|
uni.showToast({ title: '评论成功', icon: 'none' })
|
|
|
+ await runGetReviews()
|
|
|
}
|
|
|
}
|
|
|
onMounted(async () => {})
|
|
@@ -77,6 +84,7 @@ onLoad(async (query: { id: string }) => {
|
|
|
await run()
|
|
|
await runGetReviews()
|
|
|
await setSwiperStyle()
|
|
|
+ await setCircleUpvotes()
|
|
|
})
|
|
|
onShareAppMessage(async () => {
|
|
|
await shareCircle(id.value)
|
|
@@ -122,7 +130,7 @@ onShareAppMessage(async () => {
|
|
|
</template>
|
|
|
</view>
|
|
|
<div class="text-black/30 text-xs font-normal font-['PingFang SC'] leading-[10.18px]">
|
|
|
- 2024-5-31 10:06
|
|
|
+ {{ dayjs(data.createTime).format('YYYY-MM-DD HH:mm') }}
|
|
|
</div>
|
|
|
<view class="flex items-center my-4">
|
|
|
<view class="flex items-center">
|
|
@@ -168,10 +176,15 @@ onShareAppMessage(async () => {
|
|
|
<view>
|
|
|
<template v-if="reviews?.list.length">
|
|
|
<template v-for="it of reviews?.list" :key="it.id">
|
|
|
- <CommentItem :options="it" :isChild="false" @upvote="runGetReviews()"></CommentItem>
|
|
|
- <template v-for="child of it.childrens" :key="child.id">
|
|
|
+ <CommentItem
|
|
|
+ :options="it"
|
|
|
+ :isChild="false"
|
|
|
+ @upvote="runGetReviews()"
|
|
|
+ @delete="runGetReviews()"
|
|
|
+ ></CommentItem>
|
|
|
+ <!-- <template v-for="child of it.childrens" :key="child.id">
|
|
|
<CommentItem :options="child" :isChild="true"></CommentItem>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</template>
|
|
|
</template>
|
|
|
<template v-else>
|