update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<NuxtLoadingIndicator color="#ffbe33" duration="1" throttle="0"/>
|
<NuxtLoadingIndicator color="#ffbe33" :duration="1" :throttle="0"/>
|
||||||
<NuxtLayout />
|
<NuxtLayout />
|
||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
<NuxtLayout name="footer"/>
|
<NuxtLayout name="footer"/>
|
||||||
|
|||||||
+16
-6
@@ -3,8 +3,8 @@
|
|||||||
<div class="relative text-center h-[56.154vw] md:h-[11.406vw]">
|
<div class="relative text-center h-[56.154vw] md:h-[11.406vw]">
|
||||||
<p
|
<p
|
||||||
class="post w-[30.769vw] md:w-[6.979vw] h-[9.487vw] md:h-[2.24vw] flexBox text-[3.59vw] md:text-[0.938vw] absolute left-0 bottom-0 bg-white rounded-tr-[3.59vw] md:rounded-tr-[0.781vw]">
|
class="post w-[30.769vw] md:w-[6.979vw] h-[9.487vw] md:h-[2.24vw] flexBox text-[3.59vw] md:text-[0.938vw] absolute left-0 bottom-0 bg-white rounded-tr-[3.59vw] md:rounded-tr-[0.781vw]">
|
||||||
{{props.course?.price}},000
|
{{props.course?.price == 0 ? 'رایگان' : props.course?.price + ',000'}}
|
||||||
<span class="ms-[1vw] md:ms-[0.2vw] text-[2.236vw] md:text-[0.585vw]">تومان</span>
|
<span v-if="!props.course?.price == 0" class="ms-[1vw] md:ms-[0.2vw] text-[2.236vw] md:text-[0.585vw]">تومان</span>
|
||||||
</p>
|
</p>
|
||||||
<NuxtImg style="object-fit: cover;" :src="props.course?.image" alt="laravel"
|
<NuxtImg style="object-fit: cover;" :src="props.course?.image" alt="laravel"
|
||||||
:placeholder="[30, 20]"
|
:placeholder="[30, 20]"
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<div class="w-[69.231vw] md:w-[16vw] space-y-[9vw] md:space-y-[1.4vw] mt-[4vw] md:mt-[0vw] xl:mt-[0.7vw]">
|
<div class="w-[69.231vw] md:w-[16vw] space-y-[9vw] md:space-y-[1.4vw] mt-[4vw] md:mt-[0vw] xl:mt-[0.7vw]">
|
||||||
<h1
|
<h1
|
||||||
class="hover:text-primaryGreen text-[3.59vw] md:text-[0.833vw] text-[#383E43] w-full">
|
class="hover:text-primaryGreen text-[3.59vw] md:text-[0.833vw] text-[#383E43] w-full">
|
||||||
{{props.course?.name}}
|
{{hideEndOfString(props.course?.name)}}
|
||||||
</h1>
|
</h1>
|
||||||
<div class="flex justify-between text-[3.614vw] md:text-[0.658vw]">
|
<div class="flex justify-between text-[3.614vw] md:text-[0.658vw]">
|
||||||
<p class="flex items-center text-[#878787]">
|
<p class="flex items-center text-[#878787]">
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<span @click="change">
|
<span>
|
||||||
<svg class="mt-[0.5vw] w-[8.718vw] md:w-[2.24vw] h-[8.718vw] md:h-[2.24vw]" viewBox="0 0 44 46"
|
<svg class="mt-[0.5vw] w-[8.718vw] md:w-[2.24vw] h-[8.718vw] md:h-[2.24vw]" viewBox="0 0 44 46"
|
||||||
fill="none" xmlns="http://www.w3.org/2000/svg">
|
fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path
|
<path
|
||||||
@@ -143,10 +143,20 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { useToast } from 'vue-toastification'
|
import { useToast } from 'vue-toastification'
|
||||||
const props = defineProps(['course']);
|
const props = defineProps(['course']);
|
||||||
|
const MyArray = ['Salam','Man','Sadegh','Hastam'];
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
const change = () =>{
|
|
||||||
toast.error('متن تست')
|
function hideEndOfString(inputString) {
|
||||||
|
const words = inputString.split(' ');
|
||||||
|
if (words.length > 8) {
|
||||||
|
const truncatedWords = words.slice(0, 8);
|
||||||
|
return truncatedWords.join(' ') + '...';
|
||||||
|
} else {
|
||||||
|
return inputString;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.post::before {
|
.post::before {
|
||||||
|
|||||||
@@ -1,53 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
|
||||||
id="filters"
|
|
||||||
class="text-[#333333] rounded-t-[4.103vw] p-[5vw] flex flex-col fixed bg-white bottom-0 left-0 z-[1000] h-[80.769vw] translate-y-[80.769vw] duration-500 w-[100vw]"
|
|
||||||
>
|
|
||||||
<div class="flex items-center justify-between w-full">
|
|
||||||
<span class="text-[3.59vw]">مرتب سازی بر اساس</span>
|
|
||||||
<svg
|
|
||||||
@click="closeSortOptions"
|
|
||||||
class="w-[5.641vw] h-[5.641vw]"
|
|
||||||
viewBox="0 0 22 22"
|
|
||||||
fill="none"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M6.41663 6.41675L15.5833 15.5834M6.41663 15.5834L15.5833 6.41675"
|
|
||||||
stroke="#878787"
|
|
||||||
stroke-width="1.5"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="mt-[4vw] text-[3.19vw] px-[2vw]">
|
|
||||||
<li class="border-b py-[4vw] flex justify-between items-center">
|
|
||||||
<span>
|
|
||||||
همه ی دوره ها
|
|
||||||
</span>
|
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M20 7L10 17L5 12" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
||||||
</svg>
|
|
||||||
</li>
|
|
||||||
<li class="border-b py-[4vw]">دوره های رایگان</li>
|
|
||||||
<li class="border-b py-[4vw]">ارزانترین</li>
|
|
||||||
<li class="py-[4vw]">گرانترین</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const closeSortOptions = () => {
|
|
||||||
if (process.client) {
|
|
||||||
document.getElementById("brightnessFilter").style.filter = "none";
|
|
||||||
document.getElementById("brightnessFilter").style.backdropFilter = "none";
|
|
||||||
document.getElementById("filters").classList.add("translate-y-[80.769vw]");
|
|
||||||
document
|
|
||||||
.getElementsByTagName("html")[0]
|
|
||||||
.classList.remove("overflow-hidden");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
>
|
>
|
||||||
دوره های پیشنهادی
|
دوره های پیشنهادی
|
||||||
</h5>
|
</h5>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="mt-[4.051vw] md:mt-[2.1vw] grid gap-[4vw] md:gap-[1.25vw] grid-cols-1 md:grid-cols-4"
|
class="mt-[4.051vw] md:mt-[2.1vw] grid gap-[4vw] md:gap-[1.25vw] grid-cols-1 md:grid-cols-4"
|
||||||
>
|
>
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
<Card :course="course" />
|
<Card :course="course" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -324,8 +324,6 @@ async function logout(){
|
|||||||
.scrol::-webkit-scrollbar {
|
.scrol::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hide scrollbar for IE, Edge and Firefox */
|
|
||||||
.scrol {
|
.scrol {
|
||||||
-ms-overflow-style: none; /* IE and Edge */
|
-ms-overflow-style: none; /* IE and Edge */
|
||||||
scrollbar-width: none; /* Firefox */
|
scrollbar-width: none; /* Firefox */
|
||||||
|
|||||||
@@ -131,15 +131,13 @@ const { authUser } = useAuth();
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
const edit = async(formData) => {
|
const edit = async(formData) => {
|
||||||
console.log('form :',formData);
|
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
await $fetch('/api/user/update', {
|
await $fetch('/api/user/update', {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
body: formData
|
body: formData
|
||||||
})
|
})
|
||||||
// toast.success("ویرایش اطلاعات شما باموفقیت انجام شد");
|
location.reload()
|
||||||
location.reload()
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.error(error)
|
toast.error(error)
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -406,7 +406,6 @@ const sendTicket = async () => {
|
|||||||
load()
|
load()
|
||||||
addTicketForm.value = false;
|
addTicketForm.value = false;
|
||||||
subject.value = null;
|
subject.value = null;
|
||||||
console.log('تیکت',data);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+188
-27
@@ -67,7 +67,34 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
|
||||||
|
<div class="mt-[10vw] md:mt-[2.5vw] md:px-[1.6vw] w-full flex gap-[1vw] md:gap-[0.5vw] scrol relative overflow-auto whitespace-nowrap">
|
||||||
|
<p
|
||||||
|
:class="{'bg-primaryGreen text-white' : !route.query.hasOwnProperty('category')}"
|
||||||
|
@click="removeCategory()"
|
||||||
|
class="flexBox cursor-pointer
|
||||||
|
py-[2.051vw] md:py-[0.625vw] rounded-[2.051vw] md:rounded-[0.521vw]
|
||||||
|
border-[1px] border-primaryGreen text-primaryGreen
|
||||||
|
text-[3.59vw] md:text-[1.055vw]
|
||||||
|
px-[3.5vw] md:px-[1.5vw] font-semibold thin
|
||||||
|
">همه دسته بندی ها</p>
|
||||||
|
<p class="flexBox cursor-pointer
|
||||||
|
py-[2.051vw] md:py-[0.625vw] rounded-[2.051vw] md:rounded-[0.521vw]
|
||||||
|
border-[1px] border-primaryGreen text-primaryGreen
|
||||||
|
text-[3.59vw] md:text-[1.055vw]
|
||||||
|
px-[3.5vw] md:px-[1.5vw] font-semibold thin
|
||||||
|
"
|
||||||
|
:class="{'bg-primaryGreen text-white' : route.query.hasOwnProperty('category') && route.query.category == slide.id }"
|
||||||
|
v-for="slide in categories"
|
||||||
|
:key="slide.id"
|
||||||
|
@click="selectCategory(slide.id)"
|
||||||
|
>{{slide.name}}</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <div
|
||||||
class="flexBox px-0 md:px-[1vw] h-[2.813vw] mt-[10vw] md:mt-[2.5vw]"
|
class="flexBox px-0 md:px-[1vw] h-[2.813vw] mt-[10vw] md:mt-[2.5vw]"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -83,6 +110,8 @@
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Carousel
|
<Carousel
|
||||||
dir="rtl"
|
dir="rtl"
|
||||||
:items-to-show="2"
|
:items-to-show="2"
|
||||||
@@ -115,11 +144,11 @@
|
|||||||
class="fill-[#878787] hover:fill-[#383E43]"
|
class="fill-[#878787] hover:fill-[#383E43]"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="suggestions px-[1vw] md:px-[1.042vw] mt-[12vw] md:mt-[3.3vw] md:bg-white rounded-[0.781vw] flex flex-col gap-[0.417vw] pb-[1.667vw]"
|
class="suggestions px-[1vw] md:px-[1.042vw] mt-[5vw] md:mt-[3.3vw] md:bg-white rounded-[0.781vw] flex flex-col gap-[0.417vw] pb-[1.667vw]"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ps-[1.5vw] border-b-[0.104vw] mt-[2vw] flex gap-x-[1vw] items-center text-[0.833vw] text-[#878787]"
|
class="ps-[1.5vw] border-b-[0.104vw] mt-[2vw] flex gap-x-[1vw] items-center text-[0.833vw] text-[#878787]"
|
||||||
@@ -192,10 +221,14 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<p
|
||||||
|
class="flexBox min-h-[8vw]"
|
||||||
|
v-if="data?.count < 1">محصولی جهت نمایش وجود ندارد !!!</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flexBox py-[5vw] md:py-[2vw]" dir="ltr">
|
<div class="flexBox py-[5vw] md:py-[2vw]" dir="ltr">
|
||||||
<ul
|
<ul
|
||||||
|
v-if="paginationLength > 2"
|
||||||
class="flexBox gap-[6vw] md:gap-[2vw] text-[4.038vw] md:text-[1.055vw] text-[#383E43]"
|
class="flexBox gap-[6vw] md:gap-[2vw] text-[4.038vw] md:text-[1.055vw] text-[#383E43]"
|
||||||
>
|
>
|
||||||
<li class="w-[1.5vw]">
|
<li class="w-[1.5vw]">
|
||||||
@@ -231,19 +264,19 @@
|
|||||||
{{ page }}
|
{{ page }}
|
||||||
</li> -->
|
</li> -->
|
||||||
<li
|
<li
|
||||||
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page < 7 || !route.query.hasOwnProperty('page')}"
|
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page < (paginationLength) || !route.query.hasOwnProperty('page')}"
|
||||||
class="w-[1.5vw] cursor-pointer" @click="nextPage(1)">{{pageNumber - 4}}</li>
|
class="w-[1.5vw] cursor-pointer" @click="nextPage(1)">{{pageNumber - 4}}</li>
|
||||||
|
|
||||||
<li
|
<li
|
||||||
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page < 6 || !route.query.hasOwnProperty('page')}"
|
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page < (paginationLength - 1) || !route.query.hasOwnProperty('page')}"
|
||||||
class="w-[1.5vw] cursor-pointer" @click="nextPage(1)">{{pageNumber - 3}}</li>
|
class="w-[1.5vw] cursor-pointer" @click="nextPage(1)">{{pageNumber - 3}}</li>
|
||||||
|
|
||||||
<li
|
<li
|
||||||
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page < 5 || !route.query.hasOwnProperty('page')}"
|
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page < (paginationLength - 2) || !route.query.hasOwnProperty('page')}"
|
||||||
class="w-[1.5vw] cursor-pointer" @click="nextPage(1)">{{pageNumber - 2}}</li>
|
class="w-[1.5vw] cursor-pointer" @click="nextPage(1)">{{pageNumber - 2}}</li>
|
||||||
|
|
||||||
<li
|
<li
|
||||||
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page == 1|| !route.query.hasOwnProperty('page')}"
|
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page == 1 || !route.query.hasOwnProperty('page')}"
|
||||||
class="w-[1.5vw] cursor-pointer" @click="prevPage">{{pageNumber - 1}}</li>
|
class="w-[1.5vw] cursor-pointer" @click="prevPage">{{pageNumber - 1}}</li>
|
||||||
|
|
||||||
|
|
||||||
@@ -251,7 +284,7 @@
|
|||||||
<li class="w-[1.5vw] cursor-pointer flexBox bg-primaryGreen text-white w-[7.692vw] md:w-[2.292vw] h-[7.692vw] md:h-[2.292vw] rounded-[50%]">{{pageNumber}}</li>
|
<li class="w-[1.5vw] cursor-pointer flexBox bg-primaryGreen text-white w-[7.692vw] md:w-[2.292vw] h-[7.692vw] md:h-[2.292vw] rounded-[50%]">{{pageNumber}}</li>
|
||||||
|
|
||||||
<li
|
<li
|
||||||
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page >= 7}"
|
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page >= paginationLength}"
|
||||||
class="w-[1.5vw] cursor-pointer" @click="nextPage(1)">{{parseInt(pageNumber) + 1}}</li>
|
class="w-[1.5vw] cursor-pointer" @click="nextPage(1)">{{parseInt(pageNumber) + 1}}</li>
|
||||||
|
|
||||||
|
|
||||||
@@ -261,7 +294,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="w-[1.5vw]" v-if="pageNumber < 5">...</li>
|
<li class="w-[1.5vw]" v-if="pageNumber < (paginationLength - 2)">...</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -269,7 +302,7 @@
|
|||||||
|
|
||||||
<li
|
<li
|
||||||
class="w-[1.5vw]"
|
class="w-[1.5vw]"
|
||||||
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page > 5}" @click="nextPage"
|
:class="{'hidden': route.query.hasOwnProperty('page') && route.query.page > (paginationLength - 2)}" @click="nextPage"
|
||||||
>{{paginationLength}}</li>
|
>{{paginationLength}}</li>
|
||||||
|
|
||||||
|
|
||||||
@@ -296,12 +329,89 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<courses-pageSort-filter />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div
|
||||||
|
id="filters"
|
||||||
|
class="text-[#333333] rounded-t-[4.103vw] p-[5vw] flex flex-col fixed bg-white bottom-0 left-0 z-[1000] h-[80.769vw] translate-y-[80.769vw] duration-500 w-[100vw]"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between w-full">
|
||||||
|
<span class="text-[3.59vw]">مرتب سازی بر اساس</span>
|
||||||
|
<svg
|
||||||
|
@click="closeSortOptions"
|
||||||
|
class="w-[5.641vw] h-[5.641vw]"
|
||||||
|
viewBox="0 0 22 22"
|
||||||
|
fill="none"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M6.41663 6.41675L15.5833 15.5834M6.41663 15.5834L15.5833 6.41675"
|
||||||
|
stroke="#878787"
|
||||||
|
stroke-width="1.5"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="mt-[4vw] text-[3.19vw] px-[2vw]">
|
||||||
|
<li
|
||||||
|
@click="() => {sortByHandler(''); closeSortOptions()}"
|
||||||
|
class="border-b py-[4vw] flex justify-between items-center">
|
||||||
|
<span>
|
||||||
|
همه ی دوره ها
|
||||||
|
</span>
|
||||||
|
<svg
|
||||||
|
class="hidden w-[6.154vw] h-[6.154vw]"
|
||||||
|
:class="{'!block' : !route.query.hasOwnProperty('price') || route.query.price == '' }"
|
||||||
|
viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M20 7L10 17L5 12" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
</li>
|
||||||
|
<li class="border-b py-[4vw] flex justify-between items-center" @click="() => {sortByHandler('free'); closeSortOptions()}">
|
||||||
|
<span>
|
||||||
|
دوره های رایگان
|
||||||
|
</span>
|
||||||
|
<svg
|
||||||
|
class="hidden w-[6.154vw] h-[6.154vw]"
|
||||||
|
:class="{'!block' : route.query.price == 'free' }"
|
||||||
|
viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M20 7L10 17L5 12" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
</li>
|
||||||
|
<li class="border-b py-[4vw] flex justify-between items-center" @click="() => {sortByHandler('low_to_high'); closeSortOptions()}">
|
||||||
|
<span>
|
||||||
|
ارزان ترین
|
||||||
|
</span>
|
||||||
|
<svg
|
||||||
|
class="hidden w-[6.154vw] h-[6.154vw]"
|
||||||
|
:class="{'!block' : route.query.price == 'low_to_high' }"
|
||||||
|
viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M20 7L10 17L5 12" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
</li>
|
||||||
|
<li class="py-[4vw] flex justify-between items-center" @click="() => {sortByHandler('high_to_low'); closeSortOptions()}">
|
||||||
|
<span>
|
||||||
|
ارزان ترین
|
||||||
|
</span>
|
||||||
|
<svg
|
||||||
|
class="hidden w-[6.154vw] h-[6.154vw]"
|
||||||
|
:class="{'!block' : route.query.price == 'high_to_low' }"
|
||||||
|
viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M20 7L10 17L5 12" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
@@ -312,23 +422,19 @@ const query = ref({});
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const pageNumber = ref(0);
|
const pageNumber = ref(0);
|
||||||
const tedad = ref(0)
|
|
||||||
console.log('tedad 1', tedad.value);
|
|
||||||
const paginationLength = ref(0);
|
const paginationLength = ref(0);
|
||||||
query.value = route.query;
|
query.value = route.query;
|
||||||
//console.log(route.query.page);
|
|
||||||
pageNumber.value = route.query.hasOwnProperty('page') ? route.query.page : 1
|
pageNumber.value = route.query.hasOwnProperty('page') ? route.query.page : 1
|
||||||
const { data, refresh, pending } = await useFetch(() => "/api/course", {
|
const { data, refresh, pending } = await useFetch(() => "/api/course", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
query: query,
|
query: query,
|
||||||
});
|
});
|
||||||
watch(data => {
|
|
||||||
if (Object.keys(route.query).length == 0) {
|
|
||||||
query.value = {},
|
|
||||||
refresh()
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
paginationLength.value = Math.ceil(data.value.count / 2);
|
paginationLength.value = Math.ceil(data.value.count / 2);
|
||||||
function changePage(page) {
|
function changePage(page) {
|
||||||
pageNumber.value = page;
|
pageNumber.value = page;
|
||||||
@@ -352,7 +458,7 @@ function prevPage(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function nextPage(num){
|
function nextPage(num){
|
||||||
if (pageNumber.value < 7) {
|
if (pageNumber.value < paginationLength.value) {
|
||||||
pageNumber.value++
|
pageNumber.value++
|
||||||
query.value = { ...route.query, page: pageNumber };
|
query.value = { ...route.query, page: pageNumber };
|
||||||
|
|
||||||
@@ -364,23 +470,60 @@ function nextPage(num){
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function removeCategory(){
|
||||||
|
if (query.value.hasOwnProperty("category")) {
|
||||||
|
delete query.value.category;
|
||||||
|
}
|
||||||
|
if (query.value.hasOwnProperty("page")) {
|
||||||
|
delete query.value.page;
|
||||||
|
}
|
||||||
|
if (query.value.hasOwnProperty("price")) {
|
||||||
|
delete query.value.price;
|
||||||
|
}
|
||||||
|
router.push({
|
||||||
|
path: "/courses",
|
||||||
|
query: query.value,
|
||||||
|
});
|
||||||
|
pageNumber.value = 1
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const categoryLis = await useFetch("/api/category");
|
const categoryLis = await useFetch("/api/category");
|
||||||
const categories = categoryLis.data.value;
|
const categories = categoryLis.data.value;
|
||||||
|
|
||||||
function selectCategory(id) {
|
function selectCategory(id) {
|
||||||
query.value = { ...route.query, category: id };
|
query.value = { ...route.query, category: id };
|
||||||
if (query.value.hasOwnProperty("page")) {
|
if (query.value.hasOwnProperty("page")) {
|
||||||
delete query.value.page;
|
delete query.value.page;
|
||||||
}
|
}
|
||||||
|
if (id === '') {
|
||||||
|
if (query.value.hasOwnProperty("category")) {
|
||||||
|
delete query.value.category;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
router.push({
|
router.push({
|
||||||
path: "/courses",
|
path: "/courses",
|
||||||
query: query.value,
|
query: query.value,
|
||||||
});
|
});
|
||||||
|
pageNumber.value = 1
|
||||||
refresh();
|
refresh();
|
||||||
|
watch(data , () => {
|
||||||
|
paginationLength.value = Math.ceil(data.value.count / 2);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sortByHandler(param){
|
function sortByHandler(param){
|
||||||
console.log(param);
|
|
||||||
query.value = { ...route.query, price: param };
|
query.value = { ...route.query, price: param };
|
||||||
|
|
||||||
if (param === '') {
|
if (param === '') {
|
||||||
@@ -389,6 +532,7 @@ function sortByHandler(param){
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
router.push({
|
router.push({
|
||||||
path: "/courses",
|
path: "/courses",
|
||||||
query: query.value,
|
query: query.value,
|
||||||
@@ -397,11 +541,6 @@ function sortByHandler(param){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
watch(data , () => {
|
|
||||||
paginationLength.value = Math.ceil(data.value.count / 2);
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
const openSortOptions = () => {
|
const openSortOptions = () => {
|
||||||
if (process.client) {
|
if (process.client) {
|
||||||
@@ -415,6 +554,20 @@ const openSortOptions = () => {
|
|||||||
"brightness(90%)";
|
"brightness(90%)";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const closeSortOptions = () => {
|
||||||
|
if (process.client) {
|
||||||
|
document.getElementById("brightnessFilter").style.filter = "none";
|
||||||
|
document.getElementById("brightnessFilter").style.backdropFilter = "none";
|
||||||
|
document.getElementById("filters").classList.add("translate-y-[80.769vw]");
|
||||||
|
document
|
||||||
|
.getElementsByTagName("html")[0]
|
||||||
|
.classList.remove("overflow-hidden");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -427,4 +580,12 @@ const openSortOptions = () => {
|
|||||||
height: 0.01vw;
|
height: 0.01vw;
|
||||||
top: 2vw;
|
top: 2vw;
|
||||||
}
|
}
|
||||||
|
.scrol::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.scrol {
|
||||||
|
-ms-overflow-style: none; /* IE and Edge */
|
||||||
|
scrollbar-width: none; /* Firefox */
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
+11
-26
@@ -1,39 +1,24 @@
|
|||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
const { public: { apiBase } } = useRuntimeConfig();
|
const { public: { apiBase } } = useRuntimeConfig();
|
||||||
|
|
||||||
const query = getQuery(event);
|
const query = getQuery(event);
|
||||||
console.log('server query :',query);
|
let category = query.hasOwnProperty('category') ? `categoryId=${query.category}` : '';
|
||||||
// const category = '/category/' + query.category
|
let page = query.hasOwnProperty('page') ? `page=${query.page}` : '';
|
||||||
let category = query.hasOwnProperty('category') ? `categoryId=${query.category}` : '';
|
// let sortBy = query.hasOwnProperty('sortBy') ? `price=${query.price}` : '';
|
||||||
let page = query.hasOwnProperty('page') ? `page=${query.page}` : '';
|
let price = query.hasOwnProperty('price') ? `price=${query.price}` : '';
|
||||||
let sortBy = query.hasOwnProperty('price') ? `price=${query.price}` : '';
|
try {
|
||||||
// const category = 'categoryId=66587ae698d0a0db14693a5e'
|
const data = await $fetch(`${apiBase}/course?${category}&${page}&pageSize=2&${price}`, {
|
||||||
// const page = 'page=1'
|
|
||||||
try {
|
|
||||||
const data = await $fetch(`${apiBase}/course?${category}&${page}&${sortBy}&pageSize=2`, {
|
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
|
'content-type': 'application/json'
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log('err :', error);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const page = ref(0);
|
|
||||||
|
|
||||||
// const { data, refresh } = await useFetch(() => '/api/global', {
|
|
||||||
// query: { url: '/orders', page },
|
|
||||||
// headers: useRequestHeaders(['cookie'])
|
|
||||||
// })
|
|
||||||
|
|
||||||
// function paginate(value) {
|
|
||||||
// page.value = value;
|
|
||||||
// refresh()
|
|
||||||
// }
|
|
||||||
@@ -3,7 +3,6 @@ export default defineEventHandler(async (event) => {
|
|||||||
const { public: { apiBase } } = useRuntimeConfig();
|
const { public: { apiBase } } = useRuntimeConfig();
|
||||||
const token = getCookie(event, 'token');
|
const token = getCookie(event, 'token');
|
||||||
const body = await readBody(event);
|
const body = await readBody(event);
|
||||||
console.log('badane :', body);
|
|
||||||
try {
|
try {
|
||||||
const data = await $fetch(`${apiBase}/ticket/${body.id}`, {
|
const data = await $fetch(`${apiBase}/ticket/${body.id}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ export default defineEventHandler(async (event) => {
|
|||||||
const { public: { apiBase } } = useRuntimeConfig();
|
const { public: { apiBase } } = useRuntimeConfig();
|
||||||
const token = getCookie(event, 'token');
|
const token = getCookie(event, 'token');
|
||||||
const body = await readBody(event);
|
const body = await readBody(event);
|
||||||
console.log(body);
|
|
||||||
try {
|
try {
|
||||||
const data = await $fetch(`${apiBase}/ticket`, {
|
const data = await $fetch(`${apiBase}/ticket`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ export default defineEventHandler(async (event) => {
|
|||||||
const body = await readBody(event);
|
const body = await readBody(event);
|
||||||
const { public: { apiBase } } = useRuntimeConfig();
|
const { public: { apiBase } } = useRuntimeConfig();
|
||||||
const token = getCookie(event, 'token');
|
const token = getCookie(event, 'token');
|
||||||
console.log(body);
|
|
||||||
try {
|
try {
|
||||||
const data = await $fetch(`${apiBase}/user/update`, {
|
const data = await $fetch(`${apiBase}/user/update`, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
|
|||||||
Reference in New Issue
Block a user