Completion of APIs except for user progress

This commit is contained in:
HAM!DREZA
2024-06-23 11:23:05 +03:30
parent 607ead8528
commit 46dd3d65a0
17 changed files with 356 additions and 411 deletions
+45 -23
View File
@@ -38,14 +38,20 @@
class="mt-[1vw] relative bg-[#F8F8F8] rounded-[3.846vw] md:rounded-[0.781vw] flex justify-between p-[4vw] md:p-[1.55vw]"
>
<img
src="/public/images/client1.png"
v-if="item.createdBy?.avatarMedia"
:src="item.createdBy.avatarMedia"
alt="profile"
class="w-[10.256vw] md:w-[3.958vw] h-[10.256vw] md:h-[3.958vw] rounded-[50%]"
/>
<img
v-else
src="/public/images/alt.png"
alt="profile"
class="w-[10.256vw] md:w-[3.958vw] h-[10.256vw] md:h-[3.958vw] rounded-[50%]"
/>
<div class="ps-[3vw] md:ps-[1vw] w-full">
<p class="text-[3.59vw] md:text-[0.938vw] text-[#383E43]">
علی مصلحی
{{ item.createdBy.name ? item.createdBy.name : "کاربر مهمان" }}
</p>
<div class="thin">
<p class="text-[2.836vw] md:text-[0.741vw] text-[#878787]">
@@ -61,17 +67,23 @@
<div
v-for="reply in item.replies"
:key="reply.id"
class="relative bg-[#F8F8F8] rounded-[3.846vw] md:rounded-[0.781vw] flex justify-between ps-[16vw] md:ps-[6vw] p-[2vw] md:p-[1.55vw]"
class="relative bg-[#F8F8F8] rounded-[3.846vw] md:rounded-[0.781vw] flex justify-between ps-[16vw] md:ps-[0vw] p-[2vw] md:p-[1.55vw]"
>
<img
src="/public/images/client3.png"
v-if="reply.createdBy.avatarMedia"
:src="reply.createdBy.avatarMedia"
alt="profile"
class="w-[10.256vw] md:w-[3.958vw] h-[10.256vw] md:h-[3.958vw] rounded-[50%]"
/>
<img
v-else
src="/public/images/alt.png"
alt="profile"
class="w-[10.256vw] md:w-[3.958vw] h-[10.256vw] md:h-[3.958vw] rounded-[50%]"
/>
<div class="ps-[3vw] md:ps-[1vw] w-full">
<p class="text-[3.59vw] md:text-[0.938vw] text-[#383E43]">
علی مصلحی
{{ reply.createdBy.name ? reply.createdBy.name : 'کاربر مهمان' }}
</p>
<div class="thin">
<p class="text-[2.836vw] md:text-[0.741vw] text-[#878787]">
@@ -80,7 +92,7 @@
<p
class="w-[98%] text-[3.19vw] md:text-[0.833vw] text-[#383E43] leading-[4.785vw] md:leading-[1.25vw] mt-[2vw] md:mt-[0.5vw]"
>
{{ reply.text }}
{{ reply.text }}
</p>
</div>
</div>
@@ -109,10 +121,6 @@
/>
</svg> -->
</div>
</div>
<svg
@@ -142,7 +150,9 @@
</div>
<div class="w-full md:w-[23.438vw] text-[#383E43]">
<product-page-course-detailsCourse-status :props="data.course" />
<product-page-course-detailsCourse-information :props="[data.course, access]" />
<product-page-course-detailsCourse-information
:props="[data.course, access]"
/>
</div>
</div>
@@ -152,14 +162,23 @@
<div class="space-y-[5vw] md:space-y-[1vw]">
<div class="flex gap-[1vw]">
<img
src="/public/images/client1.png"
v-if="authUser?.avatarMedia"
:src="authUser.avatarMedia"
alt=""
class="h-[10.256vw0] md:h-[3.385vw] w-[10.256vw] md:w-[3.385vw] rounded-[50%]"
/>
<img
v-else
src="/public/images/alt.png"
alt=""
class="h-[10.256vw0] md:h-[3.385vw] w-[10.256vw] md:w-[3.385vw] rounded-[50%]"
/>
<div
class="space-y-[4vw] mt-[1vw] md:mt-0 ms-[1vw] md:ms-0 md:space-y-0"
>
<p class="text-[3.59vw] md:text-[0.938vw]">علی مصلحی</p>
<p class="text-[3.59vw] md:text-[0.938vw]">
{{ authUser?.name ? authUser.name : "کاربر مهمان" }}
</p>
<p
v-if="replayTarget === null"
class="text-[2.836vw] md:text-[0.741vw] text-[#878787]"
@@ -167,7 +186,7 @@
پرسش جدید
</p>
<p v-else class="text-[2.836vw] md:text-[0.741vw] text-[#878787]">
پاسخ به علی مصلحی
پاسخ به کامنت
</p>
</div>
</div>
@@ -208,25 +227,28 @@ import { useToast } from "vue-toastification";
const toast = useToast();
const route = useRoute();
const replayTarget = ref(null);
const access = ref(false)
const access = ref(false);
const { authUser } = useAuth();
const { data, refresh } = await useFetch("/api/productId", {
method: "POST",
body: {
id: route.params.product,
},
});
const myCourses = await useFetch('/api/auth/me')
myCourses.data.value.course.forEach(element => {
const myCourses = await useFetch("/api/auth/me");
myCourses.data.value?.course.forEach((element) => {
if (element.id === route.params.product) {
access.value = true
}else{
access.value = false
access.value = true;
} else {
access.value = false;
}
});
const comment = ref(null);
const sendComment = async () => {
if (authUser.value === null) {
return toast.warning("برای ثبت نظر ابتدا وارد حساب کاربری خود شوید");
}
if (comment.value === "" || comment.value === null) {
return toast.error("متن خود را وارد کنید");
}