15/04/23 - 22h

recette2
cherif 2023-04-15 21:49:02 +02:00
parent cb5fc01ecd
commit 7a4a1b8c69
7 changed files with 78 additions and 14 deletions

View File

@ -488,7 +488,7 @@ function Abonnement(props) {
getCurrentUserData(); getCurrentUserData();
GetPayementMode(); GetPayementMode();
setpackprice(); setpackprice();
}, []); }, []);

View File

@ -18,6 +18,7 @@ import { IoAddCircleOutline } from "react-icons/io5";
import MyPaymentMethode from "./PaymentMethode"; import MyPaymentMethode from "./PaymentMethode";
import img_visa_mastercard from "./../mysy_img/visa_mastercard.png" import img_visa_mastercard from "./../mysy_img/visa_mastercard.png"
import img_logo_stripe from "./../mysy_img/logo-stripe-secure.png"; import img_logo_stripe from "./../mysy_img/logo-stripe-secure.png";
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
import img_paypal from "./../mysy_img/paypal.png" import img_paypal from "./../mysy_img/paypal.png"
import moment from "moment"; import moment from "moment";
import { import {
@ -30,6 +31,7 @@ import { loadStripe } from '@stripe/stripe-js';
import { PaymentElement } from '@stripe/react-stripe-js'; import { PaymentElement } from '@stripe/react-stripe-js';
import Popup from 'reactjs-popup'; import Popup from 'reactjs-popup';
const stripePromise = loadStripe('pk_test_51LUUfAAbmaEugrFTI25uZBD3IFjbtaL6jUfRV83diDf7nco8worna4NGKhMHbPP71WCwT5EHFRdDNatxPrJWwgZ300kgH5EO4p'); const stripePromise = loadStripe('pk_test_51LUUfAAbmaEugrFTI25uZBD3IFjbtaL6jUfRV83diDf7nco8worna4NGKhMHbPP71WCwT5EHFRdDNatxPrJWwgZ300kgH5EO4p');
//const stripePromise_PROD = loadStripe('pk_live_51LUUfAAbmaEugrFTyfNe4Dj0vbxc5qXQqNs0rztjAKy8oSlc5EEQyJGjA8Z5kXmP2gvUMcYLUBYCIyWWzLCw59RY00PtGInkVf'); //const stripePromise_PROD = loadStripe('pk_live_51LUUfAAbmaEugrFTyfNe4Dj0vbxc5qXQqNs0rztjAKy8oSlc5EEQyJGjA8Z5kXmP2gvUMcYLUBYCIyWWzLCw59RY00PtGInkVf');
@ -453,6 +455,9 @@ function CheckOut(props) {
} }
const [isLoading, setLoading] = useState();
const [payment_in_process, setpayment_in_process] = useState(); const [payment_in_process, setpayment_in_process] = useState();
const [orderid, setorderid] = useState(); const [orderid, setorderid] = useState();
@ -477,7 +482,7 @@ function CheckOut(props) {
// ---------- debut // ---------- debut
setpayment_in_process("1"); setpayment_in_process("1");
setLoading(true);
/* /*
IMPORTANT : IMPORTANT :
@ -647,16 +652,18 @@ function CheckOut(props) {
console.log(" laaaaa ") console.log(" laaaaa ")
if (String(props.packs).toLowerCase() === String("decouverte")) { if (String(props.packs).toLowerCase() === String("decouverte")) {
MySy_LMS_Account_Management(); MySy_LMS_Account_Management();
setLoading(false);
alert(" La mise à jour de votre abonnement a été correctement traitée. Vous allez recevoir par email les details de la commande et la facture.") alert(" La mise à jour de votre abonnement a été correctement traitée. Vous allez recevoir par email les details de la commande et la facture.")
window.location.reload(); window.location.reload();
} else { } else {
MySy_LMS_Account_Management(); MySy_LMS_Account_Management();
setLoading(false);
alert(" La mise à jour de votre abonnement a été correctement traitée. Vous allez recevoir par email les details de la commande et la facture.") alert(" La mise à jour de votre abonnement a été correctement traitée. Vous allez recevoir par email les details de la commande et la facture.")
window.location.reload(); window.location.reload();
} }
} }
@ -665,15 +672,18 @@ function CheckOut(props) {
else { else {
setapiorderid("0"); setapiorderid("0");
setapiorderidmessage(data['message']); setapiorderidmessage(data['message']);
setLoading(false);
} }
}).catch((error) => { }).catch((error) => {
console.error('Error:', error); console.error('Error:', error);
setapiorderid("0"); setapiorderid("0");
setLoading(false);
}); });
} }
const [paymentadded, setpaymentadded] = useState(""); const [paymentadded, setpaymentadded] = useState("");
@ -1108,6 +1118,10 @@ function CheckOut(props) {
return ( return (
<div className="checkout"> <div className="checkout">
{isLoading && <div className="loader-container">
<div> <img src={img_loading_spin} /> </div>
</div>}
{String(apiorderid) === String("0") && <div className="koUpdateData"> {String(apiorderid) === String("0") && <div className="koUpdateData">
Impossible de créer la commande.<br /> Impossible de créer la commande.<br />
{apiorderidmessage} {apiorderidmessage}
@ -1334,7 +1348,7 @@ function CheckOut(props) {
variant="standard" variant="standard"
/> />
<TextField <TextField
name="adr_street" name="adr_street"
disabled disabled
@ -1899,10 +1913,10 @@ function CheckOut(props) {
{(String(okcommande) !== String("ko") || {(String(okcommande) !== String("ko") ||
(String(props.packs).toLowerCase() === String("decouverte"))) && (String(props.packs).toLowerCase() === String("decouverte"))) &&
String(payment_in_process) !== "1" String(payment_in_process) !== "1"
&& !stripe_existing_souscription_id && !stripe_existing_souscription_id
&& &&
<Button variant="contained" color="success" className="div_row22 btn_enreg_cmd " onClick={Ordervalidation}>Confirmer la commande</Button>} <Button variant="contained" color="success" className="div_row22 btn_enreg_cmd " onClick={Ordervalidation}>Confirmer la commande</Button>}
{(String(okcommande) !== String("ko") || {(String(okcommande) !== String("ko") ||
(String(props.packs).toLowerCase() === String("decouverte"))) && (String(props.packs).toLowerCase() === String("decouverte"))) &&
@ -1928,7 +1942,7 @@ function CheckOut(props) {
<div className="gest_content"> <div className="gest_content">
{' '} {' '}
<b>Important :</b> <br/> <b>Important :</b> <br />
La modification de votre abonnement va entrainer la désactivation de vos formations en cours. Mais vous pourrez les réactiver selon les conditions de votre nouvel abonnement.</div> La modification de votre abonnement va entrainer la désactivation de vos formations en cours. Mais vous pourrez les réactiver selon les conditions de votre nouvel abonnement.</div>
<div className="gest_actions"> <div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}> <div style={{ "width": "45%", "float": "left" }}>

View File

@ -547,7 +547,7 @@ const Partner = (props) => {
if (JSON.parse(res.data.message).lms_account && if (JSON.parse(res.data.message).lms_account &&
String(JSON.parse(res.data.message).lms_account) === "1") { String(JSON.parse(res.data.message).lms_account) === "1") {
sethas_partner_lms_url(JSON.parse(res.data.message).lms_account); sethas_partner_lms_url(JSON.parse(res.data.message).lms_account);
my_lms_url = (JSON.parse(res.data.message).lms_url) + "user_portal.php?recid=" + encodeURIComponent(JSON.parse(res.data.message).lms_part_recid) + my_lms_url = (JSON.parse(res.data.message).lms_virtualhost_url) + "user_portal.php?recid=" + encodeURIComponent(JSON.parse(res.data.message).lms_part_recid) +
"&mysytoken=" + encodeURIComponent(JSON.parse(res.data.message).lms_pwd_mask); "&mysytoken=" + encodeURIComponent(JSON.parse(res.data.message).lms_pwd_mask);
console.log(" ### LMS url = ", my_lms_url); console.log(" ### LMS url = ", my_lms_url);

View File

@ -44,6 +44,7 @@ import { PaymentElement } from '@stripe/react-stripe-js';
import Popup from 'reactjs-popup'; import Popup from 'reactjs-popup';
import 'reactjs-popup/dist/index.css'; import 'reactjs-popup/dist/index.css';
import Formation from "./Formation"; import Formation from "./Formation";
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
import { import {
CardElement, CardElement,
@ -871,7 +872,7 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
setPokemon(response.data); //set pokemon state setPokemon(response.data); //set pokemon state
setLoading(false); //set loading state setLoading(false); //set loading state
}); });
}, 5000); }, 50000);
} }
@ -895,8 +896,8 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
<button onClick={loading} id="finalise"> loading .....</button> <button onClick={loading} id="finalise"> loading .....</button>
<div> <div>
{isLoading && <div className="loader-container"> {isLoading && <div className="loader-container">
<div className="spinner"> loading in processsss</div> <div> <img src={img_loading_spin} /> </div>
</div>} </div>}

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -4,7 +4,29 @@
font-size: 0.1rem; font-size: 0.1rem;
} }
.loader-container {
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
background: rgba(0, 0, 0, 0.834);
z-index: 1;
top: 0px;
opacity: 80%;
}
.spinner {
width:20rem;
height: 10rem;
border: 8px solid;
border-color: #3d5af1 transparent #3d5af1 transparent;
border-radius: 50%;
animation: spin-anim 1.2s linear infinite;
background-color: red;
color: black;
}
@media only screen and (max-width: 600px) { @media only screen and (max-width: 600px) {

View File

@ -1,4 +1,31 @@
.partner { .partner {
.loader-container {
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
background: rgba(0, 0, 0, 0.834);
z-index: 1;
top: 0px;
opacity: 80%;
}
.spinner {
width:20rem;
height: 10rem;
border: 8px solid;
border-color: #3d5af1 transparent #3d5af1 transparent;
border-radius: 50%;
animation: spin-anim 1.2s linear infinite;
background-color: red;
color: black;
}
.label { .label {
cursor: pointer; cursor: pointer;
color: #00ffff; color: #00ffff;