Files
james 68317c2040 feat(admin): manage points products and redemptions
Platform operators get a points catalog screen (create, edit, publish and
unpublish products with localized names, points price, stock, and ordering) and
a redemption screen that lists orders and moves pending ones to fulfilled or
cancelled. Both are reachable from the console navigation.
2026-09-18 12:43:00 +00:00

45 lines
1.6 KiB
Vue

<script setup lang="ts">
const session = useSessionStore();
const { locale, locales, setLocale } = useI18n();
const route = useRoute();
onMounted(() => session.hydrate());
const isAuthPage = computed(() => route.path === "/login");
</script>
<template>
<div v-if="isAuthPage">
<NuxtPage />
</div>
<div v-else class="auth-layout">
<aside>
<div class="brand">{{ $t("common.appName") }} · Admin</div>
<NuxtLink to="/">{{ $t("nav.dashboard") }}</NuxtLink>
<NuxtLink to="/users">{{ $t("nav.users") }}</NuxtLink>
<NuxtLink to="/shops">{{ $t("nav.shops") }}</NuxtLink>
<NuxtLink to="/orders">{{ $t("nav.orders") }}</NuxtLink>
<NuxtLink to="/currencies">{{ $t("nav.currencies") }}</NuxtLink>
<NuxtLink to="/points-products">{{ $t("nav.pointsProducts") }}</NuxtLink>
<NuxtLink to="/points-orders">{{ $t("nav.pointsOrders") }}</NuxtLink>
</aside>
<main>
<div class="main-head">
<select
:value="locale"
: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>
<template v-if="session.isLoggedIn">
<span class="muted">{{ session.user?.display_name }}</span>
<button class="btn sm" @click="session.logout()">{{ $t("common.logout") }}</button>
</template>
<NuxtLink v-else to="/login" class="btn sm primary">{{ $t("common.login") }}</NuxtLink>
</div>
<NuxtPage />
</main>
</div>
</template>