diff --git a/src/AppRouter.js b/src/AppRouter.js index d352691..988d2d8 100644 --- a/src/AppRouter.js +++ b/src/AppRouter.js @@ -32,6 +32,7 @@ import Blogs from "./views/Blogs/index"; import Blog from "./views/Blog/index"; // import Sample from "./views/Sample/index"; import PDF from "./views/PDF/index"; +import Orders from "./views/Orders"; class AppRouter extends Component { constructor(props) { super(props); @@ -100,6 +101,9 @@ class AppRouter extends Component { + + + {/* */} diff --git a/src/Redux/actions/userFactor.js b/src/Redux/actions/userFactor.js index 0f82744..09f8729 100644 --- a/src/Redux/actions/userFactor.js +++ b/src/Redux/actions/userFactor.js @@ -3,7 +3,7 @@ const userFactor = { list: (data = {}) => async (dispatch) => - await proxy.get("userFactor/list", data, { dispatch }), + await proxy.get("userFactor/myList", data, { dispatch }), info: (data = {}) => async (dispatch) => diff --git a/src/Redux/reducers/userFactor.js b/src/Redux/reducers/userFactor.js index 9305921..f1ed60b 100644 --- a/src/Redux/reducers/userFactor.js +++ b/src/Redux/reducers/userFactor.js @@ -3,7 +3,7 @@ import { toast } from "react-toastify"; const initialState = { loading: false, error: null, - list: [], + list: null, info: null, sum: null, checkEmpty: false, diff --git a/src/views/MyBook2/index.css b/src/views/MyBook2/index.css new file mode 100644 index 0000000..e69de29 diff --git a/src/views/MyBook2/index.js b/src/views/MyBook2/index.js new file mode 100644 index 0000000..240ae29 --- /dev/null +++ b/src/views/MyBook2/index.js @@ -0,0 +1,61 @@ +import { useState } from 'react'; +import './index.css'; + +const MyBooks=()=>{ + + const [data, set_data] = useState([ + { + id: 1, + name: "ریاضی دهم", + activation_date: "1400/05/22", + activation_code: "2434df3r3", + ARId: "", + QRId: "", + type: 1, + }, + { + id: 2, + name: "ریاضی دهم", + activation_date: "1400/05/22", + activation_code: "2434df3r3", + ARId: "", + QRId: "", + type: 1, + }, + { + id: 3, + name: "ریاضی دهم", + activation_date: "1400/05/22", + activation_code: "2434df3r3", + ARId: "", + QRId: "", + type: 1, + }, + { + id: 4, + name: "ریاضی دهم", + activation_date: "1400/05/22", + activation_code: "2434df3r3", + ARId: "", + QRId: "", + type: 1, + }, + ]); + return ( +
+
کتاب‌ های من
+
+
+ فعال سازی شده +
+
دیجیتال
+
+
+
+ +
+
+ ); +} + +export default MyBooks; \ No newline at end of file diff --git a/src/views/Orders/index.css b/src/views/Orders/index.css new file mode 100644 index 0000000..b537319 --- /dev/null +++ b/src/views/Orders/index.css @@ -0,0 +1,138 @@ + + + +.order{ + width: 100%; + margin-top: 70px; + padding: 0 5px; +} + +/* .order-line{ + width: 100%; + height: 1px; + background-color: rgb(201, 199, 199); + margin-top: 10px; +} */ + +.order-title{ + width: 100%; + direction: rtl; + font-size: 25px; + font-weight: bold; + color: #5DC964; +} + +.order-data-container{ + width: 100%; +} + +.order-data-container-item{ + width: 100%; + padding-bottom: 10px; + border-bottom: 1px solid rgb(201, 199, 199); +} + +.order-data-container-item-row1{ + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + direction: rtl; + margin-top: 10px; +} + +.order-data-container-item-row1-order-id, +.order-data-container-item-row2-order-date, +.order-data-container-item-row3-order-price, +.order-data-container-item-row2-transactionId, +.order-data-container-item-row3-order-offcodeprice{ + font-size: 16px; + color: #555; + direction: rtl; +} + +.order-data-container-item-row1-order-id span, +.order-data-container-item-row2-order-date span, +.order-data-container-item-row3-order-price span, +.order-data-container-item-row3-order-offcodeprice span{ + font-size: 16px; + color: #333; + margin-right: 5px; + direction: ltr !important; +} + +.order-data-container-item-row1-order-status{ + display: flex; + align-items: center; + direction: rtl; +} + +.order-data-container-item-row1-order-status-circle{ + width: 12px; + height: 12px; + border-radius: 50%; + background-color: black; + margin-left: 3px; +} + +.order-data-container-item-row1-order-status-text{ + font-size: 13px; + width: 100px; + text-align: center; + padding: 2px 0; + background-color: #999; + border-radius: 5px; +} + +.order-data-container-item-row2{ + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 10px; +} + +.odcir2op-unit,.odcir2oo-unit{ + font-size: 12px !important; + margin-right: 3px !important; +} + +.order-data-container-item-row3{ + width: 100%; + margin-top: 10px; +} + +.order-data-container-item-row3-order-offcodeprice{ + margin-top: 10px; +} + + +.order-data-container-item-row4{ + width: 100%; +} + +.order-data-container-item-row4-imgs{ + width: 100%; + display: flex; + align-items: center; + direction: ltr; +} + +.order-data-container-item-row4-imgs-container{ + width:18%; + aspect-ratio: 1/1; + border-radius: 5px; + overflow: hidden; + background-color: brown; + margin-right: 5px; +} + +.order-data-container-item-row4-imgs-img{ + width: 100%; + height: 100%; +} + +.order-message{ + width: 100%; + font-size: 20px; +} \ No newline at end of file diff --git a/src/views/Orders/index.js b/src/views/Orders/index.js new file mode 100644 index 0000000..d82844f --- /dev/null +++ b/src/views/Orders/index.js @@ -0,0 +1,197 @@ +import { useState } from "react"; +import { userFactor } from "../../Redux/actions"; +import { connect } from "react-redux"; +import Navbar from "../Home/Navbar"; + + +import './index.css'; + +const Orders=(props)=>{ + // const [data, set_data] = useState([ + // { + // id: "12345", + // transactionId: "43448y35", + // payedAt: "1400/06/24", + // condition: 1, + // payPrice: 2500000, + // offPrice: 10000, + // description: "", + // products: [ + // { + // id: 1, + // ARId: "", + // book: { + // name: "", + // fileId: "", + // }, + // }, + // { + // id: 2, + // ARId: "", + // book: { + // name: "", + // fileId: "", + // }, + // }, + // ], + // }, + // { + // id: "45679f", + // transactionId: "43448y35", + // payedAt: "1400/06/24", + // condition: 2, + // payPrice: 2500000, + // offPrice: 0, + // description: "", + // products: [ + // { + // id: '1', + // ARId: "", + // book: { + // name: "", + // fileId: "", + // }, + // }, + // { + // id: 2, + // ARId: "", + // book: { + // name: "", + // fileId: "", + // }, + // }, + // ], + // }, + // { + // id: "509685f", + // transactionId: "43448y35", + // payedAt: "1400/06/24", + // condition: 3, + // payPrice: 2500000, + // offPrice: 10000, + // description: "", + // products: [ + // { + // id: 1, + // ARId: "", + // book: { + // name: "", + // fileId: "", + // }, + // }, + // { + // id: 2, + // ARId: "", + // book: { + // name: "", + // fileId: "", + // }, + // }, + // ], + // }, + // ]); + props.getList(); + let data = props.list; + return ( +
+ +
سفارشات من
+
+ {data != null && + data.map((item) => ( +
+
+
+ شناسه سفارش: {item.id} +
+
+
+
+ {item.condition == 1 && "در حال پردازش"} + {item.condition == 2 && "ارسال شد"} + {item.condition == 3 && "لغو شد"} +
+
+
+
+
+ شناسه پرداخت : {item.transactionId} +
+
+ تاریخ سفارش : {item.payedAt} +
+
+
+
+ مبلغ : {item.payPrice}{" "} + تومان +
+ {item.offCodePrice != 0 && ( +
+ میزان تخفیف : {item.offPrice}{" "} + تومان +
+ )} +
+
+
+ {item.products.map((item) => ( +
+ order-img +
+ ))} +
+
+
+ ))} + {data == null && ( +
سفارشی برای نماش وجود ندارد
+ )} +
+
+ ); +} + + +const mapStateToPropS = state =>{ + return{ + list:state.list + } +} + +const mapDispatchToProps = dispatch =>{ + return{ + getList:()=> dispatch(userFactor.list()) + } +} + +export default connect(mapStateToPropS, mapDispatchToProps)(Orders); + + +