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;
let status = proxy.status();
console.log({ status, s: this.props.profile });
const afterLogin = localStorage.getItem("afterLogin");
let home = (
<Route exact path={"/"}>
{status && status.status === 0 ? (
<Auth page={"profile"} />
) : afterLogin ? (
<>
{localStorage.removeItem("afterLogin")}
{console.log("hhhhhhhhhhhhhhhhhhaaaaaaaaa")}
<Redirect
to={{
pathname: afterLogin,
}}
/>
</>
) : (
<Home status={status} />
)}

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

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

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 [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 ? (
<div className="discount-code d-flex flex-column">
<h2 style={{ fontSize: fontSize.desktop.h2 }}>کد تخفیف</h2>
<p style={{ fontSize: fontSize.desktop.p }}>
اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید
</p>
<div className="discount-code__box d-flex align-items-center">
<input
style={{ fontSize: fontSize.desktop.input }}
type="text"
defaultValue={codeId}
onChange={(e) => setValue(e.target.value)}
/>
<button
style={{ fontSize: fontSize.desktop.button }}
onClick={setOff}
>
ثبت کد
</button>
</div>
{!code ? (
<>
<p style={{ fontSize: fontSize.desktop.p }}>
اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید
</p>
<div className="discount-code__box d-flex align-items-center">
<input
style={{ fontSize: fontSize.desktop.input }}
type="text"
defaultValue={codeId}
onChange={(e) => setValue(e.target.value)}
/>
<button
style={{ fontSize: fontSize.desktop.button }}
onClick={setOff}
>
ثبت کد
</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>
) : null}
{window.innerWidth < 1000 ? (
<div className="mobile-discount-code d-flex flex-column">
<h2 style={{ fontSize: fontSize.mobile.h2 }}>کد تخفیف</h2>
<p style={{ fontSize: fontSize.mobile.p }}>
اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید{" "}
</p>
<div className="mobile-discount-code__box d-flex align-items-center">
<input
style={{ fontSize: fontSize.mobile.input }}
type="text"
onChange={(e) => setValue(e.target.value)}
/>
<button
style={{ fontSize: fontSize.mobile.button }}
onClick={setOff}
>
ثبت کد
</button>
</div>
{!code ? (
<>
{" "}
<p style={{ fontSize: fontSize.mobile.p }}>
اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید{" "}
</p>
<div className="mobile-discount-code__box d-flex align-items-center">
<input
style={{ fontSize: fontSize.mobile.input }}
type="text"
onChange={(e) => setValue(e.target.value)}
/>
<button
style={{ fontSize: fontSize.mobile.button }}
onClick={setOff}
>
ثبت کد
</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>
) : 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);

@ -33,7 +33,7 @@
background-color: #2b95ff;
font-family: numeralLight;
color: white;
padding: 5px 10px;
padding: 5px 5px;
border: 0px;
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>
</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) => (
<Item data={item} key={i} />
))}
<span to={data.link} style={{ fontSize: fontSize.span }}>
مشاهده بیشتر
</span>
</div>
</Link>
);

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

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

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

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

@ -35,7 +35,10 @@ export default class SingleBlog extends Component {
ادامه مطلب
</Link>
</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.video ? <video sourcce={data.video} /> : null}
</div>

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

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

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

@ -2,7 +2,7 @@ import React, { Component } from "react";
import { toast } from "react-toastify";
import proxy from "~/Redux/proxy";
import { Link } from "react-router-dom";
import { Link, useHistory } from "react-router-dom";
import { connect } from "react-redux";
import { book } from "~/Redux/actions";
import { userProduct } from "~/Redux/actions";
@ -57,6 +57,50 @@ const fontSize = {
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 {
state = {
openComment: false,
@ -215,24 +259,12 @@ class Product extends Component {
مطالعه نمونه کتاب
</Link>
</div>
<button
onClick={() =>
proxy.status()
? this.props.pushToCart({
productId:
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>
<Addbutton
page={page}
info={info}
userId={this.props.id}
pushToCart={this.props.pushToCart}
/>
</div>
</header>
<div className="mobile-product__abstraction d-flex flex-column">

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

@ -5,7 +5,14 @@ class VideoApp extends Component {
player = {};
state = {
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() {
console.log(this.state.video.poster);
return (
// <div style={{ width: "100%", height: "100%" }}>
<ReactPlayer
style={{ backgroundImage: `url(${this.state.video.poster})` }}
height="100%"
width={"100%"}
url={this.state.video.src}
type="video/mp4"
autoplay={true}
url={this.state.video.src}
controls
playing
light
config={{
file: {
attributes: {
poster: this.state.video.poster,
disablePictureInPicture: true,
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 (
<>
{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 }}>
{/* <PlayCircleFilledRoundedIcon style={{ fontSize: 35 }} /> */}
{/* فیلمها */}
</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} />
</div>
</div>
) : null}
{window.innerWidth < 1000 ? (
<div className="d-flex flex-column">
<h3 style={{ fontSize: fontSize.mobile.h3 }}>
{/* <h3 style={{ fontSize: fontSize.mobile.h3 }}>
<PlayCircleFilledRoundedIcon style={{ fontSize: 35 }} /> فیلمها
</h3>
</h3> */}
<div className="mobile-video-box d-flex flex-column" id="video">
<ReactVideoJsPlayer fileId={data.fileIds} />
</div>

Loading…
Cancel
Save