mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
start seat counting
This commit is contained in:
@@ -132,12 +132,12 @@
|
|||||||
if ( res.status === 200 ) {
|
if ( res.status === 200 ) {
|
||||||
res.json().then( data => {
|
res.json().then( data => {
|
||||||
this.draggables = this.scaleUp( data.data );
|
this.draggables = this.scaleUp( data.data );
|
||||||
this.prepSeatplan();
|
this.prepSeatplan( data.seatInfo );
|
||||||
} );
|
} );
|
||||||
} else if ( res.status === 500 ) {
|
} else if ( res.status === 500 ) {
|
||||||
if ( sessionStorage.getItem( 'seatplan' ) ) {
|
if ( sessionStorage.getItem( 'seatplan' ) ) {
|
||||||
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
|
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
|
||||||
this.prepSeatplan();
|
this.prepSeatplan( {} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
@@ -145,7 +145,8 @@
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
prepSeatplan () {
|
prepSeatplan ( seatInfo ) {
|
||||||
|
console.log( seatInfo );
|
||||||
// Mark all selected seats + all unavailable seats
|
// Mark all selected seats + all unavailable seats
|
||||||
let categoryDetails = {};
|
let categoryDetails = {};
|
||||||
for ( let category in this.event.categories ) {
|
for ( let category in this.event.categories ) {
|
||||||
@@ -157,7 +158,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
for ( let element in this.draggables ) {
|
for ( let element in this.draggables ) {
|
||||||
this.draggables[ element ][ 'data' ] = { 'sector': this.draggables[ element ][ 'sector' ], 'categoryInfo': { 'pricing': categoryDetails[ this.draggables[ element ][ 'category' ] ], 'color': this.event.categories[ this.draggables[ element ][ 'category' ] ][ 'fg' ] } };
|
this.draggables[ element ][ 'data' ] = {
|
||||||
|
'sector': this.draggables[ element ][ 'sector' ],
|
||||||
|
'categoryInfo': {
|
||||||
|
'pricing': categoryDetails[ this.draggables[ element ][ 'category' ] ],
|
||||||
|
'color': this.event.categories[ this.draggables[ element ][ 'category' ] ][ 'fg' ]
|
||||||
|
},
|
||||||
|
'seatInfo': seatInfo,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.seatChecks();
|
this.seatChecks();
|
||||||
@@ -297,17 +305,6 @@
|
|||||||
if ( sessionStorage.getItem( 'seatplan' ) ) {
|
if ( sessionStorage.getItem( 'seatplan' ) ) {
|
||||||
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
|
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// if ( this.cart[ this.event.eventID ] ) {
|
|
||||||
// let tickets = this.cart[ this.event.eventID ][ 'tickets' ];
|
|
||||||
// for ( let seat in tickets ) {
|
|
||||||
// if ( !this.unavailableSeats[ data.user[ seat ].component ] ) {
|
|
||||||
// this.unavailableSeats[ data.reserved[ seat ].component ] = {};
|
|
||||||
// }
|
|
||||||
// this.unavailableSeats[ tickets[ seat ].component ][ tickets[ seat ].id ] = 'sel';
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
},
|
},
|
||||||
scaleUp ( valueArray ) {
|
scaleUp ( valueArray ) {
|
||||||
const allowedAttributes = [ 'w', 'h', 'x', 'y' ];
|
const allowedAttributes = [ 'w', 'h', 'x', 'y' ];
|
||||||
|
|||||||
Reference in New Issue
Block a user