before remove getcolumnsnaming

This commit is contained in:
zino
2021-05-15 22:57:15 +02:00
parent 51e78042b5
commit 39aa73b034
10 changed files with 138 additions and 125 deletions

View File

@@ -4,8 +4,9 @@ import * as State from "./state";
import * as Cart from "./cart";
import * as UI from "./ui";
export function getSeats(inXML: any): I.JSCSeats {
const pricescaleArr: I.SeatmapPricescale[] = inXML.seatmap[0].pricescale_config[0].pricescale;
export function getSeats(): I.JSCSeats {
const seatmapXML = config.state.seatmapXML;
const pricescaleArr: I.SeatmapPricescale[] = seatmapXML.seatmap[0].pricescale_config[0].pricescale;
let object: any = {};
for (let key in pricescaleArr) {
@@ -22,8 +23,10 @@ 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;
export function activateSeatsBySectionID(inValue: string) {
const seatmapXML = config.state.seatmapXML;
const seatmap = config.state.seatmap;
const pricescaleArr: I.SeatmapPricescale[] = seatmapXML.seatmap[0].pricescale_config[0].pricescale;
pricescaleArr.forEach(element => {
if (element.id[0] === inValue) {
@@ -33,8 +36,9 @@ export function activateSeatsBySectionID(inXML: any, seatmap: any, inValue: stri
});
}
export function getRowsNaming(inXML: any): string[] {
const layout: I.SeatmapLayout = inXML.seatmap[0].layouts[0].layout[0];
export function getRowsNaming(): string[] {
const seatmapXML = config.state.seatmapXML;
const layout: I.SeatmapLayout = seatmapXML.seatmap[0].layouts[0].layout[0];
const height: number = parseInt(layout.height[0]);
// return Array.from({ length: height }, (_, i: number) => i + 1);
const namingArr = Array.from({ length: height }, (_) => "");
@@ -111,11 +115,12 @@ export function getRowsNaming(inXML: any): string[] {
// return namingArr;
// }
export function generateMap(inXML: any): string[] {
const layout: I.SeatmapLayout = inXML.seatmap[0].layouts[0].layout[0];
export function generateMap(): string[] {
const seatmapXML = config.state.seatmapXML;
const layout: I.SeatmapLayout = seatmapXML.seatmap[0].layouts[0].layout[0];
const rows: I.LayoutRow2[] = layout.rows[0].row;
const pricescaleArr: I.SeatmapPricescale[] = inXML.seatmap[0].pricescale_config[0].pricescale;
const availabilityArr: I.JSCAvailability = inXML.seatmap[0].view_modes[0].view_mode[0].availability[0];
const pricescaleArr: I.SeatmapPricescale[] = seatmapXML.seatmap[0].pricescale_config[0].pricescale;
const availabilityArr: I.JSCAvailability = seatmapXML.seatmap[0].view_modes[0].view_mode[0].availability[0];
// Form: arrMatrix[Y][X]
let arrMatrix: string[][] = createArrMatrix(parseInt(layout.height[0]), parseInt(layout.width[0]), "_");
@@ -310,7 +315,7 @@ export function selectSeatsInCart(inSeatmap: any) {
});
}
export function addSeatmap(inSelector: string, inMap: string[], inRowsNaming: string[], inSeats: I.JSCSeats, inLegend: I.JSCLegend, inSeatmap: any, inVenueXML: I.VenueXML): void {
export function addSeatmap(inSelector: string, inMap: string[], inRowsNaming: string[], inSeats: I.JSCSeats, inLegend: I.JSCLegend, inSeatmap: any): void {
const containerSeatmap: any = (<any>window).jQuery(inSelector);
// console.log(inSeatmapInitMap);
@@ -335,8 +340,8 @@ export function addSeatmap(inSelector: string, inMap: string[], inRowsNaming: st
if (State.maximumSelectedSeatsReached(selectedSeat, inSeatmap))
return "available";
State.addSeatToState(inVenueXML, selectedSeat);
Cart.calcOverallPrice(inVenueXML);
State.addSeatToState(selectedSeat);
Cart.calcOverallPrice();
UI.setBtnCartText();
return "selected";
@@ -345,7 +350,7 @@ export function addSeatmap(inSelector: string, inMap: string[], inRowsNaming: st
const selectedSeat: I.JSCSelectedSeat = this.settings;
State.removeSeatFromState(selectedSeat);
Cart.calcOverallPrice(inVenueXML);
Cart.calcOverallPrice();
UI.setBtnCartText();
console.log(config.state.selectedSeatsArr);