This commit is contained in:
HAM!DREZA
2024-06-19 21:03:07 +03:30
parent 3f9e0d7615
commit 607ead8528
20 changed files with 869 additions and 298 deletions
+184 -184
View File
@@ -1,203 +1,195 @@
<template>
<div class="flex items-center flex-col pb-[30vw] md:pb-[7vw]">
<product-page-course-detailsHeader :props="data.course" />
<div
class="flex flex-col flex-col-reverse md:flex-row justify-between w-[87.69%] md:w-[81.04%] mt-[10vw] md:mt-[4.7vw]"
>
<div
class="w-full md:w-[56.354vw] text-[#383E43] text-[3.59vw] md:text-[1.055vw] leading-[5.897vw] md:leading-[1.582vw]"
>
<product-page-course-detailsDescription :props="data.course" />
test
<product-page-course-detailsHeadlines :props="data.course" />
<!-- <product-page-course-detailsComments :props="data.comments" /> -->
<div class="flex w-full flex-col pb-[30vw] md:pb-[7vw]">
<template>
<div class="flex items-center flex-col pb-[25vw] md:pb-[6vw]">
<div
class="flex items-center gap-[3vw] md:gap-[0.7vw] mt-[12vw] md:mt-[6.3vw] mb-[6vw] md:mb-[2.1vw]"
class="flex flex-col gap-[1vw] flex-col-reverse md:flex-row justify-between w-[87.69%] md:w-full mt-[8.2vw]"
>
<svg
class="w-[1.538vw] md:w-[0.521vw] h-[8.462vw] md:h-[2.76vw]"
viewBox="0 0 10 53"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 5C0 2.23858 2.23858 0 5 0H10V53H5C2.23858 53 0 50.7614 0 48V5Z"
fill="#0D3F40"
/>
</svg>
<span class="text-[4.544vw] md:text-[1.481vw] font-semibold"
>نظرات</span
<div
class="w-full md:w-[56.354vw] text-[#383E43] text-[1.055vw] leading-[1.582vw]"
>
<product-page-attended-coursesVideo />
<product-page-attended-coursesDownload-box />
<product-page-attended-coursesChats />
</div>
<!-- comment 1 -->
<div
v-for="item in data.comments"
:key="item.id"
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"
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]">
علی مصلحی
</p>
<div class="thin">
<p class="text-[2.836vw] md:text-[0.741vw] text-[#878787]">
1402/09/14
</p>
<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]"
>
{{ item.text }}
</p>
</div>
<div class="w-full md:w-[23.438vw]">
<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]"
>
<img
src="/public/images/client3.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]">
علی مصلحی
</p>
<div class="thin">
<p class="text-[2.836vw] md:text-[0.741vw] text-[#878787]">
1402/09/14
</p>
<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 }}
</p>
</div>
</div>
<!-- <svg
@click="sendReplay(reply.id)"
class="cursor-pointer absolute md:left-[2vw] left-[5vw] h-[4.615vw] w-[4.615vw] md:h-[1.25vw] md:w-[1.25vw]"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="mt-[82vw] md:mt-[4.6vw] min-h-[87.692vw] md:min-h-[29.635vw] rounded-[3.846vw] md:rounded-[0.781vw] bg-[#F8F8F8] pinkShadow space-y-[2vw] thin"
>
<div class="flexBox w-full flex-col text-[0.938vw] text-[#878787]">
<label
v-for="item in data.course.courseHeadlines" :key="item.id"
class="h-[14.615vw] md:h-[3.125vw] px-[3vw] md:px-[1.25vw] text-[3.59vw] md:text-[0.833vw] w-full flex justify-between"
>
<path
d="M7.12988 18.3101H15.1299C17.8899 18.3101 20.1299 16.0701 20.1299 13.3101C20.1299 10.5501 17.8899 8.31006 15.1299 8.31006H4.12988"
stroke="#383E43"
stroke-width="1.5"
stroke-miterlimit="10"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M6.43012 10.8099L3.87012 8.24994L6.43012 5.68994"
stroke="#383E43"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg> -->
<div class="flexBox gap-[1vw] md:gap-[0.3vw]">
<input type="radio" class="accent-primaryGreen" />
{{ item.headline }}
</div>
<div class="flexBox gap-[1vw] md:gap-[0.3vw]">
02:24
<svg
class="h-[4.359vw] w-[4.359vw] md:h-[0.99vw] md:w-[0.99vw]"
viewBox="0 0 19 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clip-path="url(#clip0_1_896)">
<path
d="M17.4166 10C17.4166 14.37 13.8699 17.9167 9.49992 17.9167C5.12992 17.9167 1.58325 14.37 1.58325 10C1.58325 5.63001 5.12992 2.08334 9.49992 2.08334C13.8699 2.08334 17.4166 5.63001 17.4166 10Z"
stroke="#383E43"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M12.437 12.5175L9.98286 11.0529C9.55536 10.7996 9.20703 10.19 9.20703 9.69124V6.4454"
stroke="#383E43"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_1_896">
<rect
width="19"
height="19"
fill="white"
transform="translate(0 0.5)"
/>
</clipPath>
</defs>
</svg>
</div>
</label>
<!-- <label
class="bg-[#FDF4FB] h-[14.615vw] md:h-[3.125vw] px-[3vw] md:px-[1.25vw] text-[3.59vw] md:text-[0.833vw] w-full flex justify-between"
>
<div class="flexBox gap-[1vw] md:gap-[0.3vw]">
<input
type="radio"
checked="checked"
class="accent-primaryGreen"
/>
آشنایی با ساختار صفحات
</div>
<div class="flexBox gap-[1vw] md:gap-[0.3vw]">
08:44
<svg
class="h-[4.359vw] w-[4.359vw] md:h-[0.99vw] md:w-[0.99vw]"
viewBox="0 0 19 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clip-path="url(#clip0_1_896)">
<path
d="M17.4166 10C17.4166 14.37 13.8699 17.9167 9.49992 17.9167C5.12992 17.9167 1.58325 14.37 1.58325 10C1.58325 5.63001 5.12992 2.08334 9.49992 2.08334C13.8699 2.08334 17.4166 5.63001 17.4166 10Z"
stroke="#383E43"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M12.437 12.5175L9.98286 11.0529C9.55536 10.7996 9.20703 10.19 9.20703 9.69124V6.4454"
stroke="#383E43"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_1_896">
<rect
width="19"
height="19"
fill="white"
transform="translate(0 0.5)"
/>
</clipPath>
</defs>
</svg>
</div>
</label>
<label
class="h-[14.615vw] md:h-[3.125vw] px-[3vw] md:px-[1.25vw] text-[3.59vw] md:text-[0.833vw] w-full flex justify-between"
>
<div class="flexBox gap-[1vw] md:gap-[0.3vw]">
<input type="radio" class="accent-primaryGreen" />
تگ های Heading
</div>
<div class="flexBox gap-[1vw] md:gap-[0.3vw]">
07:41
<svg
class="h-[4.359vw] w-[4.359vw] md:h-[0.99vw] md:w-[0.99vw]"
viewBox="0 0 19 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clip-path="url(#clip0_1_896)">
<path
d="M17.4166 10C17.4166 14.37 13.8699 17.9167 9.49992 17.9167C5.12992 17.9167 1.58325 14.37 1.58325 10C1.58325 5.63001 5.12992 2.08334 9.49992 2.08334C13.8699 2.08334 17.4166 5.63001 17.4166 10Z"
stroke="#383E43"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M12.437 12.5175L9.98286 11.0529C9.55536 10.7996 9.20703 10.19 9.20703 9.69124V6.4454"
stroke="#383E43"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_1_896">
<rect
width="19"
height="19"
fill="white"
transform="translate(0 0.5)"
/>
</clipPath>
</defs>
</svg>
</div>
</label> -->
</div>
</div>
</div>
<svg
@click="sendReplay(item.id)"
class="cursor-pointer absolute md:left-[2vw] left-[5vw] h-[4.615vw] w-[4.615vw] md:h-[1.25vw] md:w-[1.25vw]"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.12988 18.3101H15.1299C17.8899 18.3101 20.1299 16.0701 20.1299 13.3101C20.1299 10.5501 17.8899 8.31006 15.1299 8.31006H4.12988"
stroke="#383E43"
stroke-width="1.5"
stroke-miterlimit="10"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M6.43012 10.8099L3.87012 8.24994L6.43012 5.68994"
stroke="#383E43"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</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" />
</div>
</div>
<div
class="w-[63.438vw] bg-[#F8F8F8] p-[4vw] md:p-[1vw] rounded-[3.846vw] md:rounded-[0.781vw] mt-[6vw] md:mt-[2vw]"
>
<div class="space-y-[5vw] md:space-y-[1vw]">
<div class="flex gap-[1vw]">
<img
src="/public/images/client1.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
v-if="replayTarget === null"
class="text-[2.836vw] md:text-[0.741vw] text-[#878787]"
>
پرسش جدید
</p>
<p v-else class="text-[2.836vw] md:text-[0.741vw] text-[#878787]">
پاسخ به علی مصلحی
</p>
<product-page-attended-coursesProgress-bar />
</div>
</div>
<textarea
v-model="comment"
class="h-[50vw] md:h-[18vw] w-full rounded-[3.846vw] md:rounded-[0.781vw] p-[1vw]"
name=""
id=""
cols="30"
rows="10"
></textarea>
<div
class="flex justify-end gap-[1vw] text-[3.19vw] md:text-[0.833vw] text-white"
>
<button
@click="deleteComment"
class="h-[8.974vw] md:h-[2.292vw] w-[20.769vw] md:w-[5.573vw] rounded-[2.051vw] md:rounded-[0.521vw] bg-[#5A6268]"
>
حذف
</button>
<button
@click="sendComment"
class="cursor-pointer h-[8.974vw] md:h-[2.292vw] w-[20.769vw] md:w-[5.573vw] rounded-[2.051vw] md:rounded-[0.521vw] bg-primaryGreen"
>
ثبت
</button>
</div>
</div>
</div>
</template>
</div>
</template>
<script setup>
@@ -211,7 +203,14 @@ const { data, refresh } = await useFetch("/api/productId", {
id: route.params.product,
},
});
console.log(data.value.comments[0]);
const courseHeadline = await useFetch("/api/courseHeadlines", {
method: 'POST',
query: {
id: route.params.product
}
})
console.log(courseHeadline.data.value);
const comment = ref(null);
const sendComment = async () => {
@@ -241,4 +240,5 @@ const deleteComment = () => {
comment.value = null;
};
</script>
</script>
+26 -17
View File
@@ -219,7 +219,7 @@
</nuxt-link>
</div>
<div class="lastTickets mt-[20vw] md:mt-[2.917vw]">
<div v-if="lastTickets.length > 0" class="lastTickets mt-[20vw] md:mt-[2.917vw]">
<div class="flex flex-col">
<div class="flex justify-between items-center border-b pb-[0.733vw]">
<p class="text-[4.038vw] md:text-[1.055vw] font-[500]">
@@ -260,15 +260,15 @@
:key="ticket.id"
class="flex justify-between items-center mt-[1.25vw] px-2"
>
<p class="text-[3.19vw] md:text-[0.833vw] text-[#000]">
<p class="basis-2/6 text-[3.19vw] md:text-[0.833vw] text-[#000]">
{{ ticket.subject }}
</p>
<p class="text-[3.19vw] md:text-[0.833vw] text-[#878787]">
<p class="basis-2/6 text-[3.19vw] md:text-[0.833vw] text-[#878787]">
{{ jDate(ticket.createdAt) }}
</p>
<nuxt-link
to="/account/tickets"
class="flex justify-center items-center text-[2.518vw] md:text-[0.658vw] px-[2.564vw] md:px-[0.417vw] py-[2.051vw] md:py-[0.521vw] text-[#2ED573] bg-[#2ED5731A] rounded-[2.051vw] md:rounded-[0.521vw]"
class=" flex justify-center items-center text-[2.518vw] md:text-[0.658vw] px-[2.564vw] md:px-[0.417vw] py-[2.051vw] md:py-[0.521vw] text-[#2ED573] bg-[#2ED5731A] rounded-[2.051vw] md:rounded-[0.521vw]"
>
مشاهده
</nuxt-link>
@@ -289,7 +289,7 @@
</div>
</div>
<div class="lastCources mt-[20vw] md:mt-[2.917vw] mb-8">
<div v-if="lastCourses.length > 0" class="lastCources mt-[20vw] md:mt-[2.917vw] mb-8">
<div class="flex flex-col">
<div class="flex justify-between items-center border-b pb-[0.833vw]">
<p class="text-[4.038vw] md:text-[1.055vw] font-[500]">
@@ -338,11 +338,11 @@
</div>
</div>
<div class="w-full md:w-[23.385vw]">
<nuxt-link to="/account/profile" class="w-full md:w-[23.385vw]">
<div
class="bg-white mb-[1.25vw] pinkShadow p-[5vw] md:p-[1.25vw] flex flex-col profile w-full md:w-[23.385vw] h-[108.872vw] md:h-[26.25vw] rounded-[3.846vw] md:rounded-[0.781vw] space-y-[7vw] md:space-y-[1.5vw]"
class="bg-white mb-[1.25vw] pinkShadow p-[5vw] md:p-[1.25vw] flex flex-col profile w-full md:w-[23.385vw] h-[70.872vw] md:h-[20.25vw] rounded-[3.846vw] md:rounded-[0.781vw] space-y-[7vw] md:space-y-[1.5vw]"
>
<div class="flex justify-between items-center">
<div class="flex justify-between items-center mt-[1vw]">
<p
class="text-[4.038vw] md:text-[0.938vw] text-[#383E43] font-semibold"
>
@@ -373,23 +373,31 @@
<div class="flex justify-center items-center flex-col mt-[1.823vw]">
<img
src="/public/images/client1.png"
v-if="authUser.avatarMedia"
:src="authUser?.avatarMedia"
class="h-[27.949vw] md:h-[7.24vw] w-[27.949vw] md:w-[7.24vw] rounded-full"
alt=""
/>
<img
v-else
src="/public/images/alt.png"
class="h-[27.949vw] md:h-[7.24vw] w-[27.949vw] md:w-[7.24vw] rounded-full"
alt=""
/>
<p
class="text-[4.038vw] md:text-[0.938vw] text-[#383E43] font-semibold mt-[1.25vw]"
>
علی مصلحی
{{ authUser.name ? authUser.name : 'کاربر مهمان' }}
</p>
<p
class="font-[400] text-[3.19vw] md:text-[0.833vw] text-[#878787] mt-[0.417vw]"
>
alimoslehi@
{{ authUser.userName ? authUser.userName + '@' : 'نام کاربری'}}
</p>
</div>
<div class="flex justify-between mt-[2.083vw]">
<!-- <div class="flex justify-between mt-[2.083vw]">
<svg
class="w-[4.615vw] md:w-[1.25vw] h-[4.615vw] md:h-[1.25vw]"
viewBox="0 0 24 24"
@@ -424,8 +432,8 @@
stroke-linejoin="round"
/>
</svg>
</div>
<div
</div> -->
<!-- <div
class="grid grid-cols-5 md:grid-cols-7 mt-[0.833vw] justify-center"
>
<div class="hidden md:flex flex-col items-center">
@@ -514,9 +522,9 @@
چهار شنبه
</p>
</div>
</div>
</div> -->
</div>
</div>
</nuxt-link>
</div>
</template>
@@ -527,7 +535,8 @@ const lastTickets = tickets.data.value.slice(-2);
const myCourses = await useFetch("/api/auth/me");
const lastCourses = myCourses.data.value.course.slice(-2);
const balance = await useFetch("/api/user/balance");
console.log(balance.data);
const { authUser } = useAuth();
definePageMeta({
middleware: "auth",
});
+1 -1
View File
@@ -27,7 +27,7 @@
import ProgressCard from './../../../components/ProgressCard.vue'
import {Tabs, Tab} from 'vue3-tabs-component';
const myCourses = await useFetch('/api/auth/me')
console.log(myCourses.data.value.course);
const tab1 =
`<p
class="flex items-center gap-[0.5vw] p-[2vw] md:p-0 md:px-[0.6vw] rounded-[2.564vw]">
+10 -10
View File
@@ -171,26 +171,26 @@ const edit = async (formData) => {
}
};
async function changePhoto(val) {
console.log("image", val.target.files[0]);
const formData = new FormData();
formData.append('file', val.target.files[0]);
formData.append('directoryName', name.value);
console.log('keys', formData.values());
try {
await $fetch("/api/uploader", {
const dataa = await $fetch("/api/uploader", {
method: "POST",
body: formData,
body: formData
});
console.log('dataa',dataa);
} catch (error) {
console.log('error client', error);
console.log('error client', error.data.data.message);
}
// console.log('ss', formData);
// const data = await useFetch("/api/uploader", {
// method: "POST",
// body: formData
// });
// console.log("done", data.data);
// const data = await useFetch("api/uploader", {
// method: 'POST',
// body: formData
// });
}
</script>
+6 -3
View File
@@ -10,11 +10,14 @@
<div class="w-full">
<tab :name="tab1">
<ul class="space-y-[0.5vw] mt-[6vw] md:mt-[0.5vw]">
<li
<!-- <p v-if="payments.data = null" class="p-[1vw] text-[0.8vw] underline">تراکنشی وجود ندارد !!!</p>
-->
<li
v-for="(item, index) in payments.data.value"
:key="index"
class="flex justify-between items-center"
>
<p class="text-[3.59vw] md:text-[0.938vw] text-[#383E43]">
{{ item.reason }}
</p>
@@ -184,14 +187,14 @@ import { Tabs, Tab } from "vue3-tabs-component";
const { data, refresh } = await useFetch("/api/user/balance");
const payments = await useFetch("/api/user/payments");
const payNum = Math.random()
const price = ref(null);
const charge = async () => {
const toPay = await useFetch("/api/user/add", {
method: "POST",
body: {
amount: price.value,
paymentNumber: "411",
paymentNumber: payNum * Math.random(),
reason: "deposit",
},
});