diff --git a/src/AppRouter.js b/src/AppRouter.js index 346dc7b..a4a334c 100644 --- a/src/AppRouter.js +++ b/src/AppRouter.js @@ -71,10 +71,22 @@ class AppRouter extends Component { const mobile = window.innerWidth < 1000 ? true : false; let status = proxy.status(); console.log({ status, s: this.props.profile }); + const afterLogin = localStorage.getItem("afterLogin"); + let home = ( {status && status.status === 0 ? ( + ) : afterLogin ? ( + <> + {localStorage.removeItem("afterLogin")} + {console.log("hhhhhhhhhhhhhhhhhhaaaaaaaaa")} + + ) : ( )} diff --git a/src/Redux/actions/userFactor.js b/src/Redux/actions/userFactor.js index 09f8729..b21da54 100644 --- a/src/Redux/actions/userFactor.js +++ b/src/Redux/actions/userFactor.js @@ -30,11 +30,11 @@ const userFactor = { await proxy.post("userFactor/add", data, { dispatch }); await proxy.get("userFactor/list", data2, { dispatch }); }, - del: + deleteUserOffCode: (data = {}, data2 = {}) => async (dispatch) => { - await proxy.delete("userFactor/delete", data, { dispatch }); - await proxy.get("userFactor/list", data2, { dispatch }); + await proxy.delete("userFactor/deleteUserOffCode", data, { dispatch }); + await proxy.get("userFactor/info", data2, { dispatch }); }, }; diff --git a/src/Redux/reducers/userFactor.js b/src/Redux/reducers/userFactor.js index 35e21db..c753d7a 100644 --- a/src/Redux/reducers/userFactor.js +++ b/src/Redux/reducers/userFactor.js @@ -23,7 +23,7 @@ export default function userFactor(state = initialState, action) { case "userFactor/add": toast.success("درخواست شما با موفقیت انجام شد."); return { ...state, loading: false, error: null, sum: data.payPrice }; - case "userFactor/delete": + case "userFactor/deleteUserOffCode": return { ...state, loading: false, error: null }; case "userFactor/payment": window.location.replace(data); diff --git a/src/assets/IRANSans.rar b/src/assets/IRANSans.rar deleted file mode 100644 index 27e62fc..0000000 Binary files a/src/assets/IRANSans.rar and /dev/null differ diff --git a/src/assets/images/Group.png b/src/assets/images/Group.png new file mode 100644 index 0000000..7021a61 Binary files /dev/null and b/src/assets/images/Group.png differ diff --git a/src/assets/images/Groupbg.png b/src/assets/images/Groupbg.png new file mode 100644 index 0000000..d80fee2 Binary files /dev/null and b/src/assets/images/Groupbg.png differ diff --git a/src/assets/images/app.jpg b/src/assets/images/app.jpg new file mode 100644 index 0000000..c2fd403 Binary files /dev/null and b/src/assets/images/app.jpg differ diff --git a/src/views/Cart/Discount/index.js b/src/views/Cart/Discount/index.js index 2a13f79..414041c 100644 --- a/src/views/Cart/Discount/index.js +++ b/src/views/Cart/Discount/index.js @@ -21,54 +21,126 @@ const fontSize = { }, }; -const DiscoutCode = ({ codeId, setCodeId, userId, factorId }) => { - const [value, setValue] = React.useState(codeId || ""); +const DiscoutCode = ({ + codeId, + setCodeId, + delCodeId, + userId, + factorId, + code, +}) => { + const [value, setValue] = React.useState(code || ""); function setOff() { setCodeId({ offCodeValue: value, userId: userId, id: factorId || null }); } + console.log({ code }); return ( <> {window.innerWidth > 1000 ? (

کد تخفیف

-

- اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید -

-
- setValue(e.target.value)} - /> - -
+ {!code ? ( + <> +

+ اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید +

+
+ setValue(e.target.value)} + /> + +
+ + ) : ( + <> +

+ کد تخفیف برای شما ثبت شده است +

+
+ + +
+ + )}
) : null} {window.innerWidth < 1000 ? (

کد تخفیف

-

- اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید{" "} -

-
- setValue(e.target.value)} - /> - -
+ {!code ? ( + <> + {" "} +

+ اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید{" "} +

+
+ setValue(e.target.value)} + /> + +
+ + ) : ( + <> + {" "} +

+ کد تخفیف برای شما ثبت شده است +

+
+ + +
+ + )}
) : null} @@ -78,10 +150,12 @@ const DiscoutCode = ({ codeId, setCodeId, userId, factorId }) => { export default connect( (state) => ({ codeId: state.userFactor.info?.codeId, + code: state.userFactor.info?.offCode?.code, userId: state.user.status.id, factorId: state.userFactor.info?.id, }), { setCodeId: userFactor.update, + delCodeId: userFactor.deleteUserOffCode, } )(DiscoutCode); diff --git a/src/views/Cart/Discount/index.scss b/src/views/Cart/Discount/index.scss index 67d4f1a..b465498 100644 --- a/src/views/Cart/Discount/index.scss +++ b/src/views/Cart/Discount/index.scss @@ -33,7 +33,7 @@ background-color: #2b95ff; font-family: numeralLight; color: white; - padding: 5px 10px; + padding: 5px 5px; border: 0px; width: 80px; } diff --git a/src/views/Home/Download/index.js b/src/views/Home/Download/index.js new file mode 100644 index 0000000..90a466c --- /dev/null +++ b/src/views/Home/Download/index.js @@ -0,0 +1,81 @@ +import "./index.scss"; + +import app_icon_img from "~/assets/icons/home_chat.png"; +import download_icon from "~/assets/images/Group.png"; + +const H_DownloadApp = () => { + return ( + <> + {window.innerWidth > 1000 ? ( + + ) : ( +
+ +
+ app_icon_img +
+
+
+ دریافت اپلیکیشن اختصاصی دانوین +
+
+ به راحتی از همین جا دانلود کنید... +
+
+ download_icon +
+
+
+ )} + + ); +}; + +export default H_DownloadApp; diff --git a/src/views/Home/Download/index.scss b/src/views/Home/Download/index.scss new file mode 100644 index 0000000..425ea8d --- /dev/null +++ b/src/views/Home/Download/index.scss @@ -0,0 +1,98 @@ +.h-download-app { + width: 93%; + padding: 0 20px; + margin: 0 auto; + margin-top: 60px; + margin-bottom: 10px; + display: flex; + align-items: center; + justify-content: space-between; + direction: rtl; + background-image: url(../../../assets/images/Groupbg.png); + background-size: 100% 100%; +} + +.h-download-app-text { + width: 50%; + font-size: 45px; + font-family: var(--font2); + color: #132f52; +} + +.h-download-app-text span { + color: #2e81e8; +} + +.h-download-app-content { + width: 40%; + position: relative; +} + +.h-download-app-content-box1 { + width: 80%; + aspect-ratio: 0.95/1; + border-radius: 40px; + border: 10px solid #e6e6e6; + background-color: #e4fcfa; + background-image: url(../../../assets/images/app.jpg); + margin: 0 auto; + background-size: contain; +} + +.h-download-app-content-box2 { + text-decoration: none; + width: 100%; + aspect-ratio: 1/0.2; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 20px; + position: absolute; + bottom: 0; + background-color: #a2b4cb; + border-radius: 20px; +} +.h-download-app-content-mobile { + text-decoration: none; + + aspect-ratio: 1/0.2; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 20px; + margin: 5px 10px 10px; + + background-color: #a2b4cb; + border-radius: 20px; +} + +.h-download-app-content-box2-app-img-container { + width: 16%; + aspect-ratio: 1/1; + border-radius: 10px; + display: flex; + align-items: center; + justify-content: center; + background-color: white; +} + +.h-download-app-content-box2-app-img-container img { + width: 100%; +} + +.h-download-app-content-box2-text { + text-align: center; + width: 70%; +} + +.h-download-app-content-box2-text-title { + font-size: 18px; + font-family: var(--font2); + color: white; +} + +.h-download-app-content-box2-text-subtitle { + font-size: 13px; + font-family: var(--font1); + color: #005660; +} diff --git a/src/views/Home/HomeStatic/Vitrin/index.js b/src/views/Home/HomeStatic/Vitrin/index.js index 8b2d0ba..4ded020 100644 --- a/src/views/Home/HomeStatic/Vitrin/index.js +++ b/src/views/Home/HomeStatic/Vitrin/index.js @@ -32,14 +32,13 @@ export default function Vitrin(props) {

{data.title}

-
+
{data.books.map((item, i) => ( ))} - - - مشاهده بیشتر -
); diff --git a/src/views/Home/Navbar/Laptop/index.js b/src/views/Home/Navbar/Laptop/index.js index 19a1d1a..e85ff81 100644 --- a/src/views/Home/Navbar/Laptop/index.js +++ b/src/views/Home/Navbar/Laptop/index.js @@ -52,6 +52,19 @@ class LaptopNavbar extends Component { ))} +
  • + { + window.scrollTo(0, document.body.scrollHeight); + }} + style={{ + cursor: "pointer", + color: "#6f7074", + }} + > + دانلود + +
  • diff --git a/src/views/Home/Navbar/Laptop/index.scss b/src/views/Home/Navbar/Laptop/index.scss index 282bc33..033cf98 100644 --- a/src/views/Home/Navbar/Laptop/index.scss +++ b/src/views/Home/Navbar/Laptop/index.scss @@ -58,7 +58,7 @@ // height: 50px; // background : greenyellow; position: relative; - left: 14px; + // left: 14px; img { max-height: 60px; } diff --git a/src/views/Home/Navbar/Mobile/index.js b/src/views/Home/Navbar/Mobile/index.js index 580bd39..5f60933 100644 --- a/src/views/Home/Navbar/Mobile/index.js +++ b/src/views/Home/Navbar/Mobile/index.js @@ -76,18 +76,19 @@ export default function MobileNavbar(props) { if (!status) return (