修改未完成

This commit is contained in:
rain
2026-07-13 17:31:05 +08:00
parent 965fff1621
commit 355f47976a
95 changed files with 1112 additions and 721 deletions
@@ -1,13 +1,14 @@
<!-- 页面编号G-01用途我的家谱列表视觉基准已由用户验收地基迁移不得改变可见效果 -->
<template>
<view class="page-shell genealogy-index">
<image
class="page-paper-texture"
src="/static/assets/backgrounds/paper-rice-texture-v2.jpg"
src="/static/assets/foundation/opaque/page-paper.jpg"
mode="scaleToFill"
/>
<image
class="page-footer-landscape"
src="/static/assets/backgrounds/footer-mountain-bamboo.png"
src="/static/assets/foundation/transparent/footer-mountain-bamboo.png"
mode="scaleToFill"
/>
<PageHeader
@@ -28,14 +29,14 @@
<view class="current-slip" @click="openGenealogy(currentGenealogy)">
<image
class="current-frame"
src="/static/assets/backgrounds/genealogy-current-slip-frame.png"
src="/static/assets/modules/genealogy/transparent/current-slip-frame.png"
mode="scaleToFill"
/>
<view class="current-summary">
<view class="current-seal">
<image
class="current-seal-frame"
src="/static/assets/icons/genealogy/seal-current-frame-v1.png"
src="/static/assets/modules/genealogy/transparent/current-seal-frame.png"
mode="scaleToFill"
/>
<text class="current-seal-title">家谱</text>
@@ -47,7 +48,7 @@
<view class="current-meta-item">
<image
class="current-meta-icon"
src="/static/assets/icons/common/location-v1.png"
src="/static/assets/foundation/transparent/meta-location.png"
mode="aspectFit"
/>
<text class="current-meta-item-text">{{
@@ -57,7 +58,7 @@
<view class="current-meta-item">
<image
class="current-meta-icon"
src="/static/assets/icons/common/member-meta-v1.png"
src="/static/assets/foundation/transparent/meta-member.png"
mode="aspectFit"
/>
<text class="current-meta-item-text"
@@ -67,7 +68,7 @@
<view class="current-meta-item">
<image
class="current-meta-icon"
src="/static/assets/icons/common/admin-v1.png"
src="/static/assets/foundation/transparent/meta-admin.png"
mode="aspectFit"
/>
<text class="current-meta-item-text">管理员</text>
@@ -89,7 +90,7 @@
<image
class="section-divider"
src="/static/assets/backgrounds/genealogy-section-divider-v2.png"
src="/static/assets/modules/genealogy/transparent/section-divider.png"
mode="scaleToFill"
/>
@@ -120,18 +121,18 @@
<view class="create-action" @click="createGenealogy">
<image
class="create-cloud"
src="/static/assets/icons/action/create-cloud-v2.png"
src="/static/assets/modules/genealogy/transparent/create-cloud.png"
mode="aspectFit"
/>
<image
class="create-icon"
src="/static/assets/icons/action/add-v2.png"
src="/static/assets/modules/genealogy/transparent/add.png"
mode="aspectFit"
/>
<text>新建家谱</text>
<image
class="create-cloud create-cloud--right"
src="/static/assets/icons/action/create-cloud-v2.png"
src="/static/assets/modules/genealogy/transparent/create-cloud.png"
mode="aspectFit"
/>
</view>
@@ -145,7 +146,7 @@
<view class="empty-primary" @click="createGenealogy">
<image
class="create-icon"
src="/static/assets/icons/action/add-v2.png"
src="/static/assets/modules/genealogy/transparent/add.png"
mode="aspectFit"
/>
<text>新建家谱</text>
@@ -185,39 +186,39 @@ const shortcuts = [
{
key: "tree",
label: "世系图",
icon: "/static/assets/icons/genealogy/tree-v2.png",
icon: "/static/assets/modules/genealogy/transparent/shortcut-tree.png",
},
{
key: "members",
label: "成员",
icon: "/static/assets/icons/genealogy/members-v2.png",
icon: "/static/assets/modules/genealogy/transparent/shortcut-members.png",
},
{
key: "poem",
label: "字辈诗",
icon: "/static/assets/icons/genealogy/generation-poem-v2.png",
icon: "/static/assets/modules/genealogy/transparent/shortcut-generation-poem.png",
},
{
key: "applications",
label: "申请审核",
icon: "/static/assets/icons/genealogy/application-v2.png",
icon: "/static/assets/modules/genealogy/transparent/shortcut-application.png",
},
];
const openGenealogy = (genealogy) =>
uni.navigateTo({ url: `/pages/genealogy/detail?id=${genealogy.id}` });
uni.navigateTo({ url: `/pages/genealogy/g05-genealogy-overview?id=${genealogy.id}` });
const createGenealogy = () =>
uni.navigateTo({ url: "/pages/genealogy/create" });
const applyToJoin = () => uni.navigateTo({ url: "/pages/genealogy/search" });
uni.navigateTo({ url: "/pages/genealogy/g03-create-genealogy" });
const applyToJoin = () => uni.navigateTo({ url: "/pages/genealogy/g06-search-genealogies" });
const toNotifications = () =>
uni.navigateTo({ url: "/pages/notification/index" });
uni.navigateTo({ url: "/pages/notification/n01-message-center" });
const openShortcut = (key) => {
const paths = {
tree: "/pages/tree/index",
members: `/pages/genealogy/detail?id=${currentGenealogy.value.id}`,
poem: "/pages/content/list?type=poem",
applications: "/pages/genealogy/applications",
tree: "/pages/tree/t01-tree-overview",
members: `/pages/genealogy/g05-genealogy-overview?id=${currentGenealogy.value.id}`,
poem: "/pages/skeleton/content-list-skeleton?type=poem",
applications: "/pages/genealogy/g10-application-review",
};
uni.navigateTo({ url: paths[key] });
};
@@ -1,3 +1,4 @@
<!-- 页面编号G-03用途创建家谱表单 -->
<template>
<view class="page-shell create-page">
<PageHeader title="创建家谱" />
@@ -49,7 +50,7 @@ const submit = async () => {
}
const created = await appApi.createGenealogy({ ...form })
genealogyContext.setCurrentGenealogyId(created.id)
uni.redirectTo({ url: `/pages/lineage/first-person?genealogyId=${created.id}` })
uni.redirectTo({ url: `/pages/genealogy/g04-first-ancestor?genealogyId=${created.id}` })
}
</script>
+61
View File
@@ -0,0 +1,61 @@
<!-- 页面编号G-04用途创建家谱后的始祖录入 -->
<template>
<view class="page-shell first-person-page">
<PageHeader title="录入首代人物" />
<view class="form-paper">
<view class="section-title">家谱从这一位开始</view>
<text class="form-note">可先录入姓名世代和简要生平其他资料后续随时补充</text>
<view class="field-row"><text>姓名</text><input v-model="form.personName" maxlength="20" placeholder="请输入首代姓名" placeholder-class="placeholder" /></view>
<view class="field-row"><text>世代</text><text class="fixed-value">第一世</text></view>
<view class="field-row"><text>出生日期</text><input v-model="form.birthDate" placeholder="如:1940年" placeholder-class="placeholder" /></view>
<view class="intro-field"><text>生平简述</text><textarea v-model="form.introduction" maxlength="200" placeholder="可选,记录家训、迁徙或重要经历" placeholder-class="placeholder" /></view>
</view>
<view class="bottom-action"><button class="primary-button" :loading="isSubmitting" :disabled="isSubmitting" @click="submit">保存并查看世系树</button></view>
</view>
</template>
<script setup>
import { reactive, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import PageHeader from '@/components/PageHeader.vue'
import { appApi } from '@/utils/api.js'
import { genealogyContext } from '@/utils/genealogy-context.js'
const genealogyId = ref('')
const isSubmitting = ref(false)
const form = reactive({ personName: '', generationNo: 1, generationName: '一世', sex: '0', birthDate: '', introduction: '' })
onLoad((query) => {
genealogyId.value = query.genealogyId || genealogyContext.getCurrentGenealogyId()
if (genealogyId.value) genealogyContext.setCurrentGenealogyId(genealogyId.value)
})
const submit = async () => {
if (!genealogyId.value) { uni.showToast({ title: '未找到当前家谱', icon: 'none' }); return }
if (!form.personName.trim()) { uni.showToast({ title: '请填写首代姓名', icon: 'none' }); return }
isSubmitting.value = true
try {
const person = await appApi.createPerson(genealogyId.value, { ...form, personName: form.personName.trim() })
uni.redirectTo({ url: `/pages/tree/t01-tree-overview?genealogyId=${genealogyId.value}&selectedId=${person.id}` })
} catch (error) {
uni.showToast({ title: error.message || '保存失败,请稍后重试', icon: 'none' })
} finally {
isSubmitting.value = false
}
}
</script>
<style scoped lang="scss">
.first-person-page { padding-bottom: 136rpx; }
.form-paper { margin: 28rpx; padding: 34rpx 30rpx; border: 1rpx solid $gold-soft; border-radius: 22rpx; background: $paper-white; }
.form-note { display: block; margin-top: 14rpx; color: $ink-muted; font-size: 23rpx; line-height: 1.65; }
.field-row { display: flex; align-items: center; min-height: 104rpx; border-bottom: 1rpx solid #eadfc9; }
.field-row text { width: 150rpx; color: $ink-muted; font-size: 28rpx; }
.field-row input { flex: 1; color: $ink; font-size: 29rpx; }
.fixed-value { color: $brand-red !important; }
.intro-field { padding-top: 30rpx; }
.intro-field > text { display: block; color: $ink-muted; font-size: 28rpx; }
.intro-field textarea { width: 100%; height: 180rpx; margin-top: 18rpx; color: $ink; font-size: 27rpx; line-height: 1.6; }
.placeholder { color: #b7aa97; }
.bottom-action { position: fixed; right: 0; bottom: 0; left: 0; padding: 20rpx 28rpx calc(20rpx + env(safe-area-inset-bottom)); background: #fffaf0; border-top: 1rpx solid $gold-soft; }
</style>
@@ -1,3 +1,4 @@
<!-- 页面编号G-05用途家谱总览 -->
<template>
<view class="page-shell detail-page">
<PageHeader title="家谱总览" action="管理" @action="showSoon" />
@@ -52,10 +53,10 @@ const loadGenealogy = async (id) => {
}
onLoad((query) => loadGenealogy(query.id))
const toTree = () => uni.navigateTo({ url: `/pages/tree/index?genealogyId=${genealogyId.value}` })
const toFirstPerson = () => uni.navigateTo({ url: `/pages/lineage/first-person?genealogyId=${genealogyId.value}` })
const toFamily = () => uni.reLaunch({ url: '/pages/family/index' })
const toApplications = () => uni.navigateTo({ url: `/pages/genealogy/applications?genealogyId=${genealogyId.value}` })
const toTree = () => uni.navigateTo({ url: `/pages/tree/t01-tree-overview?genealogyId=${genealogyId.value}` })
const toFirstPerson = () => uni.navigateTo({ url: `/pages/genealogy/g04-first-ancestor?genealogyId=${genealogyId.value}` })
const toFamily = () => uni.reLaunch({ url: '/pages/family/f01-family-feed' })
const toApplications = () => uni.navigateTo({ url: `/pages/genealogy/g10-application-review?genealogyId=${genealogyId.value}` })
const showSoon = () => uni.showToast({ title: '该模块将在后续阶段接入', icon: 'none' })
</script>
@@ -1,3 +1,4 @@
<!-- 页面编号G-06用途公开家谱搜索 -->
<template>
<view class="page-shell search-page">
<PageHeader title="查找家谱" />
@@ -1,3 +1,4 @@
<!-- 页面编号G-10用途管理员入谱申请审核 -->
<template>
<view class="page-shell applications-page">
<PageHeader title="入谱审核" action="审核说明" @action="showHelp" />