Fix: Finalize AuthGuard translations, registration link, and restricted offers on map
This commit is contained in:
@ -22,7 +22,7 @@ const router = useRouter()
|
|||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
function goToRegister() {
|
function goToRegister() {
|
||||||
router.push('/register')
|
router.push({ path: '/login', query: { mode: 'register' } })
|
||||||
}
|
}
|
||||||
|
|
||||||
function goToLogin() {
|
function goToLogin() {
|
||||||
|
|||||||
@ -11,39 +11,44 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Card area with nav arrows -->
|
<!-- Card area with nav arrows wrapped in AuthGuard -->
|
||||||
<div class="sheet-card-area">
|
<AuthGuard
|
||||||
<button class="sheet-nav" @click="$emit('prev')" :disabled="coupons.length < 2">
|
:title="t('coupons.auth.title') || 'Ofertas Exclusivas'"
|
||||||
<span class="material-icons">chevron_left</span>
|
:message="t('coupons.auth.message') || 'Regístrate para ver todos los detalles de esta promoción y canjear tu código.'"
|
||||||
</button>
|
>
|
||||||
|
<div class="sheet-card-area">
|
||||||
|
<button class="sheet-nav" @click="$emit('prev')" :disabled="coupons.length < 2">
|
||||||
|
<span class="material-icons">chevron_left</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
<Transition name="carousel-slide" mode="out-in">
|
<Transition name="carousel-slide" mode="out-in">
|
||||||
<div
|
<div
|
||||||
v-if="currentPromo"
|
v-if="currentPromo"
|
||||||
:key="currentPromo.id"
|
:key="currentPromo.id"
|
||||||
class="sheet-card"
|
class="sheet-card"
|
||||||
:style="{ backgroundImage: `url(${getImageUrl(currentPromo.image_url, 'coupon')})` }"
|
:style="{ backgroundImage: `url(${getImageUrl(currentPromo.image_url, 'coupon')})` }"
|
||||||
@mouseenter="$emit('pause')"
|
@mouseenter="$emit('pause')"
|
||||||
@touchstart="$emit('pause')"
|
@touchstart="$emit('pause')"
|
||||||
@mouseleave="$emit('resume')"
|
@mouseleave="$emit('resume')"
|
||||||
>
|
>
|
||||||
<div class="sheet-card-overlay">
|
<div class="sheet-card-overlay">
|
||||||
<div class="sheet-info">
|
<div class="sheet-info">
|
||||||
<span class="sheet-biz-name">{{ currentPromo.business?.name || 'Local' }}</span>
|
<span class="sheet-biz-name">{{ currentPromo.business?.name || 'Local' }}</span>
|
||||||
<h3 class="sheet-promo-title">{{ currentPromo.title }}</h3>
|
<h3 class="sheet-promo-title">{{ currentPromo.title }}</h3>
|
||||||
<div class="sheet-actions">
|
<div class="sheet-actions">
|
||||||
<button class="sheet-cta" @click="$emit('promo-click', currentPromo)">{{ t('coupons.viewDetails') }}</button>
|
<button class="sheet-cta" @click="$emit('promo-click', currentPromo)">{{ t('coupons.viewDetails') }}</button>
|
||||||
<span v-if="currentPromo.discount_percentage" class="sheet-discount-tag">-{{ currentPromo.discount_percentage }}%</span>
|
<span v-if="currentPromo.discount_percentage" class="sheet-discount-tag">-{{ currentPromo.discount_percentage }}%</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Transition>
|
||||||
</Transition>
|
|
||||||
|
|
||||||
<button class="sheet-nav" @click="$emit('next')" :disabled="coupons.length < 2">
|
<button class="sheet-nav" @click="$emit('next')" :disabled="coupons.length < 2">
|
||||||
<span class="material-icons">chevron_right</span>
|
<span class="material-icons">chevron_right</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</AuthGuard>
|
||||||
|
|
||||||
<!-- Dots -->
|
<!-- Dots -->
|
||||||
<div class="sheet-dots" v-if="coupons.length > 1">
|
<div class="sheet-dots" v-if="coupons.length > 1">
|
||||||
@ -63,6 +68,7 @@
|
|||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { getImageUrl } from '@/utils/imageUrl'
|
import { getImageUrl } from '@/utils/imageUrl'
|
||||||
|
import AuthGuard from '@/components/common/AuthGuard.vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
|
|||||||
@ -148,7 +148,11 @@
|
|||||||
"active": "Active",
|
"active": "Active",
|
||||||
"offersCount": "{count} offer | {count} offers",
|
"offersCount": "{count} offer | {count} offers",
|
||||||
"viewDetails": "View details",
|
"viewDetails": "View details",
|
||||||
"restaurant": "Restaurant"
|
"restaurant": "Restaurant",
|
||||||
|
"auth": {
|
||||||
|
"title": "Exclusive Offers",
|
||||||
|
"message": "To view the details of this promotion, get your discount code and save on your purchases, register or log in now."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"taxi": {
|
"taxi": {
|
||||||
"title": "Transport Hub",
|
"title": "Transport Hub",
|
||||||
@ -196,7 +200,11 @@
|
|||||||
"contactOperator": "Contact the operator directly to confirm availability.",
|
"contactOperator": "Contact the operator directly to confirm availability.",
|
||||||
"bookWhatsapp": "Book via WhatsApp",
|
"bookWhatsapp": "Book via WhatsApp",
|
||||||
"callOperator": "Call Operator",
|
"callOperator": "Call Operator",
|
||||||
"errorLoading": "Could not load trip information"
|
"errorLoading": "Could not load trip information",
|
||||||
|
"auth": {
|
||||||
|
"title": "Explore Chiriquí without limits",
|
||||||
|
"message": "Register to book your trips, see detailed schedules and access exclusive group rates."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"busStop": {
|
"busStop": {
|
||||||
"loadingDetails": "Loading bus stop details...",
|
"loadingDetails": "Loading bus stop details...",
|
||||||
@ -237,6 +245,10 @@
|
|||||||
"commerce": "Commerce",
|
"commerce": "Commerce",
|
||||||
"tourism": "Tourism",
|
"tourism": "Tourism",
|
||||||
"drinks": "Drinks"
|
"drinks": "Drinks"
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
|
"title": "Exclusive places!",
|
||||||
|
"message": "To discover Chiriquí register or log in. Find the best hidden gems and direct offers."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"business": {
|
"business": {
|
||||||
@ -314,7 +326,8 @@
|
|||||||
"passMin8": "Minimum 8 characters",
|
"passMin8": "Minimum 8 characters",
|
||||||
"smartLocation": "Allow to detect my location automatically (Smart Location)",
|
"smartLocation": "Allow to detect my location automatically (Smart Location)",
|
||||||
"emailRegistered": "Email is already registered.",
|
"emailRegistered": "Email is already registered.",
|
||||||
"invalidCreds": "Incorrect email or password."
|
"invalidCreds": "Incorrect email or password.",
|
||||||
|
"loginLink": "Already have an account, log in"
|
||||||
},
|
},
|
||||||
"routesView": {
|
"routesView": {
|
||||||
"title": "Transport",
|
"title": "Transport",
|
||||||
|
|||||||
@ -150,7 +150,11 @@
|
|||||||
"active": "Activo",
|
"active": "Activo",
|
||||||
"offersCount": "{count} oferta | {count} ofertas",
|
"offersCount": "{count} oferta | {count} ofertas",
|
||||||
"viewDetails": "Ver detalles",
|
"viewDetails": "Ver detalles",
|
||||||
"restaurant": "Restaurante"
|
"restaurant": "Restaurante",
|
||||||
|
"auth": {
|
||||||
|
"title": "Ofertas Exclusivas",
|
||||||
|
"message": "Para ver los detalles de esta promoción, obtener tu código de descuento y ahorrar en tus compras, regístrate o accede ahora."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"taxi": {
|
"taxi": {
|
||||||
"title": "Centro de Transporte",
|
"title": "Centro de Transporte",
|
||||||
@ -198,7 +202,11 @@
|
|||||||
"contactOperator": "Contacta directamente al operador para confirmar disponibilidad.",
|
"contactOperator": "Contacta directamente al operador para confirmar disponibilidad.",
|
||||||
"bookWhatsapp": "Reservar por WhatsApp",
|
"bookWhatsapp": "Reservar por WhatsApp",
|
||||||
"callOperator": "Llamar al Operador",
|
"callOperator": "Llamar al Operador",
|
||||||
"errorLoading": "No se pudo cargar la información del viaje"
|
"errorLoading": "No se pudo cargar la información del viaje",
|
||||||
|
"auth": {
|
||||||
|
"title": "Explora Chiriquí sin límites",
|
||||||
|
"message": "Regístrate para reservar tus viajes, ver horarios detallados y acceder a tarifas grupales exclusivas."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"busStop": {
|
"busStop": {
|
||||||
"loadingDetails": "Cargando detalles de la parada...",
|
"loadingDetails": "Cargando detalles de la parada...",
|
||||||
@ -239,6 +247,10 @@
|
|||||||
"commerce": "Comercio",
|
"commerce": "Comercio",
|
||||||
"tourism": "Turismo",
|
"tourism": "Turismo",
|
||||||
"drinks": "Bebidas"
|
"drinks": "Bebidas"
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
|
"title": "¡Locales exclusivos!",
|
||||||
|
"message": "Para descubrir Chiriquí regístrate o accede. Encuentra los mejores rincones y ofertas directas."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"business": {
|
"business": {
|
||||||
@ -318,7 +330,8 @@
|
|||||||
"passMin8": "Mínimo 8 caracteres",
|
"passMin8": "Mínimo 8 caracteres",
|
||||||
"smartLocation": "Permitir detectar mi ubicación automáticamente (Smart Location)",
|
"smartLocation": "Permitir detectar mi ubicación automáticamente (Smart Location)",
|
||||||
"emailRegistered": "El correo ya está registrado.",
|
"emailRegistered": "El correo ya está registrado.",
|
||||||
"invalidCreds": "Correo o contraseña incorrectos."
|
"invalidCreds": "Correo o contraseña incorrectos.",
|
||||||
|
"loginLink": "Ya tengo cuenta, iniciar sesión"
|
||||||
},
|
},
|
||||||
"routesView": {
|
"routesView": {
|
||||||
"title": "Transporte",
|
"title": "Transporte",
|
||||||
|
|||||||
@ -12,6 +12,11 @@ const mounted = ref(false)
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
mounted.value = true
|
mounted.value = true
|
||||||
|
// Check if we should start in register mode
|
||||||
|
const mode = router.currentRoute.value.query.mode
|
||||||
|
if (mode === 'register') {
|
||||||
|
isLogin.value = false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const toggleAuth = () => {
|
const toggleAuth = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user