update 19 files and delete 1 file

master
amir hosein gorji 3 years ago
parent 588cd9cc0e
commit 69599d3c65
  1. 12
      src/AppRouter.js
  2. 6
      src/Redux/actions/userFactor.js
  3. 2
      src/Redux/reducers/userFactor.js
  4. BIN
      src/assets/IRANSans.rar
  5. BIN
      src/assets/images/Group.png
  6. BIN
      src/assets/images/Groupbg.png
  7. BIN
      src/assets/images/app.jpg
  8. 144
      src/views/Cart/Discount/index.js
  9. 2
      src/views/Cart/Discount/index.scss
  10. 81
      src/views/Home/Download/index.js
  11. 98
      src/views/Home/Download/index.scss
  12. 9
      src/views/Home/HomeStatic/Vitrin/index.js
  13. 13
      src/views/Home/Navbar/Laptop/index.js
  14. 2
      src/views/Home/Navbar/Laptop/index.scss
  15. 11
      src/views/Home/Navbar/Mobile/index.js
  16. 2
      src/views/Home/Navbar/Mobile/index.scss
  17. 5
      src/views/Home/SingleBlog/index.js
  18. 5
      src/views/Home/SingleBlog/index.scss
  19. 3
      src/views/Home/index.js
  20. 50
      src/views/Product/AddToCart/index.js
  21. 70
      src/views/Product/index.js
  22. 263
      src/views/Products/Product/index.js
  23. 19
      src/views/QR/VideoBox/React-video-js-player/index.js
  24. 15
      src/views/QR/VideoBox/index.js

@ -71,10 +71,22 @@ class AppRouter extends Component {
const mobile = window.innerWidth < 1000 ? true : false; const mobile = window.innerWidth < 1000 ? true : false;
let status = proxy.status(); let status = proxy.status();
console.log({ status, s: this.props.profile }); console.log({ status, s: this.props.profile });
const afterLogin = localStorage.getItem("afterLogin");
let home = ( let home = (
<Route exact path={"/"}> <Route exact path={"/"}>
{status && status.status === 0 ? ( {status && status.status === 0 ? (
<Auth page={"profile"} /> <Auth page={"profile"} />
) : afterLogin ? (
<>
{localStorage.removeItem("afterLogin")}
{console.log("hhhhhhhhhhhhhhhhhhaaaaaaaaa")}
<Redirect
to={{
pathname: afterLogin,
}}
/>
</>
) : ( ) : (
<Home status={status} /> <Home status={status} />
)} )}

@ -30,11 +30,11 @@ const userFactor = {
await proxy.post("userFactor/add", data, { dispatch }); await proxy.post("userFactor/add", data, { dispatch });
await proxy.get("userFactor/list", data2, { dispatch }); await proxy.get("userFactor/list", data2, { dispatch });
}, },
del: deleteUserOffCode:
(data = {}, data2 = {}) => (data = {}, data2 = {}) =>
async (dispatch) => { async (dispatch) => {
await proxy.delete("userFactor/delete", data, { dispatch }); await proxy.delete("userFactor/deleteUserOffCode", data, { dispatch });
await proxy.get("userFactor/list", data2, { dispatch }); await proxy.get("userFactor/info", data2, { dispatch });
}, },
}; };

@ -23,7 +23,7 @@ export default function userFactor(state = initialState, action) {
case "userFactor/add": case "userFactor/add":
toast.success("درخواست شما با موفقیت انجام شد."); toast.success("درخواست شما با موفقیت انجام شد.");
return { ...state, loading: false, error: null, sum: data.payPrice }; return { ...state, loading: false, error: null, sum: data.payPrice };
case "userFactor/delete": case "userFactor/deleteUserOffCode":
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "userFactor/payment": case "userFactor/payment":
window.location.replace(data); window.location.replace(data);

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

@ -21,54 +21,126 @@ const fontSize = {
}, },
}; };
const DiscoutCode = ({ codeId, setCodeId, userId, factorId }) => { const DiscoutCode = ({
const [value, setValue] = React.useState(codeId || ""); codeId,
setCodeId,
delCodeId,
userId,
factorId,
code,
}) => {
const [value, setValue] = React.useState(code || "");
function setOff() { function setOff() {
setCodeId({ offCodeValue: value, userId: userId, id: factorId || null }); setCodeId({ offCodeValue: value, userId: userId, id: factorId || null });
} }
console.log({ code });
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<div className="discount-code d-flex flex-column"> <div className="discount-code d-flex flex-column">
<h2 style={{ fontSize: fontSize.desktop.h2 }}>کد تخفیف</h2> <h2 style={{ fontSize: fontSize.desktop.h2 }}>کد تخفیف</h2>
<p style={{ fontSize: fontSize.desktop.p }}> {!code ? (
اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید <>
</p> <p style={{ fontSize: fontSize.desktop.p }}>
<div className="discount-code__box d-flex align-items-center"> اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید
<input </p>
style={{ fontSize: fontSize.desktop.input }} <div className="discount-code__box d-flex align-items-center">
type="text" <input
defaultValue={codeId} style={{ fontSize: fontSize.desktop.input }}
onChange={(e) => setValue(e.target.value)} type="text"
/> defaultValue={codeId}
<button onChange={(e) => setValue(e.target.value)}
style={{ fontSize: fontSize.desktop.button }} />
onClick={setOff} <button
> style={{ fontSize: fontSize.desktop.button }}
ثبت کد onClick={setOff}
</button> >
</div> ثبت کد
</button>
</div>
</>
) : (
<>
<p style={{ fontSize: fontSize.desktop.p }}>
کد تخفیف برای شما ثبت شده است
</p>
<div
className="discount-code__box d-flex align-items-center"
style={{ backgroundColor: "#eee" }}
>
<input
disabled
style={{ fontSize: 13, color: "gray" }}
type="text"
defaultValue={code}
/>
<button
style={{
fontSize: fontSize.mobile.button,
backgroundColor: "orange",
width: 40,
}}
onClick={() => delCodeId({})}
>
x{" "}
</button>
</div>
</>
)}
</div> </div>
) : null} ) : null}
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<div className="mobile-discount-code d-flex flex-column"> <div className="mobile-discount-code d-flex flex-column">
<h2 style={{ fontSize: fontSize.mobile.h2 }}>کد تخفیف</h2> <h2 style={{ fontSize: fontSize.mobile.h2 }}>کد تخفیف</h2>
<p style={{ fontSize: fontSize.mobile.p }}> {!code ? (
اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید{" "} <>
</p> {" "}
<div className="mobile-discount-code__box d-flex align-items-center"> <p style={{ fontSize: fontSize.mobile.p }}>
<input اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید{" "}
style={{ fontSize: fontSize.mobile.input }} </p>
type="text" <div className="mobile-discount-code__box d-flex align-items-center">
onChange={(e) => setValue(e.target.value)} <input
/> style={{ fontSize: fontSize.mobile.input }}
<button type="text"
style={{ fontSize: fontSize.mobile.button }} onChange={(e) => setValue(e.target.value)}
onClick={setOff} />
> <button
ثبت کد style={{ fontSize: fontSize.mobile.button }}
</button> onClick={setOff}
</div> >
ثبت کد
</button>
</div>
</>
) : (
<>
{" "}
<p style={{ fontSize: fontSize.mobile.p }}>
کد تخفیف برای شما ثبت شده است
</p>
<div
className="discount-code__box d-flex align-items-center"
style={{ backgroundColor: "#eee" }}
>
<input
disabled
style={{ fontSize: 13, color: "gray" }}
type="text"
defaultValue={code}
/>
<button
style={{
fontSize: fontSize.mobile.button,
backgroundColor: "orange",
width: 40,
}}
onClick={() => delCodeId({})}
>
x{" "}
</button>
</div>
</>
)}
</div> </div>
) : null} ) : null}
</> </>
@ -78,10 +150,12 @@ const DiscoutCode = ({ codeId, setCodeId, userId, factorId }) => {
export default connect( export default connect(
(state) => ({ (state) => ({
codeId: state.userFactor.info?.codeId, codeId: state.userFactor.info?.codeId,
code: state.userFactor.info?.offCode?.code,
userId: state.user.status.id, userId: state.user.status.id,
factorId: state.userFactor.info?.id, factorId: state.userFactor.info?.id,
}), }),
{ {
setCodeId: userFactor.update, setCodeId: userFactor.update,
delCodeId: userFactor.deleteUserOffCode,
} }
)(DiscoutCode); )(DiscoutCode);

@ -33,7 +33,7 @@
background-color: #2b95ff; background-color: #2b95ff;
font-family: numeralLight; font-family: numeralLight;
color: white; color: white;
padding: 5px 10px; padding: 5px 5px;
border: 0px; border: 0px;
width: 80px; width: 80px;
} }

@ -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 ? (
<div className="h-download-app" id="download">
<div className="h-download-app-text">
لذت یادگیری را با<span>دانوین</span> تجربه کنید
</div>
<div className="h-download-app-content">
<div className="h-download-app-content-box1"></div>
<a
download
href="http://danovin.ir/app.apk"
className="h-download-app-content-box2"
>
<div className="h-download-app-content-box2-app-img-container">
<img
src={app_icon_img}
className="h-download-app-content-box2-app-img"
alt="app_icon_img"
/>
</div>
<div className="h-download-app-content-box2-text">
<div className="h-download-app-content-box2-text-title">
دریافت اپلیکیشن اختصاصی دانوین
</div>
<div className="h-download-app-content-box2-text-subtitle">
به راحتی از همین جا دانلود کنید...
</div>
</div>
<img
src={download_icon}
className="h-download-app-content-box2-download-icon"
alt="download_icon"
style={{ width: 30 }}
/>
</a>
</div>
</div>
) : (
<div>
<a
download
href="http://danovin.ir/app.apk"
className="h-download-app-content-mobile"
>
<div className="h-download-app-content-box2-app-img-container">
<img
src={app_icon_img}
className="h-download-app-content-box2-app-img"
alt="app_icon_img"
/>
</div>
<div className="h-download-app-content-box2-text">
<div className="h-download-app-content-box2-text-title">
دریافت اپلیکیشن اختصاصی دانوین
</div>
<div className="h-download-app-content-box2-text-subtitle">
به راحتی از همین جا دانلود کنید...
</div>
</div>
<img
src={download_icon}
className="h-download-app-content-box2-download-icon"
alt="download_icon"
style={{ width: 30 }}
/>
</a>
<div style={{ height: 1, width: "100%" }}></div>
</div>
)}
</>
);
};
export default H_DownloadApp;

@ -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;
}

@ -32,14 +32,13 @@ export default function Vitrin(props) {
<h1 style={{ fontSize: fontSize.h1 }}>{data.title}</h1> <h1 style={{ fontSize: fontSize.h1 }}>{data.title}</h1>
</span> </span>
<div className="d-flex align-items-end" style={{ margin: "auto" }}> <div
className="d-flex justify-content-around"
style={{ margin: "auto" }}
>
{data.books.map((item, i) => ( {data.books.map((item, i) => (
<Item data={item} key={i} /> <Item data={item} key={i} />
))} ))}
<span to={data.link} style={{ fontSize: fontSize.span }}>
مشاهده بیشتر
</span>
</div> </div>
</Link> </Link>
); );

@ -52,6 +52,19 @@ class LaptopNavbar extends Component {
</Link> </Link>
</li> </li>
))} ))}
<li style={{ fontSize: fontSize.desktop.li }}>
<span
onClick={() => {
window.scrollTo(0, document.body.scrollHeight);
}}
style={{
cursor: "pointer",
color: "#6f7074",
}}
>
دانلود
</span>
</li>
</ul> </ul>
</div> </div>
<div className="d-flex align-items-center"> <div className="d-flex align-items-center">

@ -58,7 +58,7 @@
// height: 50px; // height: 50px;
// background : greenyellow; // background : greenyellow;
position: relative; position: relative;
left: 14px; // left: 14px;
img { img {
max-height: 60px; max-height: 60px;
} }

@ -76,18 +76,19 @@ export default function MobileNavbar(props) {
if (!status) if (!status)
return ( return (
<nav className="mobile-navbar d-flex"> <nav className="mobile-navbar d-flex">
<div> <div className="d-flex">
<div <div
className="mobile-navbar__menu" className="mobile-navbar__menu"
style={{ marginTop: 10 }}
onClick={toggleDrawer("right", true)} onClick={toggleDrawer("right", true)}
> >
<img src={hamburger} alt="منو" /> <img src={hamburger} alt="منو" />
<Link to="/" className="mobile-navbar__logo2">
<img src={logo} alt="لوگو" className="logo" />
</Link>
</div> </div>
<Link to="/" className="mobile-navbar__logo2" style={{}}>
<img src={logo} alt="لوگو" className="logo" />
</Link>
</div> </div>
<div className="mobile-navbar__left" style={{ marginLeft: 10 }}> <div className="mobile-navbar__left d-flex" style={{ marginLeft: 10 }}>
<Link <Link
style={{ fontSize: 12 }} style={{ fontSize: 12 }}
to={"/auth"} to={"/auth"}

@ -28,7 +28,7 @@
} }
.logo { .logo {
width: 85px; width: 85px;
margin-right: 15px; margin-right: 25px;
} }
} }
&__logo { &__logo {

@ -35,7 +35,10 @@ export default class SingleBlog extends Component {
ادامه مطلب ادامه مطلب
</Link> </Link>
</div> </div>
<div className="single-blog__left d-flex justify-content-center align-items-center"> <div
className="single-blog__left d-flex justify-content-center align-items-center"
style={{ width: "100%", height: "100%" }}
>
{data.id ? <Identifier data={data} fontSize={fontSize} /> : null} {data.id ? <Identifier data={data} fontSize={fontSize} /> : null}
{data.video ? <video sourcce={data.video} /> : null} {data.video ? <video sourcce={data.video} /> : null}
</div> </div>

@ -1,8 +1,11 @@
.single-blog { .single-blog {
width: 100%; width: 100%;
margin: 75px 0px; margin: 75px 0px;
border: 1px solid gray;
border-radius: 5px;
padding: 10px 20px;
&__right { &__right {
width: 50%; // width: 50%;
height: 100%; height: 100%;
align-items: flex-start; align-items: flex-start;
padding-left: 40px; padding-left: 40px;

@ -12,6 +12,7 @@ import HomeSearch from "./HomeSearch/index";
import Membership from "./Membership/index"; import Membership from "./Membership/index";
import SingleBlog from "./SingleBlog/index"; import SingleBlog from "./SingleBlog/index";
import Loader from "~/components/Loader/index"; import Loader from "~/components/Loader/index";
import Download from "./Download/index";
// import pic1 from "~/assets/images/pic1.png"; // import pic1 from "~/assets/images/pic1.png";
// import pic from "~/assets/images/pic.png"; // import pic from "~/assets/images/pic.png";
@ -82,6 +83,8 @@ class Home extends Component {
<Identifier item={item} key={i} /> <Identifier item={item} key={i} />
))} ))}
</div> </div>
{window.location.host.indexOf("app") > -1 ? null : <Download />}
{window.innerWidth > 1000 ? <Footer /> : null} {window.innerWidth > 1000 ? <Footer /> : null}
</> </>
</> </>

@ -4,12 +4,13 @@ import { toast } from "react-toastify";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { userProduct } from "~/Redux/actions"; import { userProduct } from "~/Redux/actions";
import { Link } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import "./index.scss"; import "./index.scss";
import document_red from "~/assets/icons/document-red.png"; import document_red from "~/assets/icons/document-red.png";
import ebook_blue from "~/assets/icons/e-book-blue.png"; import ebook_blue from "~/assets/icons/e-book-blue.png";
import basket_white from "~/assets/icons/basket-white.png"; import basket_white from "~/assets/icons/basket-white.png";
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const fontSize = { const fontSize = {
@ -24,6 +25,7 @@ const fontSize = {
}; };
function AddToCart(props) { function AddToCart(props) {
let history = useHistory();
const { const {
price, price,
off, off,
@ -35,6 +37,20 @@ function AddToCart(props) {
productType, productType,
} = props; } = props;
console.log({ info, productType }); console.log({ info, productType });
function Navigate({ path }) {
history.push(path);
}
let productId = localStorage.getItem("pushToCart");
if (productId) {
localStorage.removeItem("pushToCart");
props.pushToCart({
productId,
userId: props.id,
count: 1,
});
setTimeout(() => history.push("/cart"), 2000);
}
// if (this.state.path) return Navigate({ path: this.state.path });
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
@ -97,18 +113,26 @@ function AddToCart(props) {
<button <button
style={{ fontSize: fontSize.desktop.button }} style={{ fontSize: fontSize.desktop.button }}
className="product-addtocart__box--addButton" className="product-addtocart__box--addButton"
onClick={() => onClick={() => {
proxy.status() if (proxy.status())
? props.pushToCart({ props.pushToCart({
productId: productId:
page === "digital" page === "digital"
? info.product[0].id ? info.product[0].id
: info.product[1].id, : info.product[1].id,
userId: props.id, userId: props.id,
count: 1, count: 1,
}) });
: toast.info("ابتدا وارد حساب کاربری خود شوید.") else {
} toast.info("جهت ادامه فرآیند خرید وارد حساب خود شوید");
localStorage.setItem("afterLogin", window.location.pathname);
localStorage.setItem(
"pushToCart",
page === "digital" ? info.product[0].id : info.product[1].id
);
Navigate({ path: "/auth" });
}
}}
> >
افزودن به سبد خرید افزودن به سبد خرید
<img src={basket_white} alt="" /> <img src={basket_white} alt="" />

@ -2,7 +2,7 @@ import React, { Component } from "react";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import proxy from "~/Redux/proxy"; import proxy from "~/Redux/proxy";
import { Link } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { book } from "~/Redux/actions"; import { book } from "~/Redux/actions";
import { userProduct } from "~/Redux/actions"; import { userProduct } from "~/Redux/actions";
@ -57,6 +57,50 @@ const fontSize = {
li: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 29, li: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 29,
}, },
}; };
function Addbutton({ page, info, pushToCart, userId }) {
let history = useHistory();
function Navigate({ path }) {
history.push(path);
}
let productId = localStorage.getItem("pushToCart");
if (productId) {
toast.info("جهت ادامه فرآیند خرید وارد حساب خود شوید");
localStorage.removeItem("pushToCart");
pushToCart({
productId,
userId,
count: 1,
});
setTimeout(() => history.push("/cart"), 2000);
}
return (
<button
onClick={() => {
if (proxy.status())
pushToCart({
productId:
page === "digital" ? info.product[0].id : info.product[1].id,
userId,
count: 1,
});
else {
toast.info("جهت ادامه فرآیند خرید وارد حساب خود شوید");
localStorage.setItem("afterLogin", window.location.pathname);
localStorage.setItem(
"pushToCart",
page === "digital" ? info.product[0].id : info.product[1].id
);
Navigate({ path: "/auth" });
}
}}
className="mobile-product__header--sampleButton"
style={{ fontSize: fontSize.mobile.a }}
>
افزودن به سبد خرید
</button>
);
}
class Product extends Component { class Product extends Component {
state = { state = {
openComment: false, openComment: false,
@ -215,24 +259,12 @@ class Product extends Component {
مطالعه نمونه کتاب مطالعه نمونه کتاب
</Link> </Link>
</div> </div>
<button <Addbutton
onClick={() => page={page}
proxy.status() info={info}
? this.props.pushToCart({ userId={this.props.id}
productId: pushToCart={this.props.pushToCart}
page === "digital" />
? info.product[0].id
: info.product[1].id,
userId: this.props.id,
count: 1,
})
: toast.info("ابتدا وارد حساب کاربری خود شوید.")
}
className="mobile-product__header--sampleButton"
style={{ fontSize: fontSize.mobile.a }}
>
افزودن به سبد خرید
</button>
</div> </div>
</header> </header>
<div className="mobile-product__abstraction d-flex flex-column"> <div className="mobile-product__abstraction d-flex flex-column">

@ -1,6 +1,6 @@
/* eslint-disable jsx-a11y/anchor-is-valid */ /* eslint-disable jsx-a11y/anchor-is-valid */
import React, { Component } from "react"; import React, { Component } from "react";
import { Link } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import proxy from "~/Redux/proxy"; import proxy from "~/Redux/proxy";
import basket from "../../../assets/icons/basket.png"; import basket from "../../../assets/icons/basket.png";
@ -25,137 +25,85 @@ const grades = [
"دوازدهم", "دوازدهم",
]; ];
class Product extends Component { function Product(props) {
render() { let history = useHistory();
const { product } = this.props; function Navigate({ path }) {
history.push(path);
return ( }
<> const { product } = props;
{window.innerWidth < 1000 ? ( let productId = localStorage.getItem("pushToCart");
<div className="mobile-products-product d-flex flex-column "> if (productId) {
<Link localStorage.removeItem("pushToCart");
to={`/products/physical/${product.id}`} props.pushToCart({
className=" align-items-center d-flex flex-column " productId,
style={{ textDecoration: "none" }} userId: props.id,
> count: 1,
<img });
className="pimg" setTimeout(() => history.push("/cart"), 2000);
src={`https://dnvn.ir/api/v1/file/${product.fileIds}`} }
alt={"عکس مجصول"} return (
/> <>
<div className="mobile-products-product__info d-flex flex-column"> {window.innerWidth < 1000 ? (
<h1>{`${product.name} پایه ${grades[product.gradeId]}`}</h1> <div className="mobile-products-product d-flex flex-column ">
</div> <Link
</Link> to={`/products/physical/${product.id}`}
className=" align-items-center d-flex flex-column "
<div className="mobile-products-product__links d-flex flex-column"> style={{ textDecoration: "none" }}
<div className="d-flex" style={{ width: "100%" }}> >
<Link <img
to={`/products/physical/${product.id}`} className="pimg"
className="mobile-products-product__links--physical d-flex justify-content-between align-items-center" src={`https://dnvn.ir/api/v1/file/${product.fileIds}`}
> alt={"عکس مجصول"}
<h2> نسخه چاپی</h2> />
<span>{product.product[1].price} تومان</span> <div className="mobile-products-product__info d-flex flex-column">
</Link> <h1>{`${product.name} پایه ${grades[product.gradeId]}`}</h1>
<div
className="mobile-products-product__links--basket d-flex"
style={{ backgroundColor: "#7fc75d" }}
onClick={() => {
proxy.status()
? this.props.pushToCart({
productId: product.product[1].id,
userId: this.props.id,
count: 1,
})
: toast.info("ابتدا وارد حساب کاربری خود شوید.");
}}
>
<img src={basket2} alt="" width="20px" height="20px" />
</div>
</div>
<div className="d-flex" style={{ width: "100%", opacity: 0.3 }}>
<span
to={`/products/digital/${product.id}`}
className="mobile-products-product__links--ar d-flex justify-content-between align-items-center"
>
<h2> الکترونیکی</h2>
{/* <span>{product.product[0].price} تومان</span> */}
<span> به زودی</span>
</span>
<div
className="mobile-products-product__links--basket d-flex"
// onClick={() => {
// proxy.status()
// ? this.props.pushToCart({
// productId: product.product[0].id,
// userId: this.props.id,
// count: 1,
// })
// : toast.info("ابتدا وارد حساب کاربری خود شوید.");
// }}
>
<img src={basket} alt="" width="20px" height="20px" />
</div>
</div>
</div> </div>
</div> </Link>
) : null}
{window.innerWidth > 1000 ? ( <div className="mobile-products-product__links d-flex flex-column">
<article className="products-product d-flex flex-column align-items-center">
<Link
to={`/products/physical/${product.id}`}
style={{ textDecoration: "none" }}
>
<img
className="pimg"
src={`https://dnvn.ir/api/v1/file/${product.fileIds}`}
alt={product.name}
/>
<h1 style={{ fontSize: 15 }}>
{`${product.name} پایه ${grades[product.gradeId]}`}
</h1>
</Link>
<div className="d-flex" style={{ width: "100%" }}> <div className="d-flex" style={{ width: "100%" }}>
<Link <Link
to={`/products/physical/${product.id}`} to={`/products/physical/${product.id}`}
style={{ fontSize: 12 }} className="mobile-products-product__links--physical d-flex justify-content-between align-items-center"
className="products-product--physical d-flex justify-content-between align-items-center"
> >
<h2 style={{ fontSize: 12 }}>نسخه چاپی</h2> <h2> نسخه چاپی</h2>
<span style={{ fontSize: 12 }}> <span>{product.product[1].price} تومان</span>
{product.product[1].price} تومان
</span>
</Link> </Link>
<div <div
className="products-product--basket d-flex" className="mobile-products-product__links--basket d-flex"
style={{ backgroundColor: "#7fc75d", marginTop: 0 }} style={{ backgroundColor: "#7fc75d" }}
onClick={() => { onClick={() => {
proxy.status() if (proxy.status())
? this.props.pushToCart({ props.pushToCart({
productId: product.product[1].id, productId: product.product[1].id,
userId: this.props.id, userId: props.id,
count: 1, count: 1,
}) });
: toast.info("ابتدا وارد حساب کاربری خود شوید."); else {
localStorage.setItem(
"afterLogin",
window.location.pathname
);
localStorage.setItem("pushToCart", product.product[1].id);
Navigate({ path: "/auth" });
}
}} }}
> >
<img src={basket2} alt="" width="20px" height="20px" /> <img src={basket2} alt="" width="20px" height="20px" />
</div> </div>
</div> </div>
<div className="d-flex" style={{ width: "100%", opacity: 0.3 }}> <div className="d-flex" style={{ width: "100%", opacity: 0.3 }}>
<div <span
to={`/products/digital/${product.id}`} to={`/products/digital/${product.id}`}
className="products-product--ar d-flex justify-content-between align-items-center" className="mobile-products-product__links--ar d-flex justify-content-between align-items-center"
> >
<h2 style={{ fontSize: 12 }}>نسخه الکترونیک</h2> <h2> الکترونیکی</h2>
<span style={{ fontSize: 12 }}> {/* <span>{product.product[0].price} تومان</span> */}
{/* {product.product[0].price} تومان */}
به زودی <span> به زودی</span>
</span> </span>
</div>
<div <div
className="products-product--basket d-flex" className="mobile-products-product__links--basket d-flex"
// onClick={() => { // onClick={() => {
// proxy.status() // proxy.status()
// ? this.props.pushToCart({ // ? this.props.pushToCart({
@ -169,11 +117,86 @@ class Product extends Component {
<img src={basket} alt="" width="20px" height="20px" /> <img src={basket} alt="" width="20px" height="20px" />
</div> </div>
</div> </div>
</article> </div>
) : null} </div>
</> ) : null}
); {window.innerWidth > 1000 ? (
} <article className="products-product d-flex flex-column align-items-center">
<Link
to={`/products/physical/${product.id}`}
style={{ textDecoration: "none" }}
>
<img
className="pimg"
src={`https://dnvn.ir/api/v1/file/${product.fileIds}`}
alt={product.name}
/>
<h1 style={{ fontSize: 15 }}>
{`${product.name} پایه ${grades[product.gradeId]}`}
</h1>
</Link>
<div className="d-flex" style={{ width: "100%" }}>
<Link
to={`/products/physical/${product.id}`}
style={{ fontSize: 12 }}
className="products-product--physical d-flex justify-content-between align-items-center"
>
<h2 style={{ fontSize: 12 }}>نسخه چاپی</h2>
<span style={{ fontSize: 12 }}>
{product.product[1].price} تومان
</span>
</Link>
<div
className="products-product--basket d-flex"
style={{ backgroundColor: "#7fc75d", marginTop: 0 }}
onClick={() => {
if (proxy.status())
props.pushToCart({
productId: product.product[1].id,
userId: props.id,
count: 1,
});
else {
toast.info("جهت ادامه فرآیند خرید وارد حساب خود شوید");
localStorage.setItem("afterLogin", window.location.pathname);
localStorage.setItem("pushToCart", product.product[1].id);
Navigate({ path: "/auth" });
}
}}
>
<img src={basket2} alt="" width="20px" height="20px" />
</div>
</div>
<div className="d-flex" style={{ width: "100%", opacity: 0.3 }}>
<div
to={`/products/digital/${product.id}`}
className="products-product--ar d-flex justify-content-between align-items-center"
>
<h2 style={{ fontSize: 12 }}>نسخه الکترونیک</h2>
<span style={{ fontSize: 12 }}>
{/* {product.product[0].price} تومان */}
به زودی
</span>
</div>
<div
className="products-product--basket d-flex"
// onClick={() => {
// proxy.status()
// ? this.props.pushToCart({
// productId: product.product[0].id,
// userId: this.props.id,
// count: 1,
// })
// : toast.info("ابتدا وارد حساب کاربری خود شوید.");
// }}
>
<img src={basket} alt="" width="20px" height="20px" />
</div>
</div>
</article>
) : null}
</>
);
} }
export default connect((state) => ({}), { export default connect((state) => ({}), {

@ -5,7 +5,14 @@ class VideoApp extends Component {
player = {}; player = {};
state = { state = {
video: { video: {
src: `https://dnvn.ir/api/v1/file/${this.props.fileId}`, src: `https://dnvn.ir/api/v1/file/${
this.props.fileId.indexOf(",")
? this.props.fileId.split(",")[0]
: this.props.fileId
}`,
poster: this.props.fileId.split(",")[1]
? `https://dnvn.ir/api/v1/file/${this.props.fileId.split(",")[1]}`
: null,
}, },
}; };
@ -39,23 +46,29 @@ class VideoApp extends Component {
} }
render() { render() {
console.log(this.state.video.poster);
return ( return (
// <div style={{ width: "100%", height: "100%" }}> // <div style={{ width: "100%", height: "100%" }}>
<ReactPlayer <ReactPlayer
style={{ backgroundImage: `url(${this.state.video.poster})` }}
height="100%" height="100%"
width={"100%"} width={"100%"}
url={this.state.video.src}
type="video/mp4" type="video/mp4"
autoplay={true} autoplay={true}
url={this.state.video.src}
controls controls
playing playing
light light
config={{ config={{
file: { file: {
attributes: { attributes: {
poster: this.state.video.poster,
disablePictureInPicture: true, disablePictureInPicture: true,
controlsList: controlsList:
"nodownload nofullscreen noremoteplayback noplaybackrate", window.location.host.indexOf("app") > -1
? "nodownload nofullscreen noremoteplayback noplaybackrate"
: "nodownload noremoteplayback noplaybackrate",
}, },
}, },
}} }}

@ -21,21 +21,28 @@ export default function VideoBox(props) {
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<div className="d-flex flex-column"> <div
className="d-flex flex-column"
style={{ width: "100%", height: "100%" }}
>
<h3 style={{ fontSize: fontSize.desktop.h3 }}> <h3 style={{ fontSize: fontSize.desktop.h3 }}>
{/* <PlayCircleFilledRoundedIcon style={{ fontSize: 35 }} /> */} {/* <PlayCircleFilledRoundedIcon style={{ fontSize: 35 }} /> */}
{/* فیلمها */} {/* فیلمها */}
</h3> </h3>
<div className="video-box d-flex flex-column" id="video"> <div
className="video-box d-flex flex-column"
id="video"
style={{ width: "100%", height: "100%" }}
>
<ReactVideoJsPlayer fileId={data.fileIds} /> <ReactVideoJsPlayer fileId={data.fileIds} />
</div> </div>
</div> </div>
) : null} ) : null}
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<div className="d-flex flex-column"> <div className="d-flex flex-column">
<h3 style={{ fontSize: fontSize.mobile.h3 }}> {/* <h3 style={{ fontSize: fontSize.mobile.h3 }}>
<PlayCircleFilledRoundedIcon style={{ fontSize: 35 }} /> فیلمها <PlayCircleFilledRoundedIcon style={{ fontSize: 35 }} /> فیلمها
</h3> </h3> */}
<div className="mobile-video-box d-flex flex-column" id="video"> <div className="mobile-video-box d-flex flex-column" id="video">
<ReactVideoJsPlayer fileId={data.fileIds} /> <ReactVideoJsPlayer fileId={data.fileIds} />
</div> </div>

Loading…
Cancel
Save