debug and change

main
alireza khaji 3 years ago
parent e42bc8616e
commit e219ced301
  1. 68
      src/components/Product/index.js
  2. 13
      src/components/input/index.js
  3. 2
      src/components/input/signUpInput.js
  4. 2
      src/view/Exam2/Exam.js
  5. 1
      src/view/Exam2/Header.js
  6. 29
      src/view/Exam2/Questions.js
  7. 41
      src/view/Exam2/index.css
  8. 7
      src/view/register/index.js
  9. 9
      src/view/services/index.js
  10. 66
      src/view/services/service/index.js

@ -6,8 +6,7 @@ import { connect } from "react-redux";
import { Link } from "react-router-dom";
import imgPlaceHolder from "../../assets/img/photo-placeholder.png";
let groupType = ["A","B","AB","AB1"];
let groupType = ["A", "B", "AB", "AB1"];
const ProductDesign = ({
colors,
likeBtn,
@ -85,9 +84,9 @@ const ProductDesign = ({
];
//completeProfule-----------
const completeProfule=(id)=>{
localStorage.setItem("termId",id)
}
const completeProfule = (id) => {
localStorage.setItem("termId", id);
};
//---------------------------
let weekday = [
@ -165,7 +164,7 @@ const ProductDesign = ({
to="/register"
className="w-36 py-2 px-1 rounded-md text-white bg-[#F2F9FF] text-[#4C7FE3] flex items-center justify-center cursor-pointer text-xs text-center border-2 border-[#4C7FE3]"
onClick={() => {
completeProfule(product?.termId);
completeProfule(product?.termId);
}}
>
تکمیل اطلاعات کاربری و افزودن به سبد خرید
@ -433,22 +432,26 @@ const ProductDesign = ({
if (catId == 1) {
return (
<div
className={`flex flex-col cursor-pointer text-right rounded-xl justify-start w-full m-4 border border-red82OP ${
className={`flex flex-col text-right rounded-xl justify-start w-full m-4 border border-red82OP ${
isMobile && "w-11/12"
}`}
style={{ width: !isMobile && "375px", direction: "rtl" }}
>
<img
src="https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg"
src={
product?.fileId
? `https://new.andishmand.ir/api/v1/file/${product?.fileId}`
: imgPlaceHolder
}
className="rounded-t-xl"
onClick={onClick}
// onClick={onClick}
/>
<div
className={`border-b border-red82OP py-2 px-4 ${
isMobile ? "bg-blueFF text-right" : "text-center "
}`}
onClick={onClick}
// onClick={onClick}
>
<h1
className={`text-${
@ -457,13 +460,10 @@ const ProductDesign = ({
>
کتاب {productName}
</h1>
<p className="text-blue7E text-sm mb-2">
در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط
در این قسمت قرار میگیرد
</p>
<p className="text-blue7E text-sm mb-2">{product?.description}</p>
</div>
<div className="flex justify-between px-4 items-center">
<div className="flex justify-between px-4 items-center py-2">
<h1
className={`font-black text-xl py-4 text-red52 ${
isMobile && "w-1/2 border-l border-red82OP text-center"
@ -471,16 +471,36 @@ const ProductDesign = ({
>
{productPrice} تومان
</h1>
<div
className={`bg-${
isMobile
? "blueFF border-blueDF rounded-lg py-3 hover:bg-blueDF"
: "pinkF5 border-red52 py-2 hover:bg-red52"
} rounded-md text-red26 w-32 border-2 px-1 text-xs flex justify-center hover:text-white
<div>
{rulesAccepted && (
<div
className={`bg-${
isMobile
? "blueFF border-blueDF rounded-lg py-3 hover:bg-blueDF"
: "pinkF5 border-red52 py-2 hover:bg-red52"
} rounded-md text-red26 w-36 border-2 px-1 text-xs flex justify-center hover:text-white
`}
>
<button onClick={btnOnClick}>افزودن به سبد خرید</button>
>
<button onClick={btnOnClick}>افزودن به سبد خرید</button>
</div>
)}
{!rulesAccepted && (
<Link
to="/register"
className="w-36 py-2 px-1 rounded-md text-white bg-[#F2F9FF] text-[#4C7FE3] flex items-center justify-center cursor-pointer text-xs text-center border-2 border-[#4C7FE3]"
onClick={() => {
completeProfule(product?.termId);
}}
>
تکمیل اطلاعات کاربری و رزرو پیش ثبت نام
</Link>
)}
<div
className="w-36 py-2 px-1 rounded-md text-white bg-[#DF1452] text-white flex items-center justify-center cursor-pointer text-xs text-center border-2 border-pinkF5 mt-2"
onClick={onClick}
>
اطلاعات بیشتر
</div>
</div>
</div>
</div>

@ -1,7 +1,6 @@
import React, { useEffect } from "react";
import _onInput from "../../utils/onInput";
const Input = ({
title,
borderType,
@ -17,6 +16,7 @@ const Input = ({
max,
onFocus,
defaultValue,
example,
}) => {
useEffect(() => {
if (value !== null && value !== "" && value !== undefined) {
@ -75,7 +75,7 @@ const Input = ({
gapSize ? gapSize : "20"
} h-px absolute top-[-1px] right-7 `}
></div>
<div className="Login-box-form-item-label text-sm text-color19 bg-white absolute right-6 transition-all duration-300 pointer-events-none">
<div className="Login-box-form-item-label text-sm text-[#7c7c7c] bg-white absolute right-6 transition-all duration-300 pointer-events-none">
{title ? title : "نام کاربری"}
</div>
<input
@ -84,7 +84,7 @@ const Input = ({
id={`Login-box-form-item-input-name${id}`}
className={`Login-box-form-item-input w-full h-full px-4 outline-0 rounded-lg text-gray-700 `}
style={{
pointerEvents : defaultValue ? "none" : 'auto',
pointerEvents: defaultValue ? "none" : "auto",
direction: direction ? direction : "ltr",
backgroundColor: bg,
}}
@ -99,7 +99,12 @@ const Input = ({
value={value}
maxLength={max}
/>
{example && (
<div className="w-full text-right text-xs absolute -bottom-5 text-[#d9dada]">
{example}
</div>
)}
</div>
);
};
export default Input;
export default Input;

@ -71,7 +71,7 @@ const blurHandler = (id) => {
let inputs = document.querySelectorAll(".Login-box-form-item-input");
let label = document.querySelectorAll(".Login-box-form-item-label");
let line = document.querySelectorAll(".Login-box-form-item-line");
if (inputs[id].value === "") {
if (inputs[id]?.value === "") {
inputsBox[id].style.borderColor = "#EBEBEB";
label[id].style.transform = "translate(0px,0px)";
label[id].style.color = "#959595";

@ -1,6 +1,6 @@
import Header from "./Header";
import Questions from "./Questions";
import "./index.css";

@ -1,6 +1,7 @@
import { useState } from "react";
import { RiTimerLine } from "react-icons/ri";
import './index.css';
const Header=()=>{
return (

@ -1,5 +1,6 @@
import { useEffect, useState } from "react";
import { RiErrorWarningLine } from "react-icons/ri";
import './index.css';
import img1 from "../../assets/img/4bea9a991c6b23d3dcaf231513ee94bd.jpg";
let data = [
@ -61,8 +62,12 @@ let data = [
// text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
// img: "",
// choices: [
// "لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ ",
// "تیرتسیذر",
// "22",
// "بتربدر",
// "تیدرتسر",
// "تشدتنسدر",
// "ستیذزتن"
// ],
// guidance:"",
// choiceWidth: null,
@ -71,7 +76,7 @@ let data = [
];
//badgeList-------------
let badgeList = ["الف", "ب", "ج", "د"];
let badgeList = ["الف", "ب", "ج", "د","هـ","ز"];
const Questions = () => {
const [Data, setData] = useState(data);
@ -126,6 +131,12 @@ const Questions = () => {
} else if (wMax < 0.48 * examSize && choiceNumber === 4) {
newData[i].choiceWidth = 48;
console.log("oooo");
} else if (wMax < 0.18 * examSize && choiceNumber === 5) {
newData[i].choiceWidth = 18;
console.log("oo");
} else if (wMax < 0.15 * examSize && choiceNumber === 6) {
newData[i].choiceWidth = 15;
console.log("oo");
} else {
newData[i].choiceWidth = "full";
console.log("ooooo");
@ -156,13 +167,13 @@ const Questions = () => {
return (
<div className="Questions w-full mt-10">
{Data.map((item, index) => (
<div key={index} className="w-full mb-24">
<div key={index} className="Questions-item w-full mb-24">
{/* -----question-text----------------------- */}
<div className="w-full flex flex-row-reverse">
<div className="w-10 h-10 rounded-md flex items-center justify-center text-sm bg-[#D5DEEA]">
<div className="Questions-item-text-container w-full flex flex-row-reverse">
<div className="Qitc-badge w-10 h-10 rounded-md flex items-center justify-center text-sm bg-[#D5DEEA]">
{index + 1}
</div>
<div className="w-full mr-2">
<div className="Qitc-text w-full mr-2">
{item.text && (
<div
className="w-full text-right text-base"
@ -230,8 +241,9 @@ const Questions = () => {
</div>
))}
</div>
{/* -----guidance----------------------------- */}
{item.guidance && (
<div className="w-full pr-12 mt-4">
<div className="guidance w-full pr-12 mt-4">
<div className="w-full px-2 py-3 flex flex-row-reverse rounded-md border border-[##D7DFEA] bg-[#FAFBFB] gap-x-2">
<RiErrorWarningLine className="text-xl text-black" />
<div
@ -245,7 +257,8 @@ const Questions = () => {
)}
</div>
))}
<div className="w-full mt-20 pr-12">
{/* -----Footer----------------------------- */}
<div className="Footer w-full mt-20 pr-12">
<div className="w-full px-2 py-3 flex flex-row-reverse rounded-md border border-[##D7DFEA] bg-[#FAFBFB] gap-x-2">
<RiErrorWarningLine className="text-xl text-black" />
<div

@ -0,0 +1,41 @@
@media only screen and (max-width: 1000px) {
.Exam{
padding-left: 5px !important;
padding-right: 5px !important;
width: 100% !important;
}
.Header{
padding-left: 5px !important;
padding-right: 5px !important;
}
.Questions-item{
margin-bottom: 40px !important;
}
.Choice-container{
padding-right: 0px !important;
}
.Questions-item-text-container{
display: block !important;
direction: rtl !important;
}
.Qitc-badge{
margin-bottom: 5px !important;
}
.Qitc-text{
margin-right: 0 !important;
}
.guidance{
padding-right: 0 !important;
}
.Footer{
padding-right: 0 !important;
}
}

@ -48,7 +48,7 @@ const Register = ({
}) => {
const [submitLoading, setSubmitLoading] = useState(false);
//-----------------------------------------------
const [steps, setSteps] = useState(0);
const [steps, setSteps] = useState(1);
console.log("user:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
console.log(user);
const timeoutRef = useRef(null);
@ -875,6 +875,7 @@ const Register = ({
},
})
}
example="مثال :091299445566"
/>
<Input
className={"w-52"}
@ -930,6 +931,7 @@ const Register = ({
},
})
}
example="مثال :02133446666"
/>
</div>
</div>
@ -1035,6 +1037,7 @@ const Register = ({
},
})
}
example="مثال :091299445566"
/>
<Input
className={"w-52"}
@ -1090,6 +1093,7 @@ const Register = ({
},
})
}
example="مثال :02133446666"
/>
</div>
</div>
@ -1134,6 +1138,7 @@ const Register = ({
phone: _onInput.numberOnly(e.target.value),
})
}
example="مثال :02133446666"
/>
<Input

@ -181,6 +181,7 @@ const Services = ({
image: "https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg",
examCont: [],
type: product?.productType,
product:product
});
if (gameId !== 5) {
setPopUp(true);
@ -320,7 +321,8 @@ const Services = ({
style={gameId === 5 ? { width: "100%" } : null}
>
{(selectedProductTypes.includes(4) ||
selectedProductTypes.includes(7)) && (
selectedProductTypes.includes(7) ||
selectedProductTypes.includes(1)) && (
<Product
key={index}
productsType={filter.productsType}
@ -350,6 +352,7 @@ const Services = ({
))}
{!selectedProductTypes.includes(4) &&
!selectedProductTypes.includes(7) &&
!selectedProductTypes.includes(1) &&
gameId !== 6 && (
<div className="w-full h-28 flex flex-col items-center justify-center mx-auto rounded">
<CgDanger className="text-4xl" />
@ -481,7 +484,8 @@ const Services = ({
.map((product, index) => (
<div className="w-[90%]" key={`PRODUCT__${gameId}__${index}`}>
{(selectedProductTypes.includes(4) ||
selectedProductTypes.includes(7)) && (
selectedProductTypes.includes(7) ||
selectedProductTypes.includes(1)) && (
<Product
key={index}
productsType={filter.productsType}
@ -509,6 +513,7 @@ const Services = ({
))}
{!selectedProductTypes.includes(4) &&
!selectedProductTypes.includes(7) &&
!selectedProductTypes.includes(1) &&
gameId !== 6 && (
<div className="w-full h-28 flex flex-col items-center justify-center mx-auto rounded">
<CgDanger className="text-4xl" />

@ -82,35 +82,58 @@ const servicePopUp = ({
{content.title}
</h1>
<p className="text-red26 text-sm my-2">{content.description}</p>
<p className="text-red26 text-sm my-2">{content?.description}</p>
<div
className="w-full flex flex-col"
style={{ direction: "rtl" }}
>
<div className="flex mb-2">
<div className="bg-gray-100 rounded w-40 px-4 py-2 ml-2 text-red52">
نام کلاس
<div className="bg-gray-100 rounded w-40 px-4 py-2 ml-2 text-red52 text-center">
{content?.product?.productType === 4 ||
content?.product?.productType === 5
? "نام کلاس"
: "تعدادصفحات "}
</div>
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26">
{content.title}
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26 flex items-center">
{content?.product?.productType === 4 ||
content?.product?.productType === 5
? content?.title
: content?.product?.pagesNum}
</div>
</div>
<div className="flex mb-2">
<div className="bg-gray-100 rounded w-40 px-4 py-2 ml-2 text-red52">
{" "}
استاد{" "}
{content?.product?.productType === 4 ||
content?.product?.productType === 5
? "استاد"
: "سال انتشار"}
</div>
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26">
{content.teacher}
{content?.product?.productType === 4 ||
content?.product?.productType === 5
? content?.teacher
: content?.product?.publishYear}
</div>
</div>
<div className="flex mb-2">
<div className="bg-gray-100 rounded w-40 px-4 py-2 ml-2 text-red52">
زمان کلاس
</div>
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26">
{content.classHour} دقیقه
{content?.product?.productType === 4 ||
content?.product?.productType === 5
? "زمان کلاس"
: "نوع جلد"}
</div>
{(content?.product?.productType === 4 ||
content?.product?.productType === 5) && (
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26">
{content.classHour} دقیقه
</div>
)}
{(content?.product?.productType ===1) && (
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26">
{/* {content?.product.?} */}
رحلی کوچک
</div>
)}
</div>
</div>
</div>
@ -172,19 +195,18 @@ const servicePopUp = ({
</div>
)}
{(content.id === 3
&& (
<video className="w-1/2 rounded-md" controls>
<source
src={`https://new.andishmand.ir/api/v1/file/${content?.video}`}
type="video/mp4"
/>
</video>
))}
{content.id === 3 && (
<video className="w-1/2 rounded-md" controls>
<source
src={`https://new.andishmand.ir/api/v1/file/${content?.video}`}
type="video/mp4"
/>
</video>
)}
{content.id === 1 && (
<img
src={content.image}
src={`https://new.andishmand.ir/api/v1/file/${content?.product?.fileId}`}
className="w-1/3 rounded-md mt-4"
alt="Content"
/>

Loading…
Cancel
Save