|
@@ -52,11 +52,12 @@ const commentRef = ref<InstanceType<typeof WdInput>>()
|
|
const commentItemRef = ref<InstanceType<typeof CommentItem>[]>()
|
|
const commentItemRef = ref<InstanceType<typeof CommentItem>[]>()
|
|
const instance = getCurrentInstance()
|
|
const instance = getCurrentInstance()
|
|
const momentVideoRef = ref<ComponentExposed<typeof MomentVideo>[]>()
|
|
const momentVideoRef = ref<ComponentExposed<typeof MomentVideo>[]>()
|
|
-
|
|
|
|
const focus = ref(false)
|
|
const focus = ref(false)
|
|
|
|
+const hot = ref(true)
|
|
|
|
+const active = ref('hot');
|
|
const { data, run } = useRequest(() => getCircle(id.value), { initialData: {} })
|
|
const { data, run } = useRequest(() => getCircle(id.value), { initialData: {} })
|
|
const { data: reviews, run: runGetReviews } = useRequest(
|
|
const { data: reviews, run: runGetReviews } = useRequest(
|
|
- () => getCircleReviews({ circleId: id.value }),
|
|
|
|
|
|
+ () => getCircleReviews({ circleId: id.value,hot:hot.value}),
|
|
{
|
|
{
|
|
initialData: {
|
|
initialData: {
|
|
list: [],
|
|
list: [],
|
|
@@ -175,6 +176,13 @@ onLoad(async (query?: { id: string; isShared?: boolean }) => {
|
|
// return { title: data.value?.circleDesc }
|
|
// return { title: data.value?.circleDesc }
|
|
// })
|
|
// })
|
|
onShareAppMessage(shareAppMessage)
|
|
onShareAppMessage(shareAppMessage)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+const handleClick = async (value:boolean) => {
|
|
|
|
+ active.value = value ? 'hot' : 'time';
|
|
|
|
+ hot.value = value
|
|
|
|
+ await runGetReviews()
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
<template>
|
|
<template>
|
|
<view class="bg-white flex-grow">
|
|
<view class="bg-white flex-grow">
|
|
@@ -324,15 +332,21 @@ onShareAppMessage(shareAppMessage)
|
|
<SectionHeading v-if="!isShared" :title="`评论`" size="base">
|
|
<SectionHeading v-if="!isShared" :title="`评论`" size="base">
|
|
<template #append>
|
|
<template #append>
|
|
<view v-if="reviews?.list" class="flex">
|
|
<view v-if="reviews?.list" class="flex">
|
|
- <div class="text-black/90 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]">
|
|
|
|
|
|
+ <div @click="handleClick(true)" :class="{
|
|
|
|
+ 'text-black/90': active === 'hot',
|
|
|
|
+ 'text-black/40': active !== 'hot'
|
|
|
|
+ }" class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]">
|
|
按热度
|
|
按热度
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
- class="mx-2 text-black/40 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]"
|
|
|
|
|
|
+ class="text-xs font-normal font-['PingFang_SC'] leading-[10.18px]"
|
|
>
|
|
>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
- <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]">
|
|
|
|
|
|
+ <div @click="handleClick(false)" :class="{
|
|
|
|
+ 'text-black/90': active === 'time',
|
|
|
|
+ 'text-black/40': active !== 'time'
|
|
|
|
+ }" class="text-xs font-normal font-['PingFang_SC'] leading-[10.18px]">
|
|
按时间
|
|
按时间
|
|
</div>
|
|
</div>
|
|
</view>
|
|
</view>
|