Seed communication-style scale, expose /api/v1/scales APIs, and wire Explore/Scale H5 pages for the P1 探索测试 path. Co-authored-by: Cursor <cursoragent@cursor.com>
43 lines
1.4 KiB
Vue
43 lines
1.4 KiB
Vue
<template>
|
|
<main class="page">
|
|
<h1>探索</h1>
|
|
<p class="sub">性格探索 · 探索测试 · 关系理解 · 个人画像</p>
|
|
<p v-if="error" class="err">{{ error }}</p>
|
|
<ul class="list">
|
|
<li><router-link to="/portrait">性格探索 / 个人画像</router-link></li>
|
|
<li><router-link to="/relation">关系理解</router-link></li>
|
|
<li v-for="s in scales" :key="s.slug">
|
|
<router-link :to="`/scales/${s.slug}`">{{ s.title }}</router-link>
|
|
<span class="desc">{{ s.description }}</span>
|
|
</li>
|
|
</ul>
|
|
</main>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { onMounted, ref } from 'vue'
|
|
import { api } from '../api/client'
|
|
|
|
const scales = ref<{ slug: string; title: string; description: string }[]>([])
|
|
const error = ref('')
|
|
|
|
onMounted(async () => {
|
|
try {
|
|
const res = await api.listScales()
|
|
scales.value = res.items || []
|
|
} catch (e) {
|
|
error.value = e instanceof Error ? e.message : '加载失败'
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<style scoped>
|
|
.page{padding:24px 16px}
|
|
h1{font-size:22px}
|
|
.sub{color:var(--yxg-sub);font-size:13px;margin:6px 0 16px}
|
|
.err{color:var(--yxg-pri);font-size:13px}
|
|
.list{background:#fff;border-radius:16px;padding:8px 16px;line-height:1.8;font-size:14px;color:#555}
|
|
.list a{color:inherit;text-decoration:none;font-weight:600}
|
|
.desc{display:block;font-size:12px;color:#aaa;font-weight:400;margin-bottom:8px}
|
|
</style>
|