Implements, verifies, and archives the three remaining Wave 2 changes from openspec/MIGRATION-PLAN.md. - add-wallet-settlement (P3): demo recharge, guarded withdrawal freeze and one-time admin review, paginated own fund entries, idempotent per-shop weekly/monthly settlement statements with commission rate and one-time payout confirmation. - add-merchant-onboarding (P5): personal/enterprise applications with one live application per user, guarded review with mandatory rejection reason, and transactional shop + owner provisioning returning one-time credentials; mall onboarding/status pages and an admin review console. - add-membership-messaging (P7): platform member levels, append-only growth accrual on order completion with guarded one-way leveling, order/shipment/ refund system messages with unread/read state and soft deletion, plus the mall header unread badge. Backend: migrations 0019-0023, new wallet, settlement, merchant_onboarding, membership and messaging modules, event hooks in order/fulfillment/aftersale, and integration suites for each. Shared contract extended and all three frontends updated; code indexes, domain docs, backend guidelines and the migration tracker synced. Verification: cargo test -p vmall-api green twice consecutively; mall, admin and shop-admin builds pass; browser smoke on every new surface; openspec validate --all --strict green (33 passed). The three changes share the @vmall/shared contract, the mall mock adapter and per-app locale/nav files, so they are committed together to keep every commit buildable.
80 lines
3.0 KiB
Vue
80 lines
3.0 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: "/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: "/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>
|