28/05/23 - 15h

recette2
cherif 2023-05-28 15:37:24 +02:00
parent b0d9bb1537
commit e66c814f07
3 changed files with 72 additions and 22 deletions

View File

@ -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) {
@ -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();
@ -796,6 +799,7 @@ 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>

View File

@ -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
}

View File

@ -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*/