add phuc yen

liuvanquyet
HOANGLAOTA 1 year ago
parent 47a3673229
commit ab612b7c66
  1. BIN
      public/assets/images/logo_PY1.png
  2. 26
      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. 8
      src/_components/Modal/ModalConfirmOTP/ModalConfirmOTP.jsx
  8. 17
      src/_constants/register.js
  9. 22
      src/_containers/RegisterPage/RegisterPage.js
  10. 19
      src/_containers/RegisterPage/components/AccountAuthentication/AccountAuthentication.jsx
  11. 2
      src/_containers/RegisterPage/components/AccountAuthentication/AccountAuthentication.logic.js
  12. 2
      src/_containers/RegisterPage/components/AddClassName/index.js
  13. 53
      src/_containers/RegisterPage/components/AddressStudying/index.jsx
  14. 2
      src/_containers/RegisterPage/components/UpdateInformation/index.js
  15. 25
      src/_containers/RegisterPage/register.scss

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

@ -39,22 +39,18 @@ function App() {
<div className="loading-side hide"></div> <div className="loading-side hide"></div>
<Router path="/" history={history}> <Router path="/" history={history}>
<Switch> <Switch>
<Route> <RouteRedirectToAdmin
<Switch> path="/:orgLevel"
<RouteRedirectToAdmin exact={true}
path="/namdinh" component={RegisterPage}
exact={true} />
component={RegisterPage} <RouteRedirectToAdmin
/> path="/:orgLevel/authentication"
<RouteRedirectToAdmin exact={true}
path="/namdinh/authentication" component={AccountAuthentication}
exact={true} />
component={AccountAuthentication} <Redirect from="*" to="/namdinh" />
/>
</Switch>
</Route>
</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";

@ -120,20 +120,20 @@ const ModalConfirmOTP = (props) => {
XÁC NHẬN XÁC NHẬN
</div> </div>
</ButtonNews> </ButtonNews>
{/* <ButtonNews <ButtonNews
className={'otp-btn-responsive'} className={'otp-btn-responsive'}
width="15rem" width="15rem"
height="3.5rem" height="3.5rem"
onClick={handleGoBack} onClick={() => window.location.replace('https://sundayenglish.com/login')}
border={"1px solid #00cc83"} border={"1px solid #00cc83"}
backgroundColor={"#fff"} backgroundColor={"#fff"}
maxWidth={"45%"} maxWidth={"45%"}
maxHeight={"7vw"} maxHeight={"7vw"}
> >
<div className="fz-12 fz-09-mobile color-primary-green font_news_bold"> <div className="fz-12 fz-09-mobile color-primary-green font_news_bold">
QUAY LẠI ĐĂNG NHẬP ĐĂNG NHẬP
</div> </div>
</ButtonNews> */} </ButtonNews>
</div> </div>
</div> </div>
</div> </div>

@ -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: '',
@ -86,7 +91,7 @@ function RegisterPage() {
}; };
data.birthday = moment(dataUpdateInfo.birthday).format("YYYY-MM-DD"); data.birthday = moment(dataUpdateInfo.birthday).format("YYYY-MM-DD");
setPopupMessageRegisterTeacher(false); setPopupMessageRegisterTeacher(false);
history.push(`/namdinh/authentication`, { data: data }); history.push(`/${orgLevel}/authentication`, { data: data });
}; };
const onRegister = async () => { const onRegister = async () => {
@ -183,7 +188,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 +211,8 @@ function RegisterPage() {
setStep={setStep} setStep={setStep}
data={dataAddressStudying} data={dataAddressStudying}
setData={setDataAddressStudying} setData={setDataAddressStudying}
registerInfo={registerInfo}
setRegisterInfo={setRegisterInfo}
/> />
</div> </div>
<div <div

@ -1,11 +1,13 @@
import React from "react"; import React, { useState } from "react";
import { accountAuthenticationMethods } from "./AccountAuthentication.logic"; import { accountAuthenticationMethods } from "./AccountAuthentication.logic";
import { HeaderCloud, HeaderTS } from "../../../../_components/Header"; import { HeaderCloud, HeaderTS } from "../../../../_components/Header";
import ModalConfirmOTP from "../../../../_components/Modal/ModalConfirmOTP/ModalConfirmOTP"; import ModalConfirmOTP from "../../../../_components/Modal/ModalConfirmOTP/ModalConfirmOTP";
import "./AccountAuthentication.scss"; import "./AccountAuthentication.scss";
import { Link } from "react-router-dom"; import { Link, useParams } from "react-router-dom";
import { PopUpYesNo } from "../../../../_components/Popup"; import { PopUpYesNo } from "../../../../_components/Popup";
import { history } from "../../../../_helpers"; import { history } from "../../../../_helpers";
import { registerValue } from "../../../../_constants/register";
import { HeaderLogoRegister } from "../../../../_components/Header/HeaderLogoRegister/HeaderLogoRegister";
// export const SuccessAuthentication = () => { // export const SuccessAuthentication = () => {
// return ( // return (
@ -57,10 +59,21 @@ const AccountAuthentication = () => {
messageReSendCode, messageReSendCode,
setPopupRegisterSuccess setPopupRegisterSuccess
} = accountAuthenticationMethods(); } = accountAuthenticationMethods();
const params = useParams();
const orgLevel = params?.orgLevel;
const [registerInfo, setRegisterInfo] = useState(registerValue?.[orgLevel] || undefined);
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}
/>
)}
{popupRegisterSuccess && <PopUpYesNo message={"Xác thực tài khoản thành công!"} hideButtonNo={true} onClickYes={() => setPopupRegisterSuccess(false)} labelYes={"Đồng ý"}/>} {popupRegisterSuccess && <PopUpYesNo message={"Xác thực tài khoản thành công!"} hideButtonNo={true} onClickYes={() => setPopupRegisterSuccess(false)} labelYes={"Đồng ý"}/>}
<div className="content_1 flex-center-column"> <div className="content_1 flex-center-column">
<div className="flex-center-column container_modal_confirmOTP"> <div className="flex-center-column container_modal_confirmOTP">

@ -139,7 +139,7 @@ export const accountAuthenticationMethods = () => {
}; };
const handleGoBack = () => { const handleGoBack = () => {
history.replace("/namdinh"); history.goBack();
}; };
return { return {

@ -156,7 +156,7 @@ export default function AddClassName(props) {
<p className="add-class-content-label-list">Dạy các lớp:</p> <p className="add-class-content-label-list">Dạy các lớp:</p>
<div className="add-class-content-list"> <div className="add-class-content-list">
{listClass?.map((item, index) => ( {listClass?.map((item, index) => (
<div className="add-class-content-item"> <div key={index} className="add-class-content-item">
<InputText <InputText
key={index} key={index}
value={item.name} value={item.name}

@ -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={() => {

@ -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`} {`4. Cập nhật thông tin`}
</h3> </h3>
{props.popupMessageRegisterTeacher && ( {props.popupMessageRegisterTeacher && (

@ -5,16 +5,27 @@ $bg-gg: #be1e2d;
$bg-apple: #000000; $bg-apple: #000000;
$loading-color: #f8f8f8; $loading-color: #f8f8f8;
.bg-register .logo img { .bg-register .logo-nam-dinh {
width: 144px; a {
margin-top: 32px; margin-left: 32px;
@media screen and (max-height: 800px) { @media screen and (max-width: 768px) {
width: 120px; 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