master
amir hosein gorji 3 years ago
parent 4e66f2d8c9
commit 09bb0f0ed6
  1. BIN
      public/favicon.ico
  2. 24
      public/index.html
  3. BIN
      public/logo192.png
  4. BIN
      public/logo512.png
  5. 2
      public/manifest.json
  6. 2
      src/AppRouter.js
  7. 8
      src/views/AR/index.js
  8. 6
      src/views/Auth/Login/Cellphone/index.scss
  9. 9
      src/views/Auth/Profile/Birthdate/index.js
  10. 59
      src/views/Auth/Profile/Document/index.js
  11. 8
      src/views/Auth/Profile/Select/index.js
  12. 80
      src/views/Auth/Profile/index.js
  13. 2
      src/views/Contact/Input/index.js
  14. 9
      src/views/Contact/Select/index.js
  15. 6
      src/views/Contact/index.js
  16. 2
      src/views/Contact/index.scss
  17. 54
      src/views/Home/HomeSlider/Header/index.scss
  18. 17
      src/views/Home/Navbar/Laptop/index.js
  19. 3
      src/views/Home/Navbar/Laptop/index.scss
  20. 9
      src/views/Home/Navbar/Mobile/NavbarDrawer/NavbarDrawer.js
  21. 24
      src/views/Product/AddToCart/index.js
  22. 26
      src/views/Product/index.js
  23. 8
      src/views/Products/Product/index.js

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 15 KiB

@ -1,27 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1"
user-scalable="false"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="false" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="فروشگاه کتاب دانوین" />
<link
href="https://api.mapbox.com/mapbox-gl-js/v1.10.1/mapbox-gl.css"
rel="stylesheet"
/>
<meta name="description" content="دانوین" />
<link href="https://api.mapbox.com/mapbox-gl-js/v1.10.1/mapbox-gl.css" rel="stylesheet" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>دانوین</title>
</head>
<body>
</head>
<body>
<div id="root"></div>
<script>
if ("serviceWorker" in navigator) {
@ -41,5 +36,6 @@
});
}
</script>
</body>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 35 KiB

@ -1,6 +1,6 @@
{
"short_name": "دانوین",
"name": "فروشگاه کتاب دانوین",
"name": " دانوین",
"icons": [
{
"src": "favicon.ico",

@ -60,7 +60,7 @@ class AppRouter extends Component {
}
componentDidMount() {
this.props.getUserProductList();
//sthis.props.getUserProductList();
}
render() {

@ -1,6 +1,6 @@
import React, { Component } from "react";
import { connect } from "react-redux";
import { publicApi } from "~/Redux/actions";
import { userProduct } from "~/Redux/actions";
import Navbar from "../Home/Navbar/index";
import Footer from "../Home/Footer/index";
@ -22,7 +22,7 @@ const fontSize = {
class AR extends Component {
componentDidMount() {
window.scrollTo(0, 0);
this.props.getArList();
// this.props.getArList({ type: 3 });
}
render() {
@ -75,9 +75,9 @@ class AR extends Component {
export default connect(
(state) => ({
arList: state.publicApi.arList,
arList: state.userProduct.list,
}),
{
getArList: publicApi.getArList,
getArList: userProduct.list,
}
)(AR);

@ -32,10 +32,12 @@
text-align: right;
position: absolute;
left: 108px;
top: 23px;
top: 19px;
height: 43px;
direction: ltr;
color: #a5a5a5;
font-family: numeralLight;
display: block;
}
input {
font-family: numeralLight;
@ -47,7 +49,7 @@
text-align: left;
background-color: #f2f2f2;
border: none;
padding: 8px 5px 8px 80px;
padding: 8px 5px 8px 85px;
border-radius: 5px;
&:focus {
outline: 0px;

@ -5,10 +5,11 @@ import "./index.scss";
import moment from "jalali-moment";
export default function Birthdate(props) {
const { defaultValue, parent, name } = props;
const momentDate = moment(defaultValue[name]);
const day = momentDate.format("jDD"),
month = momentDate.format("jMM"),
year = momentDate.format("jYYYY");
let momentDate = moment(defaultValue[name]);
let isvalid = momentDate.isValid();
const day = isvalid ? momentDate.format("jDD") : null,
month = isvalid ? momentDate.format("jMM") : null,
year = isvalid ? momentDate.format("jYYYY") : null;
const [state, setState] = useState({ day, month, year });
const onChange = (_name, value) => {
let _state = { ...state, [_name]: value };

@ -21,7 +21,7 @@ export default function Document(props) {
<>
{window.innerWidth < 1000 ? (
<div className="mobile-auth-profile__document d-flex justify-content-center align-items-center mb-3">
{parent.state.docFileIds === "" ? (
{parent.state[name] === "" ? (
<>
<input
type="file"
@ -44,45 +44,66 @@ export default function Document(props) {
parent.onChange(e.target.name, e.target.files[0])
}
/>
<span style={{ color: "rgb(18,140,126)" }}>
{parent.state.docFileIds.name}
<span
style={{
fontSize: fontSize.mobile.span,
width: "100%",
textAlign: "center",
margin: "auto",
}}
>
{parent.state[name].name ||
"گواهی تدریس ثبت شده و درحال بررسی می باشد"}
</span>
{/* <img src={parent.state.file} alt={"کاربر"} /> */}
</>
)}
</div>
) : null}
{window.innerWidth > 1000 ? (
<div className="auth-profile__upload d-flex justify-content-center-align-items-center">
{parent.state.file === null ? (
<div className="mobile-auth-profile__document d-flex justify-content-center-align-items-center">
{parent.state[name] === "" ? (
<>
<input
label={props.label}
onChange={(e) => parent.onChange(e.target.name, e.target.value)}
name={props.name}
defaultValue=""
type="file"
// parent.onChange(e.target.name, e.target.value)
name={name}
onChange={(e) =>
parent.onChange(e.target.name, e.target.files[0])
}
/>
<AddAPhotoIcon
<span
style={{
width: 40,
height: 40,
color: "grey",
position: "absolute",
left: "calc(50% - 20px)",
top: "calc(50% - 20px)",
fontSize: fontSize.mobile.span,
width: "100%",
textAlign: "center",
margin: "auto",
}}
/>
>
گواهی تدریس خود را آپلود کنید.
</span>
</>
) : (
<>
<input
label={props.label}
onChange={(e) => parent.onChange(e.target.name, e.target.value)}
onChange={(e) =>
parent.onChange(e.target.name, e.target.files[0])
}
name={props.name}
defaultValue=""
type="file"
/>
<span
style={{
fontSize: fontSize.mobile.span,
width: "100%",
textAlign: "center",
margin: "auto",
}}
>
{parent.state[name].name ||
"گواهی تدریس ثبت شده و درحال بررسی می باشد"}
</span>
</>
)}
</div>

@ -34,8 +34,8 @@ export default function CustomizedSelects(props) {
>
{/* 09366858119 */}
{props.options.map((item, i) => (
<option key={i} value={i}>
{item}
<option key={i} value={item.id || i}>
{item.name || item}
</option>
))}
</Select>
@ -65,8 +65,8 @@ export default function CustomizedSelects(props) {
>
{/* 09366858119 */}
{props.options.map((item, i) => (
<option key={i} value={i}>
{item}
<option key={i} value={item.id || i}>
{item.name || item}
</option>
))}
</Select>

@ -1,6 +1,6 @@
import React, { Component } from "react";
import onInput from "~/util/onInput";
import { user, file } from "~/Redux/actions";
import { user, file, publicApi } from "~/Redux/actions";
import { connect } from "react-redux";
import Select from "./Select/index";
@ -14,8 +14,8 @@ import Loader from "~/components/Loader/index";
import Document from "./Document/index";
import logo from "../../../assets/icons/logo.png";
import pic from "../../../assets/images/pic.png";
import { useHistory } from "react-router-dom";
import "./index.scss";
import { useHistory } from "react-router-dom";
function Navigate({ path }) {
let history = useHistory();
return <>{history.push(path)}</>;
@ -47,7 +47,8 @@ class Profile extends Component {
file: this.props.uploads["file"] || this.props.profile.picFileId || null,
picFileId:
this.props.uploads["file"] || this.props.profile.picFileId || null,
docFileIds: "",
docFileIds:
this.props.uploads["docFileIds"] || this.props.profile.docFileIds || "",
firstName: "",
lastName: "",
password: "",
@ -58,13 +59,15 @@ class Profile extends Component {
gender: this.props.profile.gender || 1,
status: this.props.profile.status || 1,
nationalId: "",
provinceId: "",
phone: "",
cityId: "",
zoneId: "",
schoolId: "",
postalCode: "",
gradeIds: this.props.profile.gradeIds,
provinceId: this.props.profile.provinceId,
cityId: this.props.profile.cityId,
validation: {
firstName: "",
@ -78,20 +81,28 @@ class Profile extends Component {
};
componentDidMount() {
this.props.getProvince();
this.props.getCity({ provinceId: this.props.profile.provinceId });
// this.props.getProfile();
}
onChange = (name, value) => {
// if (name === "gradeIds" && this.state.status == 2) {
// this.setState((prevState) => ({
// gradeIds: [...prevState.gradeIds.split(","), value],
// }));
// } else
if (name === "status") {
if (name === "provinceId") {
this.props.getCity({ provinceId: value });
this.setState({
cityId: null,
[name]: value,
});
} else if (name === "status") {
this.setState((prevState) => ({
gradeIds: prevState.gradeIds.slice(0, 1) || [],
[name]: value,
}));
} else if (name === "docFileIds") {
this.props.upload({ file: value, target: name });
this.setState({
[name]: value,
});
} else if (name === "file") {
this.props.upload({ file: value, target: name });
this.setState({
@ -122,6 +133,9 @@ class Profile extends Component {
schools,
gradeIds,
status,
provinceId,
cityId,
docFileIds,
} = this.state;
const { profile, setProfile } = this.props;
const data = {
@ -143,6 +157,11 @@ class Profile extends Component {
schools: schools || profile.schools,
gradeIds: String(gradeIds || profile.gradeIds),
status: status || profile.status,
provinceId: provinceId || profile.provinceId,
cityId: cityId || profile.cityId,
docFileIds: String(
this.props.uploads["docFileIds"] || docFileIds || profile.docFileIds
),
};
await setProfile(data);
};
@ -294,21 +313,23 @@ class Profile extends Component {
/>
</div>
) : null}
{console.log(this.props.province)}
<div className="mb-2" style={{ minWidth: "100%" }}>
<Select
parent={this}
options={["karaj", "tehran"]}
name="province"
options={this.props.provinceList}
name="provinceId"
label={"استان"}
selectedOptions={this.state.provinceId}
/>
</div>
<div className="mb-2">
<Select
parent={this}
options={["karaj", "tehran"]}
name="city"
options={this.props.cityList}
name="cityId"
label={"شهرستان"}
selectedOptions={this.state.cityId}
/>
</div>
{/* <div className="mb-2">
@ -319,7 +340,7 @@ class Profile extends Component {
label={"شهر/روستا"}
/>
</div> */}
{this.state.status === "دانش آموز" ? (
{this.state.status == 1 ? (
<div className="mb-2">
<Input
parent={this}
@ -330,7 +351,7 @@ class Profile extends Component {
/>
</div>
) : null}
{this.state.status === "معلم" ? (
{this.state.status == 2 ? (
<div className="mb-2">
<Input
parent={this}
@ -341,6 +362,9 @@ class Profile extends Component {
/>
</div>
) : null}
{this.state.status == 2 ? (
<Document parent={this} name="docFileIds" />
) : null}
<div className="mb-2">
<Input
parent={this}
@ -458,8 +482,7 @@ class Profile extends Component {
selectedOptions={this.state.gradeIds}
/>
) : null}
{this.state.status === "دانش آموز" &&
Number(this.state.gradeIds) > 9 ? (
{this.state.status == 1 && Number(this.state.gradeIds) > 9 ? (
<Select
parent={this}
options={[
@ -478,15 +501,17 @@ class Profile extends Component {
<Select
parent={this}
options={["karaj", "tehran"]}
options={this.props.provinceList}
name="provinceId"
label={"استان"}
selectedOptions={this.state.provinceId}
/>
<Select
parent={this}
options={["karaj", "tehran"]}
options={this.props.cityList}
name="cityId"
label={"شهرستان"}
selectedOptions={this.state.cityId}
/>
{/* <Select
parent={this}
@ -494,7 +519,7 @@ class Profile extends Component {
name="zoneId"
label={"شهر/روستا"}
/> */}
{this.state.status === "دانش آموز" ? (
{this.state.status == 1 ? (
<Input
parent={this}
name="schools"
@ -503,7 +528,7 @@ class Profile extends Component {
onInput={onInput.persianOnly}
/>
) : null}
{this.state.status === "معلم" ? (
{this.state.status == 2 ? (
<Input
parent={this}
name="schools"
@ -512,7 +537,7 @@ class Profile extends Component {
onInput={onInput.persianOnly}
/>
) : null}
{this.state.status === "معلم" ? (
{this.state.status == 2 ? (
<Document parent={this} name="docFileIds" />
) : null}
<Input
@ -530,7 +555,6 @@ class Profile extends Component {
label={"آدرس محل سکونت"}
name="address"
defaultValue={profile}
defaultValue={profile}
/>
<div className="mobile-auth-profile__footer d-flex justify-content-center">
<button onClick={() => this.onSubmit()}>ذخیره</button>{" "}
@ -557,11 +581,15 @@ export default connect(
loading: state.user.loading,
uploading: state.file.loading,
uploads: state.file.uploads,
provinceList: state.publicApi.province,
cityList: state.publicApi.city,
}),
{
getProfile: user.getProfile,
setProfile: user.setProfile,
upload: file.upload,
getProvince: publicApi.getProvince,
getCity: publicApi.getCity,
}
)(Profile);

@ -6,7 +6,7 @@ const useStyles = makeStyles((theme) => ({
root: {
"& .MuiTextField-root": {
width: "100%",
maxWidth: "400px",
// maxWidth: "400px",
position: "relative",
marginTop: 20,
},

@ -12,8 +12,9 @@ const BootstrapInput = withStyles((theme) => ({
},
},
input: {
width: "calc(100vw - 20px) !important",
maxWidth: "400px !important",
width: "100%",
// width: "calc(100vw - 20px) !important",
// maxWidth: "400px !important",
borderRadius: 4,
position: "relative",
backgroundColor: theme.palette.background.paper,
@ -37,8 +38,8 @@ export default function CustomizedSelects(props) {
const [age, setAge] = React.useState("");
return (
<div className="home-search__select mr-2">
<FormControl className={classes.margin}>
<div className="home-search__select mr-2" style={{ width: "100%" }}>
<FormControl className={classes.margin} style={{ width: "100%" }}>
<NativeSelect
id="demo-customized-select-native"
onChange={(e) =>

@ -79,7 +79,7 @@ class Contact extends Component {
<div className="contact__location d-flex align-items-center">
<img src={location} alt="آدرس" className="m-1" />
<p style={{ fontSize: fontSize.desktop.p }}>
{contactData.address}
{contactData?.address || ""}
</p>
</div>
<div
@ -88,13 +88,13 @@ class Contact extends Component {
>
<div className="d-flex align-items-center">
<span style={{ fontSize: fontSize.desktop.span }}>
{contactData.cellphone}
{contactData?.cellphone || ""}
</span>
<img src={contact} alt="تماس" className="m-1" />
</div>
<div className="d-flex align-items-center">
<span style={{ fontSize: fontSize.desktop.span }}>
{contactData.email}
{contactData?.email || ""}
</span>
<img src={home} alt="خانه" className="m-1" />
</div>

@ -89,7 +89,7 @@
}
textarea {
width: 350px;
// width: 350px;
font-family: numeralLight;
border-radius: 10px;
font-size: calc(100vw / 90);

@ -1,93 +1,91 @@
.slider-header{
width : 100%;
.slider-header {
width: 100%;
justify-content: flex-end;
&__right{
&__right {
width: 60%;
height: 100%;
& img{
& img {
}
}
&__left{
&__left {
width: 40%;
height: 100%;
justify-content : center;
justify-content: center;
align-items: flex-end;
padding-left: 70px;
h1{
h1 {
font-size: calc(100vw / 55);
color: white;
font-family: numeralBold;
letter-spacing: -1px;
}
h2{
h2 {
margin-top: 5px;
font-size: calc(100vw / 78);
color: white;
font-family: numeralBold;
}
a{
a {
text-decoration: none;
color: white;
margin-top: 10px;
font-size: calc(100vw / 90);
padding: 6px 10px;
border : 1px solid white;
border: 1px solid white;
border-radius: 5px;
font-family: numeralMedium;
&:hover{
&:hover {
color: white;
}
}
}
}
.mobile-slider-header{
width : 100%;
.mobile-slider-header {
width: 100%;
justify-content: flex-end;
&__right{
width: 50%;
&__right {
width: 0%;
height: 100%;
justify-content : center;
justify-content: center;
align-items: center;
& img{
& img {
position: relative;
width: 200%;
// width: 200%;
height: 110%;
right: 40px;
// right: 40px;
bottom: 10px;
}
}
&__left{
&__left {
width: 50%;
height: 100%;
justify-content : center;
justify-content: center;
align-items: flex-end;
padding-left: 30px;
h1{
h1 {
font-size: calc(100vw / 37);
color: white;
font-family: numeralBold;
}
h2{
h2 {
margin-top: 5px;
font-size: calc(100vw / 48);
color: white;
font-family: numeralBold;
}
a{
a {
text-decoration: none;
color: white;
margin-top: 10px;
font-size: calc(100vw / 55);
padding: 6px 10px;
border : 1px solid white;
border: 1px solid white;
border-radius: 5px;
font-family: numeralMedium;
&:hover{
&:hover {
color: white;
}
}

@ -7,7 +7,11 @@ import logo from "~/assets/icons/logo.png";
import basket from "~/assets/icons/basket.png";
import "./index.scss";
import { useHistory } from "react-router-dom";
function Navigate({ path }) {
let history = useHistory();
return <>{history.push(path)}</>;
}
const maxDesktopSize = 1250;
const fontSize = {
@ -18,7 +22,9 @@ const fontSize = {
};
export default class LaptopNavbar extends Component {
state = {};
render() {
if (this.state.navigatePath) return <Navigate path={this.navigatePath} />;
const { links } = this.props;
return (
<nav className="laptop-navbar d-flex">
@ -64,8 +70,15 @@ export default class LaptopNavbar extends Component {
<img width="30" height="35" src={basket} alt="سبد خرید" />
</Link>
<div
to="/auth?logout"
style={{ fontSize: fontSize.desktop.a }}
className="laptop-navbar__logout"
onClick={() => {
localStorage.removeItem("refresh");
localStorage.removeItem("access");
localStorage.removeItem("userData");
this.setState({ navigatePath: "/auth" });
}}
>
خروج
</div>
@ -90,7 +103,7 @@ export default class LaptopNavbar extends Component {
LaptopNavbar.defaultProps = {
links: [
{ name: "صفحه اصلی", to: "/", page: "home" },
{ name: "سبد خرید ", to: "/cart", page: "cart" },
{ name: "فروشگاه", to: "/products", page: "products" },
{ name: "سوالات متداول", to: "/faq", page: "faq" },
{ name: "درباره ما", to: "/about", page: "about" },
{ name: "تماس با ما", to: "/contact", page: "contact" },

@ -69,8 +69,9 @@
padding: 10px 20px;
border: 1px solid #6cbe44;
color: #6cbe44;
cursor: pointer;
&:hover {
color: white;
color: #93bb52;
}
}
}

@ -186,11 +186,16 @@ NavbarDrawer.defaultProps = {
},
{
name: "خروج",
link: "/",
link: "/auth",
icon: <img src={mobileLogout} alt="خروج" />,
toast: "",
message: "",
// onClick: this.props.logout,
onClick: () => {
localStorage.removeItem("refresh");
localStorage.removeItem("access");
localStorage.removeItem("userData");
window.location.reload();
},
},
],
};

@ -53,18 +53,18 @@ function AddToCart(props) {
<img src={document_red} />
</button>
<Link
to={`/products/${
page === "digital"
? `physical/${window.location.pathname.slice(
window.location.pathname.lastIndexOf("/") + 1,
window.location.pathname.length
)}`
: `digital/${window.location.pathname.slice(
window.location.pathname.lastIndexOf("/") + 1,
window.location.pathname.length
)}`
}`}
style={{ fontSize: fontSize.desktop.button }}
// to={`/products/${
// page === "digital"
// ? `physical/${window.location.pathname.slice(
// window.location.pathname.lastIndexOf("/") + 1,
// window.location.pathname.length
// )}`
// : `digital/${window.location.pathname.slice(
// window.location.pathname.lastIndexOf("/") + 1,
// window.location.pathname.length
// )}`
// }`}
style={{ fontSize: fontSize.desktop.button, opacity: 0.3 }}
className="product-addtocart__box--digitalButton"
>
{page === "digital" ? "کتاب فیزیکی" : "نسخه دیجیتال"}

@ -160,19 +160,19 @@ class Product extends Component {
<div className="d-flex flex-column mt-3">
<div className="d-flex">
<Link
to={`/products/${
page === "digital"
? `physical/${window.location.pathname.slice(
window.location.pathname.lastIndexOf("/") + 1,
window.location.pathname.length
)}`
: `digital/${window.location.pathname.slice(
window.location.pathname.lastIndexOf("/") + 1,
window.location.pathname.length
)}`
}`}
// to={`/products/${
// page === "digital"
// ? `physical/${window.location.pathname.slice(
// window.location.pathname.lastIndexOf("/") + 1,
// window.location.pathname.length
// )}`
// : `digital/${window.location.pathname.slice(
// window.location.pathname.lastIndexOf("/") + 1,
// window.location.pathname.length
// )}`
// }`}
className="mobile-product__header--digitalButton"
style={{ fontSize: fontSize.mobile.a }}
style={{ fontSize: fontSize.mobile.a, opacity: 0.3 }}
>
{page === "digital" ? "کتاب فیزیکی" : "نسخه دیجیتال"}
</Link>
@ -319,7 +319,7 @@ export default connect(
Product.defaultProps = {
supportItems: [
{ title: "ارسال رایگان", icon: product_shipping },
{ title: "ارسال سریع", icon: product_shipping },
{ title: "پشتیبانی 24 ساعته ", icon: product_support },
{ title: "ضمانت بازگشت ", icon: product_cash_back },
],

@ -51,8 +51,8 @@ export default class Product extends Component {
</span>
</Link>
<Link
to={`/products/digital/${product.id}`}
style={{ fontSize: fontSize.mobile.a }}
// to={`/products/digital/${product.id}`}
style={{ fontSize: fontSize.mobile.a, opacity: 0.3 }}
className="mobile-products-product__links--ar d-flex justify-content-between align-items-center"
>
<h2 style={{ fontSize: fontSize.mobile.h2 }}>دیجیتال</h2>
@ -84,8 +84,8 @@ export default class Product extends Component {
) : null} */}
</Link>
<Link
to={`/products/digital/${product.id}`}
style={{ fontSize: fontSize.mobile.a }}
// to={`/products/digital/${product.id}`}
style={{ fontSize: fontSize.mobile.a, opacity: 0.3 }}
className="products-product--ar d-flex justify-content-between align-items-center"
>
<h2 style={{ fontSize: fontSize.desktop.h2 }}>دیجیتال</h2>

Loading…
Cancel
Save