add business_owner
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<RouterLink
|
||||
:to="{ name: 'app-business-detail', params: { id: business.id } }"
|
||||
class="group flex h-full flex-col rounded-2xl border border-slate-200 bg-white p-6 text-center shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-border dark:bg-surface"
|
||||
class="group flex h-full flex-col rounded-xl border border-slate-200 bg-white p-4 text-center shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-border dark:bg-surface"
|
||||
:class="featured ? 'border-brand-500 ring-1 ring-brand-500/20' : ''"
|
||||
>
|
||||
<div
|
||||
class="mx-auto mb-4 flex h-16 w-16 items-center justify-center overflow-hidden rounded-full bg-brand-500/10 text-brand-600 transition group-hover:bg-brand-500/15 dark:text-brand-500"
|
||||
class="mx-auto mb-3 flex h-12 w-12 items-center justify-center overflow-hidden rounded-full bg-brand-500/10 text-brand-600 transition group-hover:bg-brand-500/15 dark:text-brand-500"
|
||||
>
|
||||
<img
|
||||
v-if="cover"
|
||||
@@ -14,42 +14,35 @@
|
||||
class="h-full w-full object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
<AppIcon v-else name="store" size="lg" />
|
||||
<AppIcon v-else name="store" size="md" />
|
||||
</div>
|
||||
|
||||
<h3 class="text-base font-bold text-slate-800 dark:text-text">{{ business.title }}</h3>
|
||||
<h3 class="text-sm font-bold text-slate-800 dark:text-text">{{ business.title }}</h3>
|
||||
|
||||
<BusinessRatingBadge
|
||||
class="mx-auto mt-2"
|
||||
class="mx-auto mt-1.5"
|
||||
:average-rating="business.averageRating"
|
||||
:review-count="business.reviewCount"
|
||||
/>
|
||||
|
||||
<p
|
||||
v-if="business.description"
|
||||
class="mt-2 line-clamp-3 min-h-[4.5rem] text-sm leading-7 text-slate-600 dark:text-muted"
|
||||
class="mt-1.5 line-clamp-2 text-xs leading-6 text-slate-600 dark:text-muted"
|
||||
>
|
||||
{{ business.description }}
|
||||
</p>
|
||||
<p v-else class="mt-2 min-h-[4.5rem] text-sm text-slate-400 dark:text-muted">—</p>
|
||||
|
||||
<p v-if="business.category" class="mt-3 text-xs font-medium text-brand-600 dark:text-brand-500">
|
||||
<p v-if="business.category" class="mt-2 text-[11px] font-medium text-brand-600 dark:text-brand-500">
|
||||
{{ business.category.title }}
|
||||
</p>
|
||||
|
||||
<p
|
||||
v-if="business.address"
|
||||
class="mt-2 flex items-center justify-center gap-1 text-xs text-slate-500 dark:text-muted"
|
||||
class="mt-1.5 flex items-center justify-center gap-1 text-[11px] text-slate-500 dark:text-muted"
|
||||
>
|
||||
<AppIcon name="map-pin" size="sm" class="shrink-0" />
|
||||
<span class="line-clamp-1">{{ business.address }}</span>
|
||||
</p>
|
||||
|
||||
<span
|
||||
class="mt-auto pt-5 text-sm font-semibold text-brand-600 transition group-hover:text-brand-700 dark:text-brand-500"
|
||||
>
|
||||
مشاهده و رزرو
|
||||
</span>
|
||||
</RouterLink>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
v-else
|
||||
:class="
|
||||
variant === 'featured'
|
||||
? 'grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3'
|
||||
? 'grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4'
|
||||
: 'grid grid-cols-1 gap-2'
|
||||
"
|
||||
>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
<div class="relative shadow-[0_20px_50px_-12px_rgba(0,0,0,0.18)]">
|
||||
<BusinessImageGallery
|
||||
:images="singleBusiness?.images"
|
||||
:images="landingBusiness?.images"
|
||||
:title="heroTitle"
|
||||
variant="hero"
|
||||
frame-extra-class="landing-hero-blob bg-slate-200"
|
||||
@@ -103,13 +103,13 @@ const emit = defineEmits<{
|
||||
}>();
|
||||
|
||||
const tenant = useTenantStore();
|
||||
const { singleBusiness } = storeToRefs(tenant);
|
||||
const { landingBusiness } = storeToRefs(tenant);
|
||||
|
||||
const heroTitle = computed(() => singleBusiness.value?.title ?? '');
|
||||
const heroTitle = computed(() => landingBusiness.value?.title ?? '');
|
||||
|
||||
const heroSubtitle = computed(() => singleBusiness.value?.subtitle?.trim() ?? '');
|
||||
const heroSubtitle = computed(() => landingBusiness.value?.subtitle?.trim() ?? '');
|
||||
|
||||
const heroDescription = computed(() => singleBusiness.value?.description?.trim() ?? '');
|
||||
const heroDescription = computed(() => landingBusiness.value?.description?.trim() ?? '');
|
||||
|
||||
const highlights: { label: string; icon: AppIconName }[] = [
|
||||
{ label: 'رضایت مشتریان', icon: 'shield' },
|
||||
|
||||
@@ -71,7 +71,7 @@ const gridClass = computed(() => {
|
||||
function serviceLink(item: LandingServiceItem) {
|
||||
if (!props.bookingEnabled) return '#services';
|
||||
return {
|
||||
name: 'app-business-detail',
|
||||
name: 'app-business-book',
|
||||
params: { id: item.businessId },
|
||||
hash: 'services',
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ const props = withDefaults(
|
||||
const router = useRouter();
|
||||
const auth = useAuthStore();
|
||||
const tenant = useTenantStore();
|
||||
const { singleBusinessId } = storeToRefs(tenant);
|
||||
const { landingBusinessId } = storeToRefs(tenant);
|
||||
|
||||
function scrollToServices() {
|
||||
const el = document.getElementById('services');
|
||||
@@ -55,7 +55,7 @@ function goToBooking() {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = singleBusinessId.value;
|
||||
const id = landingBusinessId.value;
|
||||
if (!id) {
|
||||
scrollToServices();
|
||||
return;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
class="overflow-hidden rounded-2xl bg-slate-100 shadow-[0_8px_30px_rgba(15,23,42,0.12)] dark:bg-surface-2 dark:shadow-black/30"
|
||||
>
|
||||
<BusinessImageGallery
|
||||
:images="singleBusiness?.images"
|
||||
:images="landingBusiness?.images"
|
||||
:title="businessTitle"
|
||||
variant="card"
|
||||
/>
|
||||
@@ -132,11 +132,11 @@ const emit = defineEmits<{
|
||||
}>();
|
||||
|
||||
const tenant = useTenantStore();
|
||||
const { singleBusiness } = storeToRefs(tenant);
|
||||
const { landingBusiness } = storeToRefs(tenant);
|
||||
|
||||
const businessTitle = computed(() => singleBusiness.value?.title ?? '');
|
||||
const businessSubtitle = computed(() => singleBusiness.value?.subtitle?.trim() ?? '');
|
||||
const aboutText = computed(() => singleBusiness.value?.description?.trim() ?? '');
|
||||
const businessTitle = computed(() => landingBusiness.value?.title ?? '');
|
||||
const businessSubtitle = computed(() => landingBusiness.value?.subtitle?.trim() ?? '');
|
||||
const aboutText = computed(() => landingBusiness.value?.description?.trim() ?? '');
|
||||
|
||||
const quickActions: {
|
||||
id: string;
|
||||
|
||||
@@ -80,23 +80,23 @@ import AppIcon from '@/components/ui/AppIcon.vue';
|
||||
import { useTenantStore } from '@/stores/tenant';
|
||||
|
||||
const tenant = useTenantStore();
|
||||
const { brand, singleBusiness, isSingleBusiness } = storeToRefs(tenant);
|
||||
const { brand, landingBusiness } = storeToRefs(tenant);
|
||||
|
||||
const contactPhone = computed(() => {
|
||||
if (isSingleBusiness.value && singleBusiness.value?.contactPhone) {
|
||||
return singleBusiness.value.contactPhone;
|
||||
if (landingBusiness.value?.contactPhone) {
|
||||
return landingBusiness.value.contactPhone;
|
||||
}
|
||||
return '021-12345678';
|
||||
});
|
||||
|
||||
const contactMobile = computed(() => {
|
||||
if (isSingleBusiness.value) return null;
|
||||
if (landingBusiness.value) return null;
|
||||
return '0912-123-4567';
|
||||
});
|
||||
|
||||
const address = computed(() => {
|
||||
if (isSingleBusiness.value && singleBusiness.value?.address) {
|
||||
return singleBusiness.value.address;
|
||||
if (landingBusiness.value?.address) {
|
||||
return landingBusiness.value.address;
|
||||
}
|
||||
return 'تهران، خیابان ولیعصر، پلاک ۱۲۳';
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user