From 99f72e42c76c45122550fb986856b31cb3d0dbfc Mon Sep 17 00:00:00 2001 From: Alireza khaji Date: Mon, 20 Sep 2021 17:12:57 +0430 Subject: [PATCH 1/2] commit(ark_mybooks) --- src/AppRouter.js | 8 +- src/views/MyBook2/index.css | 95 ++++++++++++++++++++++++ src/views/MyBook2/index.js | 143 +++++++++++++++++++++++++++--------- 3 files changed, 209 insertions(+), 37 deletions(-) diff --git a/src/AppRouter.js b/src/AppRouter.js index 988d2d8..7d7153d 100644 --- a/src/AppRouter.js +++ b/src/AppRouter.js @@ -33,6 +33,7 @@ import Blog from "./views/Blog/index"; // import Sample from "./views/Sample/index"; import PDF from "./views/PDF/index"; import Orders from "./views/Orders"; +import MyBooks2 from "./views/MyBook2"; class AppRouter extends Component { constructor(props) { super(props); @@ -104,6 +105,9 @@ class AppRouter extends Component { + + + {/* */} @@ -255,7 +259,7 @@ class AppRouter extends Component { /> )} - + {/* {mobile ? ( status ? ( @@ -275,7 +279,7 @@ class AppRouter extends Component { }} /> )} - + */} {mobile ? ( status ? ( diff --git a/src/views/MyBook2/index.css b/src/views/MyBook2/index.css index e69de29..7fa69dc 100644 --- a/src/views/MyBook2/index.css +++ b/src/views/MyBook2/index.css @@ -0,0 +1,95 @@ + +.mybooks{ + width: 100%; + padding:0 5px; + margin-top: 60px; +} + +.mybooks-title{ + width: 100%; + direction: rtl; + font-size: 25px; + font-weight: bold; + color: #5DC964; +} + +.mybooks-tabs{ + width: 100%; + display: flex; + align-items: center; + direction: rtl; + margin-top: 10px; +} + +.mybooks-tabs-item{ + width: 50%; + height: 50px; + display: flex; + align-items: center; + justify-content: center; + font-size: 20px; + cursor: pointer; +} + +.mybooks-tabs-item1{ + border-radius: 0 5px 5px 0; + border: 1px solid #418f46; + background-color: white; + color: #5DC964; +} + +.mybooks-tabs-item2{ + border-radius: 5px 0px 0px 5px; + border: 1px solid #418f46; + background-color: #5DC964; + color: white; +} + +.mybooks-line{ + width: 100%; + height: 1px; + background-color: rgb(201, 199, 199); + margin-top: 15px; +} + +.mybooks-main-content{ + width: 100%; + margin-top: 15px; +} + +.mybooks-main-content-item{ + width: 100%; +} + +.mybooks-main-content-row1{ + width: 100%; + display: flex; + justify-content: space-between; + direction: ltr; + padding: 15px 0; + border-bottom: 1px solid rgb(201, 199, 199); +} + +.mybooks-main-content-row1-img-container{ + width: 25%; + height: auto; + border-radius: 5px; + overflow: hidden; +} + +.mybooks-main-content-row1-img{ + width: 100%; + height: 100%; +} + +.mybooks-main-content-row1-text{ + width: 80%; +} + +.mybooks-main-content-row1-text-name, +.mybooks-main-content-row1-text-activation-date, +.mybooks-main-content-row1-text-activation-code{ + width: 100%; + font-size: 16px; + margin-bottom: 10px; +} diff --git a/src/views/MyBook2/index.js b/src/views/MyBook2/index.js index 240ae29..c572e2e 100644 --- a/src/views/MyBook2/index.js +++ b/src/views/MyBook2/index.js @@ -1,48 +1,96 @@ import { useState } from 'react'; +import Navbar from '../Home/Navbar'; import './index.css'; -const MyBooks=()=>{ +const MyBooks2=()=>{ const [data, set_data] = useState([ { - id: 1, - name: "ریاضی دهم", - activation_date: "1400/05/22", - activation_code: "2434df3r3", - ARId: "", - QRId: "", - type: 1, + id: 291, + pid: null, + ord: null, + productId: 3, + userId: 21, + factorId: null, + authorId: null, + count: 1, + price: null, + finalPrice: null, + condition: 2, + isActive: 1, + productType: 3, + createdAt: "2021-09-16T14:01:02.180Z", + updatedAt: "2021-09-16T14:01:02.180Z", + activation_code: "2042308", + deletedAt: null, + product: { + bookId: 1, + productType: 3, + price: 0, + ARId: 228, + book: { + id: 1, + name: "علوم تجربی", + category: "دسته بندی", + text: null, + description: null, + publishYear: 1399, + pagesNum: 1, + authorName: "دکتر علی عبدالعالی", + gradeId: 6, + fileIds: "2094", + operators: null, + items: null, + sampleFileId: "2132", + categoryIds: null, + }, + }, }, { - 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, + id: 170, + pid: null, + ord: null, + productId: 36, + userId: 21, + factorId: null, + authorId: null, + count: 1, + price: null, + finalPrice: null, + condition: 2, + isActive: 1, + productType: 3, + createdAt: "2021-09-12T18:27:57.399Z", + updatedAt: "2021-09-12T18:27:57.399Z", + activation_code: "2042308", + deletedAt: null, + product: { + bookId: 12, + productType: 3, + price: 0, + ARId: 258, + book: { + id: 12, + name: "ریاضی", + category: "دسته بندی", + text: null, + description: null, + publishYear: 1399, + pagesNum: 1, + authorName: "دکتر علی عبدالعالی", + gradeId: 1, + fileIds: "2104", + operators: null, + items: null, + sampleFileId: "2125", + categoryIds: null, + }, + }, }, ]); return (
+
کتاب‌ های من
@@ -52,10 +100,35 @@ const MyBooks=()=>{
- + {data.map((item) => ( +
+
+
+ mybook-img +
+
+
+ نام آیتم: {item.product.book.name} +
+
+ تاریخ فعال‌سازی: {item.updatedAt} +
+
+ کد فعال‌سازی: {item.activation_code} +
+
+
+
+ ))}
); } -export default MyBooks; \ No newline at end of file +export default MyBooks2; \ No newline at end of file From 1e7bc8d0087aa95c6e646127edaf11281acefb3c Mon Sep 17 00:00:00 2001 From: Alireza khaji Date: Mon, 20 Sep 2021 17:36:38 +0430 Subject: [PATCH 2/2] commit(ark_mybooks_2) --- src/views/MyBook2/index.js | 3 ++- yarn.lock | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/MyBook2/index.js b/src/views/MyBook2/index.js index c572e2e..bd0a244 100644 --- a/src/views/MyBook2/index.js +++ b/src/views/MyBook2/index.js @@ -1,6 +1,7 @@ import { useState } from 'react'; import Navbar from '../Home/Navbar'; import './index.css'; +import moment from "jalali-moment"; const MyBooks2=()=>{ @@ -117,7 +118,7 @@ const MyBooks2=()=>{ نام آیتم: {item.product.book.name}
- تاریخ فعال‌سازی: {item.updatedAt} + تاریخ فعال‌سازی: {moment(item.updatedAt).format("YYYY/M/D")}
کد فعال‌سازی: {item.activation_code} diff --git a/yarn.lock b/yarn.lock index 0e02f5a..3db2f18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7647,7 +7647,7 @@ istanbul-reports@^3.0.2: jalali-moment@^3.3.10: version "3.3.10" - resolved "https://registry.npmjs.org/jalali-moment/-/jalali-moment-3.3.10.tgz" + resolved "https://registry.yarnpkg.com/jalali-moment/-/jalali-moment-3.3.10.tgz#10cb4c2080925a41ee8c72862ba63f6b5fb04743" integrity sha512-hyNsDJXB23MHLnZWPXY+Mu0zsrp+B+KzabyqPP0oGcMsEGp8yMpeVledOY+B/DrIOVeRY7JLz8b3lyJ3/vajsQ== dependencies: commander "^7.0.0"