This commit is contained in:
lalBi94 2023-03-06 05:25:05 +01:00
parent 01738fcfa8
commit de2a768813

View File

@ -125,6 +125,7 @@
* */ * */
previousPage(){ previousPage(){
try { try {
console.log(this.state.page.cat.option1)
if(this.state.page.curIndex-1 >= 0) { if(this.state.page.curIndex-1 >= 0) {
this.update({ curIndex: this.state.page.curIndex-- }); this.update({ curIndex: this.state.page.curIndex-- });
} }
@ -141,15 +142,14 @@
nextPage(choice) { nextPage(choice) {
try { try {
if(this.state.page.curIndex+1 <= 2 ) { if(this.state.page.curIndex+1 <= 2 ) {
if(this.state.page.curIndex+1 === 0) { if(this.state.page.curIndex === 0) {
this.getData() this.update({ option1: "fsef", option2: "fefs", option3: "fe" })
this.update({ option1: choice }) console.log(this.state.page.cat)
} else if(this.state.page.curIndex+1 === 1) { } else if(this.state.page.curIndex+1 === 1) {
this.update({ option2: choice }) this.update({ option2: choice })
} else if(this.state.page.curIndex+1 === 2) { } else if(this.state.page.curIndex+1 === 2) {
this.update({ option3: choice }) this.update({option3: choice})
} }
this.update({ curIndex: this.state.page.curIndex++ }); this.update({ curIndex: this.state.page.curIndex++ });
} }
} catch(e) { } catch(e) {
@ -166,7 +166,6 @@
const response = await fetch(api); const response = await fetch(api);
const data = await response.json(); const data = await response.json();
this.update({ data: data.facet_groups[0].facets }); this.update({ data: data.facet_groups[0].facets });
console.log(data)
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
@ -178,7 +177,10 @@
}; };
</script> </script>
<span if={ !this.state.data }>Chargement des données...</span> <span if={ !this.state.data }>
Chargement des données... <br />
<loader />
</span>
<div if={ this.state.data } id="selector"> <div if={ this.state.data } id="selector">
<div id="selector-top-container"> <div id="selector-top-container">