the Request , Tracking page in done

Kahdooei
yasaman 2023-12-28 19:53:46 +03:30
parent f0d4d976ca
commit b606b49ebf
6 changed files with 162 additions and 31 deletions

View File

@ -11,12 +11,12 @@ import bgimg from "../../public/img/bg.png";
import Footer from "@/components/Footer"; import Footer from "@/components/Footer";
// Import Swiper React components // Import Swiper React components
import { Swiper, SwiperSlide } from "swiper/react"; import { Swiper, SwiperSlide } from "swiper/react";
// Import Swiper styles // Import Swiper styles
import "swiper/css"; import "swiper/css";
import "swiper/css/pagination"; import "swiper/css/pagination";
// import required modules // import required modules
import { Pagination } from "swiper/modules"; import { Autoplay, Pagination, Navigation} from "swiper/modules";
import { sliderItems } from "@/constants"; import { sliderItems } from "@/constants";
export default function Landing() { export default function Landing() {
@ -26,9 +26,15 @@ export default function Landing() {
<Swiper <Swiper
slidesPerView={1} slidesPerView={1}
spaceBetween={0} spaceBetween={0}
autoplay={{
delay: 2500,
disableOnInteraction: false,
}}
loop={false}
pagination={{ pagination={{
clickable: true, clickable: true,
}} }}
modules={[Autoplay]}
className="mySwiper w-full h-full" className="mySwiper w-full h-full"
> >

View File

@ -4,6 +4,7 @@ import Image from "next/image";
import Resultimg from "../public/img/followResult.png"; import Resultimg from "../public/img/followResult.png";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { ThreeDots } from "react-loader-spinner";
import { import {
AlertDialog, AlertDialog,
@ -38,10 +39,11 @@ export default function FollowResult() {
onSuccess: (res) => { onSuccess: (res) => {
console.log(res); console.log(res);
alert("SuccessPrint"); // alert("SuccessPrint");
console.log("Success Folllow Result");
console.log(res); console.log(res);
setComplaintData(res) setComplaintData(res);
console.log(complaintData); console.log(complaintData);
}, },
onError: (error) => { onError: (error) => {
@ -58,8 +60,10 @@ export default function FollowResult() {
}); });
} }
function handlePrint() { function handlePrint() {
var prtContent = document.getElementById("details");
// document.body.innerHTML= printContents;
// window.document.write(prtContent?.innerHTML);
window.print(); window.print();
} }
return ( return (
@ -67,7 +71,7 @@ export default function FollowResult() {
<div className="h-full flex flex-col justify-center"> <div className="h-full flex flex-col justify-center">
<p <p
className="text-sm font-medium leading-6 tracking-wide text-[#7C838A] dark:text-white className="text-sm font-medium leading-6 tracking-wide text-[#7C838A] dark:text-white
3xl:text-base 3xl:font-bold " 3xl:text-base 3xl:font-bold"
> >
درخواست شما با کد رهگیری درخواست شما با کد رهگیری
<span className="text-slate-500 mx-2">{`${trackingNumber}`}</span>و <span className="text-slate-500 mx-2">{`${trackingNumber}`}</span>و
@ -102,10 +106,22 @@ export default function FollowResult() {
</AlertDialogCancel> </AlertDialogCancel>
</AlertDialogTitle> </AlertDialogTitle>
<AlertDialogDescription> <AlertDialogDescription className="h-full">
{complaintPrintMutation.isSuccess && ( {complaintPrintMutation.isPending ? (
<> <div className="felx justify-center items-center self-center h-full">
{" "} <ThreeDots
visible={true}
height="80"
width="100"
color="#003778"
radius="9"
ariaLabel="three-dots-loading"
wrapperStyle={{}}
wrapperClass=""
/>
</div>
) : (
<div id="details">
<p className="text-[#464646] text-sm font-medium"> <p className="text-[#464646] text-sm font-medium">
{" "} {" "}
موضوع شکایت:{" "} موضوع شکایت:{" "}
@ -115,29 +131,27 @@ export default function FollowResult() {
</p> </p>
<p className="text-[#464646] text-sm font-medium"> <p className="text-[#464646] text-sm font-medium">
{" "} {" "}
موضوع شکایت:{" "} متن شکایت:{" "}
<span className="text-[#7C838A] text-sm font-medium"> <span className="text-[#7C838A] text-sm font-medium">
متن تستی {`${complaintData?.contents[0]?.text}`}
</span> </span>
</p> </p>
<br />
<p className="text-[#464646] text-sm font-medium"> <p className="text-[#464646] text-sm font-medium">
{" "} {" "}
موضوع شکایت:{" "} جزئیات شکایت:
<span className="text-[#7C838A] text-sm font-medium">
متن تستی
</span>
</p>
<p className="text-[#464646] text-sm font-medium">
{" "}
موضوع شکایت:
</p> </p>
<br /> <br />
<p className="text-[#464646] text-sm font-medium"> <p className="text-[#464646] text-sm font-medium">
درخواست شما با کد رهگیری 1243230783 و رمز عبور 12422 در درخواست شما با کد رهگیری
دست بررسی و اقدام می باشد. در صورت تمایل می توانید با <span className="text-slate-500 mx-2">{`${trackingNumber}`}</span>
شماره تلفن 0353286545 جهت پشتیبانی تماس حاصل کنید.{" "} و رمز عبور
<span className="text-slate-500 mx-2">{`${password}`}</span>
در دست بررسی و اقدام می باشد. در صورت تمایل می توانید با
شماره تلفن 0353286545 جهت پشتیبانی تماس حاصل کنید.
</p> </p>
</> </div>
)} )}
</AlertDialogDescription> </AlertDialogDescription>
</AlertDialogHeader> </AlertDialogHeader>

View File

@ -47,7 +47,8 @@ export default function FollowUp() {
console.log(res); console.log(res);
console.log(result); console.log(result);
alert("Success"); // alert("Success");
console.log("Success FollowUp");
// router.push("/FollowResult"); // router.push("/FollowResult");
router.push("/FollowResult", {data: JSON.stringify( result ) }); router.push("/FollowResult", {data: JSON.stringify( result ) });

View File

@ -104,7 +104,8 @@ export default function RequestStep2() {
localStorage.setItem("trackingNumber", res.trackingNumber); localStorage.setItem("trackingNumber", res.trackingNumber);
localStorage.setItem("password", res.password); localStorage.setItem("password", res.password);
alert("Success"); // alert("Success");
console.log("Success Step2");
router.push("/RequestResult"); router.push("/RequestResult");
// router.push("/RequestResult", { data: trackingComplaint }); // router.push("/RequestResult", { data: trackingComplaint });
// return (res) // return (res)
@ -273,7 +274,7 @@ export default function RequestStep2() {
control={form.control} control={form.control}
name="categoryId" name="categoryId"
render={({ field }) => ( render={({ field }) => (
<FormItem className="w-full sm:w-[48%]"> <FormItem className="w-full sm:w-[48%] flex-row-reverse">
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7"> <FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
انتخاب دسته بندی انتخاب دسته بندی
</FormLabel> </FormLabel>
@ -387,7 +388,7 @@ export default function RequestStep2() {
render={({ field }) => ( render={({ field }) => (
<FormItem className="w-full sm:w-[48%]"> <FormItem className="w-full sm:w-[48%]">
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7"> <FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
*کد کپچا *کد امنیتی
</FormLabel> </FormLabel>
<FormControl> <FormControl>
<Input <Input

114
package-lock.json generated
View File

@ -37,6 +37,7 @@
"react-hook-form": "^7.48.2", "react-hook-form": "^7.48.2",
"react-icons": "^4.12.0", "react-icons": "^4.12.0",
"react-leaflet": "^4.2.1", "react-leaflet": "^4.2.1",
"react-loader-spinner": "^6.1.6",
"react-otp-input": "^3.1.1", "react-otp-input": "^3.1.1",
"react-use": "^17.4.2", "react-use": "^17.4.2",
"swiper": "^11.0.5", "swiper": "^11.0.5",
@ -104,6 +105,11 @@
"integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==", "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==",
"optional": true "optional": true
}, },
"node_modules/@emotion/unitless": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.0.tgz",
"integrity": "sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw=="
},
"node_modules/@eslint-community/eslint-utils": { "node_modules/@eslint-community/eslint-utils": {
"version": "4.4.0", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
@ -1413,6 +1419,11 @@
"integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==", "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==",
"devOptional": true "devOptional": true
}, },
"node_modules/@types/stylis": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.0.tgz",
"integrity": "sha512-n4sx2bqL0mW1tvDf/loQ+aMX7GQD3lc3fkCMC55VFNDu/vBOabO+LTIeXKM14xK0ppk5TUGcWRjiSpIlUpghKw=="
},
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "6.12.0", "version": "6.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.12.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.12.0.tgz",
@ -1981,6 +1992,14 @@
"node": ">= 6" "node": ">= 6"
} }
}, },
"node_modules/camelize": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz",
"integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001564", "version": "1.0.30001564",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001564.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001564.tgz",
@ -2175,6 +2194,14 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/css-color-keywords": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz",
"integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==",
"engines": {
"node": ">=4"
}
},
"node_modules/css-in-js-utils": { "node_modules/css-in-js-utils": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/css-in-js-utils/-/css-in-js-utils-3.1.0.tgz", "resolved": "https://registry.npmjs.org/css-in-js-utils/-/css-in-js-utils-3.1.0.tgz",
@ -2183,6 +2210,16 @@
"hyphenate-style-name": "^1.0.3" "hyphenate-style-name": "^1.0.3"
} }
}, },
"node_modules/css-to-react-native": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz",
"integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==",
"dependencies": {
"camelize": "^1.0.0",
"css-color-keywords": "^1.0.0",
"postcss-value-parser": "^4.0.2"
}
},
"node_modules/css-tree": { "node_modules/css-tree": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
@ -4752,6 +4789,27 @@
"react-dom": "^18.0.0" "react-dom": "^18.0.0"
} }
}, },
"node_modules/react-loader-spinner": {
"version": "6.1.6",
"resolved": "https://registry.npmjs.org/react-loader-spinner/-/react-loader-spinner-6.1.6.tgz",
"integrity": "sha512-x5h1Jcit7Qn03MuKlrWcMG9o12cp9SNDVHVJTNRi9TgtGPKcjKiXkou4NRfLAtXaFB3+Z8yZsVzONmPzhv2ErA==",
"dependencies": {
"react-is": "^18.2.0",
"styled-components": "^6.1.2"
},
"engines": {
"node": ">= 12"
},
"peerDependencies": {
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
}
},
"node_modules/react-loader-spinner/node_modules/react-is": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
"integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
},
"node_modules/react-otp-input": { "node_modules/react-otp-input": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/react-otp-input/-/react-otp-input-3.1.1.tgz", "resolved": "https://registry.npmjs.org/react-otp-input/-/react-otp-input-3.1.1.tgz",
@ -5119,6 +5177,11 @@
"node": ">=6.9" "node": ">=6.9"
} }
}, },
"node_modules/shallowequal": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz",
"integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ=="
},
"node_modules/shebang-command": { "node_modules/shebang-command": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@ -5325,6 +5388,51 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/styled-components": {
"version": "6.1.6",
"resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.6.tgz",
"integrity": "sha512-DgTLULSC29xpabJ24bbn1+hulU6vvGFQf4RPwBOJrm8WJFnN42yXpo5voBt3jDSJBa5tBd1L6PqswJjQ0wRKdg==",
"dependencies": {
"@emotion/is-prop-valid": "1.2.1",
"@emotion/unitless": "0.8.0",
"@types/stylis": "4.2.0",
"css-to-react-native": "3.2.0",
"csstype": "3.1.2",
"postcss": "8.4.31",
"shallowequal": "1.1.0",
"stylis": "4.3.1",
"tslib": "2.5.0"
},
"engines": {
"node": ">= 16"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/styled-components"
},
"peerDependencies": {
"react": ">= 16.8.0",
"react-dom": ">= 16.8.0"
}
},
"node_modules/styled-components/node_modules/@emotion/is-prop-valid": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz",
"integrity": "sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==",
"dependencies": {
"@emotion/memoize": "^0.8.1"
}
},
"node_modules/styled-components/node_modules/@emotion/memoize": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz",
"integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA=="
},
"node_modules/styled-components/node_modules/tslib": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
},
"node_modules/styled-jsx": { "node_modules/styled-jsx": {
"version": "5.1.1", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz",
@ -5348,9 +5456,9 @@
} }
}, },
"node_modules/stylis": { "node_modules/stylis": {
"version": "4.3.0", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.0.tgz", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.1.tgz",
"integrity": "sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==" "integrity": "sha512-EQepAV+wMsIaGVGX1RECzgrcqRRU/0sYOHkeLsZ3fzHaHXZy4DaOOX0vOlGQdlsjkh3mFHAIlVimpwAs4dslyQ=="
}, },
"node_modules/sucrase": { "node_modules/sucrase": {
"version": "3.34.0", "version": "3.34.0",

View File

@ -38,6 +38,7 @@
"react-hook-form": "^7.48.2", "react-hook-form": "^7.48.2",
"react-icons": "^4.12.0", "react-icons": "^4.12.0",
"react-leaflet": "^4.2.1", "react-leaflet": "^4.2.1",
"react-loader-spinner": "^6.1.6",
"react-otp-input": "^3.1.1", "react-otp-input": "^3.1.1",
"react-use": "^17.4.2", "react-use": "^17.4.2",
"swiper": "^11.0.5", "swiper": "^11.0.5",