@ -1,4 +1,6 @@
import React , { Component } from "react" ;
import { ToastContainer } from "react-toastify" ;
import { Link } from "react-router-dom" ;
import { connect } from "react-redux" ;
import { book } from "~/Redux/actions" ;
@ -14,12 +16,6 @@ import HomeScroll from "../Home/HomeScroll/index";
import HomeSlider from "../Home/HomeSlider/index" ;
import Loader from "~/components/Loader/index" ;
import sciense _7 from "~/assets/images/sciense-7.png" ;
import sciense _6 from "~/assets/images/sciense-6.png" ;
import sciense _8 from "~/assets/images/sciense-8.png" ;
import sciense _9 from "~/assets/images/sciense-9.png" ;
import zist _10 from "~/assets/images/zist-10.png" ;
import film from "~/assets/Video/film.mp4" ;
import product _shipping from "~/assets/icons/product-shipping.png" ;
import product _cash _back from "~/assets/icons/product-cash-back.png" ;
import product _support from "~/assets/icons/product-support.png" ;
@ -51,29 +47,40 @@ class Product extends Component {
window . location . pathname . length
) ,
} ) ;
this . props . getList ( ) ;
}
render ( ) {
const { product , sameProducts , supportItems , info } = this . props ;
const { product , sameProducts , supportItems , info , page , loading , list } =
this . props ;
return (
< >
{ window . innerWidth > 1000 ? (
this . props . info ? (
info ? (
< >
< div className = "product d-flex flex-column" >
< Navbar / >
< Breadcrumbs / >
< header className = "product__header d-flex mt-4" >
< Gallery gallery = { product . gallery } / >
< Gallery gallery = { info . files } / >
< Info
subTitle = { product . subTitle }
title = { product . title }
description = { product . description }
subTitle = { info . category }
title = {
page === "digital"
? info . product [ 0 ] . name
: info . product [ 1 ] . name
}
description = { info . description || "توضیحات محصول خالیست" }
/ >
< AddToCart
supportItems = { supportItems }
price = { product . price }
off = { product . off }
price = {
page === "digital"
? info . product [ 0 ] . price
: info . product [ 1 ] . price
}
// off={product.off}
page = { page }
/ >
< / h e a d e r >
< div className = "product__comments d-flex flex-column" >
@ -88,10 +95,12 @@ class Product extends Component {
< / d i v >
< div className = "product__comments--list d-flex flex-column" >
< Comment comment = { product . comments [ 0 ] } / >
{ info . comment . length > 0 ? (
< Comment comment = { info . comment [ 0 ] } / >
) : null }
< / d i v >
< / d i v >
< Identifier item = { sameProducts } / >
{ 0 ? < Identifier item = { [ ] } / > : null }
< / d i v >
< Footer / >
< / >
@ -105,7 +114,7 @@ class Product extends Component {
)
) : null }
{ window . innerWidth < 1000 ? (
this . props . info ? (
info ? (
< >
< div className = "mobile-product d-flex flex-column" >
< Navbar / >
@ -200,6 +209,17 @@ class Product extends Component {
< / d i v >
)
) : null }
< ToastContainer
position = "bottom-right"
autoClose = { 1500 }
hideProgressBar = { true }
newestOnTop = { true }
closeOnClick
rtl = { true }
pauseOnFocusLoss
draggable
pauseOnHover
/ >
< / >
) ;
}
@ -209,8 +229,10 @@ export default connect(
( state ) => ( {
info : state . book . info ,
// status: state.user.status,
loading : state . book . loading ,
list : state . book . list ,
} ) ,
{ getInfo : book . info }
{ getInfo : book . info , getList : book . list }
) ( Product ) ;
Product . defaultProps = {
@ -219,175 +241,6 @@ Product.defaultProps = {
{ title : "پشتیبانی 24 ساعته " , icon : product _support } ,
{ title : "ضمانت بازگشت " , icon : product _cash _back } ,
] ,
sameProducts : {
type : window . innerWidth > 1000 ? "slider" : "scroll" ,
title : "محصولات مرتبط" ,
moreText : "لیست کتاب ها" ,
height : window . innerWidth > 1000 ? 470 : 320 ,
design : window . innerWidth > 1000 ? "simple" : "product" ,
number : window . innerWidth > 1000 ? 4 : 2.8 ,
data : [
{
id : 0 ,
image : sciense _6 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه دهم ابتدایی" ,
price : "78.000" ,
oldPrice : "" ,
date : new Date ( ) ,
} ,
{
id : 1 ,
image : sciense _7 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه ششم ابتدایی" ,
price : "39.000" ,
oldPrice : "59.000" ,
date : new Date ( ) ,
} ,
{
id : 2 ,
image : sciense _8 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه ششم ابتدایی" ,
price : "21.000" ,
oldPrice : "" ,
} ,
{
id : 3 ,
image : sciense _9 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه دهم ابتدایی" ,
price : "" ,
oldPrice : "" ,
} ,
{
id : 4 ,
image : zist _10 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه هفتم ابتدایی" ,
price : "59.000" ,
oldPrice : "" ,
} ,
{
id : 5 ,
image : sciense _6 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه دهم ابتدایی" ,
price : "78.000" ,
oldPrice : "" ,
date : new Date ( ) ,
} ,
{
id : 6 ,
image : sciense _7 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه ششم ابتدایی" ,
price : "39.000" ,
oldPrice : "59.000" ,
date : new Date ( ) ,
} ,
{
id : 7 ,
image : sciense _8 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه ششم ابتدایی" ,
price : "21.000" ,
oldPrice : "" ,
date : new Date ( ) ,
} ,
{
id : 8 ,
image : sciense _9 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه دهم ابتدایی" ,
price : "" ,
oldPrice : "" ,
date : new Date ( ) ,
} ,
{
id : 9 ,
image : zist _10 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه هفتم ابتدایی" ,
price : "59.000" ,
oldPrice : "" ,
date : new Date ( ) ,
} ,
] ,
} ,
product : {
id : 1 ,
image : sciense _7 ,
title : "منفجر کردن مغز خود را به ما بسپارید" ,
subTitle : "پایه ششم ابتدایی" ,
price : "39.000" ,
off : "30%" ,
oldPrice : "59.000" ,
date : new Date ( ) ,
abstraction :
"لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ، و با استفاده از طراحان گرافیک است، چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است، و برای شرایط فعلی تکنولوژی مورد نیاز، و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد، کتابهای زیادی در شصت و سه درصد گذشته حال و آینده، شناخت فراوان جامعه و متخصصان را می طلبد، تا با نرم افزارها شناخت بیشت" ,
modules : [
"پک هدیه شامل یک عدد جلد سخت" ,
"عینک واقعیت مجازی" ,
"کارت گرافیک مناسب جهت اجرای بازی" ,
] ,
tips : [
"پک هدیه شامل یک عدد جلد سخت" ,
"عینک واقعیت مجازی" ,
"کارت گرافیک مناسب جهت اجرای بازی" ,
] ,
gallery : [
{ id : 0 , value : film , type : "film" } ,
{ id : 1 , value : sciense _6 , type : "image" } ,
{ id : 2 , value : sciense _7 , type : "image" } ,
{ value : sciense _8 , type : "image" } ,
] ,
description :
"لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ، و با استفاده از طراحان گرافیک است، چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است، و برای شرایط فعلی تکنولوژی مورد نیاز، و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد، کتابهای زیادی در شصت و سه درصد گذشته حال و آینده، شناخت فراوان جامعه و متخصصان را می طلبد، تا با نرم افزارها شناخت بیشت" ,
comments : [
{
id : 0 ,
username : "محمدرضا" ,
date : new Date ( ) ,
text : "عالی بود. ممنون از سایت زیباتون" ,
score : 4 ,
reply : "ممنون از شما که به ما اعتماد کردید" ,
} ,
{
id : 1 ,
username : "محمدرضا" ,
date : new Date ( ) ,
text : "عالی بود. ممنون از سایت زیباتون" ,
score : 2.5 ,
reply : "" ,
} ,
{
id : 2 ,
username : "محمدرضا" ,
date : new Date ( ) ,
text : "عالی بود. ممنون از سایت زیباتون" ,
score : 5 ,
reply : "" ,
} ,
{
id : 3 ,
username : "محمدرضا" ,
date : new Date ( ) ,
text : "عالی بود. ممنون از سایت زیباتون" ,
score : 3.7 ,
reply : "" ,
} ,
{
id : 4 ,
username : "محمدرضا" ,
date : new Date ( ) ,
text : "عالی بود. ممنون از سایت زیباتون" ,
score : 2 ,
reply : "" ,
} ,
] ,
} ,
} ;
const Item = ( props ) => {
@ -397,25 +250,36 @@ const Item = (props) => {
const Identifier = ( props ) => {
return (
< >
{ props . item . type === "scroll" ? (
{ window . innerWidth < 1000 ? (
< HomeScroll
number = { props . item . number }
height = { props . item . height }
title = { props . item . title }
data = { props . item . data }
designType = { props . item . design }
moreText = { props . item . moreText }
number = { 2.5 }
// height={props.item.height}
title = { "محصولات مشابه" }
data = { props . item }
designType = { "product" }
moreText = { "ّ بیشتر" }
/ >
) : null }
{ props . item . type === "slider" ? (
{ window . innerWidth > 1000 ? (
< HomeSlider
designType = { props . item . design }
number = { props . item . number }
height = { props . item . height }
title = { props . item . title }
data = { props . item . data }
designType = { "simple" }
number = { "4" }
// height={props.item.height}
title = { "محصولات مشابه" }
data = { props . item }
/ >
) : null }
< ToastContainer
position = "bottom-right"
autoClose = { 1500 }
hideProgressBar = { true }
newestOnTop = { true }
closeOnClick
rtl = { true }
pauseOnFocusLoss
draggable
pauseOnHover
/ >
< / >
) ;
} ;