diff --git a/src/views/Address/index.js b/src/views/Address/index.js
new file mode 100644
index 0000000..8d85a89
--- /dev/null
+++ b/src/views/Address/index.js
@@ -0,0 +1,140 @@
+import React, { useState, useEffect } from "react";
+import { connect } from "react-redux";
+import { publicApi } from "../../redux/actions";
+import onInput from "../../utils/onInput";
+import Input from "../../components/Input";
+import Select from "../../components/Select";
+
+export const Address = ({ city, province, getCity, getProvince }) => {
+ const [addressFields, setAddressFields] = useState({});
+
+ useEffect(() => {
+ if (province.length <= 1) {
+ getProvince();
+ }
+ }, []);
+
+ useEffect(() => {
+ if (addressFields?.provinceId) {
+ getCity({ provinceId: addressFields?.provinceId });
+ }
+ }, [addressFields]);
+
+ const onChange = (name, value) => {};
+
+ const Header = ({ title, text }) => {
+ return (
+
+ );
+ };
+ return (
+
+
+
+
+
+ val}
+ name="firstName"
+ onChange={(name, value) => onChange(name, value)}
+ value={addressFields?.firstName}
+ align="text-right"
+ direction="rtl"
+ />
+ val}
+ name="lastName"
+ onChange={(name, value) => onChange(name, value)}
+ value={addressFields?.lastName}
+ align="text-right"
+ direction="rtl"
+ />
+
+
+
+
+
+ onInput.numberOnly(val)}
+ name="cellphone"
+ onChange={(name, value) => onChange(name, value)}
+ value={addressFields?.cellphone}
+ align="text-right"
+ direction="ltr"
+ />
+ onInput.numberOnly(val)}
+ name="tellphone"
+ onChange={(name, value) => onChange(name, value)}
+ value={addressFields?.lastName}
+ align="text-right"
+ direction="ltr"
+ />
+
+
+
+
+
+
+
+
onInput.numberOnly(val)}
+ name="tellphone"
+ onChange={(name, value) => onChange(name, value)}
+ value={addressFields?.lastName}
+ align="text-right"
+ direction="ltr"
+ />
+
+
+ );
+};
+
+const mapStateToProps = (state) => ({
+ province: state.publicApi.province,
+ city: state.publicApi.city,
+});
+
+const mapDispatchToProps = {
+ getProvince: publicApi.getProvince,
+ getCity: publicApi.getCity,
+};
+
+export default connect(mapStateToProps, mapDispatchToProps)(Address);
diff --git a/src/views/Auth/Profile/index.js b/src/views/Auth/Profile/index.js
index 9b8ecf0..062a843 100644
--- a/src/views/Auth/Profile/index.js
+++ b/src/views/Auth/Profile/index.js
@@ -13,8 +13,8 @@ import Birthdate from "./Birthdate";
import MultipleSelector from "./MultipleSelector";
import Document from "./Document";
-
function Profile({
+ isMobile,
profile,
uploads,
getProvince,
@@ -187,7 +187,7 @@ function Profile({
// if (setDone) return
;
- return (
+ return isMobile ? (
@@ -336,7 +336,7 @@ function Profile({
/>
) : null}
- {console.log(province)}
+ {/* {console.log(province)} */}
+ ) : (
+
+ -
+
+
اطلاعات هویتی
+
لطفا نام و نام خانوادگی خود را به طور کامل وارد نمایید
+
+
+
+
);
}
@@ -431,6 +441,7 @@ export default connect(
uploads: state.file.uploads,
provinceList: state.publicApi.province,
cityList: state.publicApi.city,
+ isMobile: state.publicApi.isMobile,
}),
{
getProfile: user.getProfile,
diff --git a/src/views/Auth/SignUp/index.js b/src/views/Auth/SignUp/index.js
index 38a3460..a47d664 100644
--- a/src/views/Auth/SignUp/index.js
+++ b/src/views/Auth/SignUp/index.js
@@ -21,7 +21,7 @@ function SignUp({
setHeaderOptions,
}) {
const [level, setLevel] = useState("phonenumber");
- const [signUpFields, setSignUpFiels] = useState({});
+ const [signUpFields, setSignUpFiels] = useState({});
const [error, setError] = useState("");
const [resend, setResend] = useState(false);
const navigate = useNavigate();
@@ -130,7 +130,7 @@ function SignUp({
useEffect(() => {
if (loginFlag) {
- // navigate("/");
+ navigate("/");
}
}, [loginFlag]);
const light = theme === "light";
@@ -152,7 +152,7 @@ function SignUp({
onChange(name, value)}
value={signUpFields?.cellphone}
align="text-center"
@@ -241,7 +241,7 @@ function SignUp({
onChange={(e) =>
onChange(
e.target.name,
- (e.target.value = onInput.numberOnly(e.target.value))
+ (e.target.value = onInput.englishAndNumberWithoutSpace(e.target.value))
)
}
maxlength="1"
@@ -276,13 +276,17 @@ function SignUp({
);
}
+const mapStateToProps = (state) => ({
+ loginFlag : state.user.status,
+});
+
+const mapDispatchToProps = {
+ sendOtp: user.otp_login,
+ sendPhoneNumber: user.otp,
+ setHeaderOptions: publicApi.setHeaderOptions,
+};
+
export default connect(
- (state) => ({
- loginFlag: state.user.status,
- }),
- {
- sendOtp: user.otp_login,
- sendPhoneNumber: user.otp,
- setHeaderOptions: publicApi.setHeaderOptions,
- }
+ mapStateToProps,
+ mapDispatchToProps
)(SignUp);
diff --git a/src/views/BugsAndProblems/data.js b/src/views/BugsAndProblems/data.js
new file mode 100644
index 0000000..4722b83
--- /dev/null
+++ b/src/views/BugsAndProblems/data.js
@@ -0,0 +1,124 @@
+const list = [
+ {
+ title: "دسکتاپ - بنر بالای سایت",
+ description: "گرفتن لیست واقعی بنرها از دیتابیس",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - اسلایدر",
+ description: "اضافه کردن دکمه های اسلایدر",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - منوی بالای سایت",
+ description: "فعال سازی جستجو",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - منوی بالای سایت",
+ description: "تعداد محصولات داخل سبد خرید نمایش داده شود",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه محصولات ",
+ description: "فیلتر محصولات کاملا درست شود.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه محصول",
+ description: "خطای اجرای منطق داریم",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه محصول",
+ description: "اسلایدر عکس محصول کار نمیکند و به سرور وصل نیست.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه محصول",
+ description: "دکمه مشاهده نمونه کار نمیکند.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه محصول",
+ description: "دکمه مشاهده دوره ویدیویی محصول کار نمیکند.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه محصول",
+ description: "قسمت ثبت رضایت مشتری توسط ستاره به سرور وصل نیست",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه محصول",
+ description: "اصلاعات منوی سمت چپ واقعی نیست و همچنین دکمه اضافه کردن به سبد خرید کار نمیکند.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه محصول",
+ description: "تب مشخصات اطلاعاتش واقعی نیست.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه محصول",
+ description: "تب پرسش و پاسخ و محتوایی ندارد.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه محصول",
+ description: "امکان ثبت نظر برای محصول فراهم نیست.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه ویدئو",
+ description: "قسمت نمایش ویدئو به api وصل نیست.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه ویدئو",
+ description: "اسلایدر کار نمیکند.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه ویدئو",
+ description: "تب مشخصات و پرسش و پاسخ محتوایی ندارد.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه ویدئو",
+ description: "تب سرفصل ها مرتب نیست.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه ویدئو",
+ description: "اضافه کردن به سبد خرید کار نمیکند.",
+ status: 0,
+ developer: "",
+ },
+ {
+ title: "دسکتاپ - صفحه نمایش ویدئو",
+ description: "دیزاین این صفحه مرتب نیست کاملا.",
+ status: 0,
+ developer: "",
+ },
+];
+
+export default list;
\ No newline at end of file
diff --git a/src/views/BugsAndProblems/index.js b/src/views/BugsAndProblems/index.js
new file mode 100644
index 0000000..32f7faa
--- /dev/null
+++ b/src/views/BugsAndProblems/index.js
@@ -0,0 +1,66 @@
+import React from "react";
+import list from "./data";
+
+const colors = ['bg-white', 'bg-blue-200', 'bg-green-200', 'bg-red-200'];
+const statuses = ['کاری انجام نشده', 'در حال انجام', 'انجام شد', 'به مشکل خوردم'];
+
+function Bugs({}) {
+ return (
+
+
+
+
+
+
+
+
+ Title |
+
+ Description
+ |
+ Status |
+
+ Developer
+ |
+
+
+
+ {list.map((bug, index) => (
+
+
+ {bug.title}
+ |
+
+
+ {bug?.description}
+
+ |
+
+ {statuses[bug.status]}
+ |
+
+
+ {bug?.developer}
+
+ |
+
+ ))}
+
+
+
+
+
+
+
+ );
+}
+
+export default Bugs;
diff --git a/src/views/Contact/index.js b/src/views/Contact/index.js
index 27f6395..b7877f9 100644
--- a/src/views/Contact/index.js
+++ b/src/views/Contact/index.js
@@ -48,7 +48,7 @@ function Contact({ headerOptions, setHeaderOptions, info, isMobile, isDark }) {
return (
{
return isMobile ? (
) : (
-
+
diff --git a/src/views/Dashboard/layouts/Main/UserItems/ProductSuggestion/index.js b/src/views/Dashboard/layouts/Main/UserItems/ProductSuggestion/index.js
new file mode 100644
index 0000000..ff9772b
--- /dev/null
+++ b/src/views/Dashboard/layouts/Main/UserItems/ProductSuggestion/index.js
@@ -0,0 +1,46 @@
+import React from "react";
+import { Link } from "react-router-dom";
+import { Carousel } from "@trendyol-js/react-carousel";
+import Product from '../../../../../../components/Product';
+import arrow from "../../../../../../assets/icons/slider-arrow.svg";
+
+function Suggestion({ products, grades, isMobile }) {
+ return (
+
+
+ پیشنهادات ما به شما
+
+ {products.length > 0 && (
+
+
+ }
+ leftArrow={
+
+ }
+ >
+ {products.map((product, index) => (
+
+ ))}
+
+
+ )}
+
+ );
+}
+
+export default Suggestion;
diff --git a/src/views/Dashboard/layouts/Main/UserItems/index.js b/src/views/Dashboard/layouts/Main/UserItems/index.js
index 5758342..8984184 100644
--- a/src/views/Dashboard/layouts/Main/UserItems/index.js
+++ b/src/views/Dashboard/layouts/Main/UserItems/index.js
@@ -1,21 +1,35 @@
-import React from "react";
+import React, {useEffect} from "react";
import { connect } from "react-redux";
+import {book} from '../../../../../redux/actions';
import MyBooks from "../../../../Home/Portrait/Private/MyBooks";
import Videos from "../../../../Home/Portrait/Private/Videos";
+import ProductSuggestion from './ProductSuggestion';
-
-export const UserItems = ({}) => {
+export const UserItems = ({list, grades, getList, isMobile}) => {
+ useEffect(() => {
+ if(list.length <= 0){
+ getList();
+ }
+ },[]);
return (
-
-
-
+
);
};
-const mapStateToProps = (state) => ({});
+const mapStateToProps = (state) => ({
+ list : state.book.list,
+ grades: state.publicApi.grades,
+ isMobile: state.publicApi.isMobile
+});
-const mapDispatchToProps = {};
+const mapDispatchToProps = {
+ getList : book.list,
+};
export default connect(mapStateToProps, mapDispatchToProps)(UserItems);
\ No newline at end of file
diff --git a/src/views/Dashboard/layouts/Main/index.js b/src/views/Dashboard/layouts/Main/index.js
index bc0608e..e32dff1 100644
--- a/src/views/Dashboard/layouts/Main/index.js
+++ b/src/views/Dashboard/layouts/Main/index.js
@@ -1,20 +1,26 @@
-import React, { useState } from "react";
+import React, { useState, useEffect } from "react";
import { connect } from "react-redux";
+import {publicApi} from '../../../../redux/actions';
import Orders from "../../../Orders";
import UserItems from "../Main/UserItems";
-export const Main = ({}) => {
+export const Main = ({setHeaderOptions}) => {
+ useEffect(() => {
+ setHeaderOptions({shown: true});
+ },[]);
const views = {
- orders:
,
+ // orders:
,
userItems:
};
- const [page, setPage] = useState("orders");
- return
{views[page]}
;
+ const [page, setPage] = useState("userItems");
+ return
{views[page]}
;
};
const mapStateToProps = (state) => ({});
-const mapDispatchToProps = {};
+const mapDispatchToProps = {
+ setHeaderOptions: publicApi.setHeaderOptions,
+};
export default connect(mapStateToProps, mapDispatchToProps)(Main);
diff --git a/src/views/DeliveryForm/Address/index.js b/src/views/DeliveryForm/Address/index.js
index f24c52f..31a125b 100644
--- a/src/views/DeliveryForm/Address/index.js
+++ b/src/views/DeliveryForm/Address/index.js
@@ -3,7 +3,7 @@ import { connect } from "react-redux";
import Button from "../../../components/Button";
import Radio from "../../../components/Radio";
-function Address({ addresses, isDark, isMobile }) {
+function Address({ addresses, isDark, isMobile, setPhase }) {
const [activeAddress, setActiveAddress] = useState(addresses[0]);
const Location = ({ address }) => {
return isMobile ? (
@@ -97,7 +97,7 @@ function Address({ addresses, isDark, isMobile }) {
bgOpacity="bg-opacity-100"
width="100%"
color={isDark ? "text-white" : "text-gray70"}
- onClick={() => {}}
+ onClick={() => setPhase("address")}
/>
diff --git a/src/views/DeliveryForm/index.js b/src/views/DeliveryForm/index.js
index a30dfb5..bccbf96 100644
--- a/src/views/DeliveryForm/index.js
+++ b/src/views/DeliveryForm/index.js
@@ -1,6 +1,6 @@
import React, { useEffect } from "react";
import { connect } from "react-redux";
-import { publicApi, userFactor } from "../../redux/actions";
+import { publicApi, userFactor, userAddress } from "../../redux/actions";
import Address from "./Address";
import TransportMethod from "./TransportMethod";
import TransportDate from "./TransportDate";
@@ -10,6 +10,8 @@ import ExpressIcon from "../../assets/icons/express.svg";
import PishtazIcon from "../../assets/icons/pishtaz.svg";
export const DeliveryForm = ({
+ getList,
+ list,
setHeaderOptions,
headerOptions,
form,
@@ -18,13 +20,14 @@ export const DeliveryForm = ({
userId,
isDark,
isMobile,
+ setPhase,
}) => {
useEffect(() => {
if (isMobile) {
setHeaderOptions(headerOptions);
}
-
getFactorInfo({ userId });
+ getList();
}, []);
const PriceStatus = ({ name, value, type }) => {
@@ -82,7 +85,7 @@ export const DeliveryForm = ({
1
-
+
@@ -105,11 +108,14 @@ const mapStateToProps = (state) => ({
userId: state.user.status.id,
isDark: state.publicApi.isDark,
isMobile: state.publicApi.isMobile,
+ list : state.userAddress.list
+
});
const mapDispatchToProps = {
setHeaderOptions: publicApi.setHeaderOptions,
getFactorInfo: userFactor.info,
+ getList: userAddress.list
};
export default connect(mapStateToProps, mapDispatchToProps)(DeliveryForm);
diff --git a/src/views/Faq/index.js b/src/views/Faq/index.js
index b0e0270..c8682d4 100644
--- a/src/views/Faq/index.js
+++ b/src/views/Faq/index.js
@@ -18,8 +18,8 @@ function Faq({ headerOptions, setHeaderOptions, isMobile }) {
}, []);
return (
{
- console.log({books})
- const [filter, setFilter] = useState({
- search: "",
- grade: "",
- productsType: "کتاب",
- });
- useEffect(() => {
- getBooks();
- }, []);
- return (
-
-
-
-
-
-
-
-
- {
- books?.slice(15,24).map((product, index) => (
-
- {
+ // console.log({ books });
+ const [filter, setFilter] = useState({
+ search: "",
+ grade: "",
+ productsType: "کتاب",
+ });
+ return (
+
+
+
+
+
+
+
+ {books.length > 0 && (
+
+
+ }
+ leftArrow={
+
-
+ }
+ >
+ {books.map((product, index) => (
+
))}
-
+
- )
-}
+ )}
+
+ );
+};
const mapStateToProps = (state) => ({
- books: state.book.list,
- isDark: state.publicApi.isDark,
+ isDark: state.publicApi.isDark,
});
-export default connect(mapStateToProps, { getBooks: book.list })(Part2);
\ No newline at end of file
+export default connect(mapStateToProps, {})(Part2);
diff --git a/src/views/Home/Desktop/Part4/index.js b/src/views/Home/Desktop/Part4/index.js
index a5cde23..206f50a 100644
--- a/src/views/Home/Desktop/Part4/index.js
+++ b/src/views/Home/Desktop/Part4/index.js
@@ -2,118 +2,110 @@ import React from "react";
import Button from "../../../../components/Button";
import VodProduct from "../../../../components/VodProduct";
import { Link } from "react-router-dom";
-import posterImage from '../../../../assets/images/poster.svg'
-const Part4 = () => {
- const videosData = [
- {
- id: 0,
- name: "ریاضی",
- price: "145.000",
- grade: " پایه چهارم ",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- },
- {
- id: 2,
- name: "علوم تجربی",
- price: "145.000 ",
- grade: "پایه سوم",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- },
- {
- id: 1,
- name: "زمین شناسی",
- price: "145.000 ",
- grade: "پایه چهارم",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- },
- {
- id: 3,
- name: "ریاضی",
- price: "145.000 ",
- grade: "پایه چهارم",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- },
- {
- id: 5,
- name: "ریاضی",
- price: "145.000 ",
- grade: "پایه چهارم",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- },
- {
- id: 4,
- name: "ریاضی",
- price: "145.000 ",
- grade: "پایه چهارم",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- }
- ];
-
- return
-
-
-
-
- جدیدترین دوره های ویدیویی
-
-
-
-
-
-
-
-
+import posterImage from "../../../../assets/images/poster.svg";
+const Part4 = ({ books, grades }) => {
+ const videosData = [
+ {
+ id: 0,
+ name: "ریاضی",
+ price: "145.000",
+ grade: " پایه چهارم ",
+ imageUrl: "https://dnvn.ir/api/v1/file/2105",
+ poster: posterImage,
+ },
+ {
+ id: 2,
+ name: "علوم تجربی",
+ price: "145.000 ",
+ grade: "پایه سوم",
+ imageUrl: "https://dnvn.ir/api/v1/file/2105",
+ poster: posterImage,
+ },
+ {
+ id: 1,
+ name: "زمین شناسی",
+ price: "145.000 ",
+ grade: "پایه چهارم",
+ imageUrl: "https://dnvn.ir/api/v1/file/2105",
+ poster: posterImage,
+ },
+ {
+ id: 3,
+ name: "ریاضی",
+ price: "145.000 ",
+ grade: "پایه چهارم",
+ imageUrl: "https://dnvn.ir/api/v1/file/2105",
+ poster: posterImage,
+ },
+ {
+ id: 5,
+ name: "ریاضی",
+ price: "145.000 ",
+ grade: "پایه چهارم",
+ imageUrl: "https://dnvn.ir/api/v1/file/2105",
+ poster: posterImage,
+ },
+ {
+ id: 4,
+ name: "ریاضی",
+ price: "145.000 ",
+ grade: "پایه چهارم",
+ imageUrl: "https://dnvn.ir/api/v1/file/2105",
+ poster: posterImage,
+ },
+ ];
-
- {
- videosData.slice(0,6).map((video, index) => (
- -
-
+
+
+
+
جدیدترین دوره های ویدیویی
+
+
+
+
+
+
+
+ {books.slice(0, 6).map((video, index) => (
+ -
-
-
-
- ))
- }
-
-
-
-
-
-}
+
+ ))}
+
+
+
+ );
+};
-export default Part4;
\ No newline at end of file
+export default Part4;
diff --git a/src/views/Home/Desktop/SalesContainer/index.css b/src/views/Home/Desktop/SalesContainer/index.css
new file mode 100644
index 0000000..e69de29
diff --git a/src/views/Home/Desktop/SalesContainer/index.js b/src/views/Home/Desktop/SalesContainer/index.js
new file mode 100644
index 0000000..888550b
--- /dev/null
+++ b/src/views/Home/Desktop/SalesContainer/index.js
@@ -0,0 +1,78 @@
+import React, { useState, useEffect } from "react";
+import { connect } from "react-redux";
+import { book, publicApi } from "../../../../redux/actions";
+// import ScrollContainer from "react-indiana-drag-scroll";
+import { Carousel } from "@trendyol-js/react-carousel";
+import arrow from "../../../../assets/icons/slider-arrow.svg";
+import { Link } from "react-router-dom";
+import Product from "../../../../components/Product";
+import "./index.css";
+
+const SalesContainer = ({ books }) => {
+ const [filter, setFilter] = useState({
+ search: "",
+ grade: "",
+ productsType: "کتاب",
+ });
+ return (
+
+
+
+ {/*
*/}
+
+
دوشنبه
+
+ {" "}
+ کتاااابی{" "}
+
+
+
+
+
بیش از ۵۰ کتاب تخفیف خورده
+
+
+
+
+
+ {books.length > 0 && (
+
+
e.stopPropagation()}
+ />
+ }
+ leftArrow={
+ e.stopPropagation()}
+ />
+ }
+ >
+ {books.map((product, index) => (
+
+ ))}
+
+
+ )}
+
+ );
+};
+
+const mapStateToProps = (state) => ({
+ isDark: state.publicApi.isDark,
+});
+export default connect(mapStateToProps, { getList: book.list })(SalesContainer);
diff --git a/src/views/Home/Desktop/index.js b/src/views/Home/Desktop/index.js
index 4493a38..4368207 100644
--- a/src/views/Home/Desktop/index.js
+++ b/src/views/Home/Desktop/index.js
@@ -1,92 +1,94 @@
-import React, { useState, useEffect, useCallback } from "react";
-import ScrollContainer from "react-indiana-drag-scroll";
-import { connect } from 'react-redux';
-import { Link } from "react-router-dom";
-import filterIcon from '../../../assets/images/vuesax-linear-filter-tick.svg';
-import Banners from "../../../components/Banners";
-import SalesContainer from "../../../components/SalesContainer";
+import React, { useState, useEffect } from "react";
+import { connect } from "react-redux";
+import SalesContainer from "./SalesContainer";
-import { book, publicApi } from "../../../redux/actions";
+import { book, publicApi, product } from "../../../redux/actions";
import Part2 from "./Part2";
-import HomeImg from '../../../assets/images/HomeImg.png';
+import HomeImg from "../../../assets/images/HomeImg.png";
import Part4 from "./Part4";
import Design2D from "../../../components/Design2D";
-const DesktopHome = (
-{
- books,
- grades
-}
+const DesktopHome = ({ grades, getBooks, books }) => {
+ const banners = [
+ {
+ flex: 4,
+ items: [
+ {
+ bg: "",
+ flex: 1,
+ image:
+ "https://dkstatics-public.digikala.com/digikala-adservice-banners/d2a56a4a0c3ce4645bf0b405b0bbf3a29da1cbd3_1642861192.jpg",
+ },
+ ],
+ },
+ {
+ flex: 2,
+ items: [
+ {
+ bg: "",
+ flex: 1,
+ image:
+ "https://dkstatics-public.digikala.com/digikala-adservice-banners/e13aefeda2d3b44db78a92aac9cdc82a9b1650e9_1632230372.jpg?",
+ },
+ {
+ bg: "",
+ flex: 1,
+ image:
+ "https://dkstatics-public.digikala.com/digikala-adservice-banners/fe8f275f4e4b5e6eb2f66cf65f3895398e049b40_1625578273.jpg",
+ },
+ ],
+ },
+ {
+ flex: 2,
+ items: [
+ {
+ bg: "",
+ flex: 1,
+ image:
+ "https://dkstatics-public.digikala.com/digikala-adservice-banners/54d75e08cb0a72920ac3b2338232bf5ca70ccc74_1641638418.jpg",
+ },
+ ],
+ },
+ ];
-) =>{
-const banners = [
- {
- flex: 4,
- items: [{ bg:'',
- flex: 1,
- image: 'https://dkstatics-public.digikala.com/digikala-adservice-banners/d2a56a4a0c3ce4645bf0b405b0bbf3a29da1cbd3_1642861192.jpg'
- }],
- },
- {
- flex: 2,
- items: [
- { bg:'',
- flex: 1,
- image: 'https://dkstatics-public.digikala.com/digikala-adservice-banners/e13aefeda2d3b44db78a92aac9cdc82a9b1650e9_1632230372.jpg?'
- },
- { bg:'',
- flex: 1,
- image: 'https://dkstatics-public.digikala.com/digikala-adservice-banners/fe8f275f4e4b5e6eb2f66cf65f3895398e049b40_1625578273.jpg'
- },
- ],
- },
- {
- flex: 2,
- items: [{ bg:'',
- flex: 1,
- image: 'https://dkstatics-public.digikala.com/digikala-adservice-banners/54d75e08cb0a72920ac3b2338232bf5ca70ccc74_1641638418.jpg'
- }],
- },
-]
-
-return (
-
-
- {/*
{
+ getBooks();
+ },[]);
+
+ return (
+
+ {/*
*/}
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ );
+};
-)
+const mapStateToProps = (state) => ({
+ isDark: state.publicApi.isDark,
+ isMobile: state.publicApi.isMobile,
+ books: state.book.list,
+ gradeFilterBooks: state.book.gradeFilterBooks,
+ selectedGrade: state.book.selectedGrade,
+ grades: state.publicApi.grades,
+});
-}
+const mapDispatchToProps = {
+ getBooks: book.list,
+ gradeFilter: book.gradeFilter,
+ setHeaderOptions: publicApi.setHeaderOptions,
+};
-const mapStateToProps = (state) => ({
- isDark: state.publicApi.isDark,
- isMobile: state.publicApi.isMobile,
- books: state.book.list,
- grades: state.publicApi.grades,
- gradeFilterBooks: state.book.gradeFilterBooks,
- selectedGrade: state.book.selectedGrade,
- });
-
- const mapDispatchToProps = {
- getList: book.list,
- gradeFilter: book.gradeFilter,
- setHeaderOptions: publicApi.setHeaderOptions,
- };
-
- export default connect(mapStateToProps, mapDispatchToProps)(DesktopHome);
-
\ No newline at end of file
+export default connect(mapStateToProps, mapDispatchToProps)(DesktopHome);
diff --git a/src/views/Home/Portrait/Private/MyBooks/index.js b/src/views/Home/Portrait/Private/MyBooks/index.js
index b9b13c3..0995229 100644
--- a/src/views/Home/Portrait/Private/MyBooks/index.js
+++ b/src/views/Home/Portrait/Private/MyBooks/index.js
@@ -1,17 +1,13 @@
import React, { useEffect } from "react";
import { Link } from "react-router-dom";
import { connect } from "react-redux";
-import { book } from "../../../../../redux/actions";
-import Progress from '../../../../../components/Progress';
+import { ScrollingCarousel } from "@trendyol-js/react-carousel";
+import Progress from "../../../../../components/Progress";
-function MyBooks({ list, getList, grades, isMobile }) {
- useEffect(() => {
- getList();
- }, []);
-
- const Book = ({ book}) => {
+function MyBooks({ books, getList, grades, isMobile }) {
+ const Book = ({ book }) => {
return (
-
+
- {book.name}
- {`پایه ${grades[book.gradeId]}`}
+
+ {book.name}
+
+ {`پایه ${
+ grades[book.gradeId]
+ }`}
@@ -33,24 +33,33 @@ function MyBooks({ list, getList, grades, isMobile }) {
};
return (
-
+
-
کتابهای من
-
- {list?.slice(0,5)?.map((book, index) => (
-
- ))}
-
+
+ کتابهای من
+
+ {isMobile ? (
+
+ {books?.slice(0, 5)?.map((book, index) => (
+
+ ))}
+
+ ) : (
+
+
+ {books?.map((book, index) => (
+
+ ))}
+
+
+ )}
);
}
-
const mapStateToProps = (state) => ({
- list: state.book.list,
- grades : state.publicApi.grades,
- isMobile: state.publicApi.isMobile
+ isMobile: state.publicApi.isMobile,
});
-export default connect(mapStateToProps, { getList: book.list })(MyBooks);
+export default connect(mapStateToProps)(MyBooks);
diff --git a/src/views/Home/Portrait/Private/Videos/index.js b/src/views/Home/Portrait/Private/Videos/index.js
index 6919fd8..87f67f3 100644
--- a/src/views/Home/Portrait/Private/Videos/index.js
+++ b/src/views/Home/Portrait/Private/Videos/index.js
@@ -1,37 +1,33 @@
import React, { useEffect } from "react";
import { Link } from "react-router-dom";
+import { ScrollingCarousel } from "@trendyol-js/react-carousel";
import { connect } from "react-redux";
-import { book } from "../../../../../redux/actions";
import Progress from "../../../../../components/Progress";
import arrowBlueIcon from "../../../../../assets/icons/arrow-right-blue.svg";
import arrowWhiteIcon from "../../../../../assets/icons/arrow-left-white.svg";
-function Videos({ list, getList, grades, isDark, isMobile }) {
- useEffect(() => {
- getList();
- }, []);
-
- const Book = ({ book }) => {
+function Videos({ videos, grades, isDark, isMobile }) {
+ const Video = ({ video }) => {
return (
-
-
+
+
-
- {book.name}
+
+ {'دوره ویدئویی' + ' ' + video.name}
-
{`پایه ${
- grades[book.gradeId]
- }`}
+ {/* {`پایه ${
+ grades[video.gradeId]
+ }`}
*/}
@@ -39,7 +35,7 @@ function Videos({ list, getList, grades, isDark, isMobile }) {
};
return (
-
+
دورههای ویدئویی شما
@@ -50,21 +46,27 @@ function Videos({ list, getList, grades, isDark, isMobile }) {
className={`transform lg:hidden ${isDark ? "w-7" : "rotate-180"}`}
/>
-
- {list.slice(0,5)?.map((book, index) => (
-
- ))}
-
+ {isMobile ? (
+
+ {videos.slice(0, 5)?.map((video, index) => (
+
+ ))}
+
+ ) : (
+
+ {videos?.map((video, index) => (
+
+ ))}
+
+ )}
);
}
const mapStateToProps = (state) => ({
- list: state.book.list,
- grades: state.publicApi.grades,
isDark: state.publicApi.isDark,
- isMobile: state.publicApi.isMobile
+ isMobile: state.publicApi.isMobile,
});
-export default connect(mapStateToProps, { getList: book.list })(Videos);
+export default connect(mapStateToProps)(Videos);
diff --git a/src/views/Orders/components/Order.js b/src/views/Orders/components/Order.js
index 3b3a5b4..c69af61 100644
--- a/src/views/Orders/components/Order.js
+++ b/src/views/Orders/components/Order.js
@@ -20,7 +20,7 @@ const status = {
function Order({ order, isMobile }) {
return (
-
+
{_.join(["شماره سفارش:", order.number], " ")}
diff --git a/src/views/Orders/index.js b/src/views/Orders/index.js
index e38b63e..a80dcb7 100644
--- a/src/views/Orders/index.js
+++ b/src/views/Orders/index.js
@@ -10,7 +10,7 @@ function Orders({ orders, headerOptions, setHeaderOptions }) {
setHeaderOptions(headerOptions);
}, []);
return (
-
+
{orders.map((order, index) => (
))}
diff --git a/src/views/Product/Desktop/ProductOverAll/index.js b/src/views/Product/Desktop/ProductOverAll/index.js
index 83bb1c3..f7573b1 100644
--- a/src/views/Product/Desktop/ProductOverAll/index.js
+++ b/src/views/Product/Desktop/ProductOverAll/index.js
@@ -1,5 +1,6 @@
import React, { useState, useEffect } from "react";
import { connect } from "react-redux";
+import { Link } from "react-router-dom";
import { toast } from "react-toastify";
import { book, userProduct, publicApi } from "../../../../redux/actions";
import proxy from "../../../../redux/proxy";
@@ -27,24 +28,22 @@ export const ProductOverAll = ({
headerOptions,
setHeaderOptions,
}) => {
- const [type, setType] = useState("physical");
+ const [type, setType] = useState("1");
return (
-
+
-
- {type === "digital"
- ? book?.product[0]?.name
- : book?.product[1]?.name}
+
+ {book?.product[type]?.name}
-
+
{"پایه" + " " + grades[book?.gradeId]}
-
+
-
+
بیش از 160 نفر امتیاز داده اند
@@ -68,9 +67,9 @@ export const ProductOverAll = ({
}}
width="38%"
color={isDark ? "text-white" : "text-blueC0"}
- active={type === "physical"}
+ active={type === "1"}
selectable={true}
- onClick={() => setType("physical")}
+ onClick={() => setType("1")}
borderType="dashed"
customStyle=""
twPaddings="py-4 px-12"
@@ -85,9 +84,10 @@ export const ProductOverAll = ({
}}
width="38%"
selectable={true}
- active={type === "digital"}
+ active={type === "0"}
color={isDark ? "text-white" : "text-blueC0"}
- onClick={() => setType("digital")}
+ onClick={() => setType("0")}
+ borderType="dashed"
radius={false}
twPaddings="py-4 px-12"
/>
@@ -107,27 +107,18 @@ export const ProductOverAll = ({
-
-
);
};
diff --git a/src/views/Product/index.js b/src/views/Product/index.js
index 06a183d..8954ea3 100644
--- a/src/views/Product/index.js
+++ b/src/views/Product/index.js
@@ -42,144 +42,155 @@ export const Product = ({
<>
{/* Portrait */}
{isMobile ? (
-
-
-
-
-
- {type === "digital"
- ? book?.product[0]?.name
- : book?.product[1]?.name}
-
-
- {"پایه" + " " + grades[book?.gradeId]}
+
+
+
+ -
+ {book?.pagesNum}
صفحه
+
+ -
+ {"فیزیکی - دیجیتالی"}
در دسترس
+
+ -
+ {book?.rate}
امتیاز
+
+
+
+ نسخه محصول را انتخاب کنید
+
+
+
+
+
+ proxy.status()
+ ? pushToCart({
+ productId:
+ type === "digital"
+ ? book?.product[0]?.id
+ : book?.product[1]?.id,
+ userId: userId,
+ count: 1,
+ })
+ : toast.info("ابتدا وارد حساب کاربری خود شوید.")
+ }
+ title={
+ "خرید با قیمت" +
+ " " +
+ (type === "digital"
+ ? book?.product[0]?.price
+ : book?.product[1]?.price) +
+ " " +
+ "تومان"
+ }
+ backgroundColor="bg-blueC0"
+ border={{ color: "#196EC055", width: "1px" }}
+ width="65%"
+ color="text-white"
+ />
+ {}}
+ />
+
+
+ {}}
+ />
+
+
+
+
+ خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ
+ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ
+ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ
+ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ﺩﺍﺩ :
+ ﺩﺭ ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ
+ ﺍﮔﺮ ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ،
+ ﻧﺎ ﺣﻖ ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ
+ ﺩﺯﺩﯾﺪﻩ ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن{" "}
+
+
+
+
+
+
+
+ {[0, 1, 2, 2].map((comment, index) => (
+
+ ))}
-
-
- -
- {book?.pagesNum}
صفحه
-
- -
- {"فیزیکی - دیجیتالی"}
در دسترس
-
- -
- {book?.rate}
امتیاز
-
-
-
- نسخه محصول را انتخاب کنید
-
-
- setType("physical")}
- />
- setType("digital")}
- />
-
-
-
- proxy.status()
- ? pushToCart({
- productId:
- type === "digital"
- ? book?.product[0]?.id
- : book?.product[1]?.id,
- userId: userId,
- count: 1,
- })
- : toast.info("ابتدا وارد حساب کاربری خود شوید.")
- }
- title={
- "خرید با قیمت" +
- " " +
- (type === "digital"
- ? book?.product[0]?.price
- : book?.product[1]?.price) +
- " " +
- "تومان"
- }
- backgroundColor="bg-blueC0"
- border={{ color: "#196EC055", width: "1px" }}
- width="65%"
- color="text-white"
- />
- {}}
- />
-
-
- {}}
- />
-
-
-
-
- خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ
- ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ
- ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ
- ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ﺩﺍﺩ : ﺩﺭ
- ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ ﺍﮔﺮ
- ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﻧﺎ ﺣﻖ
- ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ
- ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن{" "}
-
-
-
-
-
-
- {[0, 1, 2, 2].map((comment, index) => (
-
- ))}
+ ) : (
+
+
-
) :
-
-
- }
+ )}
>
);
};
@@ -189,7 +200,7 @@ const mapStateToProps = (state) => ({
grades: state.publicApi.grades,
isMobile: state.publicApi.isMobile,
isDark: state.publicApi.isDark,
- userId: state.user.status.id,
+ userId: state.user.status?.id,
});
const mapDispatchToProps = {
diff --git a/src/views/Products/index.js b/src/views/Products/index.js
index a3ca32e..190d561 100644
--- a/src/views/Products/index.js
+++ b/src/views/Products/index.js
@@ -23,15 +23,12 @@ export const Products = ({
headerOptions,
desktopContentTransform,
}) => {
-
-
const [filter, setFilter] = useState({
search: "",
grade: "",
productsType: "کتاب",
});
-
const onChange = (name, value) => {
setFilter({ ...filter, [name]: value });
};
@@ -45,8 +42,6 @@ export const Products = ({
gradeFilter(filter.grade);
}, [filter]);
-
-
const Product = ({ productsType, product, index }) => {
return (
<>
@@ -80,7 +75,7 @@ export const Products = ({
{product?.name}
@@ -149,7 +144,6 @@ export const Products = ({
/>
))
: books?.map((product, index) => (
-
) : (
-
-
)}
@@ -180,6 +176,7 @@ const mapStateToProps = (state) => ({
isDark: state.publicApi.isDark,
isMobile: state.publicApi.isMobile,
books: state.book.list,
+ listVOD: state.product.listVOD,
grades: state.publicApi.grades,
gradeFilterBooks: state.book.gradeFilterBooks,
selectedGrade: state.book.selectedGrade,
diff --git a/src/views/Products/layouts/Main.js b/src/views/Products/layouts/Main.js
index c44e8bf..91e08c2 100644
--- a/src/views/Products/layouts/Main.js
+++ b/src/views/Products/layouts/Main.js
@@ -1,18 +1,17 @@
import React, { useState, useEffect, useCallback } from "react";
-import ScrollContainer from "react-indiana-drag-scroll";
-import { connect } from 'react-redux';
+import { connect } from "react-redux";
import { Link } from "react-router-dom";
-import filterIcon from '../../../assets/images/vuesax-linear-filter-tick.svg';
+import { Carousel } from "@trendyol-js/react-carousel";
-import Product from '../../../components/Product'
+import filterIcon from "../../../assets/images/vuesax-linear-filter-tick.svg";
+import Product from "../../../components/Product";
import VodProduct from "../../../components/VodProduct";
-import { book, publicApi } from "../../../redux/actions";
+import { book, publicApi, product } from "../../../redux/actions";
import posterImage from "../../../assets/images/poster.svg";
+import arrow from "../../../assets/icons/slider-arrow.svg";
-
-export const Main = ({ isMobile,
+export const Main = ({
books,
- getList,
grades,
gradeFilter,
selectedGrade,
@@ -20,170 +19,121 @@ export const Main = ({ isMobile,
setHeaderOptions,
headerOptions,
videos,
- filter }) => {
- useEffect(() => {
- window.scrollTo(0, 0)
- }, [])
+ filter,
+}) => {
+ useEffect(() => {
+ window.scrollTo(0, 0);
+ }, []);
const filteringNavItems = [
{
- title: 'بیشترین بازدید'
+ title: "بیشترین بازدید",
},
{
- title: 'پرفروش ترین'
+ title: "پرفروش ترین",
},
{
- title: 'کمترین قیمت'
+ title: "کمترین قیمت",
},
{
- title: 'بیشترین قیمت'
+ title: "بیشترین قیمت",
},
{
- title: 'محبوب ترین'
+ title: "محبوب ترین",
},
];
- const videosData = [
- {
- id: 0,
- name: "ریاضی",
- price: "145.000",
- grade: " پایه چهارم ",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- },
- {
- id: 2,
- name: "علوم تجربی",
- price: "145.000 ",
- grade: "پایه سوم",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- },
- {
- id: 1,
- name: "زمین شناسی",
- price: "145.000 ",
- grade: "پایه چهارم",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- },
- {
- id: 3,
- name: "ریاضی",
- price: "145.000 ",
- grade: "پایه چهارم",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- },
- {
- id: 5,
- name: "ریاضی",
- price: "145.000 ",
- grade: "پایه چهارم",
- imageUrl: "https://dnvn.ir/api/v1/file/2105",
- poster: posterImage,
- }
- ]
- return
-
-
-
-
- مرتب سازی بر اساس
-
-
-
- {
- filteringNavItems.map(e => (
- - console.log('a')}>{e.title}
- ))
- }
-
-
-
- {
- videosData.map((video, index) => (
-
+
+
+
+
مرتب سازی بر اساس
+
+
+ {filteringNavItems.map((e) => (
+ - console.log("a")}
>
-
+ ))}
+
+
+ {books?.length > 0 && (
+
+
-
- ))
- }
-
-
-
-
+ }
+ leftArrow={
+
+ }
+ >
+ {books?.map((video, index) => (
+
+ ))}
+
+
+ )}
+
+
{selectedGrade
? gradeFilterBooks?.map((product, index) => (
-
- ))
- : books?.map((product, index) => (
-
-
- ))}
+ ))
+ : books?.map((product, index) => (
+
+
+
+ ))}
-
-
;
+
+ );
};
-Main.defaultProps ={
- videos: [
-
- ]
-}
+Main.defaultProps = {
+ videos: [],
+};
const mapStateToProps = (state) => ({
isDark: state.publicApi.isDark,
isMobile: state.publicApi.isMobile,
- books: state.book.list,
- grades: state.publicApi.grades,
- gradeFilterBooks: state.book.gradeFilterBooks,
- selectedGrade: state.book.selectedGrade,
});
const mapDispatchToProps = {
diff --git a/src/views/Products/layouts/Sidebar.js b/src/views/Products/layouts/Sidebar.js
index 65de28d..92efa65 100644
--- a/src/views/Products/layouts/Sidebar.js
+++ b/src/views/Products/layouts/Sidebar.js
@@ -3,69 +3,33 @@ import { connect } from "react-redux";
import Checkbox from "../../../components/Checkbox";
import VerticalExpandableProductFilter from "../../../components/VerticalExpandableProductFilter";
-export const Sidebar = ({onChange}) => {
-
- const filteronGrade = [
- {
- id:0,
- name: "اول",
- expaneded: false,
- subList: [{
- id:1,
- name: 'علوم اجتماعی'
- }],
- },
- {
- id:1,
- name: "دوم",
- expaneded: false,
- subList: [{
- id:1,
- name: 'علوم اجتماعی'
- }],
- },
- {
- id:2,
- name: "سوم",
- expaneded: false,
- subList: [],
- },
-
- ];
+export const Sidebar = ({ onChange, grades }) => {
const categories = [
- {
- id: 0,
- expaneded: false,
- name: 'کتاب فیزیکی',
- subList: []
- },
- {
- id: 1,
- expaneded: false,
- name: 'کتاب دیجیتال',
- subList: []
- },
- {
- id: 2,
- expaneded: false,
- name: 'دوره ویدیویی',
- subList: []
- },
- {
- id: 3,
- expaneded: false,
- name: 'بسته های آموزشی',
- subList: []
- },
- ]
- return
-
-
-
-
;
+ "کتاب فیزیکی",
+ "کتاب دیجیتال",
+ "دوره ویدیویی",
+ "بسته های آموزشی",
+ ];
+ return (
+
+
+
+
+ );
};
-const mapStateToProps = (state) => ({});
+const mapStateToProps = (state) => ({
+ grades: state.publicApi.grades,
+});
const mapDispatchToProps = {};
diff --git a/src/views/QR/Content/index.js b/src/views/QR/Content/index.js
index 72ad605..71402d1 100644
--- a/src/views/QR/Content/index.js
+++ b/src/views/QR/Content/index.js
@@ -12,14 +12,14 @@ export const Content = ({
}) => {
useEffect(() => {
const path = window.location.pathname;
- console.log(path.slice(path.lastIndexOf("/") + 1, path.length));
+ // console.log(path.slice(path.lastIndexOf("/") + 1, path.length));
setHeaderOptions(headerOptions);
getQrData({ tail: path.slice(path.lastIndexOf("/") + 1, path.length) });
}, []);
useEffect(() => {
if (data) {
- console.log(data?.book?.name);
+ // console.log(data?.book?.name);
}
}, [data]);
diff --git a/src/views/QR/Scan/index.js b/src/views/QR/Scan/index.js
index f4eaa8d..a2f9b94 100644
--- a/src/views/QR/Scan/index.js
+++ b/src/views/QR/Scan/index.js
@@ -18,7 +18,7 @@ export const Scan = ({
};
const handleError = (err) => {
- console.error(err);
+ // console.error(err);
};
useEffect(() => {
diff --git a/src/views/ShoppingCart/Product/index.js b/src/views/ShoppingCart/Product/index.js
index 429467d..b199f6d 100644
--- a/src/views/ShoppingCart/Product/index.js
+++ b/src/views/ShoppingCart/Product/index.js
@@ -139,9 +139,20 @@ function Product({ product, grades, pushToCart, isMobile }) {
{product?.product?.price} تومان
+ pushToCart(
+ {
+ productId: product?.productId,
+ userId: product?.userId,
+ count: product?.productType === 1 ? -1 : -product?.count,
+ },
+ {},
+ { id: product?.factorId }
+ )
+ }
src={deleteIcon}
alt="delete"
- className="border border-red-800 border-solid p-1 w-8 bg-red-100 rounded-md mr-4"
+ className="border border-red-800 border-solid p-1 w-8 bg-red-100 rounded-md mr-4 cursor-pointer"
/>
diff --git a/src/views/ShoppingCart/index.js b/src/views/ShoppingCart/index.js
index 06cb8e6..bbb3ef1 100644
--- a/src/views/ShoppingCart/index.js
+++ b/src/views/ShoppingCart/index.js
@@ -3,10 +3,12 @@ import { userProduct, userFactor, publicApi } from "../../redux/actions";
import DeliveryForm from "../DeliveryForm";
import Product from "./Product";
+import Address from "../Address";
import Code from "./Code";
import Button from "../../components/Button";
//assets
+import dropdownIcon from "../../assets/icons/dropdown-blue.svg";
import alertIcon from "../../assets/icons/alert.svg";
import { connect } from "react-redux";
@@ -17,7 +19,7 @@ function ShoppingCart({
list,
payPrice,
factorInfo,
- userId,
+ user,
hasPhysical,
getList,
getInfo,
@@ -31,10 +33,19 @@ function ShoppingCart({
useEffect(() => {
getList();
- getFactorInfo({ userId });
+ getFactorInfo({ userId: user?.id });
setHeaderOptions(headerOptions);
}, []);
+ const next = {
+ products: () => setPhase("deliveryForm"),
+ deliveryForm: () => console.log("Go to shaparak"),
+ profile: () => {
+ console.log("Set profile");
+ console.log("Go to shaparak");
+ },
+ };
+
const Table = () => {
return (
@@ -50,9 +61,10 @@ function ShoppingCart({
- {list.map((product, index) => (
-
- ))}
+ {list.map(
+ (product, index) =>
+ product.condition < 2 &&
+ )}
);
@@ -96,6 +108,12 @@ function ShoppingCart({
);
};
+ const layouts = {
+ products:
,
+ deliveryForm:
,
+ address:
,
+ };
+
return isMobile ? (
{list.map((product, index) => (
@@ -147,95 +165,104 @@ function ShoppingCart({
) : (
-
- {phase === "products" &&
}
- {phase === "delivery-form" &&
}
-
-
-
-
-
- جمع کل سبد خرید
-
-
- {factorInfo?.payPrice}
- تومان
-
-
- {phase === "products" && (
-
-
-
- هزینه ارسال کالا پس از تعیین محل آدرس مشخص میشود
-
-
- )}
- {phase === "delivery-form" && (
-
-
- انتخاب شیوه پرداخت
-
-
- setPhase(phase === "products" ? "delivery-form" : "")
- }
+ {layouts[phase]}
+ {phase !== "address" && (
+
+
+
-
-
- setPhase(phase === "products" ? "delivery-form" : "")
- }
+
+
-
-
- )}
-
-
setPhase(phase === "products" ? "delivery-form" : "")}
- />
-
+
+
+ جمع کل سبد خرید
+
+
+ {factorInfo?.payPrice}
+
+ تومان
+
+
+
+ {phase === "products" && (
+
+
+
+ هزینه ارسال کالا پس از تعیین محل آدرس مشخص میشود
+
+
+ )}
+ {phase === "deliveryForm" && (
+
+
+ انتخاب شیوه پرداخت
+
+ {}}
+ />
+
+ {}}
+ />
+
+
+
+ )}
+
+ {phase === "deliveryForm" && (
+ setPhase("products")}
+ >
+ بازگشت
+
+
+ )}
+
+ )}
);
}
@@ -246,7 +273,7 @@ const mapStateToProps = (state) => ({
list: state.userProduct.list,
payPrice: state.userProduct.sum,
factorInfo: state.userFactor.info,
- userId: state.user.status.id,
+ user: state.user.status,
hasPhysical: state.userProduct.hasPhysical,
desktopContentTransform: state.publicApi.desktopContentTransform,
});
diff --git a/src/views/Video/components/Desktop/Videos.js b/src/views/Video/components/Desktop/Videos.js
index dcbcaac..dff8a32 100644
--- a/src/views/Video/components/Desktop/Videos.js
+++ b/src/views/Video/components/Desktop/Videos.js
@@ -1,31 +1,46 @@
-import React from "react";
+import React, {useState, useEffect} from "react";
import "../../../../components/ProductImage/index.scss";
import productImg from "../../../../components/ProductImage/product-image.jpg";
const Videos = ({ videos }) => {
+ const [list, setList] = useState([]);
+ const [activeVideo, setActiveVideo] = useState([]);
+
+ useEffect(() => {
+ if (videos) {
+ let mylist = videos?.split(",");
+ setList(() => mylist);
+ setActiveVideo(() => mylist[0]);
+ console.log(videos);
+ }
+ }, [videos]);
+
return (
- {videos.slice(0, 4).map((video, index) => (
+ {list?.slice(0, 4).map((video, index) => (
{/* این خط پایین که نوشتم برای این است که ایندکس که جنسش استرینگ است رو به نامبر تبدیل کند */}
{Number(index) === 3 && (
@@ -51,16 +66,3 @@ const Videos = ({ videos }) => {
export default Videos;
-Videos.defaultProps = {
- videos: [
- {
- image: productImg,
- },
- {
- image: productImg,
- },
- {
- image: productImg,
- },
- ],
-};
diff --git a/src/views/Video/components/Season.js b/src/views/Video/components/Season.js
index 896f8fc..a3e306f 100644
--- a/src/views/Video/components/Season.js
+++ b/src/views/Video/components/Season.js
@@ -1,8 +1,12 @@
import React, { useState } from "react";
import { connect } from "react-redux";
+import location from "../../../utils/location";
import { Link } from "react-router-dom";
import { publicApi } from "../../../redux/actions";
+//assets
+import dropdownIcon from "../../../assets/icons/dropdown-blue.svg";
+
const Season = ({
toggle,
season,
@@ -12,6 +16,14 @@ const Season = ({
realSeasons,
vodDuration,
}) => {
+ const setCategory = (seasonId, videoId) => {
+ localStorage.removeItem("bookId");
+ localStorage.setItem(
+ "season",
+ location.getId() + "," + seasonId + "," + videoId
+ );
+ };
+
const duration = (value) => {
const minute = value % 60;
const hour = Math.round(value / 60);
@@ -24,7 +36,7 @@ const Season = ({
);
};
// const [activeSeason, setActiveSeason] = useState(null);
- const Unit = ({ unit }) => {
+ const Unit = ({ unit, index }) => {
return isMobile ? (
*/}
) : (
-
+
-
+
{unit.name}
+
+ setCategory(season[0].categoryId, unit.name)}
+ >
+ {Number(index) === 0 ? "تماشا" : "قفل"}
+
+
-
+
);
};
return isMobile ? (
@@ -99,21 +128,38 @@ const Season = ({
season.map((unit, index) => )}
) : (
-
toggle(season[0].categoryId)}
- >
-
-
+
+ toggle(season[0].categoryId)}
+ >
+
{
realSeasons.filter((item) => item.id === season[0].categoryId)[0]
.name
}
+
-
- {season[0].categoryId === activeSeason &&
- season.map((unit, index) => )}
+
+ {season.map((unit, index) => (
+
+ ))}
);
diff --git a/src/views/Video/index.js b/src/views/Video/index.js
index a3fe969..1a2c5f1 100644
--- a/src/views/Video/index.js
+++ b/src/views/Video/index.js
@@ -1,6 +1,8 @@
import React, { useState, useEffect } from "react";
import { connect } from "react-redux";
-import { publicApi } from "../../redux/actions";
+import {toast} from 'react-toastify';
+import { Link } from "react-router-dom";
+import { publicApi, userProduct } from "../../redux/actions";
import location from "../../utils/location";
import Divider from "../../components/Divider";
import Season from "./components/Season";
@@ -15,7 +17,9 @@ import poster from "../../assets/images/poster.svg";
import tickIcon from "../../components/ProductStatusCard/tick-circle.svg";
function Video({
-
+ isLogin,
+ pushToCart,
+ userId,
product = {
id: 0,
type: "کتاب ها",
@@ -64,19 +68,9 @@ function Video({
const [type, setType] = useState(0);
useEffect(() => {
- window.scrollTo(0, 0)
- }, []);
-
- useEffect(() => {
- getBook({ bookId: 19 });
+ getBook({ bookId: location.getId() });
setHeaderOptions(headerOptions);
}, []);
-
- useEffect(() => {
- if (book) {
- // console.log(book);
- }
- }, [book]);
return isMobile ? (
@@ -91,14 +85,14 @@ function Video({
}}
>
-
+
{book?.name}
@@ -115,10 +109,10 @@ function Video({
) : (
-
+
-
+
- {"پایه" + " " + (grades[book?.gradeId] || "پایه دوازدهم")}
+ {"پایه" + " " + grades[book?.gradeId]}
-
+
بیش از 160 نفر امتیاز داده اند
@@ -164,7 +158,7 @@ function Video({
-
+
{`توسعه خرید توسط ${
book?.recommendedPeople || 4234
@@ -172,16 +166,14 @@ function Video({
-
- {book?.price || "56/894/000"}
-
+ {book?.price}
تومان
با خرید این کالا 540.000 صرفه جویی کنید
{}}
+ onClick={() =>
+ isLogin
+ ? pushToCart({
+ productId: book?.id,
+ userId: userId,
+ count: 1,
+ })
+ : toast.info("ابتدا وارد حساب کاربری خود شوید.")
+ }
/>
-
{}}
- />
+
+ مشاهده کتاب این محصول
+
@@ -215,11 +212,14 @@ const mapStateToProps = (state) => ({
book: state.publicApi.bookInfo,
seasons: state.publicApi.categories,
grades: state.publicApi.grades,
+ isLogin: state.user.status,
+ userId: state.user.status.id,
});
const mapDispatchToProps = {
setHeaderOptions: publicApi.setHeaderOptions,
getBook: publicApi.bookInfo,
+ pushToCart: userProduct.add,
};
export default connect(mapStateToProps, mapDispatchToProps)(Video);
diff --git a/src/views/VideoDisplay/Desktop/index.js b/src/views/VideoDisplay/Desktop/index.js
deleted file mode 100644
index 0eba82d..0000000
--- a/src/views/VideoDisplay/Desktop/index.js
+++ /dev/null
@@ -1,38 +0,0 @@
-import React from "react";
-import CourseChapter from "../../../components/CourseChapter";
-import VideoPlayer from "../../../components/VideoPlayer";
-const DesktopVideoDisplay = () =>{
- return(
-
-
-
-
-
-
-
-
-
ساز های باستانی ایران عزیز
-
- لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ، و با استفاده از طراحان گرافیک است، چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است، و برای شرایط فعلی تکنولوژی مورد نیاز، و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد، کتابهای زیادی در شصت و سه درصد گذشته حال و آینده، شناخت فراوان جامعه و متخصصان را می طلبد، تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی، و فرهنگ پیشرو در زبان فارسی ایجاد کرد، در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها، و شرایط سخت تایپ به پایان رسد و زمان مورد نیاز شامل حروفچینی دستاوردهای اصلی، و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد.
-
-
-
-
- {/*
-
-
- {product.name}
-
- {product.grade}
-
-
-
*/}
-
-
-
-
-
- );
-};
-
-export default DesktopVideoDisplay;
\ No newline at end of file
diff --git a/src/views/VideoDisplay/index.js b/src/views/VideoDisplay/index.js
index 444f031..6ec506d 100644
--- a/src/views/VideoDisplay/index.js
+++ b/src/views/VideoDisplay/index.js
@@ -1,10 +1,13 @@
import React, { useState, useEffect } from "react";
import { connect } from "react-redux";
import { publicApi } from "../../redux/actions";
+import PlayList from "../../components/CourseChapter";
+import VideoPlayer from "../../components/VideoPlayer";
+import JolPlayer from "../../components/JolPlayer";
+
import poster from "../../assets/images/poster.svg";
import Divider from "../../components/Divider";
import Season from "./components/Season";
-import DesktopVideoDisplay from "./Desktop";
function VideoDisplay({
isMobile,
@@ -48,17 +51,24 @@ function VideoDisplay({
seasons,
grades,
getBook,
+ getSeason,
+ selectedVideo,
}) {
useEffect(() => {
const id = window.location.pathname.slice(
8,
window.location.pathname.lastIndexOf("/")
);
-
+ getBook({bookId : id});
setHeaderOptions(headerOptions);
- // getBook({ bookId: id });
+ const cat = localStorage.getItem("season")?.split(",");
+ getSeason({ bookId: cat[0], categoryId: cat[1] });
}, []);
+ useEffect(() => {
+
+ },[])
+
const enamad =
'';
return isMobile ? (
@@ -92,21 +102,58 @@ function VideoDisplay({
) : (
-
+
+
+
+
+
+ {selectedVideo?.name}
+
+
+ لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ، و با
+ استفاده از طراحان گرافیک است، چاپگرها و متون بلکه روزنامه و مجله در
+ ستون و سطرآنچنان که لازم است، و برای شرایط فعلی تکنولوژی مورد نیاز،
+ و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد، کتابهای
+ زیادی در شصت و سه درصد گذشته حال و آینده، شناخت فراوان جامعه و
+ متخصصان را می طلبد، تا با نرم افزارها شناخت بیشتری را برای طراحان
+ رایانه ای علی الخصوص طراحان خلاقی، و فرهنگ پیشرو در زبان فارسی ایجاد
+ کرد، در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه
+ راهکارها، و شرایط سخت تایپ به پایان رسد و زمان مورد نیاز شامل
+ حروفچینی دستاوردهای اصلی، و جوابگوی سوالات پیوسته اهل دنیای موجود
+ طراحی اساسا مورد استفاده قرار گیرد.
+
+
+
+
+ {/*
+
+
+ {product.name}
+
+ {product.grade}
+
+
+
*/}
+
+
);
}
const mapStateToProps = (state) => ({
isMobile: state.publicApi.isMobile,
- book: state.publicApi.bookInfo,
- grades: state.publicApi.categories,
+ book: state.publicApi.bookSection,
+ seasons: state.publicApi.categories,
grades: state.publicApi.grades,
selectedVideo: state.publicApi.selectedVideo,
});
const mapDispatchToProps = {
setHeaderOptions: publicApi.setHeaderOptions,
- getBook: publicApi.getBook,
+ getBook: publicApi.bookInfo,
+ getSeason: publicApi.bookSection
};
export default connect(mapStateToProps, mapDispatchToProps)(VideoDisplay);
diff --git a/src/views/Videos/components/MostViewedVideo.js b/src/views/Videos/components/MostViewedVideo.js
index 27a54aa..db1a48b 100644
--- a/src/views/Videos/components/MostViewedVideo.js
+++ b/src/views/Videos/components/MostViewedVideo.js
@@ -3,7 +3,7 @@ import { Link } from "react-router-dom";
import Header from "../../../components/Header";
import posterImage from "../../../assets/images/poster.svg";
-function MostViewedVideo({}) {
+function MostViewedVideo({videos, grades}) {
const Video = ({ video }) => {
return (
-
+
{video.name}
@@ -37,7 +37,7 @@ function MostViewedVideo({}) {
{video.price}
- {"پایه" + " " + video.grade}
+ {"پایه" + " " + grades[video.gradeId]}
@@ -47,17 +47,10 @@ function MostViewedVideo({}) {
- {[0, 1, 2].map((video, index) => (
+ {videos.map((video, index) => (
))}
diff --git a/src/views/Videos/components/NewestVideo.js b/src/views/Videos/components/NewestVideo.js
index fac2566..e294189 100644
--- a/src/views/Videos/components/NewestVideo.js
+++ b/src/views/Videos/components/NewestVideo.js
@@ -1,27 +1,32 @@
import React from "react";
-import {Link} from 'react-router-dom';
+import { Link } from "react-router-dom";
import Header from "../../../components/Header";
import posterImage from "../../../assets/images/poster.svg";
-const NewestVideo = () => {
+const NewestVideo = ({ videos, grades }) => {
const Video = ({ video }) => {
return (
-
-
+
+
+
+
+
{video.name}
- {"پایه" + " " + video.grade}
+ {"پایه" + " " + grades[video.gradeId]}
);
@@ -30,23 +35,12 @@ const NewestVideo = () => {
- {[0, 1, 2, 3].map((video, index) => (
-
+ {videos.map((video, index) => (
+
))}
);
};
-export default NewestVideo;
\ No newline at end of file
+export default NewestVideo;
diff --git a/src/views/Videos/index.js b/src/views/Videos/index.js
index a40364f..c4c1907 100644
--- a/src/views/Videos/index.js
+++ b/src/views/Videos/index.js
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from "react";
import { connect } from "react-redux";
-import { publicApi } from "../../redux/actions";
+import { publicApi, book } from "../../redux/actions";
import Search from "../../components/Search";
import VerticalGradeFilter from "./components/VerticalGradeFilter";
import Divider from "../../components/Divider";
@@ -9,10 +9,11 @@ import NewestVideo from "./components/NewestVideo";
//assets
import searchLight from "../../assets/icons/search-light.svg";
-function Videos({ headerOptions, setHeaderOptions }) {
+function Videos({ headerOptions, setHeaderOptions, getList, videos, grades }) {
const [search, setSearch] = useState("");
useEffect(() => {
setHeaderOptions(headerOptions);
+ getList();
}, []);
return (
@@ -31,20 +32,24 @@ function Videos({ headerOptions, setHeaderOptions }) {
-
+
+
+
);
}
-const mapStateToProps = (state) => ({});
+const mapStateToProps = (state) => ({
+ videos : state.book.list,
+ grades: state.publicApi.grades,
+});
const mapDispatchToProps = {
setHeaderOptions: publicApi.setHeaderOptions,
+ getList : book.list
};
export default connect(mapStateToProps, mapDispatchToProps)(Videos);