implemented check tick selected seat
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import * as I from "../types/types";
|
||||
|
||||
|
||||
export function getSeats(inXML: any): I.JSCSeats {
|
||||
const pricescaleArr: I.SeatmapPricescale[] = inXML.seatmap[0].pricescale_config[0].pricescale;
|
||||
let object: any = {};
|
||||
|
||||
for (let key in pricescaleArr) {
|
||||
const seatsObj: I.JSCSeats2 = {
|
||||
"classes": "foobar",
|
||||
"classes": `_${pricescaleArr[key].id[0]}`,
|
||||
"seatsObj": pricescaleArr[key]
|
||||
}
|
||||
const seatsKey: string = String.fromCharCode(97 + parseInt(key)).toLocaleUpperCase();
|
||||
@@ -19,6 +18,17 @@ export function getSeats(inXML: any): I.JSCSeats {
|
||||
return seatmapInitSeats;
|
||||
}
|
||||
|
||||
export function activateSeatsBySectionID(inXML: any, seatmap: any, inValue: string, ) {
|
||||
const pricescaleArr: I.SeatmapPricescale[] = inXML.seatmap[0].pricescale_config[0].pricescale;
|
||||
|
||||
pricescaleArr.forEach(element => {
|
||||
if (element.id[0] === inValue) {
|
||||
const seatsArr = element.mask[0].split(",");
|
||||
seatmap.status(seatsArr, "available");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function getRows(inXML: any): number[] {
|
||||
const layout: I.SeatmapLayout = inXML.seatmap[0].layouts[0].layout[0];
|
||||
const height: number = parseInt(layout.height[0]);
|
||||
@@ -41,6 +51,34 @@ export function generateMap(inXML: any): string[] {
|
||||
return stringArrMatrix;
|
||||
}
|
||||
|
||||
export function generateLegend(inXML: any, inNode: string): I.JSCLegend {
|
||||
const pricescaleArr: I.SeatmapPricescale[] = inXML.seatmap[0].pricescale_config[0].pricescale;
|
||||
console.log(pricescaleArr);
|
||||
let legend: I.JSCLegend = {
|
||||
node: jQuery(inNode),
|
||||
items: []
|
||||
}
|
||||
|
||||
for (let key in pricescaleArr) {
|
||||
const seatsKey: string = String.fromCharCode(97 + parseInt(key)).toLocaleUpperCase();
|
||||
const price: string = `€${pricescaleArr[key].ref_price[0]}`;
|
||||
const legendItem = [ seatsKey, "available", price ];
|
||||
legend.items.push(legendItem);
|
||||
}
|
||||
|
||||
return legend;
|
||||
}
|
||||
|
||||
export function setUnavailableSeats(inXML: any, seatmap: any): void {
|
||||
const availabilityArr: I.JSCAvailability = inXML.seatmap[0].view_modes[0].view_mode[0].availability[0];
|
||||
|
||||
if (availabilityArr.unavailable_unselectable_mask[0] === "")
|
||||
return;
|
||||
|
||||
const unavailableArr: string[] = availabilityArr.unavailable_unselectable_mask[0].split(",");
|
||||
seatmap.status(unavailableArr, "unavailable");
|
||||
}
|
||||
|
||||
export function generateStringArrMatrix(inArrMatrix: string[][]): string[] {
|
||||
const stringArrMatrix: string[] = [];
|
||||
|
||||
@@ -65,14 +103,15 @@ export function enterSeatsInMatrix(inRows: I.LayoutRow2[], inArrMatrix: string[]
|
||||
|
||||
const seatArr: string[] = splitSeatStr(seatStr);
|
||||
// Form:
|
||||
// 0: "568528"
|
||||
// 1: "568528"
|
||||
// 2: "21"
|
||||
// 3: "7024"
|
||||
// 4: "13"
|
||||
// 5: "4"
|
||||
// 0: "568528" -> ID
|
||||
// 1: "568528" -> ID
|
||||
// 2: "21" -> X-Coord benutzen
|
||||
// 3: "7024" -> section ID
|
||||
// 4: "13" -> Reihenbezeichnung
|
||||
// 5: "4" -> ?
|
||||
|
||||
const X: number = parseInt(seatArr[5]);
|
||||
// const X: number = parseInt(seatArr[5]);
|
||||
const X: number = parseInt(seatArr[2]);
|
||||
const seatsKey = getSeatsKey(seatArr[0], inPricescaleArr);
|
||||
|
||||
if (seatsKey)
|
||||
|
||||
Reference in New Issue
Block a user