publication v-1
This commit is contained in:
+26
-10
@@ -55,7 +55,7 @@
|
||||
</p>
|
||||
<div class="thin">
|
||||
<p class="text-[2.836vw] md:text-[0.741vw] text-[#878787]">
|
||||
1402/09/14
|
||||
{{ jDate(item.createdBy.createdAt) }}
|
||||
</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]"
|
||||
@@ -67,7 +67,7 @@
|
||||
<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-[0vw] p-[2vw] md:p-[1.55vw]"
|
||||
class="relative bg-[#F8F8F8] rounded-[3.846vw] md:rounded-[0.781vw] flex justify-between p-[2vw] md:p-[1.55vw]"
|
||||
>
|
||||
<img
|
||||
v-if="reply.createdBy.avatarMedia"
|
||||
@@ -87,7 +87,7 @@
|
||||
</p>
|
||||
<div class="thin">
|
||||
<p class="text-[2.836vw] md:text-[0.741vw] text-[#878787]">
|
||||
1402/09/14
|
||||
{{ jDate(reply.createdBy.createdAt) }}
|
||||
</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]"
|
||||
@@ -123,7 +123,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<svg
|
||||
<!-- <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"
|
||||
@@ -145,7 +145,7 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</svg> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full md:w-[23.438vw] text-[#383E43]">
|
||||
@@ -162,8 +162,8 @@
|
||||
<div class="space-y-[5vw] md:space-y-[1vw]">
|
||||
<div class="flex gap-[1vw]">
|
||||
<img
|
||||
v-if="authUser?.avatarMedia"
|
||||
:src="authUser.avatarMedia"
|
||||
v-if="authUser?.user.avatarMedia"
|
||||
:src="authUser.user.avatarMedia"
|
||||
alt=""
|
||||
class="h-[8.256vw0] md:h-[3.385vw] w-[10.256vw] md:w-[3.385vw] rounded-[50%]"
|
||||
/>
|
||||
@@ -177,7 +177,7 @@
|
||||
class="space-y-[2vw] mt-[1vw] md:mt-0 ms-[1vw] md:ms-0 md:space-y-0"
|
||||
>
|
||||
<p class="text-[3.59vw] md:text-[0.938vw]">
|
||||
{{ authUser?.name ? authUser.name : "کاربر مهمان" }}
|
||||
{{ authUser?.user.name ? authUser.user.name : "کاربر مهمان" }}
|
||||
</p>
|
||||
<p
|
||||
v-if="replayTarget === null"
|
||||
@@ -223,7 +223,15 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
if (process.client) {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: "smooth",
|
||||
});
|
||||
|
||||
}
|
||||
import { useToast } from "vue-toastification";
|
||||
import {jDate} from "../../utils/jDate"
|
||||
const toast = useToast();
|
||||
const route = useRoute();
|
||||
const replayTarget = ref(null);
|
||||
@@ -235,13 +243,21 @@ const { data, refresh } = await useFetch("/api/productId", {
|
||||
id: route.params.product,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const myCourses = await useFetch("/api/auth/me");
|
||||
myCourses.data.value?.course.forEach((element) => {
|
||||
if (element.id === route.params.product) {
|
||||
|
||||
var ids = []
|
||||
myCourses.data.value?.user.course.forEach((element) => {
|
||||
ids.push(element.id)
|
||||
|
||||
|
||||
if (ids.includes(route.params.product)) {
|
||||
access.value = true;
|
||||
} else {
|
||||
access.value = false;
|
||||
}
|
||||
|
||||
});
|
||||
const comment = ref(null);
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
<p
|
||||
class="text-[3.59vw] md:text-[1.055vw] font-[600] text-[#383E43]"
|
||||
>
|
||||
{{ myCourses.data.value.course.length }}
|
||||
{{ myCourses.data.value.user.course.length }}
|
||||
دوره
|
||||
</p>
|
||||
<p
|
||||
@@ -361,8 +361,8 @@
|
||||
|
||||
<div class="flex justify-center items-center flex-col mt-[1.823vw]">
|
||||
<img
|
||||
v-if="authUser.avatarMedia"
|
||||
:src="authUser.avatarMedia"
|
||||
v-if="authUser.user.avatarMedia"
|
||||
:src="authUser.user.avatarMedia"
|
||||
class="h-[27.949vw] md:h-[7.24vw] w-[27.949vw] md:w-[7.24vw] rounded-full"
|
||||
alt=""
|
||||
/>
|
||||
@@ -376,12 +376,12 @@
|
||||
<p
|
||||
class="text-[4.038vw] md:text-[0.938vw] text-[#383E43] font-semibold mt-[1.25vw]"
|
||||
>
|
||||
{{ authUser.name ? authUser.name : 'کاربر مهمان' }}
|
||||
{{ authUser.user.name ? authUser.user.name : 'کاربر مهمان' }}
|
||||
</p>
|
||||
<p
|
||||
class="font-[400] text-[3.19vw] md:text-[0.833vw] text-[#878787] mt-[0.417vw]"
|
||||
>
|
||||
{{ authUser.userName ? authUser.userName + '@' : 'نام کاربری'}}
|
||||
{{ authUser.user.userName ? authUser.user.userName + '@' : 'نام کاربری'}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -521,12 +521,13 @@
|
||||
const tickets = await useFetch("/api/ticket/getTickets");
|
||||
const lastTickets = tickets?.data?.value.result.slice(-2);
|
||||
const myCourses = await useFetch("/api/auth/me");
|
||||
const lastCourses = myCourses.data?.value.course.slice(-2);
|
||||
|
||||
const lastCourses = myCourses.data?.value.com.slice(-2);
|
||||
const balance = await useFetch("/api/user/balance");
|
||||
const { authUser } = useAuth();
|
||||
|
||||
const today = new Date(); // تاریخ امروز
|
||||
const pastDate = new Date(authUser.value.createdAt); // تاریخ گذشته
|
||||
const pastDate = new Date(authUser.value.user.createdAt); // تاریخ گذشته
|
||||
|
||||
// تفاوت زمانی را محاسبه میکنیم
|
||||
const timeDifference = today.getTime() - pastDate.getTime();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<tab :name=tab1>
|
||||
<div class="me-[4vw] grid grid-cols-1 md:grid-cols-3 mt-[6vw] md:mt-[1.25vw] gap-[1vw]">
|
||||
|
||||
<div v-for="item in myCourses.data.value.course" :key="item.id">
|
||||
<div v-for="item in myCourses.data.value.com" :key="item.id">
|
||||
<ProgressCard :item="item"/>
|
||||
|
||||
</div>
|
||||
@@ -13,14 +13,21 @@
|
||||
<tab :name=tab2>
|
||||
<div class="me-[4vw] grid grid-cols-1 md:grid-cols-3 mt-[6vw] md:mt-[1.25vw] gap-[1vw]">
|
||||
|
||||
<div v-for="item in myCourses.data.value.course" :key="item.id">
|
||||
<div v-for="item in myCourses.data.value.com" :key="item.id" v-show="item.completionPercentage < 99">
|
||||
|
||||
<ProgressCard :item="item"/>
|
||||
</div>
|
||||
</div>
|
||||
</tab>
|
||||
<tab :name=tab3>
|
||||
<div class="me-[4vw] grid grid-cols-1 md:grid-cols-3 mt-[6vw] md:mt-[1.25vw] gap-[1vw]">
|
||||
|
||||
<div v-for="item in myCourses.data.value.com" :key="item.id" v-show="item.completionPercentage > 99">
|
||||
|
||||
<ProgressCard :item="item"/>
|
||||
</div>
|
||||
</div>
|
||||
</tab>
|
||||
<!-- <tab :name=tab3>
|
||||
محتوا سوم
|
||||
</tab> -->
|
||||
<tab :name=tab4>
|
||||
|
||||
</tab>
|
||||
|
||||
+11
-10
@@ -2,8 +2,8 @@
|
||||
<div class="flex justify-between flex-col text-[#383E43]">
|
||||
<div class="relative">
|
||||
<img
|
||||
v-if="authUser.avatarMedia"
|
||||
:src="authUser.avatarMedia"
|
||||
v-if="authUser.user.avatarMedia"
|
||||
:src="authUser.user.avatarMedia"
|
||||
class="w-[40.256vw] md:w-[8.177vw] h-[40.256vw] md:h-[8.177vw] rounded-[50%]"
|
||||
alt="profile"
|
||||
/>
|
||||
@@ -88,7 +88,7 @@
|
||||
:actions="false"
|
||||
>
|
||||
<div
|
||||
class="relative items-center gap-[5vw] md:gap-0 grid grid-cols-1 md:grid-cols-2 mt-[2vw] w-full md:w-[65%]"
|
||||
class="relative items-center gap-[5vw] md:gap-0 grid grid-cols-1 md:grid-cols-2 mt-[2vw] w-full md:w-[65%] pb-[20vw] md:pb-0"
|
||||
>
|
||||
<div class="flex flex-col space-y-[0.2vw] mb-[0.5vw]">
|
||||
<label for="" class="text-[3.19vw] md:text-[0.833vw] font-[400]"
|
||||
@@ -97,7 +97,7 @@
|
||||
<input
|
||||
type="text"
|
||||
name="name"
|
||||
:value="data?.phone"
|
||||
:value="data?.user.phone"
|
||||
readonly
|
||||
class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw] px-[1vw]"
|
||||
/>
|
||||
@@ -108,7 +108,7 @@
|
||||
>
|
||||
<FormKit
|
||||
name="name"
|
||||
:value="data?.name"
|
||||
:value="data?.user.name"
|
||||
type="text"
|
||||
input-class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw] px-[1vw]"
|
||||
/>
|
||||
@@ -119,7 +119,7 @@
|
||||
>
|
||||
<FormKit
|
||||
name="userName"
|
||||
:value="data?.userName"
|
||||
:value="data?.user.userName"
|
||||
type="text"
|
||||
input-class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw] px-[1vw]"
|
||||
/>
|
||||
@@ -130,14 +130,14 @@
|
||||
>
|
||||
<FormKit
|
||||
name="email"
|
||||
:value="data?.email"
|
||||
:value="data?.user.email"
|
||||
type="text"
|
||||
input-class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw] px-[1vw]"
|
||||
/>
|
||||
</div>
|
||||
<FormKit
|
||||
input-class="
|
||||
text-[3.59vw] md:text-[0.833vw] absolute md:left-[1vw] top-[80vw] md:top-[11vw] greenButton h-[13.59vw]
|
||||
text-[3.59vw] md:text-[0.833vw] absolute md:left-[1vw] top-[100vw] md:top-[11vw] greenButton h-[13.59vw]
|
||||
md:h-[2.813vw] w-full md:w-[8.438vw] rounded-[2.564vw] md:rounded-[0.521vw] flexBox px-0
|
||||
"
|
||||
type="submit"
|
||||
@@ -160,7 +160,8 @@ const loading = ref(false);
|
||||
const {data, refresh} = await useFetch('/api/auth/me')
|
||||
|
||||
const edit = async (formData) => {
|
||||
authUser.value.name = formData.name
|
||||
authUser.value.user.name = formData.name
|
||||
authUser.value.user.userName = formData.userName
|
||||
try {
|
||||
loading.value = true;
|
||||
await $fetch("/api/user/update", {
|
||||
@@ -194,7 +195,7 @@ async function changePhoto(val) {
|
||||
avatarMedia: data.data.value.url
|
||||
},
|
||||
});
|
||||
authUser.value.avatarMedia = data.data.value.url
|
||||
authUser.value.user.avatarMedia = data.data.value.url
|
||||
// profileImage.value = data.data.value.url
|
||||
toast.success('تصویر پروفایل تغییر کرد')
|
||||
refresh()
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<div class="basis-2/6 flex items-center justify-end gap-[1vw]">
|
||||
<button
|
||||
@click="openTicket(ticket.id)"
|
||||
class="hidden md:block text-[0.741vw] bg-[#F5F5F5] text-[#878787] h-[2.135vw] w-[3.646vw] rounded-[0.521vw]"
|
||||
class="text-[2.5vw] md:text-[0.741vw] bg-[#F5F5F5] text-[#878787] h-[7vw] md:h-[2.135vw] w-[12vw] md:w-[3.646vw] rounded-[1vw] md:rounded-[0.521vw]"
|
||||
>
|
||||
مشاوره
|
||||
</button>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<li
|
||||
v-for="(item, index) in payments.data.value"
|
||||
:key="index"
|
||||
class="flex justify-between items-center"
|
||||
class="py-[2vw] border-b md:py-0 md:border-none flex justify-between items-center"
|
||||
>
|
||||
|
||||
<p class="text-[3.59vw] md:text-[0.938vw] text-[#383E43]">
|
||||
@@ -48,7 +48,7 @@
|
||||
v-for="(item, index) in payments.data.value"
|
||||
:key="index"
|
||||
v-show="item.reason === 'deposit'"
|
||||
class="flex justify-between items-center"
|
||||
class="py-[2vw] border-b md:py-0 md:border-none flex justify-between items-center"
|
||||
>
|
||||
<p class="text-[3.59vw] md:text-[0.938vw] text-[#383E43]">
|
||||
{{ item.reason === 'deposit' ? 'افزایش موجودی' : 'کاهش موجودی'}}
|
||||
@@ -80,7 +80,7 @@
|
||||
v-for="(item, index) in payments.data.value"
|
||||
:key="index"
|
||||
v-show="item.reason === 'withdrawal'"
|
||||
class="flex justify-between items-center"
|
||||
class="py-[2vw] border-b md:py-0 md:border-none flex justify-between items-center"
|
||||
>
|
||||
<p class="text-[3.59vw] md:text-[0.938vw] text-[#383E43]">
|
||||
{{ item.reason === 'deposit' ? 'افزایش موجودی' : 'کاهش موجودی'}}
|
||||
@@ -157,7 +157,7 @@
|
||||
</p>
|
||||
<div class="pt-[10vw] md:pt-0 space-y-[3vw] md:space-y-[1vw]">
|
||||
<p class="text-[3.19vw] md:text-[0.833vw] text-[#383E43]">
|
||||
مبلغ مورد نظر <span v-if="price > 0" class="text-[0.6vw] font-bold text-end">{{ numberFormat(price) }} تومان</span>
|
||||
مبلغ مورد نظر <span v-if="price > 0" class="text-[2vw] md:text-[0.6vw] font-bold text-end">{{ numberFormat(price) }} تومان</span>
|
||||
</p>
|
||||
<input
|
||||
v-model="price"
|
||||
|
||||
Reference in New Issue
Block a user