Some Changes

main
Pedram Keshavarzi 3 years ago
parent 979ceaecd1
commit d39db59de0
  1. 3
      src/App.css
  2. 6
      src/components/Calendar/index.css
  3. 26
      src/components/Product/index.js
  4. 2
      src/components/exam/Carousel/index.js
  5. 4
      src/view/addExam/views/AddDescription.js
  6. 2
      src/view/addProduct/Sidebar/index.js
  7. 35
      src/view/addProduct/components/infos.js
  8. 2
      src/view/addProduct/components/tags.js
  9. 10
      src/view/addProduct/index.js
  10. 2
      src/view/dashboard/LastActivity.js
  11. 56
      src/view/services/index.js
  12. 16
      src/view/services/service/index.js

@ -51,3 +51,6 @@ select {
option {
color:#404040
}
select:focus{
color:#404040
}

@ -636,8 +636,8 @@
.Calendar__day:not(.-blank):not(.-selectedStart):not(.-selectedEnd):not(.-selectedBetween):not(.-selected):hover {
background-color: rgba(223, 20, 82, 0.06);
color: #df1452;
background-color: rgba(0, 0, 0, 0.06);
/* color: #df1452; */
/* border:1px solid #df1452; */
}
@ -697,7 +697,7 @@
.Calendar__day.-today:not(.-selectedStart):not(.-selectedEnd):not(.-selectedBetween) {
background-color: rgba(223, 20, 82, 0.06);
color: #df1452;
/* border:1px solid #df1452; */
border:1px solid #df1452;
}
/* .Calendar__day.-today:not(.-selectedStart):not(.-selectedEnd):not(.-selectedBetween)::after {

@ -79,10 +79,10 @@ const ProductDesign = ({
return (
<div className={`flex flex-col cursor-pointer pt-4 text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`}
style={{ width: !isMobile && '375px' , direction: 'rtl' }}
onClick={onClick}
>
<div className="border-b border-red82OP pb-2 px-4">
<div className="border-b border-red82OP pb-2 px-4" onClick={onClick}>
<h1 className="text-red52 text-lg font-bold">{productName}</h1>
<p className="text-red26 text-sm my-2">
در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد
@ -97,17 +97,17 @@ const ProductDesign = ({
</div>
</div>
<div className="flex border-b border-red82OP px-4 py-2 text-red26">
<div className="flex border-b border-red82OP px-4 py-2 text-red26" onClick={onClick}>
<h1>نوع گروه : A</h1>
</div>
<div className="flex p-4 justify-between items-center">
<h1 className="font-black text-xl text-red52">{productPrice} تومان</h1>
<div
className={`bg-pinkF5 text-red26 rounded-md w-32 border-2 border-red52 px-1 py-2 text-xs flex justify-center hover:bg-red52 hover:text-white
className={`bg-pinkF5 text-red26 rounded-md w-32 border-2 z-10 border-red52 px-1 py-2 text-xs flex justify-center hover:bg-red52 hover:text-white
`}
>
<button className="z-3" onClick={btnOnClick}>افزودن به سبد خرید</button>
<button className="z-10" onClick={btnOnClick}>افزودن به سبد خرید</button>
</div>
</div>
@ -195,33 +195,33 @@ const ProductDesign = ({
>
<div className="border-b border-red82OP pb-2 px-4">
<div className="border-b border-red82OP pb-2 px-4" onClick={onClick}>
<h1 className="text-red52 text-lg font-bold">آزمون {productName}</h1>
<p className="text-red26 text-sm my-2">
در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد
</p>
</div>
<div className="flex border-b border-red82OP text-center">
<div className="flex border-b border-red82OP text-center" onClick={onClick}>
<div className="w-1/2 border-l border-red82OP py-2 ">
<h1 className="font-bold text-red26">
نوع آزمون : آنلاین
</h1>
</div>
<div className="w-1/2 py-2 ">
<div className="w-1/2 py-2 " onClick={onClick}>
<h1 className="font-bold text-red26">
بودجه بندی آزمون
</h1>
</div>
</div>
<div className="flex border-b border-red82OP text-center text-xs">
<div className="w-1/2 border-l border-red82OP py-2 ">
<div className="flex border-b border-red82OP text-center text-xs" onClick={onClick}>
<div className="w-1/2 border-l border-red82OP py-2 " onClick={onClick}>
<h1 className="font-bold text-red26">
تاریخ برگزاری : 1400/02/13
</h1>
</div>
<div className="w-1/2 py-2 ">
<div className="w-1/2 py-2 " onClick={onClick}>
<h1 className="font-bold text-red26">
تعداد آزمون : 18
</h1>
@ -254,10 +254,10 @@ const ProductDesign = ({
>
<img src="https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg" className="rounded-t-xl"/>
<img src="https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg" className="rounded-t-xl" onClick={onClick}/>
<div className={`border-b border-red82OP py-2 px-4 ${isMobile ? 'bg-blueFF text-right' : 'text-center '}`}>
<div className={`border-b border-red82OP py-2 px-4 ${isMobile ? 'bg-blueFF text-right' : 'text-center '}`} onClick={onClick}>
<h1 className={`text-${isMobile ? 'blueE3' : 'blue-5F'} text-lg font-bold`}>کتاب {productName}</h1>
<p className="text-blue7E text-sm mb-2">
در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد

@ -286,7 +286,7 @@ const MyExamList = ({isMobile}) => {
<div className="my-exam-list">
<div className="my-exam-list-content rounded-lg">
<h1 className='text-right w-full font-bold text-red52 pt-4 px-6'>لیست آزمون های من</h1>
<h1 className='text-right w-full font-bold text-red52 pt-4 px-3'>لیست آزمون های من</h1>
<div className="melc-header">
{data.map((item, i) => (
<div

@ -44,7 +44,7 @@ const AddExamDescription = ({ grades, addExamState, dispatch, stepClick, backSte
/>
<DatePicker
format="YYYY/MM/DD HH:mm:ss"
range
calendar={persian}
locale={persian_fa}
renderButton={(direction, handleClick) => (
@ -61,7 +61,7 @@ const AddExamDescription = ({ grades, addExamState, dispatch, stepClick, backSte
/>
<DatePicker
format="YYYY/MM/DD HH:mm:ss"
range
calendar={persian}
locale={persian_fa}
renderButton={(direction, handleClick) => (

@ -16,7 +16,7 @@ const SideAP = () => {
ذخیره در پیشنویس
</button>
<button className="w-1/2 border border-blueCD rounded-lg font-bold text-white py-4 mr-2 bg-blueCD">
انشتار محصول
انتشار محصول
</button>
</div>

@ -2,6 +2,10 @@ import React, { useState, useEffect } from "react";
import Checkbox from "../../../components/Checkbox";
import arrow from '../../../assets/img/arrow-left-1.svg';
import RangeDatePicker from "../../../components/RangeDatePicker";
import DatePicker from "react-multi-date-picker";
import TimePicker from "react-multi-date-picker/plugins/time_picker"
import persian from "react-date-object/calendars/persian"
import persian_fa from "react-date-object/locales/persian_fa"
const ProductInfos = () => {
const type = [
@ -29,6 +33,17 @@ const ProductInfos = () => {
const inputs = [
]
const CostumeDatePickerInput = ({ openCalendar, value, handleValueChange, title }) => {
return(
<input
onFocus={openCalendar}
value={value}
onChange={handleValueChange}
placeholder={title}
className="w-full h-12 rounded-lg p-3 border border-gray-300 text-blue3A outline-blue-300"
/>
)
}
return (
<div className="w-full bg-white border mx-2 my-6 rounded-lg border-grayE0 flex flex-col py-6">
<h1 className="text-blue3A text-lg font-bold w-full text-right px-4 mb-6 border-r-4 border-blue65">
@ -37,7 +52,7 @@ const ProductInfos = () => {
<div className="flex w-full px-6 justify-between items-center">
<select className="bg-white border border-solid border-gray-200 w-1/5 px-3 rounded-lg text-xs text-gray-400 outline-blueCD mx-2 h-12">
{type.map((item) => (
<option key={`TYPE_OF_PRODUCT__${item.id}`}>{item.title}</option>
<option key={`TYPE_OF_PRODUCT__${item.id}`} className="text-base">{item.title}</option>
))}
</select>
<img src={arrow} />
@ -45,7 +60,23 @@ const ProductInfos = () => {
<img src={arrow} />
<input type="number" placeholder='قیمت کالا با تخفیف' className="bg-white border border-grayE0 h-12 w-1/6 outline-none px-2 rounded-md" />
<img src={arrow} />
<RangeDatePicker title='زمانبندی تخفیف' />
<DatePicker
format="YYYY/MM/DD HH:mm:ss"
range
calendar={persian}
locale={persian_fa}
renderButton={(direction, handleClick) => (
<button className="text-blue-500 font-bold mx-2" onClick={handleClick}>
{direction === "right" ? ">" : "<"}
</button>
)}
render={<CostumeDatePickerInput title='زمان بندی تخفیف'/>}
plugins={[
<TimePicker hideSeconds position="bottom" />,
]}
/>
<img src={arrow} />
<input type="number" placeholder='موجودی' className="bg-white border border-grayE0 h-12 w-1/6 outline-none px-2 rounded-md" />

@ -32,7 +32,7 @@ const TagsInput = () => {
{
tags.map(
(item, index) => (
<div className="bg-gray-200 py-1 flex items-center justify-center px-4 m-1 rtl rounded-md">
<div className="bg-gray-200 py-1 flex items-center justify-center px-4 m-1 rtl hover:bg-gray-500 hover:text-gray-200 transition-all duration-200 rounded-md">
<p>{item}</p>
<p className="mr-1 cursor-pointer" onClick={() => {tags.splice(tags.findIndex(e => e === item),1); setFakeState(!fakeState);}}>x</p>

@ -4,15 +4,17 @@ import SideAP from "./Sidebar";
const AddProduct = () => {
return(
<div className="w-[96%] h-screen bg-grayFD flex items-start mt-20 py-10 justify-center">
<div className="w-1/4">
<SideAP />
</div>
<div className="rtl w-[96%] rtl h-full overflow-hidden overflow-scroll overflow-x-hidden flex items-start pt-32 justify-center" >
<div className="w-3/4">
<MainAP />
</div>
<div className="w-1/4 ">
<SideAP />
</div>
</div>
)
}

@ -73,7 +73,7 @@ const LastActivity = () => {
<div className="LastActivity-row1 w-full flex items-center justify-between flex-row-reverse mb-2">
<div className="LastActivity-title-box flex flex-row-reverse items-center">
<div className="LastActivity-title-box-text mr-2 p-2 font-bold text-color2">
<div className="LastActivity-title-box-text mr-0 pr-1 p-2 font-bold text-color2">
لیست آزمون های من
</div>
</div>

@ -116,6 +116,7 @@ const Services = ({
<ServicePopUp
content={popUpContent}
closeOnClick={() => setPopUp(false)}
sendPrice={val => setPopUpContent({...popUpContent, price: popUpContent.price + val})}
/>
) : null}
<div
@ -315,6 +316,24 @@ const Services = ({
// to={"/class/" + product?.id}
key={`PRODUCT__${gameId}__${index}`}
>
{/* {console.log(product)} */}
<Product
key={index}
productsType={filter.productsType}
product={product}
index={Number(index)}
productName={`${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={separate(product?.product[0]?.price)}
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160}
productHolderBorder=""
productHolderHoverBorder="shadow-md"
teacher={product.vodTeacher}
catId={gameId}
onClick={() => {
setPopUpContent({
id: gameId,
@ -323,7 +342,7 @@ const Services = ({
teacher: product?.vodTeacher,
description:
"در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت",
price: product?.price,
price: gameId == 3 ? 0 : product?.product[0]?.price,
classHour: 21,
classMinute: 56,
image: 'https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg',
@ -356,31 +375,13 @@ const Services = ({
}
console.log(gameId)
}}
>
{/* {console.log(product)} */}
<Product
key={index}
productsType={filter.productsType}
product={product}
index={Number(index)}
productName={`${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={separate(product?.product[0]?.price)}
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160}
productHolderBorder=""
productHolderHoverBorder="shadow-md"
teacher={product.vodTeacher}
catId={gameId}
onClick={() => null}
btnOnClick={() => {
pushToCart({
productId: product?.id,
count: 1,
});
setTimeout(() => setPopUp(false), 1)
setTimeout(() => setPopUp(false), 0)
console.log(popup)
console.log(product.id)
}
@ -400,15 +401,16 @@ const Services = ({
<input
placeholder="12,000,000"
className="border border-red52 rounded-lg h-12 w-36 text-center rounded-l-none border-l-0 px-4 outline-none"
value={(separate(sharzhVal))}
onChange={e => setSharzhVal(e.target.value)}
/><p className="border flex justify-center items-center border-red52 rounded-lg h-12 w-12 text-center rounded-r-none border-r-0 px-4">ریال</p>
</div>
<div className="flex">
<p className="border flex justify-center items-center border-red52 rounded-lg h-12 w-12 text-center rounded-l-none border-l-0 px-10">بابت</p>
<p className="border flex justify-center items-center border-red52 rounded-lg h-12 w-12 text-center rounded-l-none border-l-0 px-6 pl-2 ">بابت</p>
<input
placeholder="شارژ حساب"
className="border border-red52 rounded-lg h-12 w-60 text-center rounded-r-none border-r-0 px-4 outline-none"
value={(separate(sharzhVal))}
onChange={e => setSharzhVal(e.target.value)}
className="border border-red52 rounded-lg h-12 w-60 text-right rounded-r-none border-r-0 px-4 outline-none"
/>
</div>
<button className="cursor-pointer text-red26 border border-red52 rounded-lg bg-red82OP font-bold text-sm px-6 h-12">افزودن به اعتبار</button>
@ -656,6 +658,9 @@ const Services = ({
<input
placeholder="12,000,000"
className="border border-red5B rounded-lg h-14 w-3/4 text-center rounded-l-none border-l-0 px-4 outline-none"
value={(separate(sharzhVal))}
onChange={e => setSharzhVal(e.target.value)}
/><p className="border flex justify-center items-center border-red5B rounded-lg h-14 w-1/4 text-center rounded-r-none border-r-0 px-4">ریال</p>
</div>
<div className="flex w-full mb-4">
@ -663,8 +668,7 @@ const Services = ({
<input
placeholder="شارژ حساب"
className="border border-red52 rounded-lg h-14 w-4/5 text-center rounded-r-none border-r-0 px-4 outline-none"
value={(separate(sharzhVal))}
onChange={e => setSharzhVal(e.target.value)}
/>
</div>
<button className="cursor-pointer text-blue52 border border-blueDF w-full rounded-lg font-bold text-sm px-6 h-14"

@ -1,10 +1,12 @@
import React from "react";
import Button from "../../../components/Button";
import Checkbox from '../../../components/Checkbox';
import separate from "../../../utils/separate";
const servicePopUp = ({
content,
closeOnClick,
addToCartFunction
addToCartFunction,
sendPrice
}) => {
return (
<div className="flex justify-center w-full items-center fixed text-right z-30 backdrop-blur" style={{ background: 'rgba(0,0,0,0.1)', height: 'calc(100vh - 6.5vh)', top: '8.5vh' }}>
@ -22,7 +24,7 @@ const servicePopUp = ({
</div>
</div>
<div className={`flex justify-${content.id === 3 ? 'center' : 'between'} mb-20`} style={{direction: content.id === 1 ? 'rtl' : 'ltr'}} >
{ content.id !== 3 && <div className={`${content.id === 1 ? 'w-1/2' : content.id === 4 ? 'w-2/3' : 'w-full'} my-4 p-2`}>
{ content.id !== 3 && <div className={`${content.id === 1 ? 'w-1/2' : content.id === 4 ? 'w-2/3' : 'w-full'} my-4 mx-2 p-2`}>
<h1 className="text-red25 font-black text-md">
{content.id === 1 ? 'کلاس آنلاین ' : content.id === 4 ? 'کتاب ' : null}
@ -54,7 +56,7 @@ const servicePopUp = ({
{
content.id === 3 &&
<div className="flex w-11/12 flex-col rounded-xl border border-red82OP">
<h1 className="px-2 py-6 border-b border-red82OP bg-blueFF rounded-t-xl text-blueE3 text-xl font-bold">آزمون {content.title}</h1>
<h1 className="px-2 py-6 border-b border-red82OP bg-blueFF rounded-t-xl pr-10 text-blueE3 text-xl font-bold">آزمون {content.title}</h1>
<div className="flex w-full border-b border-red82OP text-red26 text-sm font-bold" style={{direction : 'rtl'}}>
<div className="w-1/4 flex justify-center py-4 border-l border-red82OP">نوع آزمون : آنلاین</div>
<div className="w-1/4 flex justify-center py-4 border-l border-red82OP">تاریخ شروع : 1400/12/03</div>
@ -72,14 +74,14 @@ const servicePopUp = ({
(item, index) => (
<div className="flex w-full items-center justify-between border-b border-red82OP font-bold text-red26 text-xs py-3 px-6 " style={{direction : 'rtl'}}>
<div className="flex items-center font-bold">
<Checkbox name={`examPackage_${item.id}_${index}`} />
<Checkbox name={`examPackage_${item.id}_${index}`} onclick={(e) => e.target.checked ? sendPrice(item.price) : sendPrice(-item.price)}/>
<p>{item.title}</p>
</div>
<p>تاریخ : {item.date}</p>
<p>ساعت : {item.time}</p>
<p>بودجه بندی !</p>
<p>تعداد سوالات: {item.numberOfQ}</p>
<p>{item.price} تومان</p>
<p>{separate(item.price)} تومان</p>
</div>
)
)
@ -95,14 +97,14 @@ const servicePopUp = ({
</video>}
{
content.id === 4 && <img src={content.image} className="w-1/3 rounded mt-4" alt="Content"/>
content.id === 4 && <img src={content.image} className="w-1/3 rounded-md mt-4" alt="Content"/>
}
</div>
<div className="flex w-full items-center justify-start mb-8" style={{direction: 'ltr'}}>
<Button title='افزودن به سبد خرید' onClick={addToCartFunction} className="w-40"/>
<h1 className="text-xl font-bold text-red52 p-2 mt-3">
مبلغ کل : {content.price} تومان
مبلغ کل : {separate(content.price)} تومان
</h1>
</div>

Loading…
Cancel
Save