Updated
This commit is contained in:
@@ -40,7 +40,7 @@ watch(
|
||||
selectedRating.value = 5;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
const canSubmitComment = computed(() => {
|
||||
@@ -70,7 +70,7 @@ const submitComment = async () => {
|
||||
promises.push(
|
||||
rateProduct({
|
||||
rating: selectedRating.value,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,10 @@ const limitedComments = computed(() => {
|
||||
@submit.prevent="submitComment"
|
||||
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">
|
||||
<span class="typo-p-xs text-slate-700 font-semibold">امتیاز قبلی شما</span>
|
||||
<div class="flex items-center gap-1">
|
||||
@@ -127,14 +130,23 @@ const limitedComments = computed(() => {
|
||||
<Icon
|
||||
name="ci:star-solid"
|
||||
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>
|
||||
<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 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>
|
||||
<div class="flex items-center gap-1">
|
||||
<button
|
||||
@@ -196,8 +208,9 @@ const limitedComments = computed(() => {
|
||||
:title="comment.title"
|
||||
:content="comment.content"
|
||||
:date="comment.timestamp"
|
||||
:username="comment.user"
|
||||
:rate="product.user_rating ?? 0"
|
||||
:first_name="comment.user.first_name"
|
||||
:last_name="comment.user.last_name"
|
||||
:rate="comment.user_rating ?? 0"
|
||||
/>
|
||||
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user