Shop: duration slider on services, times fetched per service and length
Service cards step through their lengths with a slider and the price follows. The time picker loads bookable times for the chosen length and the months on screen from GET /api/slots (a proxy to the shop hook in each app), and reloads when the basket's bookings change. Checkout, emails and the basket show each booking's own length. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
This commit is contained in:
parent
23df2ceced
commit
eac99b2abe
18 changed files with 479 additions and 210 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import type { CalendarEventRecord, ContentBlock, BlockBackground, BlockForeground, ItemRecord, SlotRecord } from '$shared/types';
|
||||
import type { CalendarEventRecord, ContentBlock, BlockBackground, BlockForeground, ItemRecord } from '$shared/types';
|
||||
import BackgroundWrapper from './BackgroundWrapper.svelte';
|
||||
import TextBlock from './TextBlock.svelte';
|
||||
import ImageTextBlock from './ImageTextBlock.svelte';
|
||||
|
|
@ -12,11 +12,10 @@
|
|||
import ShopBlock from './ShopBlock.svelte';
|
||||
import CheckoutBlock from './CheckoutBlock.svelte';
|
||||
|
||||
let { blocks = [], calendarEvents = [], items = [], slots = [] } = $props<{
|
||||
let { blocks = [], calendarEvents = [], items = [] } = $props<{
|
||||
blocks: ContentBlock[];
|
||||
calendarEvents?: CalendarEventRecord[];
|
||||
items?: ItemRecord[];
|
||||
slots?: SlotRecord[];
|
||||
}>();
|
||||
|
||||
function getBg(block: ContentBlock): BlockBackground {
|
||||
|
|
@ -47,7 +46,7 @@
|
|||
{:else if block.type === 'upcoming_calendar'}
|
||||
<UpcomingCalendarBlock data={block.data} events={calendarEvents} />
|
||||
{:else if block.type === 'shop'}
|
||||
<ShopBlock data={block.data} {items} {slots} />
|
||||
<ShopBlock data={block.data} {items} />
|
||||
{:else if block.type === 'checkout'}
|
||||
<CheckoutBlock data={block.data} />
|
||||
{/if}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue