diff --git a/src.zip b/src.zip new file mode 100644 index 0000000..41476e5 Binary files /dev/null and b/src.zip differ diff --git a/src/App.vue b/src/App.vue index ad010c4..90b28ec 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,16 +4,59 @@

Parametry letu

- +

+ +

+
+ +

+

+
+ +

+
+
+
+ {{ seat }} +
+
+ {{ seat }} +
+
+
+

Objednávka

- Typ Letu: {{ travelType.text }} -

+ Typ Letu: + + {{ travelType.text }} + +

+

+ Počet cestujícíh : {{ personCount }} +

+

+ Třída: + + {{ classType.text }} + +

+
+ Vybraná místa: +
+ {{ seat }} +
+
@@ -26,13 +69,63 @@ export default{ return{ travelType:"", TravelTypes:[ - { value: "R", text: "Zpáteční"}, - { value: "O", text: "Jednosměrný"}, - ] + { value: "R", text: "TwoWay"}, + { value: "O", text: "OneWay"}, + ], + personCount: 1, + classType: "", + classTypes:[ + { value: "E", text: "Economy"}, + { value: "E", text: "Business"}, + ], + seats:[ + "B1", "B2", "B3", + "E1", "E2", "E3", + ], + chosenSeats: [] + } + }, + methods:{ + addSeatClick: function(seat){ + if (this.chosenSeats.length < this.personCount){ + this.chosenSeats.push(seat); + } + else{ + alert("MAXIMÁLNÍ POČET SEDADEL DOSAŽEN") + } + }, + personCountChange: function(){ + let diff = this.personCount - this.chosenSeats.length; + if (diff < 0){ + for (let i = 0; i < diff * -1; i++) { + this.chosenSeats.pop(); + } + } } } }