Compare commits
No commits in common. "e64c3ca9481c8a79c1edd4c23ae8c312c0a5b96d" and "3fa3ae9c8d731d5657946e7d252c68b32f4cce81" have entirely different histories.
e64c3ca948
...
3fa3ae9c8d
5 changed files with 22 additions and 118 deletions
|
@ -1,63 +0,0 @@
|
||||||
#back {
|
|
||||||
margin: 5.5% auto auto auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#warningBlock {
|
|
||||||
background-color: black;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#moneyBlock {
|
|
||||||
margin-top: 20vh;
|
|
||||||
background-color: black;
|
|
||||||
border-radius: 20px;
|
|
||||||
height: 30vh;
|
|
||||||
width: 40vw;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-around;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#recuBlock {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#textBlock {
|
|
||||||
font-size: 1.5vw;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
#inputsBlock {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#inputsBlock input {
|
|
||||||
max-width: 10vw;
|
|
||||||
background: rgba(84, 84, 84, 0.65);
|
|
||||||
border-radius:2vw;
|
|
||||||
padding:0.4vw 1vw 0.4vw 3.2vw;
|
|
||||||
font-size: 1.5vw;
|
|
||||||
border: 0.2vw solid black;
|
|
||||||
box-shadow: 0.4vw 0.8vw 0.4vw rgba(0, 0, 0, 0.82);
|
|
||||||
font-family: 'Wellfleet', cursive;
|
|
||||||
}
|
|
||||||
|
|
||||||
#inputsBlock input:focus{
|
|
||||||
max-width: 15vw;
|
|
||||||
outline:none;
|
|
||||||
background: rgba(84, 84, 84, 1);
|
|
||||||
border-radius:2vw;
|
|
||||||
padding:0.4vw 1vw 0.4vw 3.2vw;
|
|
||||||
font-size: 1.5vw;
|
|
||||||
border-color: white;
|
|
||||||
color:white
|
|
||||||
}
|
|
||||||
|
|
||||||
#renduBlock {
|
|
||||||
font-size: 1.8vw;
|
|
||||||
color: red;
|
|
||||||
}
|
|
|
@ -1,11 +1,3 @@
|
||||||
body {
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.home{
|
.home{
|
||||||
flex:1;
|
flex:1;
|
||||||
height:100%;
|
height:100%;
|
||||||
|
|
|
@ -6,35 +6,22 @@ class Money extends Component {
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
renduTxt: "Rendu"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.handleMoneyChange = this.handleMoneyChange.bind(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is
|
|
||||||
|
|
||||||
handleMoneyChange() {
|
|
||||||
let eurosInput = document.getElementById("euros");
|
|
||||||
let centsInput = document.getElementById("centimes");
|
|
||||||
let regex = /^[0-9]+$/; //1 ou plusieurs chiffres à la suite
|
|
||||||
let lengthCents = centsInput.value.length;
|
|
||||||
let lengthEuros = eurosInput.value.length;
|
|
||||||
let result = parseInt(eurosInput.value) + parseInt(centsInput.value)*10**-lengthCents;
|
|
||||||
if (centsInput.value.match(regex) && eurosInput.value.match(regex)) {
|
|
||||||
this.setState({renduTxt: (this.props.totalPrice - result).toPrecision(lengthEuros + lengthCents)});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="transp">
|
<div id="transp">
|
||||||
<div id="back">
|
<div id="formBody">
|
||||||
{this.props.empty ?
|
{this.props.empty ?
|
||||||
<div id="warningBlock">
|
<div id="warningBlock">
|
||||||
<div id="warningBox">
|
<div id="warningBox">
|
||||||
|
@ -49,21 +36,9 @@ class Money extends Component {
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
// A faire : input pour rentrer la somme en espèce + Affichage de la différence avec le prix
|
// A faire : input pour rentrer la somme en espèce + Affichage de la différence avec le prix
|
||||||
<div id="moneyBlock">
|
|
||||||
<div id="recuBlock">
|
|
||||||
<div id="textBlock">
|
|
||||||
Monnaie Reçue :
|
|
||||||
</div>
|
|
||||||
<div id="inputsBlock">
|
|
||||||
<input id="euros" placeholder='€' onChange={this.handleMoneyChange}/>
|
|
||||||
<input id="centimes" placeholder='cents' onChange={this.handleMoneyChange}/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="renduBlock">
|
|
||||||
<p id="renduText">{this.state.renduTxt}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<>
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -134,7 +134,7 @@ export default class Stock extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plusQuantity = (element,id) => {
|
plusQuantity = (element,id) => {
|
||||||
let index = this.getArticleById(id).i;
|
let index = this.getArticleById(id).i;
|
||||||
let articles = this.state.articles;
|
let articles = this.state.articles;
|
||||||
articles[index].quantity++;
|
articles[index].quantity++;
|
||||||
|
|
|
@ -195,7 +195,7 @@ export default class Stock extends React.Component {
|
||||||
<BarcodeReader onScan={this.handleScan}/>
|
<BarcodeReader onScan={this.handleScan}/>
|
||||||
<SearchBar/>
|
<SearchBar/>
|
||||||
{this.state.onMoney &&
|
{this.state.onMoney &&
|
||||||
<Money empty={this.state.empty} handleCloseAbove={this.handleCloseMoney} totalPrice={this.state.totalPrice}/>
|
<Money empty={this.state.empty} handleCloseAbove={this.handleCloseMoney}/>
|
||||||
}
|
}
|
||||||
{this.state.onNotInBdd &&
|
{this.state.onNotInBdd &&
|
||||||
<NotInBdd handleCloseAbove={this.closeNotInBdd}/>
|
<NotInBdd handleCloseAbove={this.closeNotInBdd}/>
|
||||||
|
|
Loading…
Reference in a new issue