222 lines
11 KiB
PHP
222 lines
11 KiB
PHP
@extends('template.layout')
|
|
@section('title', __('vuelos.page_title'))
|
|
|
|
@section('content')
|
|
@isset($vuelos)
|
|
<div class="vuelos-section">
|
|
<div class="block-title text-center">
|
|
<p class="section-badge">{{ __('vuelos.section_badge') ?? '✨ Paseos en globo Teotihuacán' }}</p>
|
|
<h3 class="section-title">{{ __('vuelos.section_title') ?? 'Nuestros vuelos' }}</h3>
|
|
<p class="section-description">Descubre la magia de volar sobre Teotihuacán con nuestras experiencias únicas</p>
|
|
</div>
|
|
|
|
<div class="flights-grid">
|
|
@php
|
|
$duracion_vuelo = __('vuelos.duration');
|
|
$ubicacion = __('vuelos.location');
|
|
$listaVuelos = $vuelos['Compartidos'] ?? ($vuelos['Shared'] ?? $vuelos);
|
|
@endphp
|
|
|
|
@forelse ($listaVuelos as $index => $item)
|
|
@php
|
|
$vuelo = $item['vuelo'] ?? $item;
|
|
$categoria = $item['categoria']['nombre'] ?? 'Compartido';
|
|
$imagenes = $item['imagenes'] ?? [];
|
|
$incluye = $item['incluye'] ?? [];
|
|
|
|
$imagen = !empty($imagenes)
|
|
? $imagenes[0]['ruta_imagen_vuelo']
|
|
: asset('img/default-flight.jpg');
|
|
|
|
$precio_publico = $vuelo['precio_publico'] ?? 0;
|
|
$precio_especial = $vuelo['precio_especial'] ?? 0;
|
|
|
|
if (isset($item['precios']) && ($item['precios']['precio_principal'] ?? 0) == 1) {
|
|
$precio_publico = $item['precios']['precio_vuelo_original'] ?? $precio_publico;
|
|
$precio_especial = $item['precios']['precio_vuelo_especial'] ?? $precio_especial;
|
|
}
|
|
|
|
$tiene_descuento = $precio_especial > 0 && $precio_especial < $precio_publico;
|
|
$descuento_porcentaje = $tiene_descuento
|
|
? round((($precio_publico - $precio_especial) / $precio_publico) * 100)
|
|
: 0;
|
|
|
|
$url = route('vueloSeleccionado', [
|
|
'vuelo' => $vuelo['enlace_permanente'] ?? $vuelo['id_vuelo'],
|
|
]);
|
|
|
|
$badge_text =
|
|
$vuelo['highlighted_text_flight_' . (app()->getLocale() == 'en' ? 'en' : 'es')] ??
|
|
($vuelo['highlighted_text_flight_es'] ?? null);
|
|
$badge_color = $vuelo['highlighted_background_color_badge_flight_es'] ?? '#04cdff';
|
|
|
|
$rating = $vuelo['raiting_global_number'] ?? 0;
|
|
$total_reseñas = $vuelo['total_reviews'] ?? rand(25, 150);
|
|
$hora_actividad = $vuelo['hora_actividad'] ?? null;
|
|
$duracion_minutos = $vuelo['duracion_minutos'] ?? 45;
|
|
@endphp
|
|
|
|
<div class="flight-card" data-vuelo-id="{{ $vuelo['id_vuelo'] }}">
|
|
{{-- Badge destacado --}}
|
|
@if ($badge_text)
|
|
<div class="flight-card__badge" style="background: {{ $badge_color }}">
|
|
<i class="fas fa-star"></i>
|
|
<span>{{ $badge_text }}</span>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Badge de descuento --}}
|
|
@if ($tiene_descuento)
|
|
<div class="flight-card__discount">
|
|
<span>-{{ $descuento_porcentaje }}%</span>
|
|
<small>OFF</small>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Imagen --}}
|
|
<div class="flight-card__image">
|
|
<img src="{{ asset('assets/img/vueloenglobo/logo-vueloenglobo.png') }}" data-src="{{ $imagen }}"
|
|
alt="{{ $vuelo['nombre_vuelo'] }}" loading="lazy"
|
|
onclick="window.location.href='{{ $url }}'" >
|
|
|
|
{{-- Overlay con ícono --}}
|
|
<div class="flight-card__overlay">
|
|
<button class="flight-card__quick-view"
|
|
onclick="event.stopPropagation(); window.location.href='{{ $url }}'">
|
|
<i class="fas fa-eye"></i> Ver detalles
|
|
</button>
|
|
</div>
|
|
|
|
{{-- Rating --}}
|
|
@if ($rating > 0)
|
|
<div class="flight-card__rating">
|
|
<i class="fas fa-star"></i>
|
|
<span>{{ number_format($rating, 1) }}</span>
|
|
<small>({{ $total_reseñas }})</small>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
{{-- Contenido --}}
|
|
<div class="flight-card__content">
|
|
{{-- Categoría --}}
|
|
<div class="flight-card__category">
|
|
<span class="category-tag">
|
|
<i class="fas fa-users"></i> {{ $categoria }}
|
|
</span>
|
|
@if ($duracion_minutos)
|
|
<span class="duration-tag">
|
|
<i class="far fa-clock"></i> {{ $duracion_minutos }} min
|
|
</span>
|
|
@endif
|
|
</div>
|
|
|
|
{{-- Título --}}
|
|
<h3 class="flight-card__title">
|
|
<a href="{{ $url }}">{{ $vuelo['nombre_vuelo'] }}</a>
|
|
</h3>
|
|
|
|
{{-- Descripción --}}
|
|
<p class="flight-card__description">
|
|
{{ Str::limit($vuelo['descripcion_corta'] ?? __('vuelos.image_not_available'), 120) }}
|
|
</p>
|
|
|
|
{{-- Horario --}}
|
|
@if (!empty($hora_actividad))
|
|
<div class="flight-card__schedule">
|
|
<i class="far fa-calendar-alt"></i>
|
|
<span>Salida: {{ date('g:i A', strtotime($hora_actividad)) }}</span>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Incluye destacados --}}
|
|
@if (!empty($incluye))
|
|
<div class="flight-card__includes">
|
|
@foreach (array_slice($incluye, 0, 3) as $item_include)
|
|
<span class="include-item">
|
|
<i class="fas fa-check-circle"></i>
|
|
{{ Str::limit($item_include['titulo_item'], 25) }}
|
|
</span>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Precios --}}
|
|
<div class="flight-card__prices">
|
|
@if ($tiene_descuento)
|
|
<div class="prices-wrapper">
|
|
<span class="price-old">${{ number_format($precio_publico, 0) }}</span>
|
|
<div class="price-current">
|
|
<span class="currency">$</span>
|
|
<span class="amount">{{ number_format($precio_especial, 0) }}</span>
|
|
<span class="period">/ persona</span>
|
|
</div>
|
|
</div>
|
|
<div class="price-savings">
|
|
<i class="fas fa-tag"></i> Ahorras
|
|
${{ number_format($precio_publico - $precio_especial, 0) }}
|
|
</div>
|
|
@else
|
|
<div class="price-current">
|
|
<span class="currency">$</span>
|
|
<span class="amount">{{ number_format($precio_publico, 0) }}</span>
|
|
<span class="period">/ persona</span>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
{{-- Meta información --}}
|
|
<div class="flight-card__meta">
|
|
<div class="meta-item">
|
|
<i class="fas fa-map-marker-alt"></i>
|
|
<span>{{ $ubicacion }}</span>
|
|
</div>
|
|
<div class="meta-item">
|
|
<i class="fas fa-clock"></i>
|
|
<span>{{ $duracion_vuelo }}</span>
|
|
</div>
|
|
<div class="meta-item">
|
|
<i class="fas fa-language"></i>
|
|
<span>Español / Inglés</span>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Botones de acción --}}
|
|
<div class="flight-card__actions">
|
|
<button class="btn-inquire"
|
|
onclick="openChatbot('{{ addslashes($vuelo['nombre_vuelo']) }}', {{ $vuelo['id_vuelo'] }})">
|
|
<i class="fas fa-comment-dots"></i>
|
|
<span>Consultar</span>
|
|
</button>
|
|
<a href="{{ $url }}" class="btn-book">
|
|
<i class="fas fa-calendar-check"></i>
|
|
<span>Reservar ahora</span>
|
|
<i class="fas fa-arrow-right"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@empty
|
|
<div class="no-flights">
|
|
<div class="no-flights__icon">
|
|
<i class="fas fa-hot-air-balloon"></i>
|
|
</div>
|
|
<h3>{{ __('vuelos.no_flights') ?? 'No hay vuelos disponibles' }}</h3>
|
|
<p>{{ __('vuelos.check_later') ?? 'Por favor, revisa más tarde o contacta con nosotros.' }}</p>
|
|
<button class="btn-contact" onclick="openChatbot()">
|
|
<i class="fas fa-headset"></i> Contactar soporte
|
|
</button>
|
|
</div>
|
|
@endforelse
|
|
</div>
|
|
</div>
|
|
@endisset
|
|
@endsection
|
|
|
|
@push('css')
|
|
@endpush
|
|
|
|
@push('js')
|
|
<script src="{{ asset('assets/js/vuelos-en-globo.js') }}"></script>
|
|
@endpush
|