Updated
This commit is contained in:
@@ -40,7 +40,7 @@ watch(
|
|||||||
selectedRating.value = 5;
|
selectedRating.value = 5;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
const canSubmitComment = computed(() => {
|
const canSubmitComment = computed(() => {
|
||||||
@@ -70,7 +70,7 @@ const submitComment = async () => {
|
|||||||
promises.push(
|
promises.push(
|
||||||
rateProduct({
|
rateProduct({
|
||||||
rating: selectedRating.value,
|
rating: selectedRating.value,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +112,10 @@ const limitedComments = computed(() => {
|
|||||||
@submit.prevent="submitComment"
|
@submit.prevent="submitComment"
|
||||||
class="flex flex-col gap-6"
|
class="flex flex-col gap-6"
|
||||||
>
|
>
|
||||||
<div v-if="hasUserRated" class="flex flex-col gap-3 px-4 py-3 bg-white rounded-lg border border-slate-300">
|
<div
|
||||||
|
v-if="hasUserRated"
|
||||||
|
class="flex flex-col gap-3 px-4 py-3 bg-white rounded-lg border border-slate-300"
|
||||||
|
>
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<span class="typo-p-xs text-slate-700 font-semibold">امتیاز قبلی شما</span>
|
<span class="typo-p-xs text-slate-700 font-semibold">امتیاز قبلی شما</span>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
@@ -127,14 +130,23 @@ const limitedComments = computed(() => {
|
|||||||
<Icon
|
<Icon
|
||||||
name="ci:star-solid"
|
name="ci:star-solid"
|
||||||
class="size-5"
|
class="size-5"
|
||||||
:class="star <= (props.product.user_rating || 0) ? '**:fill-yellow-500' : '**:fill-slate-300'"
|
:class="
|
||||||
|
star <= (props.product.user_rating || 0)
|
||||||
|
? '**:fill-yellow-500'
|
||||||
|
: '**:fill-slate-300'
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
<span class="typo-p-sm font-semibold text-slate-600 mr-2">{{ props.product.user_rating }}</span>
|
<span class="typo-p-sm font-semibold text-slate-600 mr-2">{{
|
||||||
|
props.product.user_rating
|
||||||
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="flex flex-col gap-2">
|
<div
|
||||||
|
v-else
|
||||||
|
class="flex flex-col gap-2"
|
||||||
|
>
|
||||||
<span class="typo-p-sm text-slate-500">امتیاز شما</span>
|
<span class="typo-p-sm text-slate-500">امتیاز شما</span>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<button
|
<button
|
||||||
@@ -196,8 +208,9 @@ const limitedComments = computed(() => {
|
|||||||
:title="comment.title"
|
:title="comment.title"
|
||||||
:content="comment.content"
|
:content="comment.content"
|
||||||
:date="comment.timestamp"
|
:date="comment.timestamp"
|
||||||
:username="comment.user"
|
:first_name="comment.user.first_name"
|
||||||
:rate="product.user_rating ?? 0"
|
:last_name="comment.user.last_name"
|
||||||
|
:rate="comment.user_rating ?? 0"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|||||||
Reference in New Issue
Block a user