diff --git a/app/components/Landing.tsx b/app/components/Landing.tsx index 6faf06c..89c66bd 100644 --- a/app/components/Landing.tsx +++ b/app/components/Landing.tsx @@ -136,8 +136,8 @@ export default function Landing() { quality={100} key={index} className={cn( - " w-[80%] h-[80%] absolute left-2 top-6 group-hover:hidden max-md:h-[60%] max-md:w-[60%] max-md:left-auto", - item.id == 1 && "left-8" + " w-[80%] h-[80%] absolute left-8 top-6 group-hover:hidden max-md:h-[60%] max-md:w-[60%] max-md:left-auto", + item.id == 3 && "left-2" )} /> diff --git a/app/layout.tsx b/app/layout.tsx index 2fc9dcd..ab41acb 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -25,7 +25,7 @@ export default function RootLayout({ {/* */} -
{children}
+
{children}
diff --git a/components/CallUs.tsx b/components/CallUs.tsx index e585e97..7cf32ef 100644 --- a/components/CallUs.tsx +++ b/components/CallUs.tsx @@ -1,33 +1,55 @@ "use client"; import Image from "next/image"; -import React from "react"; +import React, { useEffect, useState } from "react"; import { callUsItems } from "@/constants"; +import { getSingleWebContents } from "@/utils/commonApi"; + import { cn } from "@/lib/utils"; const Map = dynamic(() => import("./Map"), { ssr: false, }); import dynamic from "next/dynamic"; +import { useQuery } from "@tanstack/react-query"; export default function CallUs(props: any) { const { position, zoom } = props; + // const [title, setTitle] = useState("CullUs"); + + + // const { data, isLoading, isError, refetch } = useQuery({ + // queryKey: ["WebContents", title], + // queryFn: () => getSingleWebContents(title), + // refetchOnWindowFocus: false, + // }); + // console.log(data); + + + // useEffect(() => { + // refetch(); + // }, [title, refetch]); + + // if (isLoading) { + // return

Loading...

; + // } + // if (isError) { + // return

Error fetching content.

; + // } + + // const fetchedContent = data?.content || ""; // Assuming your API response has a 'content' property + return (
-
- {/*  Logo1 */} - -
+ {/*
*/} + {/* */} -
+ {/* Display fetched content */} + {/*
*/} + {/*
*/} + +
{callUsItems.map((item) => { return ( diff --git a/components/ComplainsDetails.tsx b/components/ComplainsDetails.tsx index 6533ce0..584ccb3 100644 --- a/components/ComplainsDetails.tsx +++ b/components/ComplainsDetails.tsx @@ -6,11 +6,12 @@ import Image from "next/image"; import { ComplainDetailsItems } from "@/constants"; import { useMutation } from "@tanstack/react-query"; import useData from "@/store/useData"; -import { convertDate } from "@/lib/utils"; +import { convertDate , convertFullTime } from "@/lib/utils"; import { Badge } from "./ui/badge"; import InspectorOperations from "./InspectorOperations"; import { postComplaintTracking } from "@/utils/citizenApi"; -import { Button } from "@/components/ui/button"; +import { Button } from "@/components/ui/button"; + import { AlertDialog, AlertDialogAction, @@ -196,54 +197,12 @@ export default function ComplainsDetails({ )} -
-
-
-

- گزارش شکایت -

-
-

- موضوع شکایت:{" "} - - {data.title} - -

-

- دستگاه مربوطه:{" "} - - {data?.complaintOrganization - ? data?.complaintOrganization.title - : "-"} - -

-

- پرسنل مربوطه:{" "} - - {data.complaining ? data.complaining : "-"} - -

-

- زمان ثبت:{" "} - - {convertDate(data.registeredAt)} - -

- {/*

- {" "} - موضوع شکایت:{" "} - - متن تستی - -

*/} -
- {/*

- درخواست شما با کد رهگیری {data.trackingNumber} و رمز عبور 12422 در - دست بررسی و اقدام می باشد. در صورت تمایل می توانید با شماره تلفن - 0353286545 جهت پشتیبانی تماس حاصل کنید.{" "} -

*/} -
-
+ {/* Editt */} +
+ {/* 1 */} +
+ {/* ***** */} +

انجام عملیات

@@ -254,74 +213,186 @@ export default function ComplainsDetails({ />
-
-

روند شکایت

-
- {data.contents?.map((item: any) => { - return ( -
-
-

- {item.sender == 0 ? "شهروند" : "بازرس"} -

-

- تاریخ : - - {convertDate(item.dateTime)} - -

-
-
- - {item.text ? item.text : "-"} + + {/* 2 */} +
+
+ {data.user == null ? ( + <> +
+

+ اطلاعات کلی +

+

+ موضوع شکایت:{" "} + + {data?.title} -

- {/* {item.media.length !== 0 && ( +

+

+ دستگاه مربوطه:{" "} + + {data?.complaintOrganization + ? data?.complaintOrganization.title + : "-"} + +

+

+ فرد مربوطه:{" "} + + {data.complaining ? data.complaining : "-"} + +

+

+ زمان ثبت:{" "} + + {convertFullTime(data.registeredAt)} + +

+
+ + ) : ( + <> +
+

+ اطلاعات کلی +

+

+ موضوع شکایت:{" "} + + {data?.title} + +

+

+ دستگاه مربوطه:{" "} + + {data?.complaintOrganization + ? data?.complaintOrganization.title + : "-"} + +

+

+ فرد مربوطه:{" "} + + {data.complaining ? data.complaining : "-"} + +

+

+ زمان ثبت:{" "} + + {convertFullTime(data.registeredAt)} + +

+
+
+

+ اطلاعات شاکی +

+

+ نام:{" "} + + {data.user?.firstName ? data.user?.firstName : "-"} + +

+

+ نام خانوادگی:{" "} + + {data.user?.lastName ? data.user?.lastName : "-"} + +

+

+ کدملی:{" "} + + {data.user?.nationalId ? data.user?.nationalId : "-"} + +

+

+ شماره موبایل:{" "} + + {data.user?.phoneNumber + ? data.user?.phoneNumber + : "-"} + +

+
+ + )} +
+ +
+

روند شکایت

+
+ {data.contents?.map((item: any) => { + return ( +
+
+

+ + {item.sender == 0 ? "شهروند" : "بازرس"} + +

+

+ تاریخ : + + {convertDate(item.dateTime)} + +

+
+
+ + {item.text ? item.text : "-"} + +
+ {/* {item.media.length !== 0 && ( )} */} -
-
- {item?.media.map((item: any, index: number) => { - return ( -
-
- ); - })} + ); + })} +
-
+ + {/* 3 */} + {/* ****** */} +

انجام عملیات

@@ -331,45 +402,6 @@ export default function ComplainsDetails({ complaintData={data} />
- {/* Left */} - {/*
-

- وضعیت درخواست -

- - {ComplainDetailsItems.map((item, index, array) => { - return ( -
-
-
- {item.title} -
-
- {item.desc} -
-
- {item.date}
{item.time} -
-
- -
-
- greenIcon -
-
-
-
- ); - })} -
*/}
) : ( diff --git a/components/FollowResult.tsx b/components/FollowResult.tsx index ea24924..45db683 100644 --- a/components/FollowResult.tsx +++ b/components/FollowResult.tsx @@ -86,10 +86,10 @@ export default function FollowResult() { console.log(complaintPrintMutation?.data); return ( <> -
+
{complaintPrintMutation?.data ? ( <> -
+ {/*
+
*/}
-
+ {/*
-
+
*/} +

diff --git a/components/Navbar.tsx b/components/Navbar.tsx index c0ab279..e39a7e1 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -29,7 +29,7 @@ export default function Navbar() { } else { setAuth(false); } - }, [isAuth ,token]); + }, [isAuth, token]); return (
@@ -89,16 +89,21 @@ export default function Navbar() {
- log + + log + +
-

عیــون

-

سامانه افشای فساد شهرداری

+ +

عیــون

+

سامانه افشای فساد شهرداری

+
diff --git a/components/RequestResult.tsx b/components/RequestResult.tsx index 739747d..27c9761 100644 --- a/components/RequestResult.tsx +++ b/components/RequestResult.tsx @@ -7,12 +7,14 @@ import { useQuery, useQueryClient } from "@tanstack/react-query"; import { useRouter } from "next/navigation"; import { Button } from "./ui/button"; import { useReactToPrint } from "react-to-print"; +import { getSingleWebContents } from "@/utils/commonApi"; export default function Result() { const [trackingNumber, setTrackingNumber] = useState(); const [password, setPassword] = useState(); const componentRef = useRef(null); - + const [title, setTitle] = useState("AfterRegistration"); + const router = useRouter(); useEffect(() => { const tn = localStorage.getItem("trackingNumber"); @@ -23,17 +25,43 @@ export default function Result() { const handlePrint = useReactToPrint({ content: () => componentRef.current, - // onBeforePrint() { - // setPrintStyle(!printStyle); - // }, - // onAfterPrint() { - // setPrintStyle(!printStyle) - // }, }); + + // const [fetchedContent, setFetchedContent] = useState(""); + + const { data, isLoading, isError, refetch } = useQuery({ + queryKey: ["WebContents", title], + queryFn: () => getSingleWebContents(title), + refetchOnWindowFocus: false, + }); + console.log(data); + + useEffect(() => { + refetch(); + }, [title, refetch]); + + if (isLoading) { + return

Loading...

; + } + if (isError) { + return

Error fetching content.

; + } + + const fetchedContent = data?.content || ""; + return ( -
-
-

+

+ {/*

@@ -50,24 +78,46 @@ export default function Result() { {`${password}`} در سامانه عیون ثبت شده و شما می توانید نتیجه درخواست خود را از صفحه پیگیری درخواست، با استفاده از کد رهگیری و رمز عبور مشاهده کنید. +

*/} + + {/* Display fetched content */} +
+ +

+ کد پیگیری : + {`${trackingNumber}`}

- {/*
- -
*/} - + رمز عبور :{`${password}`} +

+ {/* icon + /> */}
- +
+ +
+ {/* icon */}
); } diff --git a/constants/index.tsx b/constants/index.tsx index 18a0736..6915163 100644 --- a/constants/index.tsx +++ b/constants/index.tsx @@ -21,7 +21,7 @@ export const sliderItems = [ export const boxItems = [ { id: 1, - name: "ثبت شکایت(ناشناس)", + name: "ثبت گزارش ها(ناشناس)", icon: "/img/box1.svg", icon2: "/img/box1-hover.svg", description: "ارسال درخواست نارضایتی از پرسنل", @@ -29,7 +29,7 @@ export const boxItems = [ }, { id: 2, - name: "ثبت شکایت", + name: "ثبت گزارش ها", icon: "/img/box1.svg", icon2: "/img/box1-hover.svg", description: "ارسال درخواست نارضایتی از پرسنل", @@ -37,7 +37,7 @@ export const boxItems = [ }, { id: 3, - name: "پیگیری شکایت", + name: "پیگیری گزارش ها", icon: "/img/box2.svg", icon2: "/img/box2-hover.svg", description: "پیگیری درخواست ارسال شده", @@ -117,14 +117,14 @@ export const callUsItems = [ id: 2, title: "نشانی الکترونیک", icon: , - description: "جهت ارتباط ما با باا شماره", + description: "جهت ارتباط ما با شماره", description2: "sotzani@gamil.com", }, { id: 3, title: "تماس با ما ", icon: , - description: "جهت ارتباط ما با باا شماره", + description: "جهت ارتباط ما با شماره", description2: "03531234567", }, ]; diff --git a/lib/utils.ts b/lib/utils.ts index 5fad103..d9ceeaa 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -20,6 +20,15 @@ export function convertDate(date: string) { return convertedDate; } + +export function convertFullTime(date: string) { + const convertedDate = dayjs(date) + .calendar("jalali") + .locale("fa") + .format(" HH:mm - YYYY/M/DD"); + return convertedDate; +} + export function Decrypt(encryptedData: string , privateKey: string) { const Key = `-----BEGIN RSA PRIVATE KEY----- MIICXAIBAAKBgQCfmb1aGcWsqJPp+v6e72CPngE6P6FoCZCJESwDTXUXiJiAKshB diff --git a/package-lock.json b/package-lock.json index e560ce5..441b59d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "sootzani", - "version": "0.1.6 ", + "version": "0.1.6", "dependencies": { "@hookform/resolvers": "^3.3.2", "@radix-ui/react-alert-dialog": "^1.0.5", diff --git a/tailwind.config.js b/tailwind.config.js index abbbe76..76b5726 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -18,6 +18,13 @@ module.exports = { extend: { backgroundImage: { mainBg: "url('/img/bg.png')", + 'request-result': "url('/img/result.png')", + }, + backgroundSize: { + 'auto': 'auto', + 'cover': 'cover', + 'contain': 'contain', + '50%': '50%', }, objectPosition: { "custom": "top 10px right 10px", diff --git a/utils/commonApi.ts b/utils/commonApi.ts index eba5289..30f6ffd 100644 --- a/utils/commonApi.ts +++ b/utils/commonApi.ts @@ -23,4 +23,16 @@ export async function getSliders() { const data = await axios.get("api/Common/Sliders"); console.log(data); return data.data; +} + +export async function getWebContents() { + const data = await axios.get("api/Common/Contents"); + console.log(data); + return data.data; } + +export async function getSingleWebContents( title: string ) { + const data = await axios.get(`api/Common/Contents/${title}`); + console.log(data); + return data.data; +} \ No newline at end of file