parent
f2ae030688
commit
064fe9efab
17 changed files with 449 additions and 127 deletions
@ -0,0 +1,3 @@ |
||||
import { createBrowserHistory } from "history"; |
||||
|
||||
export default createBrowserHistory(); |
@ -1,7 +1,7 @@ |
||||
// @create-index
|
||||
|
||||
export { default as chat } from './chat.js'; |
||||
export { default as chat } from "./chat.js"; |
||||
// export { default as message } from './message.js';
|
||||
// export { default as public } from './public.js';
|
||||
export { default as user } from './user.js'; |
||||
|
||||
export { default as user } from "./user.js"; |
||||
export { default as qr } from "./qr.js"; |
||||
|
@ -0,0 +1,37 @@ |
||||
import proxy from "../proxy"; |
||||
const qr = { |
||||
list: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("qr/list", data, { dispatch }), |
||||
info: |
||||
// (data = {}) =>
|
||||
// async (dispatch) => {
|
||||
// await proxy.get("qr/info", data, { dispatch });
|
||||
// },
|
||||
|
||||
|
||||
(data = {}) => |
||||
async (dispatch) => |
||||
dispatch({ type: "qr/info", payload: data }), |
||||
add: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.post("qr/add", data); |
||||
await proxy.get("qr/list", 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 qr; |
@ -1,7 +1,7 @@ |
||||
// @create-index
|
||||
|
||||
export { default as chat } from './chat.js'; |
||||
export { default as message } from './message.js'; |
||||
export { default as public } from './public.js'; |
||||
export { default as user } from './user.js'; |
||||
|
||||
export { default as chat } from "./chat.js"; |
||||
export { default as message } from "./message.js"; |
||||
export { default as public } from "./public.js"; |
||||
export { default as user } from "./user.js"; |
||||
export { default as qr } from "./qr.js"; |
||||
|
@ -0,0 +1,40 @@ |
||||
import React, { Component } from "react"; |
||||
|
||||
import "./index.scss"; |
||||
|
||||
const maxMobileSize = 550; |
||||
const maxDesktopSize = 1250; |
||||
|
||||
const fontSize = { |
||||
mobile: { |
||||
h1: window.innerWidth > maxMobileSize ? 18 : window.innerWidth / 26, |
||||
h2: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 34, |
||||
div: window.innerWidth > maxMobileSize ? 18 : window.innerWidth / 32, |
||||
}, |
||||
desktop: { |
||||
h1: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 70, |
||||
div: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 85, |
||||
old: window.innerWidth > maxDesktopSize ? 9 : window.innerWidth / 120, |
||||
}, |
||||
}; |
||||
|
||||
export default class Item extends Component { |
||||
render() { |
||||
const { data } = this.props; |
||||
return ( |
||||
<> |
||||
{window.innerWidth < 1000 ? ( |
||||
<article className="mobile-ar-book d-flex flex-column"> |
||||
<a href={`https://ar.dnvn.ir/lunch?id=${data.id}`}> |
||||
<img src={data.imageUrl} alt={data.title} /> |
||||
<h1 style={{ fontSize: fontSize.mobile.h1 }}>{data.title}</h1> |
||||
</a> |
||||
</article> |
||||
) : null} |
||||
{window.innerWidth > 1000 ? ( |
||||
<article className="products-product d-flex flex-column align-items"></article> |
||||
) : null} |
||||
</> |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,76 @@ |
||||
.mobile-ar-book { |
||||
width: calc(100% / 2); |
||||
padding: 10px; |
||||
a { |
||||
width: 100%; |
||||
text-decoration: none; |
||||
&:hover { |
||||
} |
||||
img { |
||||
width: 100%; |
||||
height: 170px; |
||||
border-radius: 20px; |
||||
} |
||||
h1 { |
||||
font-family: numeralBold; |
||||
margin-top: 15px; |
||||
color: #4d4d4d; |
||||
letter-spacing: -1px; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.products-product { |
||||
width: calc(100% / 4); |
||||
padding: 10px; |
||||
margin-bottom: 20px; |
||||
a { |
||||
width: 100%; |
||||
text-decoration: none; |
||||
&:hover { |
||||
} |
||||
img { |
||||
width: 100%; |
||||
height: 200px; |
||||
border-radius: 30px; |
||||
} |
||||
h1 { |
||||
font-family: numeralBold; |
||||
margin-top: 15px; |
||||
color: #02a1a6; |
||||
letter-spacing: -1px; |
||||
text-align: center; |
||||
} |
||||
} |
||||
&__notAvailabe { |
||||
font-family: numeralBold; |
||||
width: 100%; |
||||
text-align: center; |
||||
color: #6f7074; |
||||
margin-top: 15px; |
||||
} |
||||
&__price { |
||||
width: 100%; |
||||
margin-top: 15px; |
||||
text-align: center; |
||||
&--old { |
||||
font-family: numeralBold; |
||||
color: #6f7074; |
||||
position: relative; |
||||
margin-left: 10px; |
||||
align-items: center; |
||||
span { |
||||
position: absolute; |
||||
left: 0px; |
||||
width: 100%; |
||||
height: 2px; |
||||
background-color: rgba(121, 121, 121, 0.534); |
||||
transform: rotate(-14deg); |
||||
} |
||||
} |
||||
&--price { |
||||
color: #4d4d4d; |
||||
font-family: numeralBold; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,86 @@ |
||||
import React, { Component } from "react"; |
||||
import Navbar from "../Home/Navbar/index"; |
||||
import Footer from "../Home/Footer/index"; |
||||
import Item from "./Item/index"; |
||||
|
||||
import zist_10 from "~/assets/images/zist-10.png"; |
||||
import chemistry_10 from "~/assets/images/chemistry-10.png"; |
||||
import sciense_8 from "~/assets/images/sciense-8.png"; |
||||
import sciense_7 from "~/assets/images/sciense-7.png"; |
||||
import sciense_6 from "~/assets/images/sciense-6.png"; |
||||
import sciense_9 from "~/assets/images/sciense-9.png"; |
||||
|
||||
import "./index.scss"; |
||||
|
||||
const maxDesktopSize = 1250; |
||||
|
||||
const fontSize = { |
||||
desktop: { |
||||
h1: window.innerWidth > maxDesktopSize ? 25 : window.innerWidth / 70, |
||||
p: window.innerHeight > maxDesktopSize ? 15 : window.innerWidth / 90, |
||||
}, |
||||
}; |
||||
|
||||
export default class AR extends Component { |
||||
render() { |
||||
const { data } = this.props; |
||||
return ( |
||||
<> |
||||
{window.innerWidth > 1000 ? ( |
||||
<> |
||||
<div className="ar d-flex flex-column align-items-center"> |
||||
<Navbar /> |
||||
<div className="ar__box d-flex flex-column"></div> |
||||
</div> |
||||
<Footer /> |
||||
</> |
||||
) : null} |
||||
{window.innerWidth < 1000 ? ( |
||||
<div className="mobile-ar d-flex flex-column"> |
||||
<Navbar /> |
||||
<div className="mobile-ar__list d-flex flex-wrap"> |
||||
{data.map((item, i) => ( |
||||
<Item data={item} key={i} /> |
||||
))} |
||||
</div> |
||||
</div> |
||||
) : null} |
||||
</> |
||||
); |
||||
} |
||||
} |
||||
|
||||
AR.defaultProps = { |
||||
data: [ |
||||
{ |
||||
id: 222, |
||||
title: "دانوین زیست دهم", |
||||
imageUrl: zist_10, |
||||
}, |
||||
{ |
||||
id: 223, |
||||
title: "دانوین شیمی نهم", |
||||
imageUrl: chemistry_10, |
||||
}, |
||||
{ |
||||
id: 225, |
||||
title: "دانوین علوم نهم", |
||||
imageUrl: sciense_6, |
||||
}, |
||||
{ |
||||
id: 226, |
||||
title: "دانوین علوم هشتم", |
||||
imageUrl: sciense_8, |
||||
}, |
||||
{ |
||||
id: 227, |
||||
title: "دانوین علوم هفتم", |
||||
imageUrl: sciense_7, |
||||
}, |
||||
{ |
||||
id: 228, |
||||
title: "دانوین علوم ششم", |
||||
imageUrl: sciense_6, |
||||
}, |
||||
], |
||||
}; |
@ -0,0 +1,20 @@ |
||||
.mobile-ar { |
||||
width: 100vw; |
||||
max-width: 1250px; |
||||
margin: 0px auto; |
||||
padding: 0px 10px 40px; |
||||
direction: rtl; |
||||
padding-top: 90px; |
||||
overflow-x: hidden; |
||||
} |
||||
|
||||
.ar { |
||||
width: 100vw; |
||||
max-width: 1250px; |
||||
min-height: calc(100vh - 288px); |
||||
margin: 0px auto; |
||||
padding: 0px 10px; |
||||
direction: rtl; |
||||
overflow-x: hidden; |
||||
padding-top: 100px; |
||||
} |
@ -1,10 +1,10 @@ |
||||
.mobile-multiple-selector { |
||||
width: 100%; |
||||
border-radius: 10px; |
||||
padding: 10px 10px; |
||||
padding: 9px 10px; |
||||
border: 1px solid #ccc !important; |
||||
margin: 0px !important; |
||||
.MuiInput-formControl { |
||||
margin: 9px 0px 7px !important; |
||||
margin: 9px 0px 15px !important; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,3 @@ |
||||
import { createBrowserHistory } from "history"; |
||||
|
||||
export default createBrowserHistory(); |
Loading…
Reference in new issue