Files
vmall/apps/admin/app.vue
T
Chengdong ZhangandCursor a46148adcf Add Chatty landing page with SaaS plan option selection
- /chatty landing with catalog-backed SaaS plans and an independent
  deployment enquiry form (sales_enquiries table, rate-limited
  POST /api/enquiries, admin review page)
- /chatty/buy lets buyers pick term, users and storage from the plan's
  catalog SKUs (plan/term_months/users/storage_gb attributes); the
  selection is kept in the URL and only the chosen SKU goes to the cart
- Recognise Chatty orders by shop on payment and success pages
- Clear the checkout idempotency key after success or a 409
- Demo seed grid of option SKUs, docs and OpenSpec specs

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-30 16:19:55 +08:00

83 lines
3.1 KiB
Vue

<script setup lang="ts">
const session = useSessionStore();
const { locale, locales, setLocale } = useI18n();
const route = useRoute();
const { boot } = useAccent();
onMounted(() => {
session.hydrate();
boot();
});
const isAuthPage = computed(() => route.path === "/login");
const navItems = [
{ to: "/", label: "nav.dashboard" },
{ to: "/users", label: "nav.users" },
{ to: "/shops", label: "nav.shops" },
{ to: "/orders", label: "nav.orders" },
{ to: "/payments", label: "nav.payments" },
{ to: "/payment-channels", label: "nav.paymentChannels" },
{ to: "/aftersales", label: "nav.aftersales" },
{ to: "/reviews", label: "nav.reviews" },
{ to: "/content", label: "nav.content" },
{ to: "/brands", label: "nav.brands" },
{ to: "/currencies", label: "nav.currencies" },
{ to: "/points-products", label: "nav.pointsProducts" },
{ to: "/points-orders", label: "nav.pointsOrders" },
{ to: "/withdrawals", label: "nav.withdrawals" },
{ to: "/settlements", label: "nav.settlements" },
{ to: "/merchant-applications", label: "nav.merchantApplications" },
{ to: "/enquiries", label: "nav.enquiries" },
{ to: "/member-levels", label: "nav.memberLevels" },
];
</script>
<template>
<div v-if="isAuthPage" class="bg-bg text-text min-h-screen font-sans">
<NuxtPage />
</div>
<div v-else class="bg-bg text-text min-h-screen font-sans md:flex">
<aside
class="border-border bg-surface w-full shrink-0 border-b p-4 md:min-h-screen md:w-60 md:border-r md:border-b-0"
>
<div class="text-primary mb-6 text-lg font-bold">{{ $t("common.appName") }} · Admin</div>
<nav class="grid gap-1" aria-label="Admin navigation">
<NuxtLink
v-for="item in navItems"
:key="item.to"
:to="item.to"
class="text-muted hover:bg-primary-soft hover:text-primary rounded-md px-3 py-2 text-sm font-medium transition-colors"
:class="route.path === item.to ? 'bg-primary-soft text-primary' : ''"
>
{{ $t(item.label) }}
</NuxtLink>
</nav>
</aside>
<main class="min-w-0 flex-1">
<header
class="border-border bg-surface flex flex-wrap items-center justify-end gap-3 border-b px-4 py-3 md:px-6"
>
<select
:value="locale"
class="border-border bg-surface text-text focus:border-primary focus:outline-primary/30 rounded-md border px-3 py-2 text-sm focus:outline-2"
:aria-label="$t('common.language')"
@change="setLocale(($event.target as HTMLSelectElement).value as 'en' | 'zh')"
>
<option v-for="l in locales" :key="l.code" :value="l.code">{{ l.name }}</option>
</select>
<VAccentSwatch />
<template v-if="session.isLoggedIn">
<span class="text-muted text-sm">{{ session.user?.display_name }}</span>
<VBtn size="sm" @click="session.logout()">{{ $t("common.logout") }}</VBtn>
</template>
<VBtn v-else size="sm" variant="primary" @click="navigateTo('/login')">{{
$t("common.login")
}}</VBtn>
</header>
<div class="mx-auto w-full max-w-7xl px-4 md:px-6">
<NuxtPage />
</div>
</main>
</div>
</template>