Last Changes

main
Pedram Keshavarzi 2 years ago
parent 666fa19f38
commit 9e7b55e196
  1. 2
      src/components/ShoppingCart/Code/index.js
  2. 31
      src/components/ShoppingCart/index.js
  3. 8
      src/components/Timer/index.js
  4. 4
      src/components/Timer/index.scss
  5. 4
      src/redux/reducers/user.js
  6. 26
      src/utils/onInput.js
  7. 12
      src/view/LoginSignUp/mobile/index.js
  8. 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"> <div className="flex w-full items-center h-14 my-3 overflow-hidden">
<input <input
type="text" 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={"کد تخفیف دارید ؟"} placeholder={"کد تخفیف دارید ؟"}
value={value} value={value}
onChange={e => setValue(_onInput.englishAndNumberWithoutSpace(e.target.value))} onChange={e => setValue(_onInput.englishAndNumberWithoutSpace(e.target.value))}

@ -45,27 +45,32 @@ function ShoppingCart({
<div className="w-full flex flex-col justify-between items-center bg-gray-200 rtl left-0 pt-24" style={{height: '100vh'}}> <div className="w-full flex flex-col justify-between items-center bg-gray-200 rtl left-0 pt-24" style={{height: '100vh'}}>
<div className={`w-full flex items-center flex-col ${list?.length > 3 && 'overflow-x-hidden overflow-scroll'}`} style={{height: '35%'}}> <div className={`w-full flex items-center flex-col ${list?.length > 3 && 'overflow-x-hidden overflow-scroll'}`} style={{height: '35%'}}>
{ {
schoolList.map((school, index) => ( 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 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 items-center "> <div className="flex flex-col items-center w-full">
<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> <div className="flex items-center w-full">
<h1 className="text-lg font-black px-2 text-black40"> {school?.product?.name}</h1> <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>
<div className="flex items-center p-0 "> <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 <div
className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52" className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52"
style={{ transform: 'translateX(-30px)' }} style={{ transform: 'translateX(-30px)' }}
onClick={() => onClick={() =>
pushToCart( pushSchoolToCart(
{ {
productId: school?.productId, productId: school?.productId,
userId: school?.userId, userId: school?.userId,
@ -102,6 +107,9 @@ function ShoppingCart({
</div> </div>
)) ))
} }
{
schoolList.length > 0 && <div className="bg-gray-300 my-2 pb-1 rounded-full w-11/12"></div>
}
{list.map((product, index) => ( {list.map((product, index) => (
<Product key={index} product={product} /> <Product key={index} product={product} />
))} ))}
@ -128,6 +136,7 @@ function ShoppingCart({
title={`پرداخت هزینه : ${factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0} تومان`} title={`پرداخت هزینه : ${factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0} تومان`}
borderType='rounded-xl' borderType='rounded-xl'
className='h-16 w-full mx-none text-xl' className='h-16 w-full mx-none text-xl'
onClick={() => payFactor()}
/> />
</div> </div>

@ -77,11 +77,11 @@ export default class Timer extends Component {
} }
render() { render() {
return ( return (
<> // <>
<div className="timer text-red52 text-sm inline"> <p className="timer text-red52 text-sm inline-block" style={{minWidth: '35px'}}>
{this.state.time ? this.state.time.m : ''}:{this.state.time ? this.state.time.s : ''} {this.state.time ? this.state.time.m : ''}:{this.state.time ? this.state.time.s : ''}
</div> </p>
</> // </>
); );
} }
} }

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

@ -41,8 +41,10 @@ export default function user(state = initialState, action) {
return { ...state, loading: false, status: data.profile, error: null }; return { ...state, loading: false, status: data.profile, error: null };
case "user/login": case "user/login":
case "user/otp/login": case "user/otp/login":
if (data.profile.username == null) { if (data.profile.nationalId == null) {
window.location.replace('/register') window.location.replace('/register')
}else{
window.location.reload()
} }
return { return {
...state, ...state,

@ -1,5 +1,6 @@
import { toast } from "react-toastify"; import { toast } from "react-toastify";
class onInput { class onInput {
persianOnly = (txt) => { persianOnly = (txt) => {
let newText = txt; let newText = txt;
@ -277,19 +278,22 @@ class onInput {
}; };
noNumber = (value) => { noNumber = (value) => {
let newText = 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 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(); const _onInput = new onInput();

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

@ -421,8 +421,8 @@ const MobileRegister = ({
</div> </div>
<div className="flex w-full flex-col"> <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" 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.noNumber(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) })} /> <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 <DatePicker
@ -767,7 +767,7 @@ const MobileRegister = ({
</div> </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