reza added very feather

master
RezaAshrafi77 3 years ago
parent f0e7f8005c
commit abaa0c00e8
  1. 5
      src/App.css
  2. 2
      src/AppRouter.js
  3. 40
      src/Redux/actions/comment.js
  4. 1
      src/Redux/actions/index.js
  5. 34
      src/Redux/reducers/comment.js
  6. 1
      src/Redux/reducers/index.js
  7. 4
      src/Redux/reducers/user.js
  8. 12
      src/Redux/reducers/userProduct.js
  9. BIN
      src/assets/icons/image.jpg
  10. 274
      src/util/onInput.js
  11. 45
      src/views/AR/BreadCrumb/index.js
  12. 8
      src/views/AR/BreadCrumb/index.scss
  13. 5
      src/views/AR/index.js
  14. 25
      src/views/Auth/Profile/Birthdate/index.js
  15. 107
      src/views/Auth/Profile/index.js
  16. 23
      src/views/Contact/Input/index.js
  17. 27
      src/views/Contact/Select/index.js
  18. 49
      src/views/Contact/index.js
  19. 3
      src/views/Contact/index.scss
  20. 2
      src/views/Home/HomeStatic/Flex/index.js
  21. 54
      src/views/Home/Navbar/Mobile/NavbarDrawer/NavbarDrawer.js
  22. 2
      src/views/Home/Navbar/Mobile/index.js
  23. 2
      src/views/MyBooks/BreadCrumb/index.js
  24. 49
      src/views/MyBooks/index.js
  25. 17
      src/views/MyBooks/index.scss
  26. 2
      src/views/Product/Comment/index.js
  27. 37
      src/views/Product/MaterialModal/index.js
  28. 15
      src/views/Product/index.js
  29. 5
      src/views/Product/index.scss
  30. 7
      src/views/Products/Product/index.js
  31. 15
      src/views/Products/index.scss
  32. 4
      src/views/QR/Image/index.js
  33. 4
      src/views/QR/VideoBox/React-video-js-player/index.scss
  34. 6
      src/views/QR/VideoBox/index.scss
  35. 26
      src/views/QR/index.js
  36. 5
      src/views/QR/index.scss
  37. 54
      src/views/QRScan/LastQr/index.js
  38. 30
      src/views/QRScan/LastQr/index.scss
  39. 7
      src/views/QRScan/index.js
  40. 42
      src/views/QRScan/index.scss
  41. 55
      src/views/Support/index.js

@ -1,10 +1,7 @@
* { * {
box-sizing: border-box !important; box-sizing: border-box !important;
direction: rtl; direction: rtl;
font-family: numeralLight;
} }
@font-face { @font-face {

@ -43,7 +43,7 @@ class AppRouter extends Component {
const mobile = window.innerWidth < 1000 ? true : false; const mobile = window.innerWidth < 1000 ? true : false;
let home = mobile ? ( let home = mobile ? (
<Route exact path={"/"}> <Route exact path={"/"}>
{proxy.status() ? ( {proxy.status ? (
this.props.profile ? ( this.props.profile ? (
<Home /> <Home />
) : ( ) : (

@ -0,0 +1,40 @@
import proxy from "../proxy";
const comment = {
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("comment/list", data, { dispatch }),
info:
(data = {}) =>
async (dispatch) => {
await proxy.get("comment/info", data, { dispatch });
},
add:
(
data = {},
data2 = {
id: window.location.pathname.slice(
window.location.pathname.lastIndexOf("/") + 1,
window.location.pathname.length
),
}
) =>
async (dispatch) => {
await proxy.post("comment/add", data);
await proxy.get("book/info", data2, { dispatch });
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("ar/delete", data);
await proxy.get("ar/list", data2, { dispatch });
},
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("ar/update", data);
await proxy.get("ar/list", data2, { dispatch });
},
};
export default comment;

@ -8,3 +8,4 @@ export { default as qr } from "./qr.js";
export { default as book } from "./book.js"; export { default as book } from "./book.js";
export { default as userProduct } from "./userProduct.js"; export { default as userProduct } from "./userProduct.js";
export { default as transport } from "./transport.js"; export { default as transport } from "./transport.js";
export { default as comment } from "./comment.js";

@ -0,0 +1,34 @@
import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
list: null,
};
export default function comment(state = initialState, action) {
let { type, data } = action;
switch (type) {
case "comment/list":
return { ...state, loading: false, error: null };
case "comment/update":
return { ...state, loading: false, error: null };
case "comment/add":
return { ...state, loading: false, error: null };
case "comment/delete":
return { ...state, loading: false, error: null };
case "comment/info":
return {
...state,
loading: false,
list: data,
error: null,
};
case "loading":
return { ...state, loading: true };
case "error":
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -8,3 +8,4 @@ export { default as qr } from "./qr.js";
export { default as book } from "./book.js"; export { default as book } from "./book.js";
export { default as userProduct } from "./userProduct.js"; export { default as userProduct } from "./userProduct.js";
export { default as transport } from "./transport.js"; export { default as transport } from "./transport.js";
export { default as comment } from "./comment.js";

@ -16,8 +16,10 @@ export default function user(state = initialState, action) {
case "user/register": case "user/register":
case "user/switchRole": case "user/switchRole":
case "public/sendOTP": case "public/sendOTP":
toast.success("کد به شماره شما ارسال گردید.");
return { ...state, loading: false, status: data.profile, error: null }; return { ...state, loading: false, status: data.profile, error: null };
case "user/otp/login": case "user/otp/login":
toast.success("به دانوین خوش آمدید.");
return { return {
...state, ...state,
loading: false, loading: false,
@ -38,6 +40,8 @@ export default function user(state = initialState, action) {
case "mothers/list": case "mothers/list":
return { ...state, loading: false, mothers: data, error: null }; return { ...state, loading: false, mothers: data, error: null };
case "user/setProfile": case "user/setProfile":
toast.success("تغییرات اعمال شد.");
window.location = "/";
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
///////////// /////////////
case "loading": case "loading":

@ -6,12 +6,22 @@ const initialState = {
list: [], list: [],
info: null, info: null,
sum: null, sum: null,
checkEmpty: false,
}; };
export default function userProduct(state = initialState, action) { export default function userProduct(state = initialState, action) {
let { type, data, message } = action; let { type, data, message } = action;
switch (type) { switch (type) {
case "userProduct/list": case "userProduct/list":
return { ...state, loading: false, list: data, error: null }; const checkEmpty = data.filter(
(item) => item.condition === 2 && item.product.productType === (1 || 3)
);
return {
...state,
loading: false,
list: data,
checkEmpty: checkEmpty.length > 0 ? false : true,
error: null,
};
case "userProduct/info": case "userProduct/info":
return { ...state, loading: false, info: data, error: null }; return { ...state, loading: false, info: data, error: null };
case "userProduct/update": case "userProduct/update":

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,274 @@
import { toast } from "react-toastify";
class onInput {
persianOnly = (txt) => {
let newText = txt;
newText = newText.replace(/`/g, "");
newText = newText.replace(/0/g, "");
newText = newText.replace(/1/g, "");
newText = newText.replace(/2/g, "");
newText = newText.replace(/3/g, "");
newText = newText.replace(/4/g, "");
newText = newText.replace(/5/g, "");
newText = newText.replace(/6/g, "");
newText = newText.replace(/7/g, "");
newText = newText.replace(/8/g, "");
newText = newText.replace(/9/g, "");
newText = newText.replace(/0/g, "");
newText = newText.replace(/q/g, "");
newText = newText.replace(/w/g, "");
newText = newText.replace(/e/g, "");
newText = newText.replace(/r/g, "");
newText = newText.replace(/t/g, "");
newText = newText.replace(/y/g, "");
newText = newText.replace(/u/g, "");
newText = newText.replace(/i/g, "");
newText = newText.replace(/o/g, "");
newText = newText.replace(/p/g, "");
newText = newText.replace(/\[/g, "");
newText = newText.replace(/\]/g, "");
newText = newText.replace(/a/g, "");
newText = newText.replace(/s/g, "");
newText = newText.replace(/d/g, "");
newText = newText.replace(/f/g, "");
newText = newText.replace(/g/g, "");
newText = newText.replace(/h/g, "");
newText = newText.replace(/j/g, "");
newText = newText.replace(/k/g, "");
newText = newText.replace(/l/g, "");
newText = newText.replace(/\;/g, "");
newText = newText.replace(/\'/g, "");
newText = newText.replace(/z/g, "");
newText = newText.replace(/x/g, "");
newText = newText.replace(/c/g, "");
newText = newText.replace(/v/g, "");
newText = newText.replace(/b/g, "");
newText = newText.replace(/n/g, "");
newText = newText.replace(/m/g, "");
newText = newText.replace(/\,/g, "");
newText = newText.replace(/\./g, "");
newText = newText.replace(/\//g, "");
newText = newText.replace(/~/g, " ");
newText = newText.replace(/Q/g, "");
newText = newText.replace(/W/g, "");
newText = newText.replace(/E/g, "");
newText = newText.replace(/R/g, "");
newText = newText.replace(/T/g, "");
newText = newText.replace(/Y/g, "");
newText = newText.replace(/U/g, "");
newText = newText.replace(/I/g, "");
newText = newText.replace(/O/g, "");
newText = newText.replace(/P/g, "");
newText = newText.replace(/A/g, "");
newText = newText.replace(/S/g, "");
newText = newText.replace(/G/g, "");
newText = newText.replace(/H/g, "");
newText = newText.replace(/J/g, "");
newText = newText.replace(/K/g, "");
newText = newText.replace(/L/g, "");
newText = newText.replace(/Z/g, "");
newText = newText.replace(/X/g, "");
newText = newText.replace(/B/g, "");
newText = newText.replace(/N/g, "");
newText = newText.replace(/M/g, "");
newText = newText.replace(/\?/g, "");
if (!newText) {
toast.info("از کاراکتر فارسی استفاده کنید");
}
return newText;
};
englishAndNumberWithoutSpace = (txt) => {
let newText = txt;
newText = newText.replace(/`/g, "");
newText = newText.replace(/0/g, "0");
newText = newText.replace(/1/g, "1");
newText = newText.replace(/2/g, "2");
newText = newText.replace(/3/g, "3");
newText = newText.replace(/4/g, "4");
newText = newText.replace(/5/g, "5");
newText = newText.replace(/6/g, "6");
newText = newText.replace(/7/g, "7");
newText = newText.replace(/8/g, "8");
newText = newText.replace(/9/g, "9");
newText = newText.replace(/ا/g, "");
newText = newText.replace(/ب/g, "");
newText = newText.replace(/پ/g, "");
newText = newText.replace(/ت/g, "");
newText = newText.replace(/ث/g, "");
newText = newText.replace(/ج/g, "");
newText = newText.replace(/چ/g, "");
newText = newText.replace(/ح/g, "");
newText = newText.replace(/خ/g, "");
newText = newText.replace(/د/g, "");
newText = newText.replace(/\[/g, "");
newText = newText.replace(/\]/g, "");
newText = newText.replace(/ذ/g, "");
newText = newText.replace(/ر/g, "");
newText = newText.replace(/ز/g, "");
newText = newText.replace(/ژ/g, "");
newText = newText.replace(/ط/g, "");
newText = newText.replace(/ظ/g, "");
newText = newText.replace(/ع/g, "");
newText = newText.replace(/غ/g, "");
newText = newText.replace(/ف/g, "");
newText = newText.replace(/\;/g, "");
newText = newText.replace(/\'/g, "");
newText = newText.replace(/ق/g, "");
newText = newText.replace(/س/g, "");
newText = newText.replace(/ش/g, "");
newText = newText.replace(/ص/g, "");
newText = newText.replace(/ض/g, "");
newText = newText.replace(/ک/g, "");
newText = newText.replace(/گ/g, "");
newText = newText.replace(/\,/g, "");
newText = newText.replace(/\./g, "");
newText = newText.replace(/\//g, "");
newText = newText.replace(/~/g, " ");
newText = newText.replace(/ل/g, "");
newText = newText.replace(/م/g, "");
newText = newText.replace(/ن/g, "");
newText = newText.replace(/و/g, "");
newText = newText.replace(/ه/g, "");
newText = newText.replace(/ی/g, "");
newText = newText.replace(/\?/g, "");
if (!newText) {
toast.info("از کاراکتر انگلیسی واعداداستفاده کنید");
}
return newText;
};
numberOnly = (txt) => {
let newText = txt;
newText = newText.replace(/`/g, "");
newText = newText.replace(/0/g, "0");
newText = newText.replace(/1/g, "1");
newText = newText.replace(/2/g, "2");
newText = newText.replace(/3/g, "3");
newText = newText.replace(/4/g, "4");
newText = newText.replace(/5/g, "5");
newText = newText.replace(/6/g, "6");
newText = newText.replace(/7/g, "7");
newText = newText.replace(/8/g, "8");
newText = newText.replace(/9/g, "9");
newText = newText.replace(/ا/g, "");
newText = newText.replace(/ب/g, "");
newText = newText.replace(/پ/g, "");
newText = newText.replace(/ت/g, "");
newText = newText.replace(/ث/g, "");
newText = newText.replace(/ج/g, "");
newText = newText.replace(/چ/g, "");
newText = newText.replace(/ح/g, "");
newText = newText.replace(/خ/g, "");
newText = newText.replace(/د/g, "");
newText = newText.replace(/\[/g, "");
newText = newText.replace(/\]/g, "");
newText = newText.replace(/ذ/g, "");
newText = newText.replace(/ر/g, "");
newText = newText.replace(/ز/g, "");
newText = newText.replace(/ژ/g, "");
newText = newText.replace(/ط/g, "");
newText = newText.replace(/ظ/g, "");
newText = newText.replace(/ع/g, "");
newText = newText.replace(/غ/g, "");
newText = newText.replace(/ف/g, "");
newText = newText.replace(/\;/g, "");
newText = newText.replace(/\'/g, "");
newText = newText.replace(/ق/g, "");
newText = newText.replace(/س/g, "");
newText = newText.replace(/ش/g, "");
newText = newText.replace(/ص/g, "");
newText = newText.replace(/ض/g, "");
newText = newText.replace(/ک/g, "");
newText = newText.replace(/گ/g, "");
newText = newText.replace(/\,/g, "");
newText = newText.replace(/\./g, "");
newText = newText.replace(/\//g, "");
newText = newText.replace(/~/g, " ");
newText = newText.replace(/ل/g, "");
newText = newText.replace(/م/g, "");
newText = newText.replace(/ن/g, "");
newText = newText.replace(/و/g, "");
newText = newText.replace(/ه/g, "");
newText = newText.replace(/ی/g, "");
newText = newText.replace(/\?/g, "");
newText = newText.replace(/q/g, "");
newText = newText.replace(/w/g, "");
newText = newText.replace(/e/g, "");
newText = newText.replace(/r/g, "");
newText = newText.replace(/t/g, "");
newText = newText.replace(/y/g, "");
newText = newText.replace(/u/g, "");
newText = newText.replace(/i/g, "");
newText = newText.replace(/o/g, "");
newText = newText.replace(/p/g, "");
newText = newText.replace(/a/g, "");
newText = newText.replace(/s/g, "");
newText = newText.replace(/d/g, "");
newText = newText.replace(/f/g, "");
newText = newText.replace(/g/g, "");
newText = newText.replace(/h/g, "");
newText = newText.replace(/j/g, "");
newText = newText.replace(/k/g, "");
newText = newText.replace(/l/g, "");
newText = newText.replace(/z/g, "");
newText = newText.replace(/x/g, "");
newText = newText.replace(/c/g, "");
newText = newText.replace(/v/g, "");
newText = newText.replace(/b/g, "");
newText = newText.replace(/n/g, "");
newText = newText.replace(/m/g, "");
newText = newText.replace(/Q/g, "");
newText = newText.replace(/W/g, "");
newText = newText.replace(/E/g, "");
newText = newText.replace(/R/g, "");
newText = newText.replace(/T/g, "");
newText = newText.replace(/Y/g, "");
newText = newText.replace(/U/g, "");
newText = newText.replace(/I/g, "");
newText = newText.replace(/O/g, "");
newText = newText.replace(/P/g, "");
newText = newText.replace(/A/g, "");
newText = newText.replace(/S/g, "");
newText = newText.replace(/G/g, "");
newText = newText.replace(/H/g, "");
newText = newText.replace(/J/g, "");
newText = newText.replace(/K/g, "");
newText = newText.replace(/L/g, "");
newText = newText.replace(/Z/g, "");
newText = newText.replace(/X/g, "");
newText = newText.replace(/B/g, "");
newText = newText.replace(/N/g, "");
newText = newText.replace(/M/g, "");
if (!newText) {
toast.info("از اعداداستفاده کنید");
}
return newText;
};
dayHandler = (num) => {
let newNum = this.numberOnly(num);
if (newNum > 31) {
toast.error("روز نباید بزرگتر از 31 باشد.");
return Math.floor(newNum / 10);
}
return newNum;
};
monthHandler = (num) => {
let newNum = this.numberOnly(num);
if (newNum > 12 || newNum < 0) {
toast.error("ماه باید بین 1 تا 12 باشد.");
return Math.floor(newNum / 10);
}
return newNum;
};
yearHandler = (num) => {
let newNum = this.numberOnly(num);
if (newNum > 1395) {
toast.error("سال باید کوچکتر از 1395 باشد.");
return Math.floor(newNum / 10);
}
return newNum;
};
}
const _onInput = new onInput();
export default _onInput;

@ -0,0 +1,45 @@
import React from "react";
import Breadcrumbs from "@material-ui/core/Breadcrumbs";
import { Link } from "react-router-dom";
import "./index.scss";
function handleClick(event) {
event.preventDefault();
console.info("You clicked a breadcrumb.");
}
const maxDesktopSize = 1250;
const maxMobileSize = 650;
const fontSize = {
desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90,
mobile: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 25,
};
export default function ActiveLastBreadcrumb(props) {
const { name } = props;
return (
<Breadcrumbs aria-label="breadcrumb">
<Link
style={{
fontSize:
window.innerWidth > 1000 ? fontSize.desktop : fontSize.mobile,
}}
to={"/"}
>
صفحه اصلی
</Link>
<Link
style={{
fontSize:
window.innerWidth > 1000 ? fontSize.desktop : fontSize.mobile,
color: "#00CC69",
}}
to={"/ar"}
>
واقعیت افزوده
</Link>
</Breadcrumbs>
);
}

@ -0,0 +1,8 @@
.MuiBreadcrumbs-li{
a {
text-decoration: none;
font-family: numeralLight;
color: #6F7074;
letter-spacing: -1px;
}
}

@ -6,6 +6,7 @@ import Navbar from "../Home/Navbar/index";
import Footer from "../Home/Footer/index"; import Footer from "../Home/Footer/index";
import Loader from "~/components/Loader/index"; import Loader from "~/components/Loader/index";
import Item from "./Item/index"; import Item from "./Item/index";
import BreadCrumbs from "./BreadCrumb/index";
import "./index.scss"; import "./index.scss";
@ -30,8 +31,9 @@ class AR extends Component {
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
arList ? ( arList ? (
<> <>
<div className="ar d-flex flex-column align-items-center"> <div className="ar d-flex flex-column">
<Navbar /> <Navbar />
<BreadCrumbs />
<div className="ar__box d-flex flex-column"></div> <div className="ar__box d-flex flex-column"></div>
</div> </div>
<Footer /> <Footer />
@ -49,6 +51,7 @@ class AR extends Component {
arList ? ( arList ? (
<div className="mobile-ar d-flex flex-column"> <div className="mobile-ar d-flex flex-column">
<Navbar /> <Navbar />
<BreadCrumbs />
<div className="mobile-ar__list d-flex flex-wrap"> <div className="mobile-ar__list d-flex flex-wrap">
{arList.map((item, i) => ( {arList.map((item, i) => (
<Item data={item} key={i} /> <Item data={item} key={i} />

@ -1,4 +1,5 @@
import React from "react"; import React from "react";
import onInput from "~/util/onInput";
import "./index.scss"; import "./index.scss";
@ -16,11 +17,26 @@ export default function Birthdate(props) {
<div className="mobile-birthdate d-flex justify-content-between align-items-center"> <div className="mobile-birthdate d-flex justify-content-between align-items-center">
<label>تاریخ تولد</label> <label>تاریخ تولد</label>
<div className="mobile-birthdate__date d-flex align-items-center"> <div className="mobile-birthdate__date d-flex align-items-center">
<Input name="day" placeholder="روز" maxLength={2} /> <Input
name="day"
placeholder="روز"
maxLength={2}
onInput={onInput.dayHandler}
/>
<span>/</span> <span>/</span>
<Input name="month" placeholder="ماه" maxLength={2} /> <Input
name="month"
placeholder="ماه"
maxLength={2}
onInput={onInput.monthHandler}
/>
<span>/</span> <span>/</span>
<Input name="year" placeholder="سال" maxLength={4} /> <Input
name="year"
placeholder="سال"
maxLength={4}
onInput={onInput.yearHandler}
/>
</div> </div>
</div> </div>
) : null} ) : null}
@ -41,7 +57,7 @@ export default function Birthdate(props) {
} }
const Input = (props) => { const Input = (props) => {
const { name, placeholder, maxLength } = props; const { name, placeholder, maxLength, onInput } = props;
return ( return (
<input <input
type="text" type="text"
@ -49,6 +65,7 @@ const Input = (props) => {
name={name} name={name}
placeholder={placeholder} placeholder={placeholder}
maxLength={maxLength} maxLength={maxLength}
onInput={(e) => (e.target.value = onInput(e.target.value))}
/> />
); );
}; };

@ -1,4 +1,6 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { ToastContainer } from "react-toastify";
import onInput from "~/util/onInput";
import { user } from "~/Redux/actions"; import { user } from "~/Redux/actions";
import { connect } from "react-redux"; import { connect } from "react-redux";
@ -117,80 +119,6 @@ class Profile extends Component {
await setProfile(data); await setProfile(data);
}; };
forcePersian = (txt) => {
let yas = txt;
yas = yas.replace(/`/g, "");
yas = yas.replace(/0/g, "");
yas = yas.replace(/1/g, "");
yas = yas.replace(/2/g, "");
yas = yas.replace(/3/g, "");
yas = yas.replace(/4/g, "");
yas = yas.replace(/5/g, "");
yas = yas.replace(/6/g, "");
yas = yas.replace(/7/g, "");
yas = yas.replace(/8/g, "");
yas = yas.replace(/9/g, "");
yas = yas.replace(/0/g, "");
yas = yas.replace(/q/g, "");
yas = yas.replace(/w/g, "");
yas = yas.replace(/e/g, "");
yas = yas.replace(/r/g, "");
yas = yas.replace(/t/g, "");
yas = yas.replace(/y/g, "");
yas = yas.replace(/u/g, "");
yas = yas.replace(/i/g, "");
yas = yas.replace(/o/g, "");
yas = yas.replace(/p/g, "");
yas = yas.replace(/\[/g, "");
yas = yas.replace(/\]/g, "");
yas = yas.replace(/a/g, "");
yas = yas.replace(/s/g, "");
yas = yas.replace(/d/g, "");
yas = yas.replace(/f/g, "");
yas = yas.replace(/g/g, "");
yas = yas.replace(/h/g, "");
yas = yas.replace(/j/g, "");
yas = yas.replace(/k/g, "");
yas = yas.replace(/l/g, "");
yas = yas.replace(/\;/g, "");
yas = yas.replace(/\'/g, "");
yas = yas.replace(/z/g, "");
yas = yas.replace(/x/g, "");
yas = yas.replace(/c/g, "");
yas = yas.replace(/v/g, "");
yas = yas.replace(/b/g, "");
yas = yas.replace(/n/g, "");
yas = yas.replace(/m/g, "");
yas = yas.replace(/\,/g, "");
yas = yas.replace(/\./g, "");
yas = yas.replace(/\//g, "");
yas = yas.replace(/~/g, " ");
yas = yas.replace(/Q/g, "");
yas = yas.replace(/W/g, "");
yas = yas.replace(/E/g, "");
yas = yas.replace(/R/g, "");
yas = yas.replace(/T/g, "");
yas = yas.replace(/Y/g, "");
yas = yas.replace(/U/g, "");
yas = yas.replace(/I/g, "");
yas = yas.replace(/O/g, "");
yas = yas.replace(/P/g, "");
yas = yas.replace(/A/g, "");
yas = yas.replace(/S/g, "");
yas = yas.replace(/G/g, "");
yas = yas.replace(/H/g, "");
yas = yas.replace(/J/g, "");
yas = yas.replace(/K/g, "");
yas = yas.replace(/L/g, "");
yas = yas.replace(/Z/g, "");
yas = yas.replace(/X/g, "");
yas = yas.replace(/B/g, "");
yas = yas.replace(/N/g, "");
yas = yas.replace(/M/g, "");
yas = yas.replace(/\?/g, "");
return yas;
};
render() { render() {
const { user, profile } = this.props; const { user, profile } = this.props;
return ( return (
@ -406,24 +334,29 @@ class Profile extends Component {
profile ? ( profile ? (
<div className="mobile-auth-profile d-flex flex-column"> <div className="mobile-auth-profile d-flex flex-column">
<img src={logo} alt="دانوین" /> <img src={logo} alt="دانوین" />
<div className="d-flex align-items-center">
<div className="d-flex flex-column">
<h1 style={{ fontSize: fontSize.mobile.h1 }}>حساب کاربری</h1> <h1 style={{ fontSize: fontSize.mobile.h1 }}>حساب کاربری</h1>
<p style={{ fontSize: fontSize.mobile.p }}> <p style={{ fontSize: fontSize.mobile.p }}>
لطفا مشحصات خود را به صورت کامل وارد نمایید لطفا مشحصات خود را به صورت کامل وارد نمایید
</p> </p>
</div>
<Upload name="file" parent={this} /> <Upload name="file" parent={this} />
</div>
<Input <Input
name="firstName" name="firstName"
label="نام" label="نام"
parent={this} parent={this}
defaultValue={profile} defaultValue={profile}
onInput={this.forcePersian} onInput={onInput.persianOnly}
/> />
<Input <Input
name="lastName" name="lastName"
label="نام خانوادگی" label="نام خانوادگی"
parent={this} parent={this}
defaultValue={profile} defaultValue={profile}
onInput={this.forcePersian} onInput={onInput.persianOnly}
/> />
<Input <Input
name="username" name="username"
@ -431,6 +364,7 @@ class Profile extends Component {
parent={this} parent={this}
align="left" align="left"
defaultValue={profile} defaultValue={profile}
onInput={onInput.englishAndNumberWithoutSpace}
/> />
<Gender <Gender
options={["دختر", "پسر"]} options={["دختر", "پسر"]}
@ -440,12 +374,13 @@ class Profile extends Component {
/> />
<Input <Input
name="nationalId" name="nationalId"
label="کد ملی" label="کدملی / اتباع"
parent={this} parent={this}
align="left" align="left"
defaultValue={profile} defaultValue={profile}
maxLength={10} maxLength={13}
inputMode="numeric" inputMode="numeric"
onInput={onInput.numberOnly}
/> />
<Birthdate /> <Birthdate />
<Gender <Gender
@ -539,6 +474,7 @@ class Profile extends Component {
name="schoolId" name="schoolId"
label={"نام مدرسه"} label={"نام مدرسه"}
defaultValue={profile} defaultValue={profile}
onInput={onInput.persianOnly}
/> />
) : null} ) : null}
{this.state.userRoleId === "معلم" ? ( {this.state.userRoleId === "معلم" ? (
@ -547,6 +483,7 @@ class Profile extends Component {
name="schoolId" name="schoolId"
label={"محل تدریس"} label={"محل تدریس"}
defaultValue={profile} defaultValue={profile}
onInput={onInput.persianOnly}
/> />
) : null} ) : null}
{this.state.userRoleId === "معلم" ? ( {this.state.userRoleId === "معلم" ? (
@ -557,7 +494,10 @@ class Profile extends Component {
name="postalCode" name="postalCode"
label={"کد پستی"} label={"کد پستی"}
align="left" align="left"
maxLength={13}
inputMode="numeric"
defaultValue={profile} defaultValue={profile}
onInput={onInput.numberOnly}
/> />
<TextArea parent={this} label={"آدرس محل سکونت"} name="address" /> <TextArea parent={this} label={"آدرس محل سکونت"} name="address" />
<div className="mobile-auth-profile__footer d-flex justify-content-center"> <div className="mobile-auth-profile__footer d-flex justify-content-center">
@ -573,6 +513,17 @@ class Profile extends Component {
</div> </div>
) )
) : null} ) : null}
<ToastContainer
position="bottom-right"
autoClose={1500}
hideProgressBar={true}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</> </>
); );
} }

@ -1,14 +1,14 @@
import React from 'react'; import React from "react";
import TextField from '@material-ui/core/TextField'; import TextField from "@material-ui/core/TextField";
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from "@material-ui/core/styles";
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
root: { root: {
'& .MuiTextField-root': { "& .MuiTextField-root": {
width: "100%",
width: '350px', maxWidth: "400px",
position : 'relative', position: "relative",
marginTop : 20, marginTop: 20,
}, },
}, },
})); }));
@ -19,7 +19,12 @@ export default function FormPropsTextFields(props) {
return ( return (
<form className={classes.root} noValidate autoComplete="off"> <form className={classes.root} noValidate autoComplete="off">
<div> <div>
<TextField id="outlined-basic" name={props.name} label={props.label} variant="outlined" /> <TextField
id="outlined-basic"
name={props.name}
label={props.label}
variant="outlined"
/>
</div> </div>
</form> </form>
); );

@ -1,5 +1,6 @@
import React from "react"; import React from "react";
import { makeStyles, withStyles } from "@material-ui/core/styles"; import { makeStyles, withStyles } from "@material-ui/core/styles";
import ExpandMoreRoundedIcon from "@material-ui/icons/ExpandMoreRounded";
import FormControl from "@material-ui/core/FormControl"; import FormControl from "@material-ui/core/FormControl";
import NativeSelect from "@material-ui/core/NativeSelect"; import NativeSelect from "@material-ui/core/NativeSelect";
import InputBase from "@material-ui/core/InputBase"; import InputBase from "@material-ui/core/InputBase";
@ -11,7 +12,8 @@ const BootstrapInput = withStyles((theme) => ({
}, },
}, },
input: { input: {
width: 350, width: "calc(100vw - 20px) !important",
maxWidth: "400px !important",
borderRadius: 4, borderRadius: 4,
position: "relative", position: "relative",
backgroundColor: theme.palette.background.paper, backgroundColor: theme.palette.background.paper,
@ -33,22 +35,31 @@ const useStyles = makeStyles((theme) => ({
export default function CustomizedSelects(props) { export default function CustomizedSelects(props) {
const classes = useStyles(); const classes = useStyles();
const [age, setAge] = React.useState(""); const [age, setAge] = React.useState("");
const handleChange = (event) => {
setAge(event.target.value);
};
return ( return (
<div className="home-search__select mr-2"> <div className="home-search__select mr-2">
<FormControl className={classes.margin}> <FormControl className={classes.margin}>
<NativeSelect <NativeSelect
id="demo-customized-select-native" id="demo-customized-select-native"
value={age} onChange={(e) =>
onChange={handleChange} props.parent.setState({ [props.name]: e.target.value })
}
input={<BootstrapInput />} input={<BootstrapInput />}
> >
{props.options.map((item) => ( {props.options.map((item, i) => (
<option value={item}>{item}</option> <option key={i} value={item}>
{item}
</option>
))} ))}
</NativeSelect> </NativeSelect>
<ExpandMoreRoundedIcon
style={{
position: "absolute",
left: 5,
top: "calc(50% - 12px)",
color: "#777",
}}
/>
</FormControl> </FormControl>
</div> </div>
); );

@ -1,6 +1,6 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { publicApi } from "~/Redux/actions"; import { publicApi, userProduct } from "~/Redux/actions";
import Navbar from "../Home/Navbar/index"; import Navbar from "../Home/Navbar/index";
import Footer from "../Home/Footer/index"; import Footer from "../Home/Footer/index";
@ -31,7 +31,17 @@ const fontSize = {
}; };
class Contact extends Component { class Contact extends Component {
state = {
name: null,
cellphone: null,
unit: null,
book: null,
subject: null,
text: null,
};
componentDidMount() { componentDidMount() {
this.props.getList();
this.props.getContactData(); this.props.getContactData();
} }
@ -56,7 +66,7 @@ class Contact extends Component {
</p> </p>
<Input label={"نامونام خانوادگی"} name={"name"} /> <Input label={"نامونام خانوادگی"} name={"name"} />
<Input label={"شماره تماس"} name={"mobile"} /> <Input label={"شماره تماس"} name={"mobile"} />
<Select options={["همه", "پرفروش"]} /> <Select options={["واحد فروش", "واحد محتوا", "واحد فنی"]} />
<Input label={"موضوع پیام"} name={"subject"} /> <Input label={"موضوع پیام"} name={"subject"} />
<textarea <textarea
placeholder="متن پیام" placeholder="متن پیام"
@ -116,13 +126,37 @@ class Contact extends Component {
برای ارتباط با دنیای شگفت انگیز دانوین از فرم زیر استفاده کنید برای ارتباط با دنیای شگفت انگیز دانوین از فرم زیر استفاده کنید
و پس از انتخاب دپارتمان مد نظر پیام خود را ارسال کنید. و پس از انتخاب دپارتمان مد نظر پیام خود را ارسال کنید.
</p> </p>
<Input label={"نامونام خانوادگی"} name={"name"} /> <Input
<Input label={"شماره تماس"} name={"mobile"} /> label={"نامونام خانوادگی"}
<Select options={["همه", "پرفروش"]} /> name={"name"}
parent={this}
/>
<Input label={"شماره تماس"} name={"cellphone"} parent={this} />
<Select
name="unit"
options={[
"واحد مورد نظر",
"واحد فروش",
"واحد محتوا",
"واحد فنی",
]}
parent={this}
/>
{this.state.unit === "واحد محتوا" ? (
<Select
name="book"
options={[
...new Set(
this.props.list.map((item) => item.product.book.name)
),
]}
parent={this}
/>
) : null}
<Input label={"موضوع پیام"} name={"subject"} /> <Input label={"موضوع پیام"} name={"subject"} />
<textarea <textarea
placeholder="متن پیام" placeholder="متن پیام"
name="description" name="text"
rows="5" rows="5"
></textarea> ></textarea>
<button>ارسال</button> <button>ارسال</button>
@ -174,6 +208,7 @@ export default connect(
(state) => ({ (state) => ({
loading: state.publicApi.loading, loading: state.publicApi.loading,
contactData: state.publicApi.contactData, contactData: state.publicApi.contactData,
list: state.userProduct.list,
}), }),
{ getContactData: publicApi.getContactData } { getContactData: publicApi.getContactData, getList: userProduct.list }
)(Contact); )(Contact);

@ -246,7 +246,8 @@
} }
textarea { textarea {
width: 350px; width: "100%";
max-width: 400;
font-family: numeralLight; font-family: numeralLight;
border-radius: 10px; border-radius: 10px;
margin-top: 20px; margin-top: 20px;

@ -16,7 +16,7 @@ export default function Flex(props) {
margin: 5, margin: 5,
borderRadius: 10, borderRadius: 10,
color: data.color, color: data.color,
filter: data.link === "/chatroom" ? "grayscale(90%)" : "", filter: data.link === "/chatroom" ? "blur(1.5px) grayscale(100%)" : "",
}; };
return ( return (
<Link <Link

@ -1,4 +1,5 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { connect } from "react-redux";
import AddCircleOutlineRoundedIcon from "@material-ui/icons/AddCircleOutlineRounded"; import AddCircleOutlineRoundedIcon from "@material-ui/icons/AddCircleOutlineRounded";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
@ -7,8 +8,6 @@ import CheckIcon from "@material-ui/icons/Check";
import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp"; import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp";
import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown"; import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown";
// import { logout } from '../../../../Redux/actions/user';
// import { connect } from 'react-redux';
import user1 from "~/assets/images/user1.png"; import user1 from "~/assets/images/user1.png";
import user2 from "~/assets/images/user2.png"; import user2 from "~/assets/images/user2.png";
@ -29,24 +28,25 @@ class NavbarDrawer extends Component {
}; };
render() { render() {
const { status } = this.props;
return ( return (
<div className="navbar-drawer d-flex flex-column"> <div className="navbar-drawer d-flex flex-column">
<div className="navbar-drawer__header d-flex"> <div className="navbar-drawer__header d-flex align-items-center">
{this.props.users.map((item, i) => <>
item.status === 1 ? (
<React.Fragment key={i}>
<Avatar <Avatar
style={{ width: 60, height: 60 }} style={{ width: 60, height: 60 }}
alt="Remy Sharp" alt="Remy Sharp"
src={item.image} src={
status.picFileId
? `https://dnvn.ir/api/v1/file/${status.picFileId}`
: ""
}
/> />
<div className="navbar-drawer__header--right d-fex flex-column"> <div className="navbar-drawer__header--right d-fex flex-column">
<h1>{item.firstName + " " + item.lastName}</h1> <h1>{status.firstName + " " + status.lastName}</h1>
<div>{item.title}</div>
</div> </div>
</React.Fragment> </>
) : null
)}
{this.state.dropdown ? ( {this.state.dropdown ? (
<div <div
className="navbar-drawer__header--dropdown" className="navbar-drawer__header--dropdown"
@ -67,22 +67,22 @@ class NavbarDrawer extends Component {
</div> </div>
{this.state.dropdown ? ( {this.state.dropdown ? (
<div className="navbar-drawer__dropdown d-flex flex-column"> <div className="navbar-drawer__dropdown d-flex flex-column">
{/* {this.props.users.map((item, i) => (
<User data={item} key={i} />
))} */}
<Link <Link
to={"/newProfile"} to={"/newProfile"}
key={this.props.users.length + 1} // key={this.props.users.length + 1}
style={{ color: "#4e4e4e" }} style={{ color: "#4e4e4e" }}
> >
<div className="navbar-drawer__bottom--link d-flex"> <div className="navbar-drawer__bottom--link d-flex">
<AddCircleOutlineRoundedIcon <AddCircleOutlineRoundedIcon
style={{ fontSize: 35, color: "#4e4e4e", margin: "0px 10px" }} style={{ fontSize: 30, color: "#777", margin: "0px 8px" }}
/> />
<div>اضافه کردن کاربر </div> <div>اضافه کردن کاربر </div>
{/* {item.message && <div class="badge">{item.message}</div>} */} {/* {item.message && <div class="badge">{item.message}</div>} */}
</div> </div>
</Link> </Link>
{this.props.users.map((item, i) => (
<User data={item} key={i} />
))}
</div> </div>
) : null} ) : null}
<div className="navbar-drawer__bottom mt-3"> <div className="navbar-drawer__bottom mt-3">
@ -112,20 +112,12 @@ class NavbarDrawer extends Component {
} }
} }
export default NavbarDrawer; export default connect(
// export default connect((state) => ({ isLogin: state.user.isLogin }), { logout })(NavbarDrawer); (state) => ({ status: state.user.status }),
{}
)(NavbarDrawer);
NavbarDrawer.defaultProps = { NavbarDrawer.defaultProps = {
users: [
{
id: 1,
firstName: "اکبر",
lastName: "خراسانی",
title: "استاد علوم تجربی",
image: user2,
status: 1,
},
],
links: [ links: [
{ {
name: "صفحه اصلی", name: "صفحه اصلی",
@ -170,9 +162,9 @@ NavbarDrawer.defaultProps = {
message: "", message: "",
}, },
{ {
name: "پیام رسان", name: "دانوینیها",
link: "/", link: "/",
icon: <img src={mobileProfile} alt="پیام رسان" />, icon: <img src={mobileProfile} alt="دانوینیها" />,
toast: "", toast: "",
message: "", message: "",
}, },

@ -82,7 +82,9 @@ export default function MobileNavbar(props) {
<img src={search} alt="جستجو" /> <img src={search} alt="جستجو" />
) : ( ) : (
<div className="d-flex align-items-center"> <div className="d-flex align-items-center">
<Link to={"/products"}>
<img src={search} alt="جستجو" /> <img src={search} alt="جستجو" />
</Link>
<Link to={"/qr-scan"}> <Link to={"/qr-scan"}>
<img src={qr} alt="QR" /> <img src={qr} alt="QR" />
</Link> </Link>

@ -20,7 +20,7 @@ const fontSize = {
export default function ActiveLastBreadcrumb(props) { export default function ActiveLastBreadcrumb(props) {
const { name } = props; const { name } = props;
return ( return (
<Breadcrumbs aria-label="breadcrumb"> <Breadcrumbs aria-label="breadcrumb" className="m-1">
<Link <Link
style={{ style={{
fontSize: fontSize:

@ -6,13 +6,8 @@ import { Link } from "react-router-dom";
import Navbar from "../Home/Navbar/index"; import Navbar from "../Home/Navbar/index";
import Footer from "../Home/Footer/index"; import Footer from "../Home/Footer/index";
import BreadCrumbs from "./BreadCrumb/index"; import BreadCrumbs from "./BreadCrumb/index";
import Loader from "~/components/Loader/index";
import sciense_6 from "~/assets/images/olum6.jpg";
import sciense_8 from "~/assets/images/olum8.jpg";
import sciense_9 from "~/assets/images/olum9.jpg";
import sciense_7 from "~/assets/images/olum7.jpg";
import shimi_10 from "~/assets/images/shimi10.jpg";
import zist_10 from "~/assets/images/zist10.jpg";
import "./index.scss"; import "./index.scss";
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const maxMobileSize = 550; const maxMobileSize = 550;
@ -20,11 +15,13 @@ const maxMobileSize = 550;
const fontSize = { const fontSize = {
mobile: { mobile: {
h1: window.innerWidth > maxMobileSize ? 24 : window.innerWidth / 20, h1: window.innerWidth > maxMobileSize ? 24 : window.innerWidth / 20,
a: window.innerHeight > maxMobileSize ? 15 : window.innerWidth / 30, a: window.innerWidth > maxMobileSize ? 15 : window.innerWidth / 30,
p: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 30,
}, },
desktop: { desktop: {
h1: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 70, h1: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 70,
a: window.innerHeight > maxDesktopSize ? 15 : window.innerWidth / 85, a: window.innerHeight > maxDesktopSize ? 15 : window.innerWidth / 85,
p: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 90,
}, },
}; };
@ -34,7 +31,7 @@ class MyBooks extends React.Component {
} }
render() { render() {
const { list } = this.props; const { list, checkEmpty } = this.props;
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
@ -43,9 +40,20 @@ class MyBooks extends React.Component {
<Navbar /> <Navbar />
<BreadCrumbs /> <BreadCrumbs />
<div className="mybooks__list d-flex flex-wrap p-1"> <div className="mybooks__list d-flex flex-wrap p-1">
{list.map((item, i) => ( {!checkEmpty ? (
<Item data={item} key={i} id={i} /> list.map((item, i) => <Item data={item} key={i} id={i} />)
))} ) : (
<div
className="mybooks__list--empty d-flex flex-column justify-content-center align-items-center"
style={{ width: "100vw", height: "calc(100vh - 400px)" }}
>
<p style={{ fontSize: fontSize.desktop.p }}>
برای استفاده از این بخش باید یک کتاب فعال خریداری کرده
باشید
</p>
<Link to="/products">فروشگاه</Link>
</div>
)}
</div> </div>
</div> </div>
<Footer /> <Footer />
@ -55,11 +63,21 @@ class MyBooks extends React.Component {
<> <>
<div className="mobile-products d-flex flex-column"> <div className="mobile-products d-flex flex-column">
<Navbar /> <Navbar />
{/* <h1 style={{ fontSize: fontSize.mobile.h1 }}>کتابهای من</h1> */}
<div className="d-flex flex-wrap p-1"> <div className="d-flex flex-wrap p-1">
{list.map((item, i) => ( {!checkEmpty ? (
<Item data={item} key={i} id={i} /> list.map((item, i) => <Item data={item} key={i} id={i} />)
))} ) : (
<div
className="mobile-products__empty d-flex flex-column justify-content-center align-items-center text-center"
style={{ height: "calc(100vh - 100px)", width: "100vw" }}
>
<p style={{ fontSize: fontSize.mobile.p }}>
برای استفاده از این بخش باید یک کتاب فعال خریداری کرده
باشید
</p>
<Link to="/products">فروشگاه</Link>
</div>
)}
</div> </div>
</div> </div>
</> </>
@ -72,6 +90,7 @@ class MyBooks extends React.Component {
export default connect( export default connect(
(state) => ({ (state) => ({
list: state.userProduct.list, list: state.userProduct.list,
checkEmpty: state.userProduct.checkEmpty,
// status: state.user.status, // status: state.user.status,
}), }),
{ getList: userProduct.list } { getList: userProduct.list }

@ -5,10 +5,25 @@
padding: 0px 10px 40px; padding: 0px 10px 40px;
direction: rtl; direction: rtl;
overflow-x: hidden; overflow-x: hidden;
min-height: calc(100vh - 288px); min-height: calc(100vh - 315px);
padding-top: 70px; padding-top: 70px;
&__list { &__list {
max-width: 1000px; max-width: 1000px;
margin: 0px auto; margin: 0px auto;
&--empty {
font-family: numeralLight;
a {
display: inline;
font-family: numeralLight;
text-decoration: none;
padding: 5px 20px 3px;
background-color: #00cc69;
border-radius: 25px;
color: white;
&:focus:enabled {
text-decoration: none;
}
}
}
} }
} }

@ -26,7 +26,7 @@ export default function Comment(props) {
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<div className="mobile-comment d-flex flex-column"> <div className="mobile-comment d-flex flex-column">
<strong style={{ fontSize: fontSize.mobile.strong }}> <strong style={{ fontSize: fontSize.mobile.strong }}>
{comment.username || "حسین"} {comment.username}
</strong> </strong>
<p style={{ fontSize: fontSize.mobile.p }}>{comment.text}</p> <p style={{ fontSize: fontSize.mobile.p }}>{comment.text}</p>
<span style={{ fontSize: fontSize.mobile.span }}> <span style={{ fontSize: fontSize.mobile.span }}>

@ -1,4 +1,6 @@
import React from "react"; import React, { useState } from "react";
import { connect } from "react-redux";
import { comment, book } from "~/Redux/actions";
import { makeStyles } from "@material-ui/core/styles"; import { makeStyles } from "@material-ui/core/styles";
import Modal from "@material-ui/core/Modal"; import Modal from "@material-ui/core/Modal";
@ -43,10 +45,21 @@ const useStyles = makeStyles((theme) => ({
}, },
})); }));
export default function SimpleModal(props) { function SimpleModal(props) {
const classes = useStyles(); const classes = useStyles();
// getModalStyle is not a pure function, we roll the style only on the first render // getModalStyle is not a pure function, we roll the style only on the first render
const [modalStyle] = React.useState(getModalStyle); const [modalStyle] = React.useState(getModalStyle);
const [text, setText] = useState(null);
const submitComment = () => {
props.addComment({
userId: props.id,
bookId: props.info.id,
title: null,
text: text,
});
props.handleOpenComment();
};
const body = ( const body = (
<div style={modalStyle} className={classes.paper + " material-modal"}> <div style={modalStyle} className={classes.paper + " material-modal"}>
@ -62,8 +75,16 @@ export default function SimpleModal(props) {
> >
کامنت خود را وارد کرده و دکمه ثبت را بزنید. کامنت خود را وارد کرده و دکمه ثبت را بزنید.
</h2> </h2>
<textarea placeholder="متن پیام" name="description" rows="5"></textarea> <textarea
<button style={{ marginTop: 20, borderRadius: 6, padding: 8 }}> placeholder="متن پیام"
name="description"
rows="5"
onChange={(e) => setText(e.target.value)}
></textarea>
<button
style={{ marginTop: 20, borderRadius: 6, padding: 8 }}
onClick={() => submitComment()}
>
ثبت ثبت
</button> </button>
</div> </div>
@ -82,3 +103,11 @@ export default function SimpleModal(props) {
</div> </div>
); );
} }
export default connect(
(state) => ({
info: state.book.info,
id: state.user.status.id,
}),
{ addComment: comment.add, getInfo: book.info }
)(SimpleModal);

@ -1,5 +1,5 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { ToastContainer } from "react-toastify"; import { ToastContainer, toast } from "react-toastify";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { connect } from "react-redux"; import { connect } from "react-redux";
@ -149,6 +149,12 @@ class Product extends Component {
<h2 style={{ fontSize: fontSize.mobile.h2 }}> <h2 style={{ fontSize: fontSize.mobile.h2 }}>
{info.category} {info.category}
</h2> </h2>
<h3 style={{ fontSize: fontSize.mobile.h1 }}>
{page === "digital"
? info.product[0].price
: info.product[1].price}{" "}
تومان
</h3>
<div className="d-flex flex-column mt-3"> <div className="d-flex flex-column mt-3">
<div className="d-flex"> <div className="d-flex">
<Link <Link
@ -169,6 +175,9 @@ class Product extends Component {
{page === "digital" ? "کتاب فیزیکی" : "نسخه دیجیتال"} {page === "digital" ? "کتاب فیزیکی" : "نسخه دیجیتال"}
</Link> </Link>
<Link <Link
onClick={() =>
toast.info("برای این کتاب نمونهای درج نشده است.")
}
className="mobile-product__header--purchase" className="mobile-product__header--purchase"
style={{ fontSize: fontSize.mobile.a }} style={{ fontSize: fontSize.mobile.a }}
> >
@ -262,8 +271,8 @@ class Product extends Component {
) )
) : null} ) : null}
<ToastContainer <ToastContainer
position="bottom-right" position="top-right"
autoClose={1500} autoClose={2000}
hideProgressBar={true} hideProgressBar={true}
newestOnTop={true} newestOnTop={true}
closeOnClick closeOnClick

@ -25,7 +25,10 @@
font-family: numeralMedium; font-family: numeralMedium;
color: #6f7074; color: #6f7074;
} }
h3 {
font-family: numeralLight;
color: #00cc69;
}
a { a {
border: 0px; border: 0px;
font-family: numeralLight; font-family: numeralLight;

@ -28,7 +28,10 @@ export default class Product extends Component {
return ( return (
<> <>
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<div className="mobile-products-product d-flex flex-column"> <Link
to={`/products/physical/${product.id}`}
className="mobile-products-product d-flex flex-column"
>
<img <img
src={`https://dnvn.ir/api/v1/file/${product.fileIds}`} src={`https://dnvn.ir/api/v1/file/${product.fileIds}`}
alt={"عکس مجصول"} alt={"عکس مجصول"}
@ -58,7 +61,7 @@ export default class Product extends Component {
</span> </span>
</Link> </Link>
</div> </div>
</div> </Link>
) : null} ) : null}
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<article className="products-product d-flex flex-column align-items-center"> <article className="products-product d-flex flex-column align-items-center">

@ -23,6 +23,21 @@
direction: rtl; direction: rtl;
overflow-x: hidden; overflow-x: hidden;
padding-top: 70px; padding-top: 70px;
&__empty {
font-family: numeralLight;
a {
display: inline;
font-family: numeralLight;
text-decoration: none;
padding: 5px 20px 3px;
background-color: #00cc69;
border-radius: 25px;
color: white;
&:focus:enabled {
text-decoration: none;
}
}
}
&__search { &__search {
// width: 100%; // width: 100%;
position: relative; position: relative;

@ -200,7 +200,7 @@ export default function QRImage(props) {
return ( return (
<> <>
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<div className="d-flex flex-column"> <div className="d-flex flex-column" id="image">
<h3 style={{ fontSize: fontSize.mobile.h3 }}> <h3 style={{ fontSize: fontSize.mobile.h3 }}>
<PhotoLibraryRoundedIcon style={{ fontSize: 30 }} /> عکسها{" "} <PhotoLibraryRoundedIcon style={{ fontSize: 30 }} /> عکسها{" "}
</h3> </h3>
@ -208,7 +208,7 @@ export default function QRImage(props) {
</div> </div>
) : null} ) : null}
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<div className="d-flex flex-column"> <div className="d-flex flex-column" id="image">
<h3 style={{ fontSize: fontSize.desktop.h3 }}> <h3 style={{ fontSize: fontSize.desktop.h3 }}>
<PhotoLibraryRoundedIcon style={{ fontSize: 30 }} /> <PhotoLibraryRoundedIcon style={{ fontSize: 30 }} />
عکسها عکسها

@ -1,6 +1,6 @@
.video-js { .video-js {
width: 100% !important; // width: 100% !important;
height: 100% !important; // height: 100% !important;
border-radius: 20px; border-radius: 20px;
button { button {
&:focus { &:focus {

@ -3,7 +3,7 @@
border-radius: 10px; border-radius: 10px;
background-color: #eee; background-color: #eee;
margin: 0px 0px 20px; margin: 0px 0px 20px;
height: calc(100vh / 4); // height: calc(100vh / 4);
position: relative; position: relative;
h2 { h2 {
font-family: numeralMedium; font-family: numeralMedium;
@ -24,8 +24,8 @@
border-radius: 10px; border-radius: 10px;
background-color: #eee; background-color: #eee;
margin: 15px auto; margin: 15px auto;
height: calc(100vh / 2.5); // height: calc(100vh / 2.5);
min-height: 300px; // min-height: 300px;
position: relative; position: relative;
h2 { h2 {
font-family: numeralMedium; font-family: numeralMedium;

@ -72,6 +72,22 @@ class QR extends Component {
} }
} }
componentDidUpdate(prevProps, prevState) {
const { qrList } = this.props;
if (prevProps.qrList !== qrList) {
localStorage.setItem(
"latestQr",
JSON.stringify({
name: qrList.book.name,
pagesNum: qrList.book.pagesNum,
gradeId: qrList.book.gradeId,
link: window.location.search,
fileIds: qrList.book.fileIds,
})
);
}
}
render() { render() {
const { QR, qrList } = this.props; const { QR, qrList } = this.props;
const fontSize = { const fontSize = {
@ -99,10 +115,6 @@ class QR extends Component {
}, },
}; };
// if (this.content.clientHeight < window.innerHeight - 60) {
// this.buttons.style.display = "none";
// }
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
@ -313,6 +325,12 @@ const Identifier = (props) => {
const MenuIdentifier = (props) => { const MenuIdentifier = (props) => {
return ( return (
<> <>
{props.data.type === "image" ? (
<a
href="#image"
className="mobile-qr__buttons--image mobile-qr__buttons--media"
></a>
) : null}
{props.data.type === "voice" ? ( {props.data.type === "voice" ? (
<a <a
href="#voice" href="#voice"

@ -82,6 +82,11 @@
transform: translateY(120px); transform: translateY(120px);
margin-top: 10px; margin-top: 10px;
} }
&--image {
background: url(../../assets/icons/image.jpg) no-repeat #e6ffa2;
background-size: 35px;
background-position: center center;
}
&--voice { &--voice {
background: url(../../assets/icons/play.svg) no-repeat #a2ffc1; background: url(../../assets/icons/play.svg) no-repeat #a2ffc1;
background-size: 21px; background-size: 21px;

@ -1,31 +1,45 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import { Link } from "react-router-dom";
import './index.scss'; import "./index.scss";
export default function LastQR(props){
const {data} = props; const grades = [
return( "اول",
<> "دوم",
{ "سوم",
window.innerWidth > 1000 ? "چهارم",
<div className="last-qr"> "پنجم",
"ششم",
"هفتم",
"هشتم",
"نهم",
"دهم",
"یازدهم",
"دوازدهم",
];
</div> : null export default function LastQR(props) {
} const { data } = props;
{ return (
window.innerWidth < 1000 ? <>
<div className="mobile-last-qr d-flex"> {window.innerWidth > 1000 ? <div className="last-qr"></div> : null}
{window.innerWidth < 1000 ? (
<Link to={`/qr${data.link}`} className="mobile-last-qr d-flex">
<div className="mobile-last-qr__right d-flex"> <div className="mobile-last-qr__right d-flex">
<img src={data.image} alt={data.title} /> <img
src={`https://dnvn.ir/api/v1/file/${data.fileIds}`}
alt={data.name}
/>
<div className="d-flex flex-column"> <div className="d-flex flex-column">
<strong>{data.title}</strong> <strong>{data.name}</strong>
<span>{data.subTitle}</span> <span>{grades[data.gradeId]}</span>
</div> </div>
</div> </div>
<div className="mobile-last-qr__left d-flex"> <div className="mobile-last-qr__left d-flex">
<button>صفحه {data.page}</button> <button>صفحه {data.pagesNum}</button>
</div> </div>
</div> : null </Link>
} ) : null}
</> </>
); );
} }

@ -1,32 +1,34 @@
.mobile-last-qr{ .mobile-last-qr {
width: 100%; width: 100%;
padding: 15px 10px; padding: 15px 10px;
justify-content: space-between; justify-content: space-between;
background-color:white; background-color: white;
align-items:center; align-items: center;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 0px 10px rgb(226, 226, 226); box-shadow: 0px 0px 10px rgb(226, 226, 226);
&__right{ text-decoration: none;
align-items:center; &__right {
img{ align-items: center;
img {
height: 100px; height: 100px;
border-radius: 10px; border-radius: 10px;
margin-left: 15px; margin-left: 15px;
} }
strong{ strong {
font-family: numeralMedium; font-family: numeralMedium;
font-size: calc(100vw / 30); font-size: calc(100vw / 25);
font-weight: 600; font-weight: 600;
letter-spacing: -1px; letter-spacing: -1px;
color: #4e4e4e;
} }
span{ span {
font-family: numeralMedium; font-family: numeralMedium;
font-size: calc(100vw / 35); font-size: calc(100vw / 30);
color: #00CC69; color: #00cc69;
} }
} }
&__left{ &__left {
button{ button {
display: inline; display: inline;
font-family: numeralLight; font-family: numeralLight;
text-decoration: none; text-decoration: none;
@ -36,7 +38,7 @@
border-radius: 25px; border-radius: 25px;
font-size: calc(100vw / 26); font-size: calc(100vw / 26);
color: #00cc69; color: #00cc69;
&:focus:enabled{ &:focus:enabled {
text-decoration: none; text-decoration: none;
} }
} }

@ -127,12 +127,17 @@ class QRScan extends Component {
{this.state.tail === null ? null : ( {this.state.tail === null ? null : (
<Modal parent={this} tail={this.state.tail} /> <Modal parent={this} tail={this.state.tail} />
)} )}
{localStorage.getItem("latestQr") ? (
<section className="mobile-qr-scan__lasts d-flex flex-column"> <section className="mobile-qr-scan__lasts d-flex flex-column">
<h2>آخرین مشاهدات</h2> <h2>آخرین مشاهدات</h2>
{data.map((item, i) => ( {data.map((item, i) => (
<LastQr data={item} key={i} /> <LastQr
data={JSON.parse(localStorage.getItem("latestQr"))}
key={i}
/>
))} ))}
</section> </section>
) : null}
</div> </div>
</> </>
) : null} ) : null}

@ -56,51 +56,15 @@
} }
} }
&__camera { &__camera {
margin-top: 20px; // margin-top: 20px;
width: 100%; width: 100%;
border-radius: 10px; border-radius: 10px;
margin: 30px auto; margin: 5px auto;
position: relative; position: relative;
&--shape { &--shape {
position: absolute; position: absolute;
background-color: rgba(0, 0, 0, 0.8); background-color: rgba(0, 0, 0, 0.8);
} }
&--shapeTop {
width: calc(100% - 60px);
height: 30px;
left: 30px;
top: 0px;
}
&--shapeBottom {
width: calc(100% - 60px);
height: 30px;
left: 30px;
bottom: 0px;
}
&--shapeLeft {
width: 30px;
height: 100%;
left: 0px;
bottom: 0px;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
&--shapeRight {
width: 30px;
height: 100%;
right: 0px;
bottom: 0px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
&--shapeCenter {
position: absolute;
width: calc(100% - 60px);
height: calc(100% - 60px);
right: 30px;
bottom: 30px;
border: 3px solid red;
}
} }
&__text { &__text {
text-align: justify; text-align: justify;
@ -110,7 +74,7 @@
} }
&__lasts { &__lasts {
width: 100%; width: 100%;
margin: 30px 0px; margin: 15px 0px;
h2 { h2 {
font-family: numeralBold; font-family: numeralBold;
color: #02a255; color: #02a255;

@ -1,10 +1,12 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { userProduct } from "~/Redux/actions";
import Navbar from "../Home/Navbar/index"; import Navbar from "../Home/Navbar/index";
import Input from "../Contact/Input/index"; import Input from "../Contact/Input/index";
import Select from "../Contact/Select/index"; import Select from "../Contact/Select/index";
import "../Contact/index.scss"; import "../Contact/index.scss";
import { connect } from "react-redux";
const maxDesktopSize = 1250; const maxDesktopSize = 1250;
const maxMobileSize = 550; const maxMobileSize = 550;
@ -23,6 +25,18 @@ const fontSize = {
}; };
class Support extends Component { class Support extends Component {
state = {
name: null,
cellphone: null,
unit: null,
book: null,
subject: null,
text: null,
};
componentDidMount() {
this.props.getList();
}
render() { render() {
return ( return (
<> <>
@ -30,15 +44,31 @@ class Support extends Component {
<Navbar page={"contact"} /> <Navbar page={"contact"} />
<div className="mobile-contact__form d-flex flex-column"> <div className="mobile-contact__form d-flex flex-column">
<h1 style={{ fontSize: fontSize.mobile.h1 }}>پشتیبانی</h1> <h1 style={{ fontSize: fontSize.mobile.h1 }}>پشتیبانی</h1>
<Input label={"نامونام خانوادگی"} name={"name"} /> <Input label={"نامونام خانوادگی"} name={"name"} parent={this} />
<Input label={"شماره تماس"} name={"mobile"} /> <Input label={"شماره تماس"} name={"cellphone"} parent={this} />
{/* <Select options={["همه", "پرفروش"]} /> */} <Select
<Input label={"موضوع پیام"} name={"subject"} /> name="unit"
<textarea options={[
placeholder="متن پیام" "واحد مورد نظر",
name="description" "واحد فروش",
rows="5" "واحد محتوایی",
></textarea> "واحد فنی",
]}
parent={this}
/>
{this.state.unit === "واحد محتوایی" ? (
<Select
name="book"
options={[
...new Set(
this.props.list.map((item) => item.product.book.name)
),
]}
parent={this}
/>
) : null}
<Input label={"موضوع پیام"} name={"subject"} parent={this} />
<textarea placeholder="متن پیام" name="text" rows="5"></textarea>
<button>ارسال</button> <button>ارسال</button>
</div> </div>
</div> </div>
@ -47,4 +77,9 @@ class Support extends Component {
} }
} }
export default Support; export default connect(
(state) => ({
list: state.userProduct.list,
}),
{ getList: userProduct.list }
)(Support);

Loading…
Cancel
Save