liuvanquyet
HOANGLAOTA 1 year ago
parent afa765d7d2
commit 4f0ff5511a
  1. BIN
      public/assets/images/logo_PY1.png
  2. 12
      src/App.js
  3. 2
      src/_components/Header/HeaderCloud.js
  4. 10
      src/_components/Header/HeaderLogoRegister/HeaderLogoRegister.js
  5. 5
      src/_components/Header/HeaderLogoRegister/headerTS.style.scss
  6. 2
      src/_components/Header/index.js
  7. 17
      src/_constants/register.js
  8. 21
      src/_containers/RegisterPage/RegisterPage.js
  9. 2
      src/_containers/RegisterPage/components/AccountType/index.js
  10. 8
      src/_containers/RegisterPage/components/AccountType/index.scss
  11. 2
      src/_containers/RegisterPage/components/AddClassName/index.js
  12. 53
      src/_containers/RegisterPage/components/AddressStudying/index.jsx
  13. 7
      src/_containers/RegisterPage/components/RegisterSuccess/index.js
  14. 43
      src/_containers/RegisterPage/components/RegisterSuccess/index.scss
  15. 4
      src/_containers/RegisterPage/components/UpdateInformation/index.js
  16. 27
      src/_containers/RegisterPage/register.scss

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

@ -31,13 +31,13 @@ function App() {
<div className="loading-side hide"></div> <div className="loading-side hide"></div>
<Router path="/" history={history}> <Router path="/" history={history}>
<Switch> <Switch>
<RouteRedirectToAdmin <RouteRedirectToAdmin
path="/namdinh" path="/:orgLevel"
exact={true} exact={true}
component={RegisterPage} component={RegisterPage}
/> />
<Redirect from="*" to="/namdinh" />
</Switch> </Switch>
<Redirect to="/namdinh" />
</Router> </Router>
</div> </div>
); );

@ -5,7 +5,7 @@ import { useSelector } from "react-redux";
function HeaderCloud() { function HeaderCloud() {
const authentication = useSelector((state) => state.authentication); const authentication = useSelector((state) => state.authentication);
return ( return (
<div className="logo"> <div className="logo-nam-dinh">
<Link to={`/namdinh`}> <Link to={`/namdinh`}>
<img src={"/assets/images/Logo_ND.png"} alt={"Logo"} /> <img src={"/assets/images/Logo_ND.png"} alt={"Logo"} />
</Link> </Link>

@ -3,19 +3,19 @@ import { Link } from "react-router-dom";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import './headerTS.style.scss' import './headerTS.style.scss'
function HeaderTS() { function HeaderLogoRegister({srcImg, name, color}) {
const authentication = useSelector((state) => state.authentication);
return ( return (
<div className="logo header-ts"> <div className="logo header-ts">
<Link to={`/`}> <Link to={`/`}>
<img <img
src={"/assets/images/logo_GV.png"} src={srcImg}
alt={"Logo"} alt={"Logo"}
/> />
<span className="flex-1 d-flex align-items-center branch-text" > Đặng Thu Hiền</span> {name.split('\n').map((str, index) => <span key={index} className="flex-1 d-flex align-items-center branch-text" style={{color}}>{str}</span>)}
</Link> </Link>
</div> </div>
); );
} }
export { HeaderTS }; export { HeaderLogoRegister };

@ -25,12 +25,12 @@
} }
img { img {
width: 90px; width: 120px;
height: auto; height: auto;
margin-top: 0 !important; margin-top: 0 !important;
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
width: 50px; width: 74px;
} }
} }
@ -38,7 +38,6 @@
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
margin-top: 4px; margin-top: 4px;
color: #14375F;
font-family: 'Barlow-Bold'; font-family: 'Barlow-Bold';
@media screen and (max-height: 800px) { @media screen and (max-height: 800px) {

@ -1,5 +1,5 @@
export * from "./HeaderCloud"; export * from "./HeaderCloud";
export * from "./HeaderCurve"; export * from "./HeaderCurve";
export * from "./HeaderSquare"; export * from "./HeaderSquare";
export * from "./HeaderTS/HeaderTS"; export * from "./HeaderLogoRegister/HeaderLogoRegister";
export { default as HeaderNews } from "./HeaderNews/HeaderNews"; export { default as HeaderNews } from "./HeaderNews/HeaderNews";

@ -0,0 +1,17 @@
export const registerValue = {
namdinh: {
province_alias: 'nam_dinh_',
district_alias: '',
organization: '',
represent_code: 'ND1'
},
phucyen: {
province_alias: 'vinh_phuc',
district_alias: 'thanh_pho_phuc_yen',
organization: '',
represent_code: 'PY1',
logo: '/assets/images/logo_PY1.png',
name: 'Phòng Giáo dục thành phố\nPhúc Yên - Vĩnh Phúc',
color: '#3493B8'
}
}

@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { HeaderCloud, HeaderTS } from "../../_components/Header"; import { HeaderCloud, HeaderLogoRegister } from "../../_components/Header";
import { stepAuthConstants } from "../../_constants/auth"; import { stepAuthConstants } from "../../_constants/auth";
import { apiCaller, history } from "../../_helpers"; import { apiCaller, history } from "../../_helpers";
import AccountType from "./components/AccountType"; import AccountType from "./components/AccountType";
@ -15,7 +15,12 @@ import { isEmpty } from "lodash";
import AddClassName from "./components/AddClassName"; import AddClassName from "./components/AddClassName";
import './register.scss' import './register.scss'
import AddressStudying from "./components/AddressStudying"; import AddressStudying from "./components/AddressStudying";
import { useParams } from "react-router-dom";
import { registerValue } from "../../_constants/register";
function RegisterPage() { function RegisterPage() {
const params = useParams()
const orgLevel = params?.orgLevel;
const [registerInfo, setRegisterInfo] = useState(registerValue?.[orgLevel] || undefined);
const [step, setStep] = useState(stepAuthConstants.STEP_ADDRESS_STUDYING); const [step, setStep] = useState(stepAuthConstants.STEP_ADDRESS_STUDYING);
const [dataAddressStudying, setDataAddressStudying] = useState({ const [dataAddressStudying, setDataAddressStudying] = useState({
province: '', province: '',
@ -137,6 +142,7 @@ function RegisterPage() {
} else { } else {
const newData = { const newData = {
...data, ...data,
class_nickname: dataClassName?.class_nickname,
auto_active: 1 auto_active: 1
} }
apiCaller("/api_register/register", "POST", newData).then((res) => { apiCaller("/api_register/register", "POST", newData).then((res) => {
@ -183,7 +189,15 @@ function RegisterPage() {
return ( return (
<div className="bg-register rel"> <div className="bg-register rel">
<HeaderTS /> {!!registerInfo &&
(orgLevel === 'namdinh' ?
<HeaderCloud />
: <HeaderLogoRegister
srcImg={registerInfo?.logo}
name={registerInfo?.name}
color={registerInfo?.color}
/>
)}
{statusRegister.type !== "success" ? ( {statusRegister.type !== "success" ? (
<> <>
<div <div
@ -198,7 +212,8 @@ function RegisterPage() {
setStep={setStep} setStep={setStep}
data={dataAddressStudying} data={dataAddressStudying}
setData={setDataAddressStudying} setData={setDataAddressStudying}
registerInfo={registerInfo}
setRegisterInfo={setRegisterInfo}
/> />
</div> </div>
<div <div

@ -36,7 +36,7 @@ const AccountType = (props) => {
grade, grade,
schoolType, schoolType,
}); });
props.setStep(stepAuthConstants.STEP_UPDATE_ACCOUNT); props.setStep(stepAuthConstants.STEP_ADD_CLASS_NAME);
} }
}; };

@ -99,11 +99,19 @@ $normal-class: #979797;
box-shadow: 0px 1px 3px #cccccc; box-shadow: 0px 1px 3px #cccccc;
background-color: white; background-color: white;
@media screen and (max-width: 768px) {
height: 80px;
}
svg { svg {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%, -50%, 0);
@media screen and (max-width: 768px) {
width: 50px;
}
} }
.class_number { .class_number {

@ -133,7 +133,7 @@ export default function AddClassName(props) {
<div className="sunE-custom-form login-form-container_content responsive_small_screen_margin_login"> <div className="sunE-custom-form login-form-container_content responsive_small_screen_margin_login">
<h2 className="title_register title text-center">ĐĂNG TÀI KHOẢN</h2> <h2 className="title_register title text-center">ĐĂNG TÀI KHOẢN</h2>
<h3 className="step_register_name text-center"> <h3 className="step_register_name text-center">
{`3. ${role === 'student' ? "Chọn lớp" : "Tạo lớp"}`} {`4. ${role === 'student' ? "Học lớp" : "Tạo lớp"}`}
</h3> </h3>
<div className="add-class-content"> <div className="add-class-content">
<form <form

@ -1,11 +1,15 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import './index.scss' import './index.scss'
import { apiCaller } from '../../../../_helpers'; import { apiCaller, history } from '../../../../_helpers';
import InputSelectSearch from '../../../../_components/Auth/InputSelectSearch'; import InputSelectSearch from '../../../../_components/Auth/InputSelectSearch';
import { renderLocationIcon, renderSchoolIcon } from './renderIcon'; import { renderLocationIcon, renderSchoolIcon } from './renderIcon';
import { stepAuthConstants } from '../../../../_constants/auth'; import { stepAuthConstants } from '../../../../_constants/auth';
import { useParams } from 'react-router-dom';
import { registerValue } from '../../../../_constants/register';
export default function AddressStudying(props) { export default function AddressStudying(props) {
const params = useParams()
const orgLevel = params?.orgLevel
const [school, setSchool] = useState({ const [school, setSchool] = useState({
title: '', title: '',
value: '', value: '',
@ -14,13 +18,13 @@ export default function AddressStudying(props) {
// address // address
const [provinceList, setProvinceList] = useState([]); const [provinceList, setProvinceList] = useState([]);
const [province, setProvince] = useState({ const [province, setProvince] = useState({
title: "Nam Định", title: "",
value: "nam_Dinh_", value: props?.registerInfo?.province_alias || "nam_dinh_",
}); });
const [districtList, setDistrictList] = useState([]); const [districtList, setDistrictList] = useState([]);
const [district, setDistrict] = useState({ const [district, setDistrict] = useState({
title: "", title: "",
value: "", value: props?.registerInfo?.district_alias || "",
}); });
const [schoolList, setSchoolList] = useState([]); const [schoolList, setSchoolList] = useState([]);
const [errProvince, setErrProvince] = useState(""); const [errProvince, setErrProvince] = useState("");
@ -60,7 +64,7 @@ export default function AddressStudying(props) {
}; };
const getOrganizationList = (districtAlias) => { const getOrganizationList = (districtAlias) => {
apiCaller(`/api_organization/get_represent_code?district_alias=${districtAlias}&represent_code=nd1`).then( apiCaller(`/api_organization/get_represent_code?district_alias=${districtAlias}&represent_code=${props?.registerInfo?.represent_code}`).then(
(res) => { (res) => {
if(res?.status) { if(res?.status) {
setOrganizationList(res.data) setOrganizationList(res.data)
@ -129,9 +133,38 @@ export default function AddressStudying(props) {
} }
useEffect(() => { useEffect(() => {
getDistrictList(province.value); if(!props?.registerInfo) {
history.push('/namdinh')
return;
}
if(province.value) {
getDistrictList(province.value);
}
if (district.value) {
getOrganizationList(district.value);
}
}, []); }, []);
useEffect(() => {
if(!!registerValue?.[orgLevel]?.represent_code) {
if(!!registerValue[orgLevel]?.province_alias) {
setProvince({
title: '',
value: registerValue[orgLevel].province_alias
})
getDistrictList(registerValue[orgLevel]?.province_alias);
}
if (!!registerValue[orgLevel]?.district_alias) {
setDistrict({
title: '',
value: registerValue[orgLevel].district_alias
})
getOrganizationList(registerValue[orgLevel]?.district_alias);
}
props.setRegisterInfo(registerValue[orgLevel])
}
}, [orgLevel])
return ( return (
<div className="sunE-form-container login-form-container register_create_account register_step"> <div className="sunE-form-container login-form-container register_create_account register_step">
<div className="sunE-custom-form login-form-container_content responsive_small_screen_margin_login"> <div className="sunE-custom-form login-form-container_content responsive_small_screen_margin_login">
@ -162,7 +195,7 @@ export default function AddressStudying(props) {
errorAbsolute={true} errorAbsolute={true}
bottomErr={true} bottomErr={true}
/> */} /> */}
<InputSelectSearch {!!props?.registerInfo?.province_alias && !props?.registerInfo?.district_alias && <InputSelectSearch
className="field_item field_district" className="field_item field_district"
value={district} value={district}
setValue={changeDistrict} setValue={changeDistrict}
@ -183,7 +216,7 @@ export default function AddressStudying(props) {
setErrorText={setErrDistrict} setErrorText={setErrDistrict}
errorAbsolute={true} errorAbsolute={true}
bottomErr={true} bottomErr={true}
/> />}
<InputSelectSearch <InputSelectSearch
className="field_item field_school" className="field_item field_school"
value={organization} value={organization}
@ -194,8 +227,8 @@ export default function AddressStudying(props) {
title: item.name, title: item.name,
}; };
})} })}
placeholder="Tổ chức" placeholder="Trường"
titleHeader="Chọn Tổ chức" titleHeader="Chọn Trường"
renderLabelIcon={renderSchoolIcon} renderLabelIcon={renderSchoolIcon}
disabledClick={!district.value} disabledClick={!district.value}
onClickDisable={() => { onClickDisable={() => {

@ -1,6 +1,7 @@
import React from "react"; import React from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import "./index.scss"; import "./index.scss";
import ButtonNews from "../../../../_components/Button/ButtonNews";
const RegisterSuccess = ({handleReset}) => { const RegisterSuccess = ({handleReset}) => {
return ( return (
@ -30,8 +31,10 @@ const RegisterSuccess = ({handleReset}) => {
</div> </div>
<div className="back_login"> <div className="back_login">
{/* <Link to="/login"> */} {/* <Link to="/login"> */}
<button className={"btn-line-blue"} onClick={handleReset}>Đồng ý</button> <button className={"btn-line-blue btn-back"} onClick={handleReset}>
{/* </Link> */} <span>Trở về</span>
</button>
<button className={"btn-line-blue"} onClick={() => window.location.href = 'https://sundayenglish.com/login'} >Đăng nhập</button>
</div> </div>
</div> </div>
</div> </div>

@ -2,19 +2,32 @@
.title_register { .title_register {
margin-bottom: 36px; margin-bottom: 36px;
} }
.success_icon { .success_icon {
text-align: center; text-align: center;
margin-bottom: 44px; margin-bottom: 44px;
} }
.success_message { .success_message {
text-align: center; text-align: center;
p { p {
font-size: 18px; font-size: 18px;
} }
} }
.back_login { .back_login {
text-align: center; text-align: center;
margin-top: 44px; margin-top: 44px;
display: flex;
align-items: center;
gap: 32px;
@media screen and (max-width: 768px) {
flex-direction: column-reverse;
gap: 16px;
}
button { button {
width: 210px; width: 210px;
height: 50px; height: 50px;
@ -23,4 +36,32 @@
font-size: 18px; font-size: 18px;
} }
} }
}
.btn-back {
width: 100px;
background-image: none;
background:
linear-gradient(#F3FFFF, #F3FFFF) padding-box,
linear-gradient(to right, #00b9b7, #00e1a0) border-box;
height: 40px;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
border: 2px solid transparent;
border-radius: 10px;
span {
font-size: 18px;
font-weight: 600;
background: -webkit-linear-gradient(#00b9b7, #00e1a0);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
width: 100%;
}
:hover {
opacity: 0.6;
}
}
}

@ -113,7 +113,7 @@ const UpdateInformation = (props) => {
<div className="sunE-custom-form register_update_info_content responsive_small_screen_margin_login"> <div className="sunE-custom-form register_update_info_content responsive_small_screen_margin_login">
<h2 className="title_register title text-center">ĐĂNG TÀI KHOẢN</h2> <h2 className="title_register title text-center">ĐĂNG TÀI KHOẢN</h2>
<h3 className="step_register_name text-center"> <h3 className="step_register_name text-center">
{`3. Cập nhật thông tin`} {`5. Cập nhật thông tin`}
</h3> </h3>
{props.popupMessageRegisterTeacher && ( {props.popupMessageRegisterTeacher && (
@ -325,7 +325,7 @@ const UpdateInformation = (props) => {
<div className="login_text text-center no_select flex-center"> <div className="login_text text-center no_select flex-center">
<p <p
onClick={() => { onClick={() => {
props.setStep(stepAuthConstants.STEP_ACCOUNT_TYPE); props.setStep(stepAuthConstants.STEP_ADD_CLASS_NAME);
}} }}
style={{ style={{
width: "fit-content", width: "fit-content",

@ -5,16 +5,29 @@ $bg-gg: #be1e2d;
$bg-apple: #000000; $bg-apple: #000000;
$loading-color: #f8f8f8; $loading-color: #f8f8f8;
.bg-register .logo img {
width: 144px;
margin-top: 32px;
@media screen and (max-height: 800px) {
width: 120px; .bg-register .logo-nam-dinh {
a {
margin-left: 32px;
@media screen and (max-width: 768px) {
margin-left: 16px;
}
} }
@media screen and (max-width: 768px) { img {
width: 96px; width: 173px;
margin-top: 32px;
@media screen and (max-height: 800px) {
width: 163px;
margin-top: 16px;
}
@media screen and (max-width: 768px) {
width: 128px;
}
} }
} }

Loading…
Cancel
Save