alireza khaji 2 years ago
commit 32a83a4757
  1. 2
      src/components/ShoppingCart/Code/index.js
  2. 31
      src/components/ShoppingCart/index.js
  3. 4
      src/components/Timer/index.scss
  4. 26
      src/utils/onInput.js
  5. 12
      src/view/LoginSignUp/mobile/index.js
  6. 6
      src/view/register/mobile/index.js

@ -14,7 +14,7 @@ function Code({ codeId, setCodeId, userId, factorId }) {
<div className="flex w-full items-center h-14 my-3 overflow-hidden">
<input
type="text"
className="border-red52 border-solid w-full border rounded-xl rounded-l-none flex-1 text-right pr-3 h-full font-medium text-tiny bg-white outline-none placeholder:text-blue5F dark:text-white"
className="border-red52 border-solid w-full border rounded-xl rounded-l-none flex-1 text-right pr-3 h-full font-medium text-tiny bg-white outline-none placeholder:text-blue5F "
placeholder={"کد تخفیف دارید ؟"}
value={value}
onChange={e => setValue(_onInput.englishAndNumberWithoutSpace(e.target.value))}

@ -46,27 +46,32 @@ function ShoppingCart({
<div className="w-full flex flex-col justify-between items-center bg-gray-200 rtl left-0 pt-[3.5%]" style={{height: '100vh'}}>
<div className={`w-full flex items-center flex-col ${list?.length > 3 && 'overflow-x-hidden overflow-scroll'}`} style={{height: '35%'}}>
{
schoolList.map((school, index) => (
<div className="flex bg-white justify-between items-center border-2 border-gray-300 p-4 rounded-xl m-2 " style={{ width: '90%' }}>
<div className="flex items-center ">
<div className="text-sm h-10 flex items-center p-2 border-l-2 border-gray-300 text-gray-400"> {school?.product?.book?.category} </div>
<h1 className="text-lg font-black px-2 text-black40"> {school?.product?.name}</h1>
<div className="flex bg-white justify-between items-center border-2 border-gray-300 p-4 rounded-xl m-2 mt-0 " key={`SCHOOL_${index}`} style={{ width: '90%' }}>
<div className="flex flex-col items-center w-full">
<div className="flex items-center w-full">
<div className="text-xs h-10 flex items-center p-2 border-l-2 border-gray-300 text-gray-400"> رزرو پیش ثبت نام </div>
<h1 className="text-md font-black px-2 text-black40"> {school?.product?.name}</h1>
</div>
<button className="w-full px-1 h-12 mt-1 text-white bg-red52 rounded-lg text-sm font-semibold" onClick={() => paySchool()}>
پرداخت مستقیم به حساب مدرسه با مبلغ {separate(school.price)} تومان
</button>
<p className="w-full text-right text-xs mt-2">
<span className="text-red-600 font-bold"> توجه: </span>
نحوه پرداخت برای رزرو پیش ثبتنام از طریق دکمه بالا خواهد بود
و می بایست ازین طریق جداگانه پرداخت گردد
</p>
</div>
<div className="flex items-center p-0 ">
<div className="text-sm text-black40 flex items-center" style={{ transform: 'translateX(-20px)' }} >
{
school.count > 1 && <p className="ml-2 text-xs text-red52">{school?.count} عدد</p>
}
<p>{separate(school?.product?.price)} تومان</p>
</div>
<div
className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52"
style={{ transform: 'translateX(-30px)' }}
onClick={() =>
pushToCart(
pushSchoolToCart(
{
productId: school?.productId,
userId: school?.userId,
@ -103,6 +108,9 @@ function ShoppingCart({
</div>
))
}
{
schoolList.length > 0 && <div className="bg-gray-300 my-2 pb-1 rounded-full w-11/12"></div>
}
{list.map((product, index) => (
<Product key={index} product={product} />
))}
@ -129,6 +137,7 @@ function ShoppingCart({
title={`پرداخت هزینه : ${factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0} تومان`}
borderType='rounded-xl'
className='h-16 w-full mx-none text-xl'
onClick={() => payFactor()}
/>
</div>

@ -1,8 +1,8 @@
.timer {
flex-direction: row;
direction: rtl !important;
margin-right: 10px;
margin-left: 10px;
// margin-right: 10px;
// margin-left: 10px;
color: $green2;
font-family: numeralLight;
}

@ -1,5 +1,6 @@
import { toast } from "react-toastify";
class onInput {
persianOnly = (txt) => {
let newText = txt;
@ -277,19 +278,22 @@ class onInput {
};
noNumber = (value) => {
let newText = value;
newText = newText.replace(/`/g, "");
newText = newText.replace(/0/g, "");
newText = newText.replace(/1/g, "");
newText = newText.replace(/2/g, "");
newText = newText.replace(/3/g, "");
newText = newText.replace(/4/g, "");
newText = newText.replace(/5/g, "");
newText = newText.replace(/6/g, "");
newText = newText.replace(/7/g, "");
newText = newText.replace(/8/g, "");
newText = newText.replace(/9/g, "");
return newText
};
persianNoNum = (value) => {
var p = /^[\u0600-\u06FF\s]+$/;
var tst = p.test(value);
if (tst === true) {
return value
}
else {
if (value.length !== 0) {
toast.info("از کاراکتر فارسی استفاده کنید");
}
return ''
}
};
}
const _onInput = new onInput();

@ -142,7 +142,7 @@ const LoginSignUpMobile = ({
};
const checkOtp = () => {
if (
if (steps !== 1 &&
signUpFields?.otp1 &&
signUpFields?.otp2 &&
signUpFields?.otp3 &&
@ -160,6 +160,7 @@ const LoginSignUpMobile = ({
});
setError(undefined);
} else {
setError("کد وارد شده را چک کنید.");
}
@ -292,15 +293,16 @@ const LoginSignUpMobile = ({
}}
>درخواست مجدد کد تایید</button>
</div>
: <div className="w-4/5 ">
: <p className="w-4/5 ">
یک کد چهار رقمی تا &nbsp;{" "}
<Timer seconds={120} refresh={() => { setResend(true) }} /> &nbsp; دیگر برای شماره
<Timer seconds={120} refresh={() => { setResend(true) }} />
&nbsp; دیگر برای شماره
&nbsp;{" "}
<span className="text-red52 text-sm">
{signUpFields?.cellphone}
</span>{" "}
&nbsp; ارسال خواهد شد.
</div>)
</p>)
}
</p>
@ -434,7 +436,7 @@ const LoginSignUpMobile = ({
onClick={(e) => {
checkOtp(e)
activeLogin()
// activeLogin()
}}
>

@ -421,8 +421,8 @@ const MobileRegister = ({
</div>
<div className="flex w-full flex-col">
<Input className={'w-full'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={0} value={userInfo.firstName} onChange={(e) => setUserInfo({ ...userInfo, firstName: _onInput.noNumber(e.target.value) })} />
<Input className={'w-full'} title="نام خانوادگی" borderType="rounded" id={1} direction='rtl' value={userInfo.lastName} onChange={(e) => setUserInfo({ ...userInfo, lastName: _onInput.noNumber(e.target.value) })} />
<Input className={'w-full'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={0} value={userInfo.firstName} onChange={(e) => setUserInfo({ ...userInfo, firstName: _onInput.persianNoNum(e.target.value) })} />
<Input className={'w-full'} title="نام خانوادگی" borderType="rounded" id={1} direction='rtl' value={userInfo.lastName} onChange={(e) => setUserInfo({ ...userInfo, lastName: _onInput.persianNoNum(e.target.value) })} />
<Input className={'w-full'} title="کدملی" borderType="rounded" gapSize="12" id={2} type='textNumber' max={10} value={userInfo.nationalId} onChange={e => setUserInfo({ ...userInfo, nationalId: _onInput.numberOnly(e.target.value) })} />
<DatePicker
@ -767,7 +767,7 @@ const MobileRegister = ({
</div>
<p className="text-gray-500 text-sm text-justify pl-2 overflow-x-hidden overflow-scroll w-full" style={{ height: '60vh' }}>
<p className="text-gray-500 text-sm text-justify pl-2 overflow-x-hidden overflow-scroll w-full" style={{ height: '50vh' }}>
بند اول: موارد مربوط به آموزش مخاطبین
پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوشپسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم
هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید.

Loading…
Cancel
Save