Fix favorites system, add support for bus stops and tourist trips, and improve UI consistency
This commit is contained in:
@ -12,6 +12,7 @@ import { telemetryService } from "@/services/telemetryService";
|
||||
import { analyticsService } from "@/services/analyticsService";
|
||||
|
||||
import BusStopInfoModal from "@/components/BusStopInfoModal.vue";
|
||||
import FavoriteButton from "@/components/FavoriteButton.vue";
|
||||
import type { BusStop } from '@/types'
|
||||
|
||||
const router = useRouter();
|
||||
@ -231,6 +232,19 @@ onMounted(async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle stopId if present
|
||||
const queryStopId = router.currentRoute.value.query.stopId as string;
|
||||
if (queryStopId) {
|
||||
await busStopStore.loadBusStops();
|
||||
const foundStop = busStopStore.busStops.find(s => s.id === queryStopId);
|
||||
if (foundStop) {
|
||||
selectedBusStop.value = foundStop;
|
||||
showBusStopModal.value = true;
|
||||
setCenter(foundStop.latitude, foundStop.longitude);
|
||||
setZoom(17);
|
||||
}
|
||||
}
|
||||
|
||||
// Wait for Google Maps to load
|
||||
if (isLoaded.value) {
|
||||
await initializeMap();
|
||||
@ -1141,6 +1155,14 @@ function clearNavigation() {
|
||||
<span v-if="currentPromo.discount_percentage" class="sheet-discount">
|
||||
-{{ currentPromo.discount_percentage }}%
|
||||
</span>
|
||||
<div class="sheet-fav-pos" @click.stop>
|
||||
<FavoriteButton
|
||||
item-type="coupon"
|
||||
:item-id="currentPromo.id"
|
||||
:item-name="currentPromo.title"
|
||||
:item-image="currentPromo.image_url || undefined"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Info -->
|
||||
@ -1192,6 +1214,14 @@ function clearNavigation() {
|
||||
<div class="promo-header-modal">
|
||||
<img :src="getImageUrl(selectedPromo.image_url)" class="promo-img-modal" />
|
||||
<div class="promo-badge-modal">PROMO</div>
|
||||
<div class="promo-modal-fav">
|
||||
<FavoriteButton
|
||||
item-type="coupon"
|
||||
:item-id="selectedPromo.id"
|
||||
:item-name="selectedPromo.title"
|
||||
:item-image="selectedPromo.image_url || undefined"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="promo-body-modal">
|
||||
<h2 class="promo-title-modal">{{ selectedPromo.title }}</h2>
|
||||
@ -2155,4 +2185,17 @@ function clearNavigation() {
|
||||
.nav-destination { color: #e8eaed; }
|
||||
.nav-btn-close { background: #3c4043; color: #bdc1c6; }
|
||||
}
|
||||
|
||||
.sheet-fav-pos {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 6px;
|
||||
z-index: 10;
|
||||
}
|
||||
.promo-modal-fav {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
left: 15px;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user