28/05/23 - 15h
parent
b0d9bb1537
commit
e66c814f07
|
@ -29,6 +29,7 @@ import img_logo_stripe from "./../mysy_img/logo-stripe-secure.png";
|
|||
import SendIcon from '@mui/icons-material/Send';
|
||||
import { confirmAlert } from 'react-confirm-alert'; // Import
|
||||
import { RiAddCircleLine } from "react-icons/ri";
|
||||
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
|
||||
|
||||
function Abonnement(props) {
|
||||
|
||||
|
@ -488,7 +489,7 @@ function Abonnement(props) {
|
|||
getCurrentUserData();
|
||||
GetPayementMode();
|
||||
setpackprice();
|
||||
|
||||
|
||||
|
||||
}, []);
|
||||
|
||||
|
@ -759,6 +760,8 @@ function Abonnement(props) {
|
|||
})
|
||||
}
|
||||
|
||||
const [isLoading, setLoading] = useState();
|
||||
|
||||
const [neworderid, setneworderid] = useState("");
|
||||
const [New_Ordervalidation_api, setNew_Ordervalidation_api] = useState();
|
||||
const [New_Ordervalidation_message, setNew_Ordervalidation_message] = useState();
|
||||
|
@ -795,7 +798,8 @@ function Abonnement(props) {
|
|||
|
||||
|
||||
//form.append("1", JSON.stringify({ "code": "art_supp", "prix": "120", "comment": "nc" }));
|
||||
|
||||
|
||||
setLoading(true);
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/createOrder/";
|
||||
|
||||
fetch(myurl,
|
||||
|
@ -817,11 +821,13 @@ function Abonnement(props) {
|
|||
|
||||
// Mise à jour du plan de payement
|
||||
Update_Payement_Plan_Qty();
|
||||
setLoading(false);
|
||||
|
||||
}
|
||||
else {
|
||||
setNew_Ordervalidation_api("false");
|
||||
setNew_Ordervalidation_message(data['message']);
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -829,8 +835,10 @@ function Abonnement(props) {
|
|||
console.error('Error:', error);
|
||||
setneworderid("");
|
||||
setNew_Ordervalidation_api("false");
|
||||
setLoading(false);
|
||||
|
||||
});
|
||||
// setLoading(false);
|
||||
|
||||
}
|
||||
|
||||
|
@ -952,6 +960,10 @@ function Abonnement(props) {
|
|||
|
||||
return (
|
||||
<div className="abonnement">
|
||||
{isLoading && <div className="loader-container">
|
||||
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
||||
</div>}
|
||||
|
||||
|
||||
{String(gotocheckout) === String("1") && <div>
|
||||
<Button onClick={returntoorder} className="btn_retour_ps"> Retour aux produits & Services </Button>
|
||||
|
@ -981,10 +993,10 @@ function Abonnement(props) {
|
|||
<div className="div_row">
|
||||
<div className="div_row_gauche pave_nb_ftion">
|
||||
Nombre de formations : {String(parnternbformation)}
|
||||
{result && !(JSON.parse(result).end_date_abonnement) && !changepartnb_ftion
|
||||
&& currentpack2
|
||||
&& String(currentpack2).toLowerCase() !=="decouverte"
|
||||
&&
|
||||
{result && !(JSON.parse(result).end_date_abonnement) && !changepartnb_ftion
|
||||
&& currentpack2
|
||||
&& String(currentpack2).toLowerCase() !== "decouverte"
|
||||
&&
|
||||
<Button className="btn_modif_nb_ftion" onClick={Change_Partne_Nb_Ftion} >Modifier <RiAddCircleLine /> </Button>
|
||||
}
|
||||
</div>
|
||||
|
@ -1056,11 +1068,11 @@ function Abonnement(props) {
|
|||
</div>
|
||||
|
||||
<div style={{ "width": "100%" }} id="div_nb_formation" className="mob_heigh">
|
||||
<div className = "pave_btn_enreg_new_nb_ftion" >
|
||||
<div className="pave_btn_enreg_new_nb_ftion" >
|
||||
<Button className="btn_enreg_new_nb_ftion" onClick={make_new_abonnement} >Enregistrer </Button>
|
||||
</div>
|
||||
|
||||
<div className = "pave_btn_annule_new_nb_ftion">
|
||||
<div className="pave_btn_annule_new_nb_ftion">
|
||||
<Button className="btn_annule_new_nb_ftion" onClick={annule_enreg_new_ftion} >Annuler </Button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1235,7 +1247,7 @@ function Abonnement(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
|
||||
<TextField
|
||||
|
@ -1252,7 +1264,7 @@ function Abonnement(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
<br />
|
||||
|
||||
|
@ -1269,7 +1281,7 @@ function Abonnement(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
|
||||
|
||||
|
@ -1286,10 +1298,10 @@ function Abonnement(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<TextField
|
||||
name="adr_street"
|
||||
disabled
|
||||
|
@ -1303,7 +1315,7 @@ function Abonnement(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
<br />
|
||||
<TextField
|
||||
|
@ -1319,7 +1331,7 @@ function Abonnement(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
|
||||
<TextField
|
||||
|
@ -1335,7 +1347,7 @@ function Abonnement(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
<br />
|
||||
<TextField
|
||||
|
@ -1351,7 +1363,7 @@ function Abonnement(props) {
|
|||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
<br />
|
||||
|
||||
|
|
|
@ -216,17 +216,26 @@ function HebergementLms(props) {
|
|||
_URL.revokeObjectURL(objectUrl);
|
||||
console.log(" img_width = ", img_width, " img_height = ", img_height)
|
||||
|
||||
if (parseFloat(img_width) > 140 && parseFloat(img_width) < 250 &&
|
||||
if (parseFloat(img_width) > 130 && parseFloat(img_width) < 260 &&
|
||||
parseFloat(img_height) > 60 && parseFloat(img_height) < 150) {
|
||||
//console.log(" img_height est = ", img_height, " < à 1500 ");
|
||||
|
||||
// Verification que le nom du fichier est alpha numerique
|
||||
var regExp = /^[A-Za-z0-9]+$/;
|
||||
/*var regExp = /^[A-Za-z0-9]+$/;
|
||||
if (!regExp.test(event.target.files[0].name)) {
|
||||
sethandleSubmission_logo_message(" Le nom de l'image comporte des caractères non alphanumériques");
|
||||
sethandleSubmission_logo_api("false");
|
||||
setLoading(false);
|
||||
|
||||
return
|
||||
}*/
|
||||
|
||||
|
||||
if (String(event.target.files[0].name).length > 50) {
|
||||
sethandleSubmission_logo_message(" Le nom du fichier est trop long. il doit faire moins de 50 caractère");
|
||||
sethandleSubmission_logo_api("false");
|
||||
setLoading(false);
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -241,7 +250,7 @@ function HebergementLms(props) {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log(" after img_width = ", img_width, " after img_height = ", img_height)
|
||||
//console.log(" after img_width = ", img_width, " after img_height = ", img_height)
|
||||
};
|
||||
img.src = objectUrl;
|
||||
|
||||
|
@ -343,18 +352,27 @@ function HebergementLms(props) {
|
|||
img.onload = function () {
|
||||
img_height = this.height;
|
||||
img_width = this.width;
|
||||
console.log(" img_width = ", img_width);
|
||||
//console.log(" img_width = ", img_width);
|
||||
_URL.revokeObjectURL(objectUrl);
|
||||
if (parseFloat(img_width) > 1500 && parseFloat(img_width) < 1930 &&
|
||||
parseFloat(img_height) > 150 && parseFloat(img_height) < 195) {
|
||||
//console.log(" img_height est = ", img_height, " < à 1500 ");
|
||||
|
||||
// Verification que le nom du fichier est alpha numerique
|
||||
var regExp = /^[A-Za-z0-9]+$/;
|
||||
/*var regExp = /^[A-Za-z0-9]+$/;
|
||||
if (!regExp.test(event.target.files[0].name)) {
|
||||
sethandleSubmission_bg_message(" Le nom de l'image comporte des caractères non alphanumériques");
|
||||
sethandleSubmission_bg_api("false");
|
||||
setLoading(false);
|
||||
return
|
||||
}*/
|
||||
|
||||
|
||||
if (String(event.target.files[0].name).length > 50) {
|
||||
sethandleSubmission_bg_message(" Le nom du fichier est trop long. il doit faire moins de 50 caractère");
|
||||
sethandleSubmission_bg_api("false");
|
||||
setLoading(false);
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,26 @@
|
|||
font-style: italic;
|
||||
}
|
||||
|
||||
.loader-container {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
//justify-content: center;
|
||||
align-items: center;
|
||||
left: -5%;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
top: 0px;
|
||||
background: white;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.mysy_spinner{
|
||||
border-radius: 5px;
|
||||
border: 1px solid black;
|
||||
opacity: 100%;
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (max-width: 600px) {
|
||||
/*style smartphones et petites tablettes en portrait*/
|
||||
|
|
Loading…
Reference in New Issue