完成40%

This commit is contained in:
rain
2026-07-14 17:36:39 +08:00
parent 1015e60ff7
commit 8c98936da5
151 changed files with 5132 additions and 351 deletions
+225 -39
View File
@@ -139,21 +139,67 @@
</view>
</template>
<view v-else class="state-panel state-panel--empty">
<view class="empty-scroll"><text>待立家谱</text></view>
<text class="state-title">从第一位家人开始</text>
<text class="state-copy">为家族留下可传承的名字故事与记忆</text>
<view class="empty-primary" @click="createGenealogy">
<view v-else class="genealogy-empty-state">
<view class="empty-panel">
<image
class="create-icon"
src="/static/assets/modules/genealogy/transparent/add.png"
mode="aspectFit"
class="empty-panel__skin"
src="/static/assets/modules/genealogy/opaque/g01-empty-panel.png"
mode="scaleToFill"
/>
<text>新建家谱</text>
<view class="empty-panel__content">
<view class="empty-seal">
<image
class="empty-seal__skin"
src="/static/assets/modules/genealogy/transparent/current-seal-frame.png"
mode="scaleToFill"
/>
<text class="empty-seal__text">家谱</text>
</view>
<text class="empty-title">还没有加入任何家谱</text>
<text class="empty-copy">先为自己的家族立一部谱或搜索家谱申请加入</text>
<image
class="empty-divider"
src="/static/assets/modules/genealogy/transparent/section-divider.png"
mode="scaleToFill"
/>
<view
class="empty-create-action"
hover-class="action-hover"
@click="createGenealogy"
>
<image
class="empty-create-action__skin"
src="/static/assets/foundation/opaque/a01-primary-button.png"
mode="scaleToFill"
/>
<view class="empty-create-action__content">
<image
class="empty-create-action__icon"
src="/static/assets/modules/genealogy/transparent/add.png"
mode="aspectFit"
/>
<text>新建家谱</text>
<image
class="empty-create-action__cloud"
src="/static/assets/modules/genealogy/transparent/create-cloud.png"
mode="aspectFit"
/>
</view>
</view>
<view
class="empty-search-action"
hover-class="action-hover"
@click="applyToJoin"
>
<image
class="empty-search-action__skin"
src="/static/assets/foundation/opaque/a01-secondary-button.png"
mode="scaleToFill"
/>
<text class="empty-search-action__copy">搜索并申请加入</text>
</view>
</view>
</view>
<view class="empty-secondary" @click="applyToJoin"
><text>搜索并申请加入</text></view
>
</view>
</view>
@@ -163,6 +209,7 @@
<script setup>
import { computed, ref } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import AppTabbar from "@/components/AppTabbar.vue";
import GenealogyCard from "@/components/GenealogyCard.vue";
import PageHeader from "@/components/PageHeader.vue";
@@ -170,10 +217,35 @@ import { genealogies, notifications } from "@/data/mock.js";
const isLoading = ref(false);
const list = ref(genealogies);
const forceEmptyState = ref(false);
const isEmptyStateRoute = () => {
if (typeof location !== "undefined") {
const query = new URLSearchParams(location.hash.split("?")[1] || "");
return query.get("state") === "empty";
}
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
return currentPage?.options?.state === "empty";
};
const syncEmptyStateFromRoute = () => {
forceEmptyState.value = isEmptyStateRoute();
};
onLoad(() => {
syncEmptyStateFromRoute();
});
onShow(() => {
syncEmptyStateFromRoute();
});
const unreadCount = computed(
() => notifications.filter((item) => item.unread).length,
);
const hasGenealogies = computed(() => list.value.length > 0);
const hasGenealogies = computed(() => !forceEmptyState.value && list.value.length > 0);
const createdGenealogies = computed(() =>
list.value.filter((item, index) => index === 0),
);
@@ -440,9 +512,7 @@ const openShortcut = (key) => {
margin-top: 18rpx;
}
.create-action,
.empty-primary,
.empty-secondary {
.create-action {
display: flex;
min-height: 96rpx;
align-items: center;
@@ -464,18 +534,6 @@ const openShortcut = (key) => {
letter-spacing: 3rpx;
}
.empty-primary {
width: 360rpx;
margin: 32rpx auto 0;
border: 2rpx solid $brand-red;
border-radius: 48rpx;
background: rgba(255, 249, 238, 0.94);
color: $brand-red;
font-family: serif;
font-weight: 700;
letter-spacing: 3rpx;
}
.create-icon {
width: 38rpx;
height: 38rpx;
@@ -527,8 +585,7 @@ const openShortcut = (key) => {
line-height: 1.7;
}
.loading-seal,
.empty-scroll {
.loading-seal {
border: 2rpx solid $gold;
}
.loading-seal {
@@ -537,22 +594,151 @@ const openShortcut = (key) => {
border-radius: 50%;
}
.empty-scroll {
.genealogy-empty-state {
min-height: 856rpx;
}
.empty-panel {
position: relative;
height: 856rpx;
}
.empty-panel__skin {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.empty-panel__content {
position: relative;
z-index: 1;
display: flex;
width: 154rpx;
height: 196rpx;
height: 100%;
flex-direction: column;
align-items: center;
box-sizing: border-box;
padding: 58rpx 60rpx 54rpx;
text-align: center;
}
.empty-seal {
position: relative;
display: flex;
width: 92rpx;
height: 142rpx;
align-items: center;
justify-content: center;
color: $gold;
font-family: serif;
font-size: 33rpx;
}
.empty-seal__skin {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}
.empty-seal__text {
position: relative;
z-index: 1;
color: #fff7e7;
font-family: "STKaiti", "KaiTi", serif;
font-size: 32rpx;
font-weight: 700;
letter-spacing: 2rpx;
writing-mode: vertical-rl;
}
.empty-secondary {
.empty-title {
display: block;
margin-top: 24rpx;
color: #392719;
font-family: "STKaiti", "KaiTi", serif;
font-size: 40rpx;
font-weight: 700;
letter-spacing: 2rpx;
}
.empty-copy {
display: block;
min-height: 74rpx;
margin-top: 14rpx;
color: #786654;
font-size: 24rpx;
line-height: 1.75;
}
.empty-divider {
display: block;
width: 100%;
height: 30rpx;
margin-top: 16rpx;
color: $ink-muted;
font-size: 27rpx;
}
.empty-create-action,
.empty-search-action {
position: relative;
display: flex;
width: 468rpx;
height: 104rpx;
align-items: center;
justify-content: center;
overflow: hidden;
}
.empty-create-action {
margin-top: 20rpx;
}
.empty-search-action {
margin-top: 18rpx;
}
.empty-create-action__skin,
.empty-search-action__skin {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}
.empty-create-action__content {
position: relative;
z-index: 1;
display: flex;
align-items: center;
color: #fff9ec;
font-family: "STKaiti", "KaiTi", serif;
font-size: 31rpx;
font-weight: 700;
letter-spacing: 4rpx;
}
.empty-create-action__icon {
width: 34rpx;
height: 34rpx;
margin-right: 8rpx;
}
.empty-create-action__cloud {
width: 46rpx;
height: 24rpx;
margin-left: 8rpx;
}
.empty-search-action__copy {
position: relative;
z-index: 1;
color: #7b4e24;
font-family: "STKaiti", "KaiTi", serif;
font-size: 29rpx;
font-weight: 700;
letter-spacing: 3rpx;
}
.action-hover {
opacity: 0.82;
}
@media screen and (max-width: 340px) {