修改完成55%

This commit is contained in:
2026-07-15 08:31:21 +08:00
parent 8c98936da5
commit 241a7af54c
98 changed files with 3269 additions and 782 deletions
+72 -3
View File
@@ -1,3 +1,72 @@
<!-- 页面编号T-07用途成员目录与搜索 -->
<template><ModulePage page-id="t07" /></template>
<script setup>import ModulePage from '@/components/ModulePage.vue'</script>
<!-- 页面编号T-07用途成员目录搜索空态与失败状态 -->
<template>
<view class="directory-page" :class="{ 'directory-state--list': directoryState === 'list', 'directory-state--empty': directoryState === 'empty', 'directory-state--error': directoryState === 'error' }">
<image class="directory-page__paper" src="/static/assets/foundation/opaque/page-paper.jpg" mode="aspectFill" />
<view class="directory-page__header"><PageHeader title="成员目录" /></view>
<view class="directory-search">
<image src="/static/assets/modules/genealogy/opaque/g06-search-input-wide.png" mode="scaleToFill" />
<input v-model="keyword" placeholder="按姓名、字辈或支系查找" placeholder-class="directory-placeholder" @confirm="searchMembers" />
<text @click="searchMembers">查找</text>
</view>
<view class="directory-content">
<template v-if="directoryState === 'list'">
<view class="directory-summary"><text>家谱成员</text><text>{{ filteredMembers.length }} · 按世代排列</text></view>
<view v-for="item in filteredMembers" :key="item.id" class="directory-card" @click="openMember(item)">
<image src="/static/assets/modules/genealogy/opaque/application-status-card.png" mode="scaleToFill" />
<view class="directory-card__copy"><text>{{ item.name }}</text><text> {{ item.generation }} · {{ item.generationName }} · {{ item.branch }}</text><text>{{ item.note }}</text></view>
</view>
</template>
<view v-else class="directory-state-card">
<image src="/static/assets/modules/genealogy/opaque/application-status-card.png" mode="scaleToFill" />
<view><text>{{ directoryState === 'empty' ? '没有找到相关成员' : '成员目录暂不可用' }}</text><text>{{ directoryState === 'empty' ? '换一个姓名、字辈或支系关键词再试。' : '请从当前家谱重新进入,成员资料不会受到影响。' }}</text></view>
</view>
</view>
</view>
</template>
<script setup>
import { computed, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import PageHeader from '@/components/PageHeader.vue'
const genealogyId = ref('')
const keyword = ref('')
const directoryState = ref('loading')
const members = [
{ id: 101, name: '汤文远', generation: 12, generationName: '文字辈', branch: '主支', note: '始祖 · 档案完整' },
{ id: 102, name: '汤正国', generation: 13, generationName: '正字辈', branch: '长房', note: '家谱管理员' },
{ id: 103, name: '汤正华', generation: 13, generationName: '正字辈', branch: '二房', note: '资料待补充' }
]
const filteredMembers = computed(() => {
const value = keyword.value.trim()
if (!value) return members
return members.filter((item) => `${item.name}${item.generationName}${item.branch}`.includes(value))
})
onLoad((query) => { genealogyId.value = query.genealogyId || ''; directoryState.value = query.state === 'empty' ? 'empty' : query.state === 'error' ? 'error' : 'list' })
const searchMembers = () => { directoryState.value = filteredMembers.value.length ? 'list' : 'empty' }
const openMember = (item) => uni.navigateTo({ url: `/pages/tree/t03-member-profile?genealogyId=${genealogyId.value}&personId=${item.id}` })
</script>
<style scoped lang="scss">
.directory-page { position: relative; min-height: 100vh; overflow: hidden; background: $paper; }
.directory-page__paper { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.directory-page__header, .directory-search, .directory-content { position: relative; z-index: 2; }
.directory-search { width: calc(100% - 48rpx); height: 84rpx; margin: 20rpx auto 0; }
.directory-search image { position: absolute; inset: 0; width: 100%; height: 100%; }
.directory-search input { position: absolute; top: 0; right: 110rpx; bottom: 0; left: 26rpx; z-index: 1; height: 84rpx; color: $ink; font-size: 22rpx; line-height: 84rpx; }
.directory-search > text { position: absolute; top: 29rpx; right: 28rpx; z-index: 1; color: $brand-red; font-size: 22rpx; font-weight: 700; }
.directory-placeholder { color: #a79884; }
.directory-content { padding: 22rpx 24rpx 50rpx; }
.directory-summary { display: flex; justify-content: space-between; margin: 0 8rpx 18rpx; }
.directory-summary text:first-child { color: $ink; font-family: 'STKaiti', 'KaiTi', serif; font-size: 29rpx; font-weight: 700; }
.directory-summary text:last-child { color: $ink-muted; font-size: 20rpx; }
.directory-card, .directory-state-card { position: relative; width: 100%; height: calc((100vw - 24px) * .34286); min-height: 220rpx; margin-bottom: 16rpx; }
.directory-card > image, .directory-state-card > image { position: absolute; inset: 0; width: 100%; height: 100%; }
.directory-card__copy { position: absolute; inset: 20% 9%; z-index: 1; }
.directory-card__copy text { display: block; }
.directory-card__copy text:first-child { color: $ink; font-family: 'STKaiti', 'KaiTi', serif; font-size: 29rpx; font-weight: 700; }
.directory-card__copy text:nth-child(2) { margin-top: 10rpx; color: $ink-muted; font-size: 21rpx; }
.directory-card__copy text:last-child { margin-top: 9rpx; color: $brand-red; font-size: 19rpx; }
.directory-state-card { margin-top: 70rpx; }
.directory-state-card > view { position: absolute; inset: 24% 12%; z-index: 1; text-align: center; }
.directory-state-card text { display: block; }
.directory-state-card text:first-child { color: $ink; font-family: 'STKaiti', 'KaiTi', serif; font-size: 30rpx; font-weight: 700; }
.directory-state-card text:last-child { margin-top: 14rpx; color: $ink-muted; font-size: 21rpx; line-height: 1.5; }
</style>