From d2f71b6b14585e58019a1609adf09cf7004dc5dc Mon Sep 17 00:00:00 2001 From: HAM!DREZA Date: Tue, 2 Jul 2024 18:19:51 +0330 Subject: [PATCH] fixed faq bugs --- assets/css/tailwind.css | 1 + components/Card.vue | 2 +- components/ProgressCard.vue | 1 - components/home-page/Intro.vue | 2 +- components/product-page/Attended-course.vue | 41 ++-- .../attended-courses/Headlines.vue | 1 - .../course-details/Course-information.vue | 2 + .../course-details/Course-status.vue | 6 +- .../course-details/Description.vue | 32 +-- .../product-page/course-details/Header.vue | 49 ++-- .../product-page/course-details/Headlines.vue | 25 -- layouts/default.vue | 6 +- layouts/profile.vue | 7 +- pages/[product]/index.vue | 12 +- pages/account/index.vue | 10 +- pages/account/profile.vue | 23 +- pages/account/tickets.vue | 17 +- pages/frequently-questions/index.vue | 224 +++++++----------- server/api/course copy.js | 24 -- server/api/faq.js | 20 ++ server/api/ticket/id.js | 7 +- 21 files changed, 205 insertions(+), 307 deletions(-) delete mode 100644 server/api/course copy.js create mode 100644 server/api/faq.js diff --git a/assets/css/tailwind.css b/assets/css/tailwind.css index ec412bf..7fd4f50 100644 --- a/assets/css/tailwind.css +++ b/assets/css/tailwind.css @@ -13,6 +13,7 @@ body { font-family: "Iransans"; direction: rtl; + overflow-x: hidden !important; } @layer utilities { .pinkShadow { diff --git a/components/Card.vue b/components/Card.vue index fe63e8c..2aaa36d 100644 --- a/components/Card.vue +++ b/components/Card.vue @@ -129,7 +129,7 @@ - {{props.course.averageRating}} + {{props.course.averageRating}} diff --git a/components/ProgressCard.vue b/components/ProgressCard.vue index cb983fd..2f06d6a 100644 --- a/components/ProgressCard.vue +++ b/components/ProgressCard.vue @@ -47,7 +47,6 @@ const props = defineProps(['item']); const router = useRouter() const route = useRoute() -console.log(props); const change = () =>{ router.replace(`/${props.item.id}`) } diff --git a/components/home-page/Intro.vue b/components/home-page/Intro.vue index 2e8bbfa..50c41b0 100644 --- a/components/home-page/Intro.vue +++ b/components/home-page/Intro.vue @@ -3,7 +3,7 @@
-

+

{{ headers.data?.value.header }}

- 02:24 + {{ convertStoMs(item.time) }} پیشرفت شما - {{ progress.completionPercentage }}% + {{ Math.floor(progress.completionPercentage) }}%
{ - addToProgress(); reload(); if (process.client) { document.querySelector(".next").classList.remove("hidden"); } - toast.success('ویدیو به پایان رسید'); + toast.success("ویدیو به پایان رسید"); }; const sendComment = async () => { @@ -567,7 +579,6 @@ if (query.value.hasOwnProperty("episode")) { fileName: fimd.videoUrl, }, }); - console.log("video", getUrl.data.value.url); url.value = getUrl.data.value.url; index.value = data.value.indexOf(fimd); refresh(); @@ -602,21 +613,21 @@ async function chengeVideo(item) { await refresh(); } -console.log("yek", data.value[index.value]); + async function nextHandler() { if (process.client) { document.querySelector(".next").classList.add("hidden"); } query.value = { ...route.query, episode: data.value[index.value + 1].id }; index.value = index.value + 1; - console.log("index", index); + // const addToProgress = await $fetch("/api/progressCounter", { // method: "POST", // body: { // id: route.query.episode, // }, // }); -addToProgress() + addToProgress(); activeHead.value = data.value[index.value]; const getUrl = await useFetch("/api/checkMedia", { query: { diff --git a/components/product-page/attended-courses/Headlines.vue b/components/product-page/attended-courses/Headlines.vue index a940e03..962c6ad 100644 --- a/components/product-page/attended-courses/Headlines.vue +++ b/components/product-page/attended-courses/Headlines.vue @@ -147,5 +147,4 @@ \ No newline at end of file diff --git a/components/product-page/course-details/Course-information.vue b/components/product-page/course-details/Course-information.vue index 7f807e9..9bfbd8f 100644 --- a/components/product-page/course-details/Course-information.vue +++ b/components/product-page/course-details/Course-information.vue @@ -262,6 +262,8 @@ import { useToast } from "vue-toastification"; const { authUser } = useAuth(); const props = defineProps(["props"], ["access"]); + + const toast = useToast() const router = useRouter() const paymentHandler = (id) => { diff --git a/components/product-page/course-details/Course-status.vue b/components/product-page/course-details/Course-status.vue index a36dd7a..99b2470 100644 --- a/components/product-page/course-details/Course-status.vue +++ b/components/product-page/course-details/Course-status.vue @@ -61,8 +61,8 @@ class="mt-[3vw] md:mt-[0.7vw] h-[2.051vw] md:h-[0.521vw] rounded-[2vw] md:rounded-[0.521vw]" >
@@ -75,7 +75,7 @@ \ No newline at end of file diff --git a/server/api/course copy.js b/server/api/course copy.js deleted file mode 100644 index 9932f3b..0000000 --- a/server/api/course copy.js +++ /dev/null @@ -1,24 +0,0 @@ -export default defineEventHandler(async (event) => { - const { public: { apiBase } } = useRuntimeConfig(); - - const query = getQuery(event); - let category = query.hasOwnProperty('category') ? `categoryId=${query.category}` : ''; - let page = query.hasOwnProperty('page') ? `page=${query.page}` : ''; - // let sortBy = query.hasOwnProperty('sortBy') ? `price=${query.price}` : ''; - let price = query.hasOwnProperty('price') ? `price=${query.price}` : ''; - let name = query.hasOwnProperty('name') ? `name=${query.name}` : ''; - try { - const data = await $fetch(`${apiBase}/course?${category}&${page}&pageSize=2&${price}&${name}`, { - method: 'GET', - headers: { - 'Accept': 'application/json', - 'content-type': 'application/json' - - } - }); - return data; - } catch (error) { - return error; - } - -}); \ No newline at end of file diff --git a/server/api/faq.js b/server/api/faq.js new file mode 100644 index 0000000..6162412 --- /dev/null +++ b/server/api/faq.js @@ -0,0 +1,20 @@ +export default defineEventHandler(async (event) => { + const { public: { apiBase } } = useRuntimeConfig(); + const token = getCookie(event, 'token'); + + const query = getQuery(event); + + try { + const data = await $fetch(`${apiBase}/common/faq/faq`, { + method: 'GET', + headers: { + 'Accept': 'application/json', + } + }); + + return data; + } catch (error) { + return error; + } + +}); \ No newline at end of file diff --git a/server/api/ticket/id.js b/server/api/ticket/id.js index a42814f..e56f136 100644 --- a/server/api/ticket/id.js +++ b/server/api/ticket/id.js @@ -1,16 +1,15 @@ export default defineEventHandler(async (event) => { - const { public: { apiBase } } = useRuntimeConfig(); const token = getCookie(event, 'token'); const body = await readBody(event); + const query = getQuery(event); try { - const data = await $fetch(`${apiBase}/ticket/${body.id}`, { + const data = await $fetch(`${apiBase}/ticket/${query.id}`, { method: 'GET', headers: { 'Accept': 'application/json', 'Authorization': `Bearer ${token}` - }, - id: body.id + } }); return data; } catch (error) {