修改部分样式
This commit is contained in:
@@ -45,9 +45,14 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else-if="contextInvalidated" class="state-panel state-panel--context">
|
||||
<view
|
||||
v-else-if="contextInvalidated"
|
||||
class="state-panel state-panel--context"
|
||||
>
|
||||
<text class="state-title">当前家谱已不可用</text>
|
||||
<text class="state-copy">权限或家谱列表可能已经变化,请明确选择仍可访问的家谱。</text>
|
||||
<text class="state-copy"
|
||||
>权限或家谱列表可能已经变化,请明确选择仍可访问的家谱。</text
|
||||
>
|
||||
<AppButton block label="选择可用家谱" @click="openSwitcher" />
|
||||
</view>
|
||||
|
||||
@@ -89,7 +94,9 @@
|
||||
src="/static/assets/foundation/transparent/meta-admin.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<text class="current-meta-item-text">{{ currentRoleLabel }}</text>
|
||||
<text class="current-meta-item-text">{{
|
||||
currentRoleLabel
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -259,7 +266,11 @@
|
||||
<view class="add-dialog__heading">
|
||||
<text class="dialog-title">添加家谱</text>
|
||||
<text class="dialog-copy">建议先搜索已有家谱,避免重复创建</text>
|
||||
<text v-if="quota" class="dialog-copy">{{ quota.createRemaining === -1 ? '当前可继续创建家谱' : `还可创建 ${quota.createRemaining} 部家谱` }}</text>
|
||||
<text v-if="quota" class="dialog-copy">{{
|
||||
quota.createRemaining === -1
|
||||
? "当前可继续创建家谱"
|
||||
: `还可创建 ${quota.createRemaining} 部家谱`
|
||||
}}</text>
|
||||
<view
|
||||
class="add-dialog__close"
|
||||
role="button"
|
||||
@@ -368,7 +379,12 @@ import {
|
||||
isRequestCancelled,
|
||||
} from "@/utils/api.js";
|
||||
import { genealogyContext } from "@/utils/genealogy-context.js";
|
||||
import { consumeNavigationResult, handleBackPress, openPage, runBackGuard } from "@/utils/navigation.js";
|
||||
import {
|
||||
consumeNavigationResult,
|
||||
handleBackPress,
|
||||
openPage,
|
||||
runBackGuard,
|
||||
} from "@/utils/navigation.js";
|
||||
|
||||
const isLoading = ref(false);
|
||||
const hasError = ref(false);
|
||||
@@ -395,9 +411,7 @@ let presentationState = "default";
|
||||
let skipNextShowRefresh = true;
|
||||
|
||||
const syncEmptyStateFromRoute = (query = {}) => {
|
||||
presentationState = ["empty", "loading", "error"].includes(
|
||||
query?.state,
|
||||
)
|
||||
presentationState = ["empty", "loading", "error"].includes(query?.state)
|
||||
? query.state
|
||||
: "default";
|
||||
forceEmptyState.value = presentationState === "empty";
|
||||
@@ -413,8 +427,7 @@ const reconcilePageGenealogyContext = () => {
|
||||
genealogyContext.reconcileCurrentGenealogyId(
|
||||
availableIds,
|
||||
requestedGenealogyId.value,
|
||||
) ||
|
||||
null;
|
||||
) || null;
|
||||
contextReconcileFailed.value = false;
|
||||
contextInvalidated.value = Boolean(
|
||||
availableIds.length &&
|
||||
@@ -469,7 +482,8 @@ const loadUnreadCount = async () => {
|
||||
const count = await appApi.getUnreadNotificationCount({
|
||||
requestController: unreadRequestController,
|
||||
});
|
||||
if (pageActive && generation === unreadLoadGeneration) unreadCount.value = count;
|
||||
if (pageActive && generation === unreadLoadGeneration)
|
||||
unreadCount.value = count;
|
||||
} catch (error) {
|
||||
if (!isRequestCancelled(error)) unreadCount.value = 0;
|
||||
}
|
||||
@@ -484,7 +498,12 @@ const loadQuota = async () => {
|
||||
});
|
||||
if (pageActive && generation === quotaLoadGeneration) quota.value = result;
|
||||
} catch (error) {
|
||||
if (!isRequestCancelled(error) && pageActive && generation === quotaLoadGeneration) quota.value = null;
|
||||
if (
|
||||
!isRequestCancelled(error) &&
|
||||
pageActive &&
|
||||
generation === quotaLoadGeneration
|
||||
)
|
||||
quota.value = null;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -749,7 +768,8 @@ const openShortcut = (key) => {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 24rpx;
|
||||
background: url("/static/assets/modules/genealogy/transparent/current-seal-frame.png") center / contain no-repeat;
|
||||
background: url("/static/assets/modules/genealogy/transparent/current-seal-frame.png")
|
||||
center / contain no-repeat;
|
||||
color: #fff7e7;
|
||||
}
|
||||
.current-seal-title {
|
||||
@@ -1093,7 +1113,8 @@ const openShortcut = (key) => {
|
||||
height: 184rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: url("/static/assets/modules/genealogy/transparent/current-seal-frame.png") center / contain no-repeat;
|
||||
background: url("/static/assets/modules/genealogy/transparent/current-seal-frame.png")
|
||||
center / contain no-repeat;
|
||||
}
|
||||
|
||||
.empty-seal__text {
|
||||
@@ -1142,12 +1163,14 @@ const openShortcut = (key) => {
|
||||
|
||||
.empty-search-action {
|
||||
margin-top: 26rpx;
|
||||
background: url("/static/assets/foundation/transparent/a01-scroll-primary-v3.png") center / contain no-repeat;
|
||||
background: url("/static/assets/foundation/transparent/a01-scroll-primary-v3.png")
|
||||
center / contain no-repeat;
|
||||
}
|
||||
|
||||
.empty-invite-action {
|
||||
margin-top: 22rpx;
|
||||
background: url("/static/assets/foundation/transparent/a01-scroll-secondary-v3.png") center / contain no-repeat;
|
||||
background: url("/static/assets/foundation/transparent/a01-scroll-secondary-v3.png")
|
||||
center / contain no-repeat;
|
||||
}
|
||||
|
||||
.empty-search-action__copy,
|
||||
@@ -1187,7 +1210,8 @@ const openShortcut = (key) => {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 30rpx;
|
||||
background: url("/static/assets/foundation/transparent/a01-scroll-primary-v3.png") center / contain no-repeat;
|
||||
background: url("/static/assets/foundation/transparent/a01-scroll-primary-v3.png")
|
||||
center / contain no-repeat;
|
||||
}
|
||||
.state-retry__copy {
|
||||
color: #fff9ec;
|
||||
|
||||
@@ -8,53 +8,120 @@
|
||||
<view class="create-card">
|
||||
<text class="create-card__eyebrow">立谱信息</text>
|
||||
<text class="create-card__title">为家族创建一部家谱</text>
|
||||
<text class="create-card__note">创建成功后会回到我的家谱;首代人物可在后续合同开放后再录入。</text>
|
||||
<text class="create-card__note"
|
||||
>创建成功后会回到我的家谱;首代人物可在后续合同开放后再录入。</text
|
||||
>
|
||||
|
||||
<view class="field-row">
|
||||
<text class="field-row__label"><text class="required-mark">*</text>姓氏</text>
|
||||
<input v-model="form.surname" maxlength="4" placeholder="请输入姓氏" placeholder-class="placeholder" @input="clearFieldError('surname')" />
|
||||
<text class="field-row__label"
|
||||
><text class="required-mark">*</text>姓氏</text
|
||||
>
|
||||
<input
|
||||
v-model="form.surname"
|
||||
maxlength="4"
|
||||
placeholder="请输入姓氏"
|
||||
placeholder-class="placeholder"
|
||||
@input="clearFieldError('surname')"
|
||||
/>
|
||||
</view>
|
||||
<text v-if="fieldErrors.surname" class="field-error">{{ fieldErrors.surname }}</text>
|
||||
<text v-if="fieldErrors.surname" class="field-error">{{
|
||||
fieldErrors.surname
|
||||
}}</text>
|
||||
|
||||
<view class="field-row">
|
||||
<text class="field-row__label"><text class="required-mark">*</text>谱名</text>
|
||||
<input v-model="form.genealogyName" maxlength="24" placeholder="请输入家谱名称" placeholder-class="placeholder" @input="clearFieldError('genealogyName')" />
|
||||
<text class="field-row__label"
|
||||
><text class="required-mark">*</text>谱名</text
|
||||
>
|
||||
<input
|
||||
v-model="form.genealogyName"
|
||||
maxlength="24"
|
||||
placeholder="请输入家谱名称"
|
||||
placeholder-class="placeholder"
|
||||
@input="clearFieldError('genealogyName')"
|
||||
/>
|
||||
</view>
|
||||
<text v-if="fieldErrors.genealogyName" class="field-error">{{ fieldErrors.genealogyName }}</text>
|
||||
<text v-if="fieldErrors.genealogyName" class="field-error">{{
|
||||
fieldErrors.genealogyName
|
||||
}}</text>
|
||||
|
||||
<view class="field-row field-row--selector" @click="openRegionPicker">
|
||||
<text class="field-row__label"><text class="required-mark">*</text>所在地区</text>
|
||||
<text class="region-selector-value" :class="{ 'region-selector-value--placeholder': !selectedRegion }">{{ selectedRegion ? regionPickerTrail.map((item) => item.label).join(' / ') : (regionLoading ? '正在加载地区…' : (regionPickerError || '请选择所在地区')) }}</text>
|
||||
<text class="field-row__label"
|
||||
><text class="required-mark">*</text>所在地区</text
|
||||
>
|
||||
<text
|
||||
class="region-selector-value"
|
||||
:class="{ 'region-selector-value--placeholder': !selectedRegion }"
|
||||
>{{
|
||||
selectedRegion
|
||||
? regionPickerTrail.map((item) => item.label).join(" / ")
|
||||
: regionLoading
|
||||
? "正在加载地区…"
|
||||
: regionPickerError || "请选择所在地区"
|
||||
}}</text
|
||||
>
|
||||
</view>
|
||||
<text v-if="fieldErrors.regionCode" class="field-error">{{ fieldErrors.regionCode }}</text>
|
||||
<text v-if="fieldErrors.regionCode" class="field-error">{{
|
||||
fieldErrors.regionCode
|
||||
}}</text>
|
||||
|
||||
<view class="field-row">
|
||||
<text class="field-row__label">堂号</text>
|
||||
<input v-model="form.ancestralHall" maxlength="12" placeholder="请输入堂号" placeholder-class="placeholder" />
|
||||
<input
|
||||
v-model="form.ancestralHall"
|
||||
maxlength="12"
|
||||
placeholder="请输入堂号"
|
||||
placeholder-class="placeholder"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="field-row">
|
||||
<text class="field-row__label">所在地</text>
|
||||
<input v-model="form.originPlace" maxlength="30" placeholder="请输入所在地" placeholder-class="placeholder" />
|
||||
<input
|
||||
v-model="form.originPlace"
|
||||
maxlength="30"
|
||||
placeholder="请输入所在地"
|
||||
placeholder-class="placeholder"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="field-row">
|
||||
<text class="field-row__label">详细地址</text>
|
||||
<input v-model="form.addressDetail" maxlength="60" placeholder="请输入详细地址" placeholder-class="placeholder" />
|
||||
<input
|
||||
v-model="form.addressDetail"
|
||||
maxlength="60"
|
||||
placeholder="请输入详细地址"
|
||||
placeholder-class="placeholder"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="intro-field">
|
||||
<text class="intro-field__label">家谱简介</text>
|
||||
<textarea v-model="form.intro" maxlength="200" auto-height placeholder="可记录迁徙、家训或建谱缘由" placeholder-class="placeholder" />
|
||||
<textarea
|
||||
v-model="form.intro"
|
||||
maxlength="200"
|
||||
auto-height
|
||||
placeholder="可记录迁徙、家训或建谱缘由"
|
||||
placeholder-class="placeholder"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="cover-field">
|
||||
<view>
|
||||
<text class="cover-field__label">封面图片</text>
|
||||
<text class="cover-field__hint">选择图片后会取得真实上传回执,并在创建家谱时关联。</text>
|
||||
<text class="cover-field__hint"
|
||||
>选择图片后会取得真实上传回执,并在创建家谱时关联。</text
|
||||
>
|
||||
</view>
|
||||
<button class="upload-button" :disabled="isUploading || isSubmitting" @click="uploadCover">{{ isUploading ? '上传中…' : '选择图片' }}</button>
|
||||
<text v-if="coverFileName" class="upload-receipt">已上传:{{ coverFileName }}</text>
|
||||
<button
|
||||
class="upload-button"
|
||||
:disabled="isUploading || isSubmitting"
|
||||
@click="uploadCover"
|
||||
>
|
||||
{{ isUploading ? "上传中…" : "选择图片" }}
|
||||
</button>
|
||||
<text v-if="coverFileName" class="upload-receipt"
|
||||
>已上传:{{ coverFileName }}</text
|
||||
>
|
||||
</view>
|
||||
<text v-if="uploadError" class="field-error">{{ uploadError }}</text>
|
||||
|
||||
@@ -65,14 +132,23 @@
|
||||
v-for="option in GENEALOGY_ACCESS_PRESET_OPTIONS"
|
||||
:key="option.value"
|
||||
class="access-rule__option"
|
||||
:class="{ 'access-rule__option--active': form.accessPreset === option.value }"
|
||||
:class="{
|
||||
'access-rule__option--active':
|
||||
form.accessPreset === option.value,
|
||||
}"
|
||||
@click="form.accessPreset = option.value"
|
||||
>{{ option.label }}</view>
|
||||
>{{ option.label }}</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<text v-if="submitError" class="submit-error">{{ submitError }}</text>
|
||||
<AppButton block :disabled="isSubmitting || isUploading" :label="isSubmitting ? '正在创建…' : '确认创建家谱'" @click="submitCreate" />
|
||||
<AppButton
|
||||
block
|
||||
:disabled="isSubmitting || isUploading"
|
||||
:label="isSubmitting ? '正在创建…' : '确认创建家谱'"
|
||||
@click="submitCreate"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -84,7 +160,12 @@
|
||||
</view>
|
||||
<view class="region-sheet__picker">
|
||||
<view class="region-sheet__column-headings">
|
||||
<text v-for="label in ['省份', '城市', '区县']" :key="label" class="region-sheet__column-heading">{{ label }}</text>
|
||||
<text
|
||||
v-for="label in ['省份', '城市', '区县']"
|
||||
:key="label"
|
||||
class="region-sheet__column-heading"
|
||||
>{{ label }}</text
|
||||
>
|
||||
</view>
|
||||
<picker-view
|
||||
class="region-sheet__picker-view"
|
||||
@@ -100,14 +181,22 @@
|
||||
v-for="(option, optionIndex) in column"
|
||||
:key="option.regionCode"
|
||||
class="region-sheet__picker-item"
|
||||
:class="{ 'region-sheet__picker-item--selected': regionPickerIndexes[columnIndex] === optionIndex }"
|
||||
>{{ option.label }}</view>
|
||||
:class="{
|
||||
'region-sheet__picker-item--selected':
|
||||
regionPickerIndexes[columnIndex] === optionIndex,
|
||||
}"
|
||||
>{{ option.label }}</view
|
||||
>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
</view>
|
||||
<view class="region-sheet__footer">
|
||||
<view class="region-sheet__cancel" @click="closeRegionPicker">取消</view>
|
||||
<button class="region-sheet__confirm" @click="confirmRegionSelection">确认选择</button>
|
||||
<view class="region-sheet__cancel" @click="closeRegionPicker"
|
||||
>取消</view
|
||||
>
|
||||
<button class="region-sheet__confirm" @click="confirmRegionSelection">
|
||||
确认选择
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -134,11 +223,26 @@ import AppButton from "@/components/AppButton.vue";
|
||||
import AppDialog from "@/components/AppDialog.vue";
|
||||
import GenealogyPageBackground from "@/components/GenealogyPageBackground.vue";
|
||||
import PageHeader from "@/components/PageHeader.vue";
|
||||
import { appApi, createRequestController, isRequestCancelled } from "@/utils/api.js";
|
||||
import {
|
||||
appApi,
|
||||
createRequestController,
|
||||
isRequestCancelled,
|
||||
} from "@/utils/api.js";
|
||||
import { createDiscardConfirmation } from "@/utils/discard-confirmation.js";
|
||||
import { GENEALOGY_ACCESS_PRESET, GENEALOGY_ACCESS_PRESET_OPTIONS, toApiGenealogyAccess } from "@/utils/genealogy-contracts.js";
|
||||
import { isImagePickCancelled, pickAndUploadImage } from "@/utils/resumable-image-upload.js";
|
||||
import { finishPage, handleBackPress, runBackGuard } from "@/utils/navigation.js";
|
||||
import {
|
||||
GENEALOGY_ACCESS_PRESET,
|
||||
GENEALOGY_ACCESS_PRESET_OPTIONS,
|
||||
toApiGenealogyAccess,
|
||||
} from "@/utils/genealogy-contracts.js";
|
||||
import {
|
||||
isImagePickCancelled,
|
||||
pickAndUploadImage,
|
||||
} from "@/utils/resumable-image-upload.js";
|
||||
import {
|
||||
finishPage,
|
||||
handleBackPress,
|
||||
runBackGuard,
|
||||
} from "@/utils/navigation.js";
|
||||
|
||||
const form = reactive({
|
||||
surname: "",
|
||||
@@ -149,7 +253,11 @@ const form = reactive({
|
||||
intro: "",
|
||||
accessPreset: GENEALOGY_ACCESS_PRESET.MEMBER_ONLY,
|
||||
});
|
||||
const fieldErrors = reactive({ surname: "", genealogyName: "", regionCode: "" });
|
||||
const fieldErrors = reactive({
|
||||
surname: "",
|
||||
genealogyName: "",
|
||||
regionCode: "",
|
||||
});
|
||||
const submitError = ref("");
|
||||
const isSubmitting = ref(false);
|
||||
const isUploading = ref(false);
|
||||
@@ -166,14 +274,18 @@ const regionPickerError = ref("");
|
||||
const regionLoading = ref(false);
|
||||
const regionPickerOpen = ref(false);
|
||||
const discardDialogVisible = ref(false);
|
||||
const regionPickerIndicatorStyle = "height: 104rpx; border-top: 1px solid rgba(159, 23, 15, .46); border-bottom: 1px solid rgba(159, 23, 15, .46); background: rgba(159, 23, 15, .08);";
|
||||
const regionPickerIndicatorStyle =
|
||||
"height: 104rpx; border-top: 1px solid rgba(159, 23, 15, .46); border-bottom: 1px solid rgba(159, 23, 15, .46); background: rgba(159, 23, 15, .08);";
|
||||
let pageActive = true;
|
||||
const hasDraft = computed(() =>
|
||||
Object.entries(form).some(([key, value]) =>
|
||||
key === "accessPreset"
|
||||
? value !== GENEALOGY_ACCESS_PRESET.MEMBER_ONLY
|
||||
: String(value).trim(),
|
||||
) || Boolean(selectedRegion.value?.regionCode) || Boolean(coverOssId.value),
|
||||
const hasDraft = computed(
|
||||
() =>
|
||||
Object.entries(form).some(([key, value]) =>
|
||||
key === "accessPreset"
|
||||
? value !== GENEALOGY_ACCESS_PRESET.MEMBER_ONLY
|
||||
: String(value).trim(),
|
||||
) ||
|
||||
Boolean(selectedRegion.value?.regionCode) ||
|
||||
Boolean(coverOssId.value),
|
||||
);
|
||||
const discardConfirmation = createDiscardConfirmation((visible) => {
|
||||
discardDialogVisible.value = visible;
|
||||
@@ -190,17 +302,26 @@ const clearFieldError = (field) => {
|
||||
const validate = () => {
|
||||
fieldErrors.surname = form.surname.trim() ? "" : "请填写姓氏";
|
||||
fieldErrors.genealogyName = form.genealogyName.trim() ? "" : "请填写谱名";
|
||||
fieldErrors.regionCode = selectedRegion.value?.regionCode ? "" : "请选择所在地区";
|
||||
return !fieldErrors.surname && !fieldErrors.genealogyName && !fieldErrors.regionCode;
|
||||
fieldErrors.regionCode = selectedRegion.value?.regionCode
|
||||
? ""
|
||||
: "请选择所在地区";
|
||||
return (
|
||||
!fieldErrors.surname &&
|
||||
!fieldErrors.genealogyName &&
|
||||
!fieldErrors.regionCode
|
||||
);
|
||||
};
|
||||
|
||||
const fetchRegionChildren = async (parentCode) => {
|
||||
regionLoading.value = true;
|
||||
regionPickerError.value = "";
|
||||
try {
|
||||
return await appApi.getRegionChildren(parentCode, { requestController: regionController });
|
||||
return await appApi.getRegionChildren(parentCode, {
|
||||
requestController: regionController,
|
||||
});
|
||||
} catch (error) {
|
||||
if (!isRequestCancelled(error)) regionPickerError.value = error?.message || "地区列表加载失败,请重试";
|
||||
if (!isRequestCancelled(error))
|
||||
regionPickerError.value = error?.message || "地区列表加载失败,请重试";
|
||||
return [];
|
||||
} finally {
|
||||
regionLoading.value = false;
|
||||
@@ -218,7 +339,8 @@ const loadRegionRoot = async () => {
|
||||
};
|
||||
|
||||
const loadPickerColumns = async (provinceIndex = 0, cityIndex = 0) => {
|
||||
const provinces = regionPickerColumns.value[0] || await fetchRegionChildren("0");
|
||||
const provinces =
|
||||
regionPickerColumns.value[0] || (await fetchRegionChildren("0"));
|
||||
const province = provinces[provinceIndex];
|
||||
if (!province) return;
|
||||
|
||||
@@ -238,7 +360,9 @@ const loadPickerColumns = async (provinceIndex = 0, cityIndex = 0) => {
|
||||
|
||||
const handleRegionPickerChange = async (event) => {
|
||||
if (regionLoading.value) return;
|
||||
const nextIndexes = (event?.detail?.value || []).map((index) => Number(index) || 0);
|
||||
const nextIndexes = (event?.detail?.value || []).map(
|
||||
(index) => Number(index) || 0,
|
||||
);
|
||||
const indexes = regionPickerIndexes.value;
|
||||
const provinceIndex = nextIndexes[0] || 0;
|
||||
const cityIndex = nextIndexes[1] || 0;
|
||||
@@ -276,7 +400,9 @@ const confirmRegionSelection = () => {
|
||||
});
|
||||
const region = trail[trail.length - 1];
|
||||
if (!region) return;
|
||||
regionPickerIndexes.value = trail.map((_, index) => Number(indexes[index]) || 0);
|
||||
regionPickerIndexes.value = trail.map(
|
||||
(_, index) => Number(indexes[index]) || 0,
|
||||
);
|
||||
selectedRegion.value = region;
|
||||
regionPickerTrail.value = trail;
|
||||
fieldErrors.regionCode = "";
|
||||
@@ -293,7 +419,8 @@ const requestBack = () =>
|
||||
transientOpen: regionPickerOpen.value || discardDialogVisible.value,
|
||||
dirty: hasDraft.value,
|
||||
submitting: isSubmitting.value || isUploading.value,
|
||||
"close-transient": () => regionPickerOpen.value ? closeRegionPicker() : cancelDiscard(),
|
||||
"close-transient": () =>
|
||||
regionPickerOpen.value ? closeRegionPicker() : cancelDiscard(),
|
||||
"block-submitting": () => true,
|
||||
"confirm-discard": requestDiscardConfirmation,
|
||||
});
|
||||
@@ -305,12 +432,18 @@ const uploadCover = async () => {
|
||||
isUploading.value = true;
|
||||
uploadError.value = "";
|
||||
try {
|
||||
const receipt = await pickAndUploadImage({ requestController: createController });
|
||||
const receipt = await pickAndUploadImage({
|
||||
requestController: createController,
|
||||
});
|
||||
if (!pageActive) return;
|
||||
coverOssId.value = receipt.ossId;
|
||||
coverFileName.value = receipt.fileName || "封面图片";
|
||||
} catch (error) {
|
||||
if (pageActive && !isImagePickCancelled(error) && !isRequestCancelled(error)) {
|
||||
if (
|
||||
pageActive &&
|
||||
!isImagePickCancelled(error) &&
|
||||
!isRequestCancelled(error)
|
||||
) {
|
||||
uploadError.value = error?.message || "封面图片上传失败,请稍后重试";
|
||||
}
|
||||
} finally {
|
||||
@@ -329,23 +462,30 @@ const submitCreate = async () => {
|
||||
isSubmitting.value = true;
|
||||
submitError.value = "";
|
||||
try {
|
||||
const created = await appApi.createGenealogy({
|
||||
surname: form.surname,
|
||||
genealogyName: form.genealogyName,
|
||||
regionCode: selectedRegion.value.regionCode,
|
||||
ancestralHall: form.ancestralHall,
|
||||
originPlace: form.originPlace,
|
||||
addressDetail: form.addressDetail,
|
||||
intro: form.intro,
|
||||
coverOssId: coverOssId.value,
|
||||
...access,
|
||||
}, { requestController: createController });
|
||||
const created = await appApi.createGenealogy(
|
||||
{
|
||||
surname: form.surname,
|
||||
genealogyName: form.genealogyName,
|
||||
regionCode: selectedRegion.value.regionCode,
|
||||
ancestralHall: form.ancestralHall,
|
||||
originPlace: form.originPlace,
|
||||
addressDetail: form.addressDetail,
|
||||
intro: form.intro,
|
||||
coverOssId: coverOssId.value,
|
||||
...access,
|
||||
},
|
||||
{ requestController: createController },
|
||||
);
|
||||
if (!pageActive) return;
|
||||
await finishPage("G01", {}, {
|
||||
operation: "genealogy-created",
|
||||
entityId: created.id,
|
||||
refresh: true,
|
||||
});
|
||||
await finishPage(
|
||||
"G01",
|
||||
{},
|
||||
{
|
||||
operation: "genealogy-created",
|
||||
entityId: created.id,
|
||||
refresh: true,
|
||||
},
|
||||
);
|
||||
} catch (error) {
|
||||
if (!pageActive || isRequestCancelled(error)) return;
|
||||
submitError.value = error?.message || "创建失败,请稍后重试";
|
||||
@@ -365,51 +505,299 @@ onUnload(() => {
|
||||
<style scoped lang="scss">
|
||||
@use "../../styles/adaptive-frame-profiles.scss" as adaptive;
|
||||
|
||||
.create-page { display: flex; min-height: 100vh; flex-direction: column; background: $paper; }
|
||||
.page-content { z-index: 1; padding: 24rpx 32rpx 72rpx; }
|
||||
.create-card { @include adaptive.adaptive-genealogy-state-panel; padding: 48rpx 38rpx 42rpx; }
|
||||
.create-card__eyebrow, .create-card__title, .create-card__note, .field-error, .submit-error { display: block; }
|
||||
.create-card__eyebrow { color: $brand-red; font-size: 26rpx; font-weight: 700; letter-spacing: 3rpx; }
|
||||
.create-card__title { margin-top: 12rpx; color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 42rpx; font-weight: 700; }
|
||||
.create-card__note { margin-top: 16rpx; color: $ink-muted; font-size: 25rpx; line-height: 1.65; }
|
||||
.field-row { display: flex; min-height: 100rpx; align-items: center; margin-top: 22rpx; padding: 0 20rpx; border: 1rpx solid rgba(128, 89, 49, .34); border-radius: 12rpx; background: rgba(255, 252, 245, .7); }
|
||||
.field-row__label { width: 142rpx; flex: 0 0 auto; color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 30rpx; font-weight: 700; }
|
||||
.required-mark { display: inline-block; margin-right: 4rpx; color: $brand-red; font-size: 26rpx; line-height: 1; transform: translateY(-3rpx); }
|
||||
.field-row input { min-width: 0; flex: 1; color: $ink; font-size: 28rpx; }
|
||||
.field-row--selector { justify-content: space-between; cursor: pointer; }
|
||||
.region-selector-value { min-width: 0; flex: 1; color: $ink; font-size: 28rpx; text-align: right; overflow-wrap: anywhere; }
|
||||
.region-selector-value--placeholder { color: #ab9a86; }
|
||||
.placeholder { color: #ab9a86; }
|
||||
.intro-field { margin-top: 22rpx; padding: 20rpx; border: 1rpx solid rgba(128, 89, 49, .34); border-radius: 12rpx; background: rgba(255, 252, 245, .7); }
|
||||
.intro-field__label { display: block; color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 30rpx; font-weight: 700; }
|
||||
.intro-field textarea { display: block; width: 100%; min-height: 120rpx; margin-top: 14rpx; color: $ink; font-size: 27rpx; line-height: 1.55; }
|
||||
.cover-field { display: grid; gap: 12rpx; margin-top: 22rpx; padding: 20rpx; border: 1rpx solid rgba(128, 89, 49, .34); border-radius: 12rpx; background: rgba(255, 252, 245, .7); }
|
||||
.cover-field__label { display: block; color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 30rpx; font-weight: 700; }
|
||||
.cover-field__hint { display: block; margin-top: 6rpx; color: $ink-muted; font-size: 21rpx; line-height: 1.45; }
|
||||
.upload-button { justify-self: start; min-height: 60rpx; margin: 0; padding: 0 20rpx; border: 1rpx solid rgba(159, 23, 15, .42); border-radius: 8rpx; background: transparent; color: $brand-red; font-size: 22rpx; }
|
||||
.upload-receipt { color: $ink-muted; font-size: 21rpx; overflow-wrap: anywhere; }
|
||||
.field-error, .submit-error { margin-top: 10rpx; color: $brand-red; font-size: 24rpx; line-height: 1.5; }
|
||||
.access-rule { margin-top: 28rpx; }
|
||||
.access-rule__label { color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 31rpx; font-weight: 700; }
|
||||
.access-rule__options { display: flex; margin-top: 16rpx; gap: 16rpx; }
|
||||
.access-rule__option { flex: 1; padding: 20rpx 12rpx; border: 1rpx solid rgba(128, 89, 49, .34); border-radius: 12rpx; color: $ink-muted; font-size: 25rpx; text-align: center; }
|
||||
.access-rule__option--active { border-color: $brand-red; background: rgba(159, 23, 15, .07); color: $brand-red; font-weight: 700; }
|
||||
.create-card .app-button { margin-top: 32rpx; }
|
||||
.region-sheet { position: fixed; z-index: 10; inset: 0; display: flex; align-items: flex-end; }
|
||||
.region-sheet__mask { position: absolute; inset: 0; background: rgba(43, 30, 20, .42); }
|
||||
.region-sheet__panel { position: relative; width: 100%; padding: 22rpx 28rpx calc(24rpx + env(safe-area-inset-bottom)); border-radius: 30rpx 30rpx 0 0; background: #fdf9ef; box-shadow: 0 -12rpx 36rpx rgba(43, 30, 20, .2); }
|
||||
.region-sheet__intro { padding: 0 10rpx 16rpx; text-align: center; }
|
||||
.region-sheet__title { display: block; }
|
||||
.region-sheet__title { color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 36rpx; font-weight: 700; }
|
||||
.region-sheet__picker { overflow: hidden; border: 1rpx solid rgba(128, 89, 49, .28); border-radius: 16rpx; background: rgba(255, 252, 245, .8); }
|
||||
.region-sheet__column-headings { display: flex; height: 84rpx; border-bottom: 1rpx solid rgba(128, 89, 49, .18); }
|
||||
.region-sheet__column-heading { box-sizing: border-box; width: 33.333%; padding: 24rpx 12rpx; color: $ink-muted; font-size: 26rpx; text-align: center; }
|
||||
.region-sheet__column-heading + .region-sheet__column-heading { border-left: 1rpx solid rgba(128, 89, 49, .16); }
|
||||
.region-sheet__picker-view { width: 100%; height: 520rpx; }
|
||||
.region-sheet__picker-item { box-sizing: border-box; height: 104rpx; overflow: hidden; padding: 0 6rpx; color: $ink-muted; font-size: 26rpx; line-height: 104rpx; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.region-sheet__picker-item--selected { color: $brand-red; font-weight: 700; }
|
||||
.region-sheet__footer { display: flex; align-items: center; margin-top: 22rpx; gap: 12rpx; }
|
||||
.region-sheet__cancel { min-width: 116rpx; padding: 20rpx 10rpx; color: $ink-muted; font-size: 28rpx; text-align: center; }
|
||||
.region-sheet__confirm { flex: 1; height: 82rpx; margin: 0; padding: 0; border: 0; border-radius: 10rpx; background: $brand-red; color: #fff; font-size: 29rpx; font-weight: 700; line-height: 82rpx; }
|
||||
.region-sheet__confirm::after { display: none; }
|
||||
.create-page {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
flex-direction: column;
|
||||
background: $paper;
|
||||
}
|
||||
.page-content {
|
||||
z-index: 1;
|
||||
padding: 24rpx 32rpx 72rpx;
|
||||
}
|
||||
.create-card {
|
||||
@include adaptive.adaptive-genealogy-state-panel;
|
||||
padding: 48rpx 38rpx 42rpx;
|
||||
}
|
||||
.create-card__eyebrow,
|
||||
.create-card__title,
|
||||
.create-card__note,
|
||||
.field-error,
|
||||
.submit-error {
|
||||
display: block;
|
||||
}
|
||||
.create-card__eyebrow {
|
||||
color: $brand-red;
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
letter-spacing: 3rpx;
|
||||
}
|
||||
.create-card__title {
|
||||
margin-top: 12rpx;
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 42rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.create-card__note {
|
||||
margin-top: 16rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 25rpx;
|
||||
line-height: 1.65;
|
||||
}
|
||||
.field-row {
|
||||
display: flex;
|
||||
min-height: 100rpx;
|
||||
align-items: center;
|
||||
margin-top: 22rpx;
|
||||
padding: 0 20rpx;
|
||||
border: 1rpx solid rgba(128, 89, 49, 0.34);
|
||||
border-radius: 12rpx;
|
||||
background: rgba(255, 252, 245, 0.7);
|
||||
}
|
||||
.field-row__label {
|
||||
width: 142rpx;
|
||||
flex: 0 0 auto;
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.required-mark {
|
||||
display: inline-block;
|
||||
margin-right: 4rpx;
|
||||
color: $brand-red;
|
||||
font-size: 26rpx;
|
||||
line-height: 1;
|
||||
transform: translateY(-3rpx);
|
||||
}
|
||||
.field-row input {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
color: $ink;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.field-row--selector {
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
}
|
||||
.region-selector-value {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
color: $ink;
|
||||
font-size: 28rpx;
|
||||
text-align: right;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.region-selector-value--placeholder {
|
||||
color: #ab9a86;
|
||||
}
|
||||
.placeholder {
|
||||
color: #ab9a86;
|
||||
}
|
||||
.intro-field {
|
||||
margin-top: 22rpx;
|
||||
padding: 20rpx;
|
||||
border: 1rpx solid rgba(128, 89, 49, 0.34);
|
||||
border-radius: 12rpx;
|
||||
background: rgba(255, 252, 245, 0.7);
|
||||
}
|
||||
.intro-field__label {
|
||||
display: block;
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.intro-field textarea {
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-height: 120rpx;
|
||||
margin-top: 14rpx;
|
||||
color: $ink;
|
||||
font-size: 27rpx;
|
||||
line-height: 1.55;
|
||||
}
|
||||
.cover-field {
|
||||
display: grid;
|
||||
gap: 12rpx;
|
||||
margin-top: 22rpx;
|
||||
padding: 20rpx;
|
||||
border: 1rpx solid rgba(128, 89, 49, 0.34);
|
||||
border-radius: 12rpx;
|
||||
background: rgba(255, 252, 245, 0.7);
|
||||
}
|
||||
.cover-field__label {
|
||||
display: block;
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.cover-field__hint {
|
||||
display: block;
|
||||
margin-top: 6rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 21rpx;
|
||||
line-height: 1.45;
|
||||
}
|
||||
.upload-button {
|
||||
justify-self: start;
|
||||
min-height: 60rpx;
|
||||
margin: 0;
|
||||
padding: 0 20rpx;
|
||||
border: 1rpx solid rgba(159, 23, 15, 0.42);
|
||||
border-radius: 8rpx;
|
||||
background: transparent;
|
||||
color: $brand-red;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.upload-receipt {
|
||||
color: $ink-muted;
|
||||
font-size: 21rpx;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.field-error,
|
||||
.submit-error {
|
||||
margin-top: 10rpx;
|
||||
color: $brand-red;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.access-rule {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
.access-rule__label {
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 31rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.access-rule__options {
|
||||
display: flex;
|
||||
margin-top: 16rpx;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.access-rule__option {
|
||||
flex: 1;
|
||||
padding: 20rpx 12rpx;
|
||||
border: 1rpx solid rgba(128, 89, 49, 0.34);
|
||||
border-radius: 12rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 25rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.access-rule__option--active {
|
||||
border-color: $brand-red;
|
||||
background: rgba(159, 23, 15, 0.07);
|
||||
color: $brand-red;
|
||||
font-weight: 700;
|
||||
}
|
||||
.create-card .app-button {
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
.region-sheet {
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
.region-sheet__mask {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: rgba(43, 30, 20, 0.42);
|
||||
}
|
||||
.region-sheet__panel {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding: 22rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
background: #fdf9ef;
|
||||
box-shadow: 0 -12rpx 36rpx rgba(43, 30, 20, 0.2);
|
||||
}
|
||||
.region-sheet__intro {
|
||||
padding: 0 10rpx 16rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.region-sheet__title {
|
||||
display: block;
|
||||
}
|
||||
.region-sheet__title {
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.region-sheet__picker {
|
||||
overflow: hidden;
|
||||
border: 1rpx solid rgba(128, 89, 49, 0.28);
|
||||
border-radius: 16rpx;
|
||||
background: rgba(255, 252, 245, 0.8);
|
||||
}
|
||||
.region-sheet__column-headings {
|
||||
display: flex;
|
||||
height: 84rpx;
|
||||
border-bottom: 1rpx solid rgba(128, 89, 49, 0.18);
|
||||
}
|
||||
.region-sheet__column-heading {
|
||||
box-sizing: border-box;
|
||||
width: 33.333%;
|
||||
padding: 24rpx 12rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.region-sheet__column-heading + .region-sheet__column-heading {
|
||||
border-left: 1rpx solid rgba(128, 89, 49, 0.16);
|
||||
}
|
||||
.region-sheet__picker-view {
|
||||
width: 100%;
|
||||
height: 520rpx;
|
||||
}
|
||||
.region-sheet__picker-item {
|
||||
box-sizing: border-box;
|
||||
height: 104rpx;
|
||||
overflow: hidden;
|
||||
padding: 0 6rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 26rpx;
|
||||
line-height: 104rpx;
|
||||
text-align: center;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.region-sheet__picker-item--selected {
|
||||
color: $brand-red;
|
||||
font-weight: 700;
|
||||
}
|
||||
.region-sheet__footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 22rpx;
|
||||
gap: 12rpx;
|
||||
}
|
||||
.region-sheet__cancel {
|
||||
min-width: 116rpx;
|
||||
padding: 20rpx 10rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.region-sheet__confirm {
|
||||
flex: 1;
|
||||
height: 82rpx;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 10rpx;
|
||||
background: $brand-red;
|
||||
color: #fff;
|
||||
font-size: 29rpx;
|
||||
font-weight: 700;
|
||||
line-height: 82rpx;
|
||||
}
|
||||
.region-sheet__confirm::after {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
<text v-if="genealogy.personCount !== null"
|
||||
>世系 {{ genealogy.personCount }} 人</text
|
||||
>
|
||||
<text>{{ getGenealogyAccessPresetLabel(genealogy.accessPreset) }}</text>
|
||||
<text>{{
|
||||
getGenealogyAccessPresetLabel(genealogy.accessPreset)
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="overview-hero__stats">
|
||||
<text v-if="genealogy.joinTime"
|
||||
@@ -85,7 +87,9 @@
|
||||
</view>
|
||||
<view class="overview-summary">
|
||||
<text class="overview-action__title">访问范围</text
|
||||
><text>{{ getGenealogyAccessPresetLabel(genealogy.accessPreset) }}</text>
|
||||
><text>{{
|
||||
getGenealogyAccessPresetLabel(genealogy.accessPreset)
|
||||
}}</text>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
@@ -110,28 +114,42 @@
|
||||
viewMode === "preview" ? "本地流程预览" : "公开家谱"
|
||||
}}</text>
|
||||
<text class="overview-public__title">{{ genealogy.name }}</text>
|
||||
<text class="overview-public__source">{{ genealogy.source || "来源信息待同步" }}</text>
|
||||
<text class="overview-public__source">{{
|
||||
genealogy.source || "来源信息待同步"
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="overview-public__details">
|
||||
<view
|
||||
><text>姓氏</text><text>{{ genealogy.surname }}氏</text></view
|
||||
>
|
||||
<view
|
||||
><text>地区</text><text>{{ genealogy.location || "待补充" }}</text></view
|
||||
><text>地区</text
|
||||
><text>{{ genealogy.location || "待补充" }}</text></view
|
||||
>
|
||||
<view
|
||||
><text>堂号</text><text>{{ genealogy.hall || "待补充" }}</text></view
|
||||
><text>堂号</text
|
||||
><text>{{ genealogy.hall || "待补充" }}</text></view
|
||||
>
|
||||
<view
|
||||
><text>当前支系</text><text>{{ genealogy.branchName || "待补充" }}</text></view
|
||||
><text>当前支系</text
|
||||
><text>{{ genealogy.branchName || "待补充" }}</text></view
|
||||
>
|
||||
<view
|
||||
><text>{{ viewMode === "preview" ? "首代人物" : "所属上级谱" }}</text
|
||||
><text>{{ (viewMode === "preview" ? genealogy.ancestorName : genealogy.parentName) || "待补充" }}</text></view
|
||||
><text>{{
|
||||
viewMode === "preview" ? "首代人物" : "所属上级谱"
|
||||
}}</text
|
||||
><text>{{
|
||||
(viewMode === "preview"
|
||||
? genealogy.ancestorName
|
||||
: genealogy.parentName) || "待补充"
|
||||
}}</text></view
|
||||
>
|
||||
</view>
|
||||
<view
|
||||
v-if="viewMode === 'public' && (genealogy.manager || genealogy.certification)"
|
||||
v-if="
|
||||
viewMode === 'public' &&
|
||||
(genealogy.manager || genealogy.certification)
|
||||
"
|
||||
class="overview-public__trust"
|
||||
>
|
||||
<text>{{ genealogy.manager || "管理者待确认" }}</text>
|
||||
@@ -231,11 +249,11 @@ const publicActionLabel = computed(() => {
|
||||
if (publicRelation.value === "pending") return "查看申请进度";
|
||||
if (!publicCanApply.value) return "";
|
||||
return (
|
||||
({
|
||||
{
|
||||
available: "申请加入这部家谱",
|
||||
rejected: "修改后重新申请",
|
||||
removed: "重新申请加入",
|
||||
})[publicRelation.value] || ""
|
||||
}[publicRelation.value] || ""
|
||||
);
|
||||
});
|
||||
|
||||
@@ -332,8 +350,7 @@ onUnload(() => {
|
||||
});
|
||||
const reloadOverview = () => loadGenealogy({ genealogyId: genealogyId.value });
|
||||
const toGenealogies = () => returnTo("G01", {});
|
||||
const toTree = () =>
|
||||
openPage("T01", { genealogyId: genealogyId.value }, "G05");
|
||||
const toTree = () => openPage("T01", { genealogyId: genealogyId.value }, "G05");
|
||||
const toFamily = () => goRoot("F01", { genealogyId: genealogyId.value });
|
||||
const toApplications = () =>
|
||||
openPage("G10", { genealogyId: genealogyId.value }, "G05");
|
||||
@@ -424,7 +441,9 @@ const applyToJoin = () => {
|
||||
font-size: 22rpx;
|
||||
transform: translateY(-18rpx);
|
||||
}
|
||||
.overview-hero__stats + .overview-hero__stats { margin-left: 18rpx; }
|
||||
.overview-hero__stats + .overview-hero__stats {
|
||||
margin-left: 18rpx;
|
||||
}
|
||||
.overview-actions {
|
||||
display: grid;
|
||||
min-height: 386rpx;
|
||||
|
||||
@@ -1,18 +1,45 @@
|
||||
<template>
|
||||
<view class="search-page">
|
||||
<GenealogyPageBackground />
|
||||
<view class="page-header"><PageHeader title="搜索家谱" custom-back @back="backToGenealogies" /></view>
|
||||
<view class="page-header"
|
||||
><PageHeader title="搜索家谱" custom-back @back="backToGenealogies"
|
||||
/></view>
|
||||
<view class="page-content">
|
||||
<view class="search-note"><text>公开家谱</text><text>以下结果来自服务端公开家谱列表。</text></view>
|
||||
<view v-if="state === 'loading'" class="state-card"><AppLoading text="正在读取公开家谱" /></view>
|
||||
<view v-else-if="state === 'error'" class="state-card"><text>暂时无法读取公开家谱</text><AppButton block type="secondary" label="重新加载" @click="loadGenealogies" /></view>
|
||||
<view v-else-if="state === 'empty'" class="state-card"><text>暂未找到公开家谱</text></view>
|
||||
<view class="search-note"
|
||||
><text>公开家谱</text
|
||||
><text>以下结果来自服务端公开家谱列表。</text></view
|
||||
>
|
||||
<view v-if="state === 'loading'" class="state-card"
|
||||
><AppLoading text="正在读取公开家谱"
|
||||
/></view>
|
||||
<view v-else-if="state === 'error'" class="state-card"
|
||||
><text>暂时无法读取公开家谱</text
|
||||
><AppButton
|
||||
block
|
||||
type="secondary"
|
||||
label="重新加载"
|
||||
@click="loadGenealogies"
|
||||
/></view>
|
||||
<view v-else-if="state === 'empty'" class="state-card"
|
||||
><text>暂未找到公开家谱</text></view
|
||||
>
|
||||
<view v-else class="result-list">
|
||||
<view v-for="item in rows" :key="item.id" class="genealogy-card">
|
||||
<view class="card-heading"><text>{{ item.name }}</text><text v-if="item.surname">{{ item.surname }}氏</text></view>
|
||||
<text v-if="item.location" class="card-meta">{{ item.location }}</text>
|
||||
<view class="card-heading"
|
||||
><text>{{ item.name }}</text
|
||||
><text v-if="item.surname">{{ item.surname }}氏</text></view
|
||||
>
|
||||
<text v-if="item.location" class="card-meta">{{
|
||||
item.location
|
||||
}}</text>
|
||||
<text v-if="item.intro" class="card-copy">{{ item.intro }}</text>
|
||||
<view class="card-footer"><text>{{ item.memberCount }} 位成员</text><AppButton :label="item.canManage ? '已在我的家谱' : '申请加入'" :disabled="item.canManage" @click="applyToJoin(item)" /></view>
|
||||
<view class="card-footer"
|
||||
><text>{{ item.memberCount }} 位成员</text
|
||||
><AppButton
|
||||
:label="item.canManage ? '已在我的家谱' : '申请加入'"
|
||||
:disabled="item.canManage"
|
||||
@click="applyToJoin(item)"
|
||||
/></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -26,7 +53,11 @@ import AppButton from "@/components/AppButton.vue";
|
||||
import AppLoading from "@/components/AppLoading.vue";
|
||||
import GenealogyPageBackground from "@/components/GenealogyPageBackground.vue";
|
||||
import PageHeader from "@/components/PageHeader.vue";
|
||||
import { appApi, createRequestController, isRequestCancelled } from "@/utils/api.js";
|
||||
import {
|
||||
appApi,
|
||||
createRequestController,
|
||||
isRequestCancelled,
|
||||
} from "@/utils/api.js";
|
||||
import { openPage, returnTo } from "@/utils/navigation.js";
|
||||
|
||||
const rows = ref([]);
|
||||
@@ -37,31 +68,165 @@ const loadGenealogies = async () => {
|
||||
controller.abort();
|
||||
state.value = "loading";
|
||||
try {
|
||||
const result = await appApi.getPublicGenealogies({ requestController: controller });
|
||||
const result = await appApi.getPublicGenealogies({
|
||||
requestController: controller,
|
||||
});
|
||||
if (!active) return;
|
||||
rows.value = result.map((item) => ({
|
||||
id: String(item.genealogyId),
|
||||
name: String(item.genealogyName || "未命名家谱"),
|
||||
surname: String(item.surname || ""),
|
||||
location: String(item.regionFullName || item.regionName || item.originPlace || item.addressDetail || ""),
|
||||
intro: String(item.intro || ""),
|
||||
memberCount: Number.isSafeInteger(item.memberCount) ? item.memberCount : 0,
|
||||
canManage: item.canManage === true
|
||||
})).filter((item) => /^[1-9]\d*$/.test(item.id));
|
||||
rows.value = result
|
||||
.map((item) => ({
|
||||
id: String(item.genealogyId),
|
||||
name: String(item.genealogyName || "未命名家谱"),
|
||||
surname: String(item.surname || ""),
|
||||
location: String(
|
||||
item.regionFullName ||
|
||||
item.regionName ||
|
||||
item.originPlace ||
|
||||
item.addressDetail ||
|
||||
"",
|
||||
),
|
||||
intro: String(item.intro || ""),
|
||||
memberCount: Number.isSafeInteger(item.memberCount)
|
||||
? item.memberCount
|
||||
: 0,
|
||||
canManage: item.canManage === true,
|
||||
}))
|
||||
.filter((item) => /^[1-9]\d*$/.test(item.id));
|
||||
state.value = rows.value.length ? "ready" : "empty";
|
||||
} catch (error) {
|
||||
if (!active || isRequestCancelled(error)) return;
|
||||
state.value = "error";
|
||||
}
|
||||
};
|
||||
const applyToJoin = (item) => openPage("G08", { genealogyId: item.id, genealogyName: item.name }, "G06");
|
||||
const applyToJoin = (item) =>
|
||||
openPage("G08", { genealogyId: item.id, genealogyName: item.name }, "G06");
|
||||
const backToGenealogies = () => returnTo("G01");
|
||||
onLoad(loadGenealogies);
|
||||
onShow(() => { if (state.value !== "loading") loadGenealogies(); });
|
||||
onUnload(() => { active = false; controller.abort(); });
|
||||
onShow(() => {
|
||||
if (state.value !== "loading") loadGenealogies();
|
||||
});
|
||||
onUnload(() => {
|
||||
active = false;
|
||||
controller.abort();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "../../styles/adaptive-frame-profiles.scss" as adaptive;
|
||||
.search-page{display:flex;min-height:100vh;flex-direction:column;background:$paper}.page-header,.page-content{z-index:1}.page-content{padding:18rpx 24rpx 72rpx}.search-note,.state-card,.genealogy-card{@include adaptive.adaptive-genealogy-state-panel}.search-note{display:flex;min-height:112rpx;flex-direction:column;justify-content:center;padding:20rpx 30rpx}.search-note text:first-child{color:$ink;font-family:STKaiti,KaiTi,serif;font-size:30rpx;font-weight:700}.search-note text:last-child{margin-top:6rpx;color:$ink-muted;font-size:21rpx}.state-card{display:flex;min-height:310rpx;flex-direction:column;align-items:center;justify-content:center;margin-top:18rpx;padding:42rpx;text-align:center;color:$ink;font-size:28rpx}.state-card .app-button{width:100%;margin-top:22rpx}.result-list{display:flex;flex-direction:column;gap:16rpx;margin-top:18rpx}.genealogy-card{padding:28rpx 32rpx}.card-heading{display:flex;align-items:baseline;justify-content:space-between;gap:18rpx}.card-heading text:first-child{color:$ink;font-family:STKaiti,KaiTi,serif;font-size:31rpx;font-weight:700;overflow-wrap:anywhere}.card-heading text:last-child{flex:0 0 auto;color:$brand-red;font-size:22rpx}.card-meta,.card-copy{display:block;color:$ink-muted;font-size:22rpx;line-height:1.5}.card-meta{margin-top:10rpx}.card-copy{margin-top:8rpx}.card-footer{display:flex;align-items:center;justify-content:space-between;gap:18rpx;margin-top:20rpx;color:$ink-muted;font-size:21rpx}.card-footer .app-button{min-width:180rpx}@media(max-width:340px){.page-content{padding-right:20rpx;padding-left:20rpx}.card-footer{align-items:flex-start;flex-direction:column}.card-footer .app-button{width:100%}}
|
||||
.search-page {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
flex-direction: column;
|
||||
background: $paper;
|
||||
}
|
||||
.page-header,
|
||||
.page-content {
|
||||
z-index: 1;
|
||||
}
|
||||
.page-content {
|
||||
padding: 18rpx 24rpx 72rpx;
|
||||
}
|
||||
.search-note,
|
||||
.state-card,
|
||||
.genealogy-card {
|
||||
@include adaptive.adaptive-genealogy-state-panel;
|
||||
}
|
||||
.search-note {
|
||||
display: flex;
|
||||
min-height: 112rpx;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
.search-note text:first-child {
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.search-note text:last-child {
|
||||
margin-top: 6rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 21rpx;
|
||||
}
|
||||
.state-card {
|
||||
display: flex;
|
||||
min-height: 310rpx;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 18rpx;
|
||||
padding: 42rpx;
|
||||
text-align: center;
|
||||
color: $ink;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.state-card .app-button {
|
||||
width: 100%;
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
.result-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
.genealogy-card {
|
||||
padding: 28rpx 32rpx;
|
||||
}
|
||||
.card-heading {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 18rpx;
|
||||
}
|
||||
.card-heading text:first-child {
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 31rpx;
|
||||
font-weight: 700;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.card-heading text:last-child {
|
||||
flex: 0 0 auto;
|
||||
color: $brand-red;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.card-meta,
|
||||
.card-copy {
|
||||
display: block;
|
||||
color: $ink-muted;
|
||||
font-size: 22rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.card-meta {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.card-copy {
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.card-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 18rpx;
|
||||
margin-top: 20rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 21rpx;
|
||||
}
|
||||
.card-footer .app-button {
|
||||
min-width: 180rpx;
|
||||
}
|
||||
@media (max-width: 340px) {
|
||||
.page-content {
|
||||
padding-right: 20rpx;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
.card-footer {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
.card-footer .app-button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
<template>
|
||||
<view class="join-page">
|
||||
<GenealogyPageBackground />
|
||||
<view class="page-header"><PageHeader title="申请加入家谱" custom-back @back="requestBack" /></view>
|
||||
<view class="page-header"
|
||||
><PageHeader title="申请加入家谱" custom-back @back="requestBack"
|
||||
/></view>
|
||||
<view class="page-content">
|
||||
<view v-if="!hasValidContext" class="state-card">
|
||||
<text>申请入口无效</text>
|
||||
@@ -17,7 +19,7 @@
|
||||
<view v-else class="join-form">
|
||||
<view class="form-heading">
|
||||
<text>申请加入</text>
|
||||
<text>{{ genealogyName || '当前家谱' }}</text>
|
||||
<text>{{ genealogyName || "当前家谱" }}</text>
|
||||
</view>
|
||||
<view v-for="field in fields" :key="field.key" class="form-field">
|
||||
<text>{{ field.label }}</text>
|
||||
@@ -41,7 +43,12 @@
|
||||
/>
|
||||
</view>
|
||||
<text v-if="error" class="form-error">{{ error }}</text>
|
||||
<AppButton block :disabled="state === 'submitting'" :label="state === 'submitting' ? '正在提交' : '提交申请'" @click="submit" />
|
||||
<AppButton
|
||||
block
|
||||
:disabled="state === 'submitting'"
|
||||
:label="state === 'submitting' ? '正在提交' : '提交申请'"
|
||||
@click="submit"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<AppDialog
|
||||
@@ -66,7 +73,11 @@ import AppButton from "@/components/AppButton.vue";
|
||||
import AppDialog from "@/components/AppDialog.vue";
|
||||
import GenealogyPageBackground from "@/components/GenealogyPageBackground.vue";
|
||||
import PageHeader from "@/components/PageHeader.vue";
|
||||
import { appApi, createRequestController, isRequestCancelled } from "@/utils/api.js";
|
||||
import {
|
||||
appApi,
|
||||
createRequestController,
|
||||
isRequestCancelled,
|
||||
} from "@/utils/api.js";
|
||||
import { createDiscardConfirmation } from "@/utils/discard-confirmation.js";
|
||||
import { handleBackPress, returnTo, runBackGuard } from "@/utils/navigation.js";
|
||||
|
||||
@@ -75,18 +86,54 @@ const genealogyName = ref("");
|
||||
const state = ref("form");
|
||||
const error = ref("");
|
||||
const discardVisible = ref(false);
|
||||
const form = reactive({ applicantName: "", phone: "", relationDesc: "", applyReason: "", inviterUserId: "" });
|
||||
const form = reactive({
|
||||
applicantName: "",
|
||||
phone: "",
|
||||
relationDesc: "",
|
||||
applyReason: "",
|
||||
inviterUserId: "",
|
||||
});
|
||||
const fields = [
|
||||
{ key: "applicantName", label: "申请人姓名", maxlength: 50, placeholder: "填写您的姓名" },
|
||||
{ key: "phone", label: "手机号", inputType: "number", maxlength: 11, placeholder: "填写联系电话" },
|
||||
{ key: "relationDesc", label: "关系说明", maxlength: 100, placeholder: "例如:本族成员" },
|
||||
{ key: "applyReason", label: "申请理由", multiline: true, maxlength: 500, placeholder: "说明申请加入的原因" },
|
||||
{ key: "inviterUserId", label: "邀请人编号", inputType: "number", maxlength: 20, placeholder: "如有邀请人可填写编号" },
|
||||
{
|
||||
key: "applicantName",
|
||||
label: "申请人姓名",
|
||||
maxlength: 50,
|
||||
placeholder: "填写您的姓名",
|
||||
},
|
||||
{
|
||||
key: "phone",
|
||||
label: "手机号",
|
||||
inputType: "number",
|
||||
maxlength: 11,
|
||||
placeholder: "填写联系电话",
|
||||
},
|
||||
{
|
||||
key: "relationDesc",
|
||||
label: "关系说明",
|
||||
maxlength: 100,
|
||||
placeholder: "例如:本族成员",
|
||||
},
|
||||
{
|
||||
key: "applyReason",
|
||||
label: "申请理由",
|
||||
multiline: true,
|
||||
maxlength: 500,
|
||||
placeholder: "说明申请加入的原因",
|
||||
},
|
||||
{
|
||||
key: "inviterUserId",
|
||||
label: "邀请人编号",
|
||||
inputType: "number",
|
||||
maxlength: 20,
|
||||
placeholder: "如有邀请人可填写编号",
|
||||
},
|
||||
];
|
||||
const controller = createRequestController();
|
||||
const hasValidContext = computed(() => /^[1-9]\d*$/.test(genealogyId.value));
|
||||
const dirty = computed(() => Object.values(form).some((value) => value.trim()));
|
||||
const confirmation = createDiscardConfirmation((visible) => { discardVisible.value = visible; });
|
||||
const confirmation = createDiscardConfirmation((visible) => {
|
||||
discardVisible.value = visible;
|
||||
});
|
||||
const confirmDiscard = confirmation.confirm;
|
||||
const cancelDiscard = confirmation.cancel;
|
||||
|
||||
@@ -101,7 +148,11 @@ const submit = async () => {
|
||||
state.value = "submitting";
|
||||
error.value = "";
|
||||
try {
|
||||
await appApi.applyToJoin(genealogyId.value, { ...form }, { requestController: controller });
|
||||
await appApi.applyToJoin(
|
||||
genealogyId.value,
|
||||
{ ...form },
|
||||
{ requestController: controller },
|
||||
);
|
||||
state.value = "success";
|
||||
} catch (cause) {
|
||||
if (!isRequestCancelled(cause)) {
|
||||
@@ -110,37 +161,115 @@ const submit = async () => {
|
||||
}
|
||||
}
|
||||
};
|
||||
const requestBack = () => runBackGuard({
|
||||
transientOpen: discardVisible.value,
|
||||
dirty: dirty.value && state.value === "form",
|
||||
submitting: state.value === "submitting",
|
||||
"close-transient": cancelDiscard,
|
||||
"block-submitting": () => true,
|
||||
"confirm-discard": confirmation.request,
|
||||
});
|
||||
const requestBack = () =>
|
||||
runBackGuard({
|
||||
transientOpen: discardVisible.value,
|
||||
dirty: dirty.value && state.value === "form",
|
||||
submitting: state.value === "submitting",
|
||||
"close-transient": cancelDiscard,
|
||||
"block-submitting": () => true,
|
||||
"confirm-discard": confirmation.request,
|
||||
});
|
||||
|
||||
onBackPress((event) => handleBackPress(event, requestBack));
|
||||
onUnmounted(() => { controller.abort(); confirmation.dispose(); });
|
||||
onUnmounted(() => {
|
||||
controller.abort();
|
||||
confirmation.dispose();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "../../styles/adaptive-frame-profiles.scss" as adaptive;
|
||||
.join-page { display: flex; min-height: 100vh; flex-direction: column; background: $paper; }
|
||||
.page-header, .page-content { z-index: 1; }
|
||||
.page-content { padding: 18rpx 24rpx 72rpx; }
|
||||
.state-card, .join-form { @include adaptive.adaptive-genealogy-state-panel; }
|
||||
.state-card { min-height: 340rpx; padding: 78rpx 52rpx 50rpx; text-align: center; }
|
||||
.state-card text { display: block; }
|
||||
.state-card text:first-child, .form-heading text:first-child { color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 35rpx; font-weight: 700; }
|
||||
.state-card text:nth-child(2) { margin-top: 18rpx; color: $ink-muted; font-size: 24rpx; line-height: 1.65; }
|
||||
.state-card .app-button, .join-form .app-button { margin-top: 28rpx; }
|
||||
.join-form { padding: 30rpx; }
|
||||
.form-heading { display: flex; flex-direction: column; gap: 8rpx; padding-bottom: 22rpx; border-bottom: 1rpx solid rgba(128, 89, 49, .24); }
|
||||
.form-heading text:last-child { color: $brand-red; font-size: 24rpx; }
|
||||
.form-field { margin-top: 22rpx; }
|
||||
.form-field > text { display: block; color: $ink; font-size: 24rpx; font-weight: 700; }
|
||||
.form-field input, .form-field textarea { @include adaptive.adaptive-genealogy-form-field; box-sizing: border-box; display: block; width: 100%; margin-top: 10rpx; padding: 16rpx 22rpx; color: $ink; font-size: 24rpx; }
|
||||
.form-field input { min-height: 76rpx; padding-top: 0; padding-bottom: 0; }
|
||||
.form-field textarea { min-height: 120rpx; line-height: 1.55; }
|
||||
.form-error { display: block; margin-top: 16rpx; color: $brand-red; font-size: 22rpx; line-height: 1.45; }
|
||||
.join-page {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
flex-direction: column;
|
||||
background: $paper;
|
||||
}
|
||||
.page-header,
|
||||
.page-content {
|
||||
z-index: 1;
|
||||
}
|
||||
.page-content {
|
||||
padding: 18rpx 24rpx 72rpx;
|
||||
}
|
||||
.state-card,
|
||||
.join-form {
|
||||
@include adaptive.adaptive-genealogy-state-panel;
|
||||
}
|
||||
.state-card {
|
||||
min-height: 340rpx;
|
||||
padding: 78rpx 52rpx 50rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.state-card text {
|
||||
display: block;
|
||||
}
|
||||
.state-card text:first-child,
|
||||
.form-heading text:first-child {
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 35rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.state-card text:nth-child(2) {
|
||||
margin-top: 18rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.65;
|
||||
}
|
||||
.state-card .app-button,
|
||||
.join-form .app-button {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
.join-form {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.form-heading {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
padding-bottom: 22rpx;
|
||||
border-bottom: 1rpx solid rgba(128, 89, 49, 0.24);
|
||||
}
|
||||
.form-heading text:last-child {
|
||||
color: $brand-red;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.form-field {
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
.form-field > text {
|
||||
display: block;
|
||||
color: $ink;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.form-field input,
|
||||
.form-field textarea {
|
||||
@include adaptive.adaptive-genealogy-form-field;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 10rpx;
|
||||
padding: 16rpx 22rpx;
|
||||
color: $ink;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.form-field input {
|
||||
min-height: 76rpx;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.form-field textarea {
|
||||
min-height: 120rpx;
|
||||
line-height: 1.55;
|
||||
}
|
||||
.form-error {
|
||||
display: block;
|
||||
margin-top: 16rpx;
|
||||
color: $brand-red;
|
||||
font-size: 22rpx;
|
||||
line-height: 1.45;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,12 +2,30 @@
|
||||
<template>
|
||||
<view class="applications-page">
|
||||
<GenealogyPageBackground />
|
||||
<view class="page-header"><PageHeader title="我的申请" custom-back @back="returnToGenealogies" /></view>
|
||||
<view class="page-header"
|
||||
><PageHeader title="我的申请" custom-back @back="returnToGenealogies"
|
||||
/></view>
|
||||
<view class="page-content">
|
||||
<view v-if="state === 'loading'" class="state-card"><AppLoading text="正在读取我的申请" /></view>
|
||||
<view v-else-if="state === 'error'" class="state-card"><text>暂时无法读取我的申请</text><AppButton block type="secondary" label="重新加载" @click="loadApplications" /></view>
|
||||
<view v-else-if="state === 'empty'" class="state-card"><text>暂无加入申请</text><text>申请记录会直接从服务端读取。</text><AppButton block label="返回我的家谱" @click="returnToGenealogies" /></view>
|
||||
<view v-else class="state-card"><text>已读取 {{ applications.length }} 条申请</text><text>申请详情接口尚未开放,当前不会用本地数据补造申请内容。</text><AppButton block label="返回我的家谱" @click="returnToGenealogies" /></view>
|
||||
<view v-if="state === 'loading'" class="state-card"
|
||||
><AppLoading text="正在读取我的申请"
|
||||
/></view>
|
||||
<view v-else-if="state === 'error'" class="state-card"
|
||||
><text>暂时无法读取我的申请</text
|
||||
><AppButton
|
||||
block
|
||||
type="secondary"
|
||||
label="重新加载"
|
||||
@click="loadApplications"
|
||||
/></view>
|
||||
<view v-else-if="state === 'empty'" class="state-card"
|
||||
><text>暂无加入申请</text><text>申请记录会直接从服务端读取。</text
|
||||
><AppButton block label="返回我的家谱" @click="returnToGenealogies"
|
||||
/></view>
|
||||
<view v-else class="state-card"
|
||||
><text>已读取 {{ applications.length }} 条申请</text
|
||||
><text>申请详情接口尚未开放,当前不会用本地数据补造申请内容。</text
|
||||
><AppButton block label="返回我的家谱" @click="returnToGenealogies"
|
||||
/></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -19,7 +37,11 @@ import AppButton from "@/components/AppButton.vue";
|
||||
import AppLoading from "@/components/AppLoading.vue";
|
||||
import GenealogyPageBackground from "@/components/GenealogyPageBackground.vue";
|
||||
import PageHeader from "@/components/PageHeader.vue";
|
||||
import { appApi, createRequestController, isRequestCancelled } from "@/utils/api.js";
|
||||
import {
|
||||
appApi,
|
||||
createRequestController,
|
||||
isRequestCancelled,
|
||||
} from "@/utils/api.js";
|
||||
import { returnTo } from "@/utils/navigation.js";
|
||||
|
||||
const applications = ref([]);
|
||||
@@ -30,7 +52,9 @@ const loadApplications = async () => {
|
||||
controller.abort();
|
||||
state.value = "loading";
|
||||
try {
|
||||
applications.value = await appApi.getMyJoinApplications({ requestController: controller });
|
||||
applications.value = await appApi.getMyJoinApplications({
|
||||
requestController: controller,
|
||||
});
|
||||
if (!active) return;
|
||||
state.value = applications.value.length ? "ready" : "empty";
|
||||
} catch (error) {
|
||||
@@ -40,11 +64,53 @@ const loadApplications = async () => {
|
||||
};
|
||||
const returnToGenealogies = () => returnTo("G01");
|
||||
onLoad(loadApplications);
|
||||
onShow(() => { if (state.value !== "loading") loadApplications(); });
|
||||
onUnload(() => { active = false; controller.abort(); });
|
||||
onShow(() => {
|
||||
if (state.value !== "loading") loadApplications();
|
||||
});
|
||||
onUnload(() => {
|
||||
active = false;
|
||||
controller.abort();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "../../styles/adaptive-frame-profiles.scss" as adaptive;
|
||||
.applications-page{display:flex;min-height:100vh;flex-direction:column;background:$paper}.page-header,.page-content{z-index:1}.page-content{padding:18rpx 24rpx 72rpx}.state-card{box-sizing:border-box;min-height:340rpx;padding:78rpx 52rpx 50rpx;text-align:center;@include adaptive.adaptive-genealogy-state-panel}.state-card text{display:block}.state-card text:first-child{color:$ink;font-family:STKaiti,KaiTi,serif;font-size:35rpx;font-weight:700}.state-card text:nth-child(2){margin-top:18rpx;color:$ink-muted;font-size:24rpx;line-height:1.65}.state-card .app-button{margin-top:28rpx}
|
||||
.applications-page {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
flex-direction: column;
|
||||
background: $paper;
|
||||
}
|
||||
.page-header,
|
||||
.page-content {
|
||||
z-index: 1;
|
||||
}
|
||||
.page-content {
|
||||
padding: 18rpx 24rpx 72rpx;
|
||||
}
|
||||
.state-card {
|
||||
box-sizing: border-box;
|
||||
min-height: 340rpx;
|
||||
padding: 78rpx 52rpx 50rpx;
|
||||
text-align: center;
|
||||
@include adaptive.adaptive-genealogy-state-panel;
|
||||
}
|
||||
.state-card text {
|
||||
display: block;
|
||||
}
|
||||
.state-card text:first-child {
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 35rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.state-card text:nth-child(2) {
|
||||
margin-top: 18rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.65;
|
||||
}
|
||||
.state-card .app-button {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,13 +2,35 @@
|
||||
<template>
|
||||
<view class="review-page">
|
||||
<GenealogyPageBackground />
|
||||
<view class="page-header"><PageHeader title="申请审核" custom-back @back="returnToGenealogies" /></view>
|
||||
<view class="page-header"
|
||||
><PageHeader title="申请审核" custom-back @back="returnToGenealogies"
|
||||
/></view>
|
||||
<view class="page-content">
|
||||
<view v-if="!valid" class="state-card"><text>申请审核入口无效</text><AppButton block label="返回我的家谱" @click="returnToGenealogies" /></view>
|
||||
<view v-else-if="state === 'loading'" class="state-card"><AppLoading text="正在读取待审核申请" /></view>
|
||||
<view v-else-if="state === 'error'" class="state-card"><text>暂时无法读取待审核申请</text><AppButton block type="secondary" label="重新加载" @click="loadApplications" /></view>
|
||||
<view v-else-if="state === 'empty'" class="state-card"><text>暂无待审核申请</text><text>待审核记录会直接从服务端读取。</text><AppButton block label="返回我的家谱" @click="returnToGenealogies" /></view>
|
||||
<view v-else class="state-card"><text>已读取 {{ applications.length }} 条待审核申请</text><text>审核详情接口尚未开放,当前不会用本地数据补造申请内容或审核结果。</text><AppButton block label="返回我的家谱" @click="returnToGenealogies" /></view>
|
||||
<view v-if="!valid" class="state-card"
|
||||
><text>申请审核入口无效</text
|
||||
><AppButton block label="返回我的家谱" @click="returnToGenealogies"
|
||||
/></view>
|
||||
<view v-else-if="state === 'loading'" class="state-card"
|
||||
><AppLoading text="正在读取待审核申请"
|
||||
/></view>
|
||||
<view v-else-if="state === 'error'" class="state-card"
|
||||
><text>暂时无法读取待审核申请</text
|
||||
><AppButton
|
||||
block
|
||||
type="secondary"
|
||||
label="重新加载"
|
||||
@click="loadApplications"
|
||||
/></view>
|
||||
<view v-else-if="state === 'empty'" class="state-card"
|
||||
><text>暂无待审核申请</text><text>待审核记录会直接从服务端读取。</text
|
||||
><AppButton block label="返回我的家谱" @click="returnToGenealogies"
|
||||
/></view>
|
||||
<view v-else class="state-card"
|
||||
><text>已读取 {{ applications.length }} 条待审核申请</text
|
||||
><text
|
||||
>审核详情接口尚未开放,当前不会用本地数据补造申请内容或审核结果。</text
|
||||
><AppButton block label="返回我的家谱" @click="returnToGenealogies"
|
||||
/></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -20,7 +42,11 @@ import AppButton from "@/components/AppButton.vue";
|
||||
import AppLoading from "@/components/AppLoading.vue";
|
||||
import GenealogyPageBackground from "@/components/GenealogyPageBackground.vue";
|
||||
import PageHeader from "@/components/PageHeader.vue";
|
||||
import { appApi, createRequestController, isRequestCancelled } from "@/utils/api.js";
|
||||
import {
|
||||
appApi,
|
||||
createRequestController,
|
||||
isRequestCancelled,
|
||||
} from "@/utils/api.js";
|
||||
import { returnTo } from "@/utils/navigation.js";
|
||||
|
||||
const genealogyId = ref("");
|
||||
@@ -34,7 +60,10 @@ const loadApplications = async () => {
|
||||
controller.abort();
|
||||
state.value = "loading";
|
||||
try {
|
||||
applications.value = await appApi.getPendingApplications(genealogyId.value, { requestController: controller });
|
||||
applications.value = await appApi.getPendingApplications(
|
||||
genealogyId.value,
|
||||
{ requestController: controller },
|
||||
);
|
||||
if (!active) return;
|
||||
state.value = applications.value.length ? "ready" : "empty";
|
||||
} catch (error) {
|
||||
@@ -43,12 +72,57 @@ const loadApplications = async () => {
|
||||
}
|
||||
};
|
||||
const returnToGenealogies = () => returnTo("G01");
|
||||
onLoad((query) => { genealogyId.value = String(query?.genealogyId || ""); if (valid.value) loadApplications(); });
|
||||
onShow(() => { if (valid.value && state.value !== "loading") loadApplications(); });
|
||||
onUnload(() => { active = false; controller.abort(); });
|
||||
onLoad((query) => {
|
||||
genealogyId.value = String(query?.genealogyId || "");
|
||||
if (valid.value) loadApplications();
|
||||
});
|
||||
onShow(() => {
|
||||
if (valid.value && state.value !== "loading") loadApplications();
|
||||
});
|
||||
onUnload(() => {
|
||||
active = false;
|
||||
controller.abort();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "../../styles/adaptive-frame-profiles.scss" as adaptive;
|
||||
.review-page{display:flex;min-height:100vh;flex-direction:column;background:$paper}.page-header,.page-content{z-index:1}.page-content{padding:18rpx 24rpx 72rpx}.state-card{box-sizing:border-box;min-height:340rpx;padding:78rpx 52rpx 50rpx;text-align:center;@include adaptive.adaptive-genealogy-state-panel}.state-card text{display:block}.state-card text:first-child{color:$ink;font-family:STKaiti,KaiTi,serif;font-size:35rpx;font-weight:700}.state-card text:nth-child(2){margin-top:18rpx;color:$ink-muted;font-size:24rpx;line-height:1.65}.state-card .app-button{margin-top:28rpx}
|
||||
.review-page {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
flex-direction: column;
|
||||
background: $paper;
|
||||
}
|
||||
.page-header,
|
||||
.page-content {
|
||||
z-index: 1;
|
||||
}
|
||||
.page-content {
|
||||
padding: 18rpx 24rpx 72rpx;
|
||||
}
|
||||
.state-card {
|
||||
box-sizing: border-box;
|
||||
min-height: 340rpx;
|
||||
padding: 78rpx 52rpx 50rpx;
|
||||
text-align: center;
|
||||
@include adaptive.adaptive-genealogy-state-panel;
|
||||
}
|
||||
.state-card text {
|
||||
display: block;
|
||||
}
|
||||
.state-card text:first-child {
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 35rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.state-card text:nth-child(2) {
|
||||
margin-top: 18rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.65;
|
||||
}
|
||||
.state-card .app-button {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,58 +2,132 @@
|
||||
<template>
|
||||
<view class="settings-page" :class="`settings-state--${pageState}`">
|
||||
<GenealogyPageBackground />
|
||||
<view class="page-header"><PageHeader title="家谱设置" custom-back @back="returnToOverview" /></view>
|
||||
<view class="page-header"
|
||||
><PageHeader title="家谱设置" custom-back @back="returnToOverview"
|
||||
/></view>
|
||||
|
||||
<view class="page-content">
|
||||
<AppLoading v-if="pageState === 'loading'" text="正在读取家谱设置" description="请稍候,正在同步当前家谱信息。" />
|
||||
<AppLoading
|
||||
v-if="pageState === 'loading'"
|
||||
text="正在读取家谱设置"
|
||||
description="请稍候,正在同步当前家谱信息。"
|
||||
/>
|
||||
|
||||
<view v-else-if="pageState === 'form'" class="settings-card">
|
||||
<text class="settings-card__title">编辑家谱信息</text>
|
||||
<text class="settings-card__note">带红色星号的内容不能为空;其余内容可按需要补充。</text>
|
||||
<text class="settings-card__note"
|
||||
>带红色星号的内容不能为空;其余内容可按需要补充。</text
|
||||
>
|
||||
|
||||
<view class="field-row">
|
||||
<text class="field-row__label"><text class="required-mark">*</text>姓氏</text>
|
||||
<input v-model="form.surname" maxlength="4" placeholder="请输入姓氏" placeholder-class="placeholder" @input="clearFieldError('surname')" />
|
||||
<text class="field-row__label"
|
||||
><text class="required-mark">*</text>姓氏</text
|
||||
>
|
||||
<input
|
||||
v-model="form.surname"
|
||||
maxlength="4"
|
||||
placeholder="请输入姓氏"
|
||||
placeholder-class="placeholder"
|
||||
@input="clearFieldError('surname')"
|
||||
/>
|
||||
</view>
|
||||
<text v-if="fieldErrors.surname" class="field-error">{{ fieldErrors.surname }}</text>
|
||||
<text v-if="fieldErrors.surname" class="field-error">{{
|
||||
fieldErrors.surname
|
||||
}}</text>
|
||||
|
||||
<view class="field-row">
|
||||
<text class="field-row__label"><text class="required-mark">*</text>谱名</text>
|
||||
<input v-model="form.genealogyName" maxlength="24" placeholder="请输入家谱名称" placeholder-class="placeholder" @input="clearFieldError('genealogyName')" />
|
||||
<text class="field-row__label"
|
||||
><text class="required-mark">*</text>谱名</text
|
||||
>
|
||||
<input
|
||||
v-model="form.genealogyName"
|
||||
maxlength="24"
|
||||
placeholder="请输入家谱名称"
|
||||
placeholder-class="placeholder"
|
||||
@input="clearFieldError('genealogyName')"
|
||||
/>
|
||||
</view>
|
||||
<text v-if="fieldErrors.genealogyName" class="field-error">{{ fieldErrors.genealogyName }}</text>
|
||||
<text v-if="fieldErrors.genealogyName" class="field-error">{{
|
||||
fieldErrors.genealogyName
|
||||
}}</text>
|
||||
|
||||
<view class="field-row field-row--selector" @click="openRegionPicker">
|
||||
<text class="field-row__label"><text class="required-mark">*</text>所在地区</text>
|
||||
<text class="region-selector-value" :class="{ 'region-selector-value--placeholder': !regionDisplay }">{{ regionDisplay || (regionLoading ? '正在加载地区…' : (regionPickerError || '请选择所在地区')) }}</text>
|
||||
<text class="field-row__label"
|
||||
><text class="required-mark">*</text>所在地区</text
|
||||
>
|
||||
<text
|
||||
class="region-selector-value"
|
||||
:class="{ 'region-selector-value--placeholder': !regionDisplay }"
|
||||
>{{
|
||||
regionDisplay ||
|
||||
(regionLoading
|
||||
? "正在加载地区…"
|
||||
: regionPickerError || "请选择所在地区")
|
||||
}}</text
|
||||
>
|
||||
</view>
|
||||
<text v-if="fieldErrors.regionCode" class="field-error">{{ fieldErrors.regionCode }}</text>
|
||||
<text v-if="fieldErrors.regionCode" class="field-error">{{
|
||||
fieldErrors.regionCode
|
||||
}}</text>
|
||||
|
||||
<view class="field-row">
|
||||
<text class="field-row__label">堂号</text>
|
||||
<input v-model="form.ancestralHall" maxlength="12" placeholder="请输入堂号" placeholder-class="placeholder" />
|
||||
<input
|
||||
v-model="form.ancestralHall"
|
||||
maxlength="12"
|
||||
placeholder="请输入堂号"
|
||||
placeholder-class="placeholder"
|
||||
/>
|
||||
</view>
|
||||
<view class="field-row">
|
||||
<text class="field-row__label">所在地</text>
|
||||
<input v-model="form.originPlace" maxlength="30" placeholder="请输入所在地" placeholder-class="placeholder" />
|
||||
<input
|
||||
v-model="form.originPlace"
|
||||
maxlength="30"
|
||||
placeholder="请输入所在地"
|
||||
placeholder-class="placeholder"
|
||||
/>
|
||||
</view>
|
||||
<view class="field-row">
|
||||
<text class="field-row__label">详细地址</text>
|
||||
<input v-model="form.addressDetail" maxlength="60" placeholder="请输入详细地址" placeholder-class="placeholder" />
|
||||
<input
|
||||
v-model="form.addressDetail"
|
||||
maxlength="60"
|
||||
placeholder="请输入详细地址"
|
||||
placeholder-class="placeholder"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="intro-field">
|
||||
<text class="intro-field__label">家谱简介</text>
|
||||
<textarea v-model="form.intro" maxlength="200" auto-height placeholder="记录家谱缘由、迁徙或家训" placeholder-class="placeholder" />
|
||||
<textarea
|
||||
v-model="form.intro"
|
||||
maxlength="200"
|
||||
auto-height
|
||||
placeholder="记录家谱缘由、迁徙或家训"
|
||||
placeholder-class="placeholder"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="cover-field">
|
||||
<view>
|
||||
<text class="cover-field__label">封面图片</text>
|
||||
<text class="cover-field__hint">{{ coverOssId ? '当前已关联封面;重新选择后会以新的真实上传回执更新。' : '选择图片后会取得真实上传回执,并在保存时关联。' }}</text>
|
||||
<text class="cover-field__hint">{{
|
||||
coverOssId
|
||||
? "当前已关联封面;重新选择后会以新的真实上传回执更新。"
|
||||
: "选择图片后会取得真实上传回执,并在保存时关联。"
|
||||
}}</text>
|
||||
</view>
|
||||
<button class="upload-button" :disabled="isUploading || isSubmitting" @click="uploadCover">{{ isUploading ? '上传中…' : '选择图片' }}</button>
|
||||
<text v-if="coverFileName" class="upload-receipt">已上传:{{ coverFileName }}</text>
|
||||
<button
|
||||
class="upload-button"
|
||||
:disabled="isUploading || isSubmitting"
|
||||
@click="uploadCover"
|
||||
>
|
||||
{{ isUploading ? "上传中…" : "选择图片" }}
|
||||
</button>
|
||||
<text v-if="coverFileName" class="upload-receipt"
|
||||
>已上传:{{ coverFileName }}</text
|
||||
>
|
||||
</view>
|
||||
<text v-if="uploadError" class="field-error">{{ uploadError }}</text>
|
||||
|
||||
@@ -64,14 +138,23 @@
|
||||
v-for="option in GENEALOGY_ACCESS_PRESET_OPTIONS"
|
||||
:key="option.value"
|
||||
class="access-rule__option"
|
||||
:class="{ 'access-rule__option--active': form.accessPreset === option.value }"
|
||||
:class="{
|
||||
'access-rule__option--active':
|
||||
form.accessPreset === option.value,
|
||||
}"
|
||||
@click="form.accessPreset = option.value"
|
||||
>{{ option.label }}</view>
|
||||
>{{ option.label }}</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<text v-if="submitError" class="submit-error">{{ submitError }}</text>
|
||||
<AppButton block :disabled="isSubmitting || isUploading" :label="isSubmitting ? '正在保存…' : '保存设置'" @click="submitUpdate" />
|
||||
<AppButton
|
||||
block
|
||||
:disabled="isSubmitting || isUploading"
|
||||
:label="isSubmitting ? '正在保存…' : '保存设置'"
|
||||
@click="submitUpdate"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view v-else class="state-card">
|
||||
@@ -84,20 +167,48 @@
|
||||
<view v-if="regionPickerOpen" class="region-sheet">
|
||||
<view class="region-sheet__mask" @click="closeRegionPicker" />
|
||||
<view class="region-sheet__panel">
|
||||
<view class="region-sheet__intro"><text class="region-sheet__title">选择地区</text></view>
|
||||
<view class="region-sheet__intro"
|
||||
><text class="region-sheet__title">选择地区</text></view
|
||||
>
|
||||
<view class="region-sheet__picker">
|
||||
<view class="region-sheet__column-headings">
|
||||
<text v-for="label in ['省份', '城市', '区县']" :key="label" class="region-sheet__column-heading">{{ label }}</text>
|
||||
<text
|
||||
v-for="label in ['省份', '城市', '区县']"
|
||||
:key="label"
|
||||
class="region-sheet__column-heading"
|
||||
>{{ label }}</text
|
||||
>
|
||||
</view>
|
||||
<picker-view class="region-sheet__picker-view" :indicator-style="regionPickerIndicatorStyle" :value="regionPickerIndexes" @change="handleRegionPickerChange">
|
||||
<picker-view-column v-for="(column, columnIndex) in regionPickerColumns" :key="columnIndex">
|
||||
<view v-for="(option, optionIndex) in column" :key="option.regionCode" class="region-sheet__picker-item" :class="{ 'region-sheet__picker-item--selected': regionPickerIndexes[columnIndex] === optionIndex }">{{ option.label }}</view>
|
||||
<picker-view
|
||||
class="region-sheet__picker-view"
|
||||
:indicator-style="regionPickerIndicatorStyle"
|
||||
:value="regionPickerIndexes"
|
||||
@change="handleRegionPickerChange"
|
||||
>
|
||||
<picker-view-column
|
||||
v-for="(column, columnIndex) in regionPickerColumns"
|
||||
:key="columnIndex"
|
||||
>
|
||||
<view
|
||||
v-for="(option, optionIndex) in column"
|
||||
:key="option.regionCode"
|
||||
class="region-sheet__picker-item"
|
||||
:class="{
|
||||
'region-sheet__picker-item--selected':
|
||||
regionPickerIndexes[columnIndex] === optionIndex,
|
||||
}"
|
||||
>{{ option.label }}</view
|
||||
>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
</view>
|
||||
<view class="region-sheet__footer">
|
||||
<view class="region-sheet__cancel" @click="closeRegionPicker">取消</view>
|
||||
<button class="region-sheet__confirm" @click="confirmRegionSelection">确认选择</button>
|
||||
<view class="region-sheet__cancel" @click="closeRegionPicker"
|
||||
>取消</view
|
||||
>
|
||||
<button class="region-sheet__confirm" @click="confirmRegionSelection">
|
||||
确认选择
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -111,9 +222,20 @@ import AppButton from "@/components/AppButton.vue";
|
||||
import AppLoading from "@/components/AppLoading.vue";
|
||||
import GenealogyPageBackground from "@/components/GenealogyPageBackground.vue";
|
||||
import PageHeader from "@/components/PageHeader.vue";
|
||||
import { appApi, createRequestController, isRequestCancelled } from "@/utils/api.js";
|
||||
import { GENEALOGY_ACCESS_PRESET, GENEALOGY_ACCESS_PRESET_OPTIONS, toApiGenealogyAccess } from "@/utils/genealogy-contracts.js";
|
||||
import { isImagePickCancelled, pickAndUploadImage } from "@/utils/resumable-image-upload.js";
|
||||
import {
|
||||
appApi,
|
||||
createRequestController,
|
||||
isRequestCancelled,
|
||||
} from "@/utils/api.js";
|
||||
import {
|
||||
GENEALOGY_ACCESS_PRESET,
|
||||
GENEALOGY_ACCESS_PRESET_OPTIONS,
|
||||
toApiGenealogyAccess,
|
||||
} from "@/utils/genealogy-contracts.js";
|
||||
import {
|
||||
isImagePickCancelled,
|
||||
pickAndUploadImage,
|
||||
} from "@/utils/resumable-image-upload.js";
|
||||
import { goBack, returnTo } from "@/utils/navigation.js";
|
||||
|
||||
const genealogyId = ref("");
|
||||
@@ -127,7 +249,11 @@ const form = reactive({
|
||||
intro: "",
|
||||
accessPreset: GENEALOGY_ACCESS_PRESET.MEMBER_ONLY,
|
||||
});
|
||||
const fieldErrors = reactive({ surname: "", genealogyName: "", regionCode: "" });
|
||||
const fieldErrors = reactive({
|
||||
surname: "",
|
||||
genealogyName: "",
|
||||
regionCode: "",
|
||||
});
|
||||
const submitError = ref("");
|
||||
const isSubmitting = ref(false);
|
||||
const isUploading = ref(false);
|
||||
@@ -143,7 +269,8 @@ const regionPickerIndexes = ref([0]);
|
||||
const regionPickerError = ref("");
|
||||
const regionLoading = ref(false);
|
||||
const regionPickerOpen = ref(false);
|
||||
const regionPickerIndicatorStyle = "height: 104rpx; border-top: 1px solid rgba(159, 23, 15, .46); border-bottom: 1px solid rgba(159, 23, 15, .46); background: rgba(159, 23, 15, .08);";
|
||||
const regionPickerIndicatorStyle =
|
||||
"height: 104rpx; border-top: 1px solid rgba(159, 23, 15, .46); border-bottom: 1px solid rgba(159, 23, 15, .46); background: rgba(159, 23, 15, .08);";
|
||||
const controller = createRequestController();
|
||||
let pageActive = true;
|
||||
|
||||
@@ -155,12 +282,24 @@ const regionDisplay = computed(() =>
|
||||
);
|
||||
const stateCopy = computed(() => {
|
||||
if (pageState.value === "success") {
|
||||
return { title: "家谱设置已保存", copy: "服务端已返回成功结果。", action: "返回家谱总览" };
|
||||
return {
|
||||
title: "家谱设置已保存",
|
||||
copy: "服务端已返回成功结果。",
|
||||
action: "返回家谱总览",
|
||||
};
|
||||
}
|
||||
if (!hasValidContext.value) {
|
||||
return { title: "家谱入口无效", copy: "没有取得有效家谱标识。", action: "返回上一页" };
|
||||
return {
|
||||
title: "家谱入口无效",
|
||||
copy: "没有取得有效家谱标识。",
|
||||
action: "返回上一页",
|
||||
};
|
||||
}
|
||||
return { title: "家谱设置暂时无法读取", copy: "请检查网络后重新读取。", action: "重新读取" };
|
||||
return {
|
||||
title: "家谱设置暂时无法读取",
|
||||
copy: "请检查网络后重新读取。",
|
||||
action: "重新读取",
|
||||
};
|
||||
});
|
||||
|
||||
const clearFieldError = (field) => {
|
||||
@@ -170,17 +309,27 @@ const clearFieldError = (field) => {
|
||||
const validate = () => {
|
||||
fieldErrors.surname = form.surname.trim() ? "" : "请填写姓氏";
|
||||
fieldErrors.genealogyName = form.genealogyName.trim() ? "" : "请填写谱名";
|
||||
fieldErrors.regionCode = (selectedRegion.value?.regionCode || currentRegionCode.value) ? "" : "请选择所在地区";
|
||||
return !fieldErrors.surname && !fieldErrors.genealogyName && !fieldErrors.regionCode;
|
||||
fieldErrors.regionCode =
|
||||
selectedRegion.value?.regionCode || currentRegionCode.value
|
||||
? ""
|
||||
: "请选择所在地区";
|
||||
return (
|
||||
!fieldErrors.surname &&
|
||||
!fieldErrors.genealogyName &&
|
||||
!fieldErrors.regionCode
|
||||
);
|
||||
};
|
||||
|
||||
const fetchRegionChildren = async (parentCode) => {
|
||||
regionLoading.value = true;
|
||||
regionPickerError.value = "";
|
||||
try {
|
||||
return await appApi.getRegionChildren(parentCode, { requestController: controller });
|
||||
return await appApi.getRegionChildren(parentCode, {
|
||||
requestController: controller,
|
||||
});
|
||||
} catch (error) {
|
||||
if (!isRequestCancelled(error)) regionPickerError.value = error?.message || "地区列表加载失败,请重试";
|
||||
if (!isRequestCancelled(error))
|
||||
regionPickerError.value = error?.message || "地区列表加载失败,请重试";
|
||||
return [];
|
||||
} finally {
|
||||
regionLoading.value = false;
|
||||
@@ -188,7 +337,8 @@ const fetchRegionChildren = async (parentCode) => {
|
||||
};
|
||||
|
||||
const loadPickerColumns = async (provinceIndex = 0, cityIndex = 0) => {
|
||||
const provinces = regionPickerColumns.value[0] || await fetchRegionChildren("0");
|
||||
const provinces =
|
||||
regionPickerColumns.value[0] || (await fetchRegionChildren("0"));
|
||||
const province = provinces[provinceIndex];
|
||||
if (!province) return;
|
||||
const cities = await fetchRegionChildren(province.regionCode);
|
||||
@@ -215,7 +365,9 @@ const loadRegionRoot = async () => {
|
||||
|
||||
const handleRegionPickerChange = async (event) => {
|
||||
if (regionLoading.value) return;
|
||||
const nextIndexes = (event?.detail?.value || []).map((index) => Number(index) || 0);
|
||||
const nextIndexes = (event?.detail?.value || []).map(
|
||||
(index) => Number(index) || 0,
|
||||
);
|
||||
const indexes = regionPickerIndexes.value;
|
||||
const provinceIndex = nextIndexes[0] || 0;
|
||||
const cityIndex = nextIndexes[1] || 0;
|
||||
@@ -236,9 +388,13 @@ const openRegionPicker = async () => {
|
||||
if (!regionPickerColumns.value.length) await loadRegionRoot();
|
||||
if (regionPickerColumns.value.length) regionPickerOpen.value = true;
|
||||
};
|
||||
const closeRegionPicker = () => { regionPickerOpen.value = false; };
|
||||
const closeRegionPicker = () => {
|
||||
regionPickerOpen.value = false;
|
||||
};
|
||||
const confirmRegionSelection = () => {
|
||||
const trail = regionPickerColumns.value.map((column, index) => column[Number(regionPickerIndexes.value[index])]).filter(Boolean);
|
||||
const trail = regionPickerColumns.value
|
||||
.map((column, index) => column[Number(regionPickerIndexes.value[index])])
|
||||
.filter(Boolean);
|
||||
const region = trail[trail.length - 1];
|
||||
if (!region) return;
|
||||
selectedRegion.value = region;
|
||||
@@ -256,7 +412,9 @@ const loadSettings = async () => {
|
||||
}
|
||||
pageState.value = "loading";
|
||||
try {
|
||||
const settings = await appApi.getGenealogySettings(genealogyId.value, { requestController: controller });
|
||||
const settings = await appApi.getGenealogySettings(genealogyId.value, {
|
||||
requestController: controller,
|
||||
});
|
||||
if (!pageActive) return;
|
||||
Object.assign(form, {
|
||||
surname: settings.surname,
|
||||
@@ -265,7 +423,8 @@ const loadSettings = async () => {
|
||||
originPlace: settings.originPlace,
|
||||
addressDetail: settings.addressDetail,
|
||||
intro: settings.intro,
|
||||
accessPreset: settings.accessPreset || GENEALOGY_ACCESS_PRESET.MEMBER_ONLY,
|
||||
accessPreset:
|
||||
settings.accessPreset || GENEALOGY_ACCESS_PRESET.MEMBER_ONLY,
|
||||
});
|
||||
currentRegionCode.value = settings.regionCode;
|
||||
currentRegionDisplay.value = settings.regionFullName || settings.regionName;
|
||||
@@ -287,7 +446,11 @@ const uploadCover = async () => {
|
||||
coverOssId.value = receipt.ossId;
|
||||
coverFileName.value = receipt.fileName || "封面图片";
|
||||
} catch (error) {
|
||||
if (pageActive && !isImagePickCancelled(error) && !isRequestCancelled(error)) {
|
||||
if (
|
||||
pageActive &&
|
||||
!isImagePickCancelled(error) &&
|
||||
!isRequestCancelled(error)
|
||||
) {
|
||||
uploadError.value = error?.message || "封面图片上传失败,请稍后重试";
|
||||
}
|
||||
} finally {
|
||||
@@ -305,17 +468,21 @@ const submitUpdate = async () => {
|
||||
isSubmitting.value = true;
|
||||
submitError.value = "";
|
||||
try {
|
||||
await appApi.updateGenealogy(genealogyId.value, {
|
||||
surname: form.surname,
|
||||
genealogyName: form.genealogyName,
|
||||
regionCode: selectedRegion.value?.regionCode || currentRegionCode.value,
|
||||
ancestralHall: form.ancestralHall,
|
||||
originPlace: form.originPlace,
|
||||
addressDetail: form.addressDetail,
|
||||
intro: form.intro,
|
||||
...(coverOssId.value ? { coverOssId: coverOssId.value } : {}),
|
||||
...access,
|
||||
}, { requestController: controller });
|
||||
await appApi.updateGenealogy(
|
||||
genealogyId.value,
|
||||
{
|
||||
surname: form.surname,
|
||||
genealogyName: form.genealogyName,
|
||||
regionCode: selectedRegion.value?.regionCode || currentRegionCode.value,
|
||||
ancestralHall: form.ancestralHall,
|
||||
originPlace: form.originPlace,
|
||||
addressDetail: form.addressDetail,
|
||||
intro: form.intro,
|
||||
...(coverOssId.value ? { coverOssId: coverOssId.value } : {}),
|
||||
...access,
|
||||
},
|
||||
{ requestController: controller },
|
||||
);
|
||||
if (!pageActive) return;
|
||||
pageState.value = "success";
|
||||
} catch (error) {
|
||||
@@ -326,11 +493,19 @@ const submitUpdate = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const returnToOverview = () => hasValidContext.value ? returnTo("G05", { genealogyId: genealogyId.value }) : goBack();
|
||||
const handleStateAction = () => pageState.value === "success" ? returnToOverview() : loadSettings();
|
||||
const returnToOverview = () =>
|
||||
hasValidContext.value
|
||||
? returnTo("G05", { genealogyId: genealogyId.value })
|
||||
: goBack();
|
||||
const handleStateAction = () =>
|
||||
pageState.value === "success" ? returnToOverview() : loadSettings();
|
||||
|
||||
onLoad((query) => { genealogyId.value = String(query?.genealogyId || ""); });
|
||||
onMounted(() => { void loadSettings(); });
|
||||
onLoad((query) => {
|
||||
genealogyId.value = String(query?.genealogyId || "");
|
||||
});
|
||||
onMounted(() => {
|
||||
void loadSettings();
|
||||
});
|
||||
onUnload(() => {
|
||||
pageActive = false;
|
||||
controller.abort();
|
||||
@@ -340,54 +515,305 @@ onUnload(() => {
|
||||
<style scoped lang="scss">
|
||||
@use "../../styles/adaptive-frame-profiles.scss" as adaptive;
|
||||
|
||||
.settings-page { display: flex; min-height: 100vh; flex-direction: column; background: $paper; }
|
||||
.page-header, .page-content { z-index: 1; }
|
||||
.page-content { flex: 1; padding: 24rpx 32rpx 72rpx; }
|
||||
.settings-card, .state-card { @include adaptive.adaptive-genealogy-state-panel; box-sizing: border-box; }
|
||||
.settings-card { padding: 42rpx 38rpx; }
|
||||
.settings-card__title, .settings-card__note, .field-error, .submit-error { display: block; }
|
||||
.settings-card__title { color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 40rpx; font-weight: 700; }
|
||||
.settings-card__note { margin-top: 12rpx; color: $ink-muted; font-size: 24rpx; line-height: 1.55; }
|
||||
.field-row { display: flex; min-height: 100rpx; align-items: center; margin-top: 22rpx; padding: 0 20rpx; border: 1rpx solid rgba(128, 89, 49, .34); border-radius: 12rpx; background: rgba(255, 252, 245, .7); }
|
||||
.field-row__label { width: 142rpx; flex: 0 0 auto; color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 30rpx; font-weight: 700; }
|
||||
.required-mark { display: inline-block; margin-right: 4rpx; color: $brand-red; font-size: 26rpx; line-height: 1; transform: translateY(-3rpx); }
|
||||
.field-row input { min-width: 0; flex: 1; color: $ink; font-size: 28rpx; }
|
||||
.field-row--selector { justify-content: space-between; cursor: pointer; }
|
||||
.region-selector-value { min-width: 0; flex: 1; color: $ink; font-size: 28rpx; text-align: right; overflow-wrap: anywhere; }
|
||||
.region-selector-value--placeholder, .placeholder { color: #ab9a86; }
|
||||
.intro-field, .cover-field { margin-top: 22rpx; padding: 20rpx; border: 1rpx solid rgba(128, 89, 49, .34); border-radius: 12rpx; background: rgba(255, 252, 245, .7); }
|
||||
.intro-field__label, .cover-field__label { display: block; color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 30rpx; font-weight: 700; }
|
||||
.intro-field textarea { display: block; width: 100%; min-height: 120rpx; margin-top: 14rpx; color: $ink; font-size: 27rpx; line-height: 1.55; }
|
||||
.cover-field { display: grid; gap: 12rpx; }
|
||||
.cover-field__hint { display: block; margin-top: 6rpx; color: $ink-muted; font-size: 21rpx; line-height: 1.45; }
|
||||
.upload-button { justify-self: start; min-height: 60rpx; margin: 0; padding: 0 20rpx; border: 1rpx solid rgba(159, 23, 15, .42); border-radius: 8rpx; background: transparent; color: $brand-red; font-size: 22rpx; }
|
||||
.upload-receipt { color: $ink-muted; font-size: 21rpx; overflow-wrap: anywhere; }
|
||||
.field-error, .submit-error { margin-top: 10rpx; color: $brand-red; font-size: 24rpx; line-height: 1.5; }
|
||||
.access-rule { margin-top: 28rpx; }
|
||||
.access-rule__label { color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 31rpx; font-weight: 700; }
|
||||
.access-rule__options { display: flex; margin-top: 16rpx; gap: 16rpx; }
|
||||
.access-rule__option { flex: 1; padding: 20rpx 12rpx; border: 1rpx solid rgba(128, 89, 49, .34); border-radius: 12rpx; color: $ink-muted; font-size: 25rpx; text-align: center; }
|
||||
.access-rule__option--active { border-color: $brand-red; background: rgba(159, 23, 15, .07); color: $brand-red; font-weight: 700; }
|
||||
.settings-card .app-button { margin-top: 32rpx; }
|
||||
.state-card { min-height: 340rpx; padding: 78rpx 52rpx 50rpx; text-align: center; }
|
||||
.state-card text { display: block; }
|
||||
.state-card text:first-child { color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 35rpx; font-weight: 700; }
|
||||
.state-card text:nth-child(2) { margin-top: 18rpx; color: $ink-muted; font-size: 24rpx; line-height: 1.65; }
|
||||
.state-card .app-button { margin-top: 28rpx; }
|
||||
.region-sheet { position: fixed; z-index: 10; inset: 0; display: flex; align-items: flex-end; }
|
||||
.region-sheet__mask { position: absolute; inset: 0; background: rgba(43, 30, 20, .42); }
|
||||
.region-sheet__panel { width: 100%; padding: 22rpx 28rpx calc(24rpx + env(safe-area-inset-bottom)); border-radius: 30rpx 30rpx 0 0; background: #fdf9ef; box-shadow: 0 -12rpx 36rpx rgba(43, 30, 20, .2); }
|
||||
.region-sheet__intro { padding: 0 10rpx 16rpx; text-align: center; }
|
||||
.region-sheet__title { display: block; color: $ink; font-family: STKaiti, KaiTi, serif; font-size: 36rpx; font-weight: 700; }
|
||||
.region-sheet__picker { border: 1rpx solid rgba(128, 89, 49, .28); border-radius: 16rpx; background: rgba(255, 252, 245, .8); }
|
||||
.region-sheet__column-headings { display: flex; height: 84rpx; border-bottom: 1rpx solid rgba(128, 89, 49, .18); }
|
||||
.region-sheet__column-heading { box-sizing: border-box; width: 33.333%; padding: 24rpx 12rpx; color: $ink-muted; font-size: 26rpx; text-align: center; }
|
||||
.region-sheet__column-heading + .region-sheet__column-heading { border-left: 1rpx solid rgba(128, 89, 49, .16); }
|
||||
.region-sheet__picker-view { width: 100%; height: 520rpx; }
|
||||
.region-sheet__picker-item { box-sizing: border-box; height: 104rpx; padding: 0 6rpx; color: $ink-muted; font-size: 26rpx; line-height: 104rpx; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.region-sheet__picker-item--selected { color: $brand-red; font-weight: 700; }
|
||||
.region-sheet__footer { display: flex; align-items: center; margin-top: 22rpx; gap: 12rpx; }
|
||||
.region-sheet__cancel { min-width: 116rpx; padding: 20rpx 10rpx; color: $ink-muted; font-size: 28rpx; text-align: center; }
|
||||
.region-sheet__confirm { flex: 1; height: 82rpx; margin: 0; padding: 0; border: 0; border-radius: 10rpx; background: $brand-red; color: #fff; font-size: 29rpx; font-weight: 700; line-height: 82rpx; }
|
||||
.region-sheet__confirm::after { display: none; }
|
||||
.settings-page {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
flex-direction: column;
|
||||
background: $paper;
|
||||
}
|
||||
.page-header,
|
||||
.page-content {
|
||||
z-index: 1;
|
||||
}
|
||||
.page-content {
|
||||
flex: 1;
|
||||
padding: 24rpx 32rpx 72rpx;
|
||||
}
|
||||
.settings-card,
|
||||
.state-card {
|
||||
@include adaptive.adaptive-genealogy-state-panel;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.settings-card {
|
||||
padding: 42rpx 38rpx;
|
||||
}
|
||||
.settings-card__title,
|
||||
.settings-card__note,
|
||||
.field-error,
|
||||
.submit-error {
|
||||
display: block;
|
||||
}
|
||||
.settings-card__title {
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 40rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.settings-card__note {
|
||||
margin-top: 12rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.55;
|
||||
}
|
||||
.field-row {
|
||||
display: flex;
|
||||
min-height: 100rpx;
|
||||
align-items: center;
|
||||
margin-top: 22rpx;
|
||||
padding: 0 20rpx;
|
||||
border: 1rpx solid rgba(128, 89, 49, 0.34);
|
||||
border-radius: 12rpx;
|
||||
background: rgba(255, 252, 245, 0.7);
|
||||
}
|
||||
.field-row__label {
|
||||
width: 142rpx;
|
||||
flex: 0 0 auto;
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.required-mark {
|
||||
display: inline-block;
|
||||
margin-right: 4rpx;
|
||||
color: $brand-red;
|
||||
font-size: 26rpx;
|
||||
line-height: 1;
|
||||
transform: translateY(-3rpx);
|
||||
}
|
||||
.field-row input {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
color: $ink;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.field-row--selector {
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
}
|
||||
.region-selector-value {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
color: $ink;
|
||||
font-size: 28rpx;
|
||||
text-align: right;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.region-selector-value--placeholder,
|
||||
.placeholder {
|
||||
color: #ab9a86;
|
||||
}
|
||||
.intro-field,
|
||||
.cover-field {
|
||||
margin-top: 22rpx;
|
||||
padding: 20rpx;
|
||||
border: 1rpx solid rgba(128, 89, 49, 0.34);
|
||||
border-radius: 12rpx;
|
||||
background: rgba(255, 252, 245, 0.7);
|
||||
}
|
||||
.intro-field__label,
|
||||
.cover-field__label {
|
||||
display: block;
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.intro-field textarea {
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-height: 120rpx;
|
||||
margin-top: 14rpx;
|
||||
color: $ink;
|
||||
font-size: 27rpx;
|
||||
line-height: 1.55;
|
||||
}
|
||||
.cover-field {
|
||||
display: grid;
|
||||
gap: 12rpx;
|
||||
}
|
||||
.cover-field__hint {
|
||||
display: block;
|
||||
margin-top: 6rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 21rpx;
|
||||
line-height: 1.45;
|
||||
}
|
||||
.upload-button {
|
||||
justify-self: start;
|
||||
min-height: 60rpx;
|
||||
margin: 0;
|
||||
padding: 0 20rpx;
|
||||
border: 1rpx solid rgba(159, 23, 15, 0.42);
|
||||
border-radius: 8rpx;
|
||||
background: transparent;
|
||||
color: $brand-red;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.upload-receipt {
|
||||
color: $ink-muted;
|
||||
font-size: 21rpx;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.field-error,
|
||||
.submit-error {
|
||||
margin-top: 10rpx;
|
||||
color: $brand-red;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.access-rule {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
.access-rule__label {
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 31rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.access-rule__options {
|
||||
display: flex;
|
||||
margin-top: 16rpx;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.access-rule__option {
|
||||
flex: 1;
|
||||
padding: 20rpx 12rpx;
|
||||
border: 1rpx solid rgba(128, 89, 49, 0.34);
|
||||
border-radius: 12rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 25rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.access-rule__option--active {
|
||||
border-color: $brand-red;
|
||||
background: rgba(159, 23, 15, 0.07);
|
||||
color: $brand-red;
|
||||
font-weight: 700;
|
||||
}
|
||||
.settings-card .app-button {
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
.state-card {
|
||||
min-height: 340rpx;
|
||||
padding: 78rpx 52rpx 50rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.state-card text {
|
||||
display: block;
|
||||
}
|
||||
.state-card text:first-child {
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 35rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.state-card text:nth-child(2) {
|
||||
margin-top: 18rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.65;
|
||||
}
|
||||
.state-card .app-button {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
.region-sheet {
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
.region-sheet__mask {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: rgba(43, 30, 20, 0.42);
|
||||
}
|
||||
.region-sheet__panel {
|
||||
width: 100%;
|
||||
padding: 22rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
background: #fdf9ef;
|
||||
box-shadow: 0 -12rpx 36rpx rgba(43, 30, 20, 0.2);
|
||||
}
|
||||
.region-sheet__intro {
|
||||
padding: 0 10rpx 16rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.region-sheet__title {
|
||||
display: block;
|
||||
color: $ink;
|
||||
font-family: STKaiti, KaiTi, serif;
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.region-sheet__picker {
|
||||
border: 1rpx solid rgba(128, 89, 49, 0.28);
|
||||
border-radius: 16rpx;
|
||||
background: rgba(255, 252, 245, 0.8);
|
||||
}
|
||||
.region-sheet__column-headings {
|
||||
display: flex;
|
||||
height: 84rpx;
|
||||
border-bottom: 1rpx solid rgba(128, 89, 49, 0.18);
|
||||
}
|
||||
.region-sheet__column-heading {
|
||||
box-sizing: border-box;
|
||||
width: 33.333%;
|
||||
padding: 24rpx 12rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.region-sheet__column-heading + .region-sheet__column-heading {
|
||||
border-left: 1rpx solid rgba(128, 89, 49, 0.16);
|
||||
}
|
||||
.region-sheet__picker-view {
|
||||
width: 100%;
|
||||
height: 520rpx;
|
||||
}
|
||||
.region-sheet__picker-item {
|
||||
box-sizing: border-box;
|
||||
height: 104rpx;
|
||||
padding: 0 6rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 26rpx;
|
||||
line-height: 104rpx;
|
||||
text-align: center;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.region-sheet__picker-item--selected {
|
||||
color: $brand-red;
|
||||
font-weight: 700;
|
||||
}
|
||||
.region-sheet__footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 22rpx;
|
||||
gap: 12rpx;
|
||||
}
|
||||
.region-sheet__cancel {
|
||||
min-width: 116rpx;
|
||||
padding: 20rpx 10rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.region-sheet__confirm {
|
||||
flex: 1;
|
||||
height: 82rpx;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 10rpx;
|
||||
background: $brand-red;
|
||||
color: #fff;
|
||||
font-size: 29rpx;
|
||||
font-weight: 700;
|
||||
line-height: 82rpx;
|
||||
}
|
||||
.region-sheet__confirm::after {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,67 +3,145 @@
|
||||
<view class="poem-page">
|
||||
<GenealogyPageBackground />
|
||||
<view class="poem-page__header">
|
||||
<PageHeader :title="pageTitle" :action="poemState === 'list' || poemState === 'empty' ? '维护' : ''" custom-back @action="enterManagement" @back="requestBack" />
|
||||
<PageHeader
|
||||
:title="pageTitle"
|
||||
:action="poemState === 'list' || poemState === 'empty' ? '维护' : ''"
|
||||
custom-back
|
||||
@action="enterManagement"
|
||||
@back="requestBack"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="poem-panel" :class="`poem-state--${poemState}`">
|
||||
<AppLoading v-if="poemState === 'loading'" text="正在读取字辈诗" description="正在整理家谱的传承字序。" />
|
||||
<AppLoading
|
||||
v-if="poemState === 'loading'"
|
||||
text="正在读取字辈诗"
|
||||
description="正在整理家谱的传承字序。"
|
||||
/>
|
||||
|
||||
<view v-else-if="poemState === 'list'" class="poem-list">
|
||||
<text class="poem-list__eyebrow">{{ genealogyName }} · 传承字序</text>
|
||||
<text class="poem-list__title">{{ generationRangeTitle }}</text>
|
||||
<text class="poem-list__copy">按已记录的世代和字辈展示传承字序。</text>
|
||||
<view class="poem-rows">
|
||||
<view v-for="item in visiblePoemRows" :key="item.poemId" class="poem-row" :class="{ 'poem-row--disabled': item.status === GENERATION_POEM_STATUS.DISABLED }">
|
||||
<view
|
||||
v-for="item in visiblePoemRows"
|
||||
:key="item.poemId"
|
||||
class="poem-row"
|
||||
:class="{
|
||||
'poem-row--disabled':
|
||||
item.status === GENERATION_POEM_STATUS.DISABLED,
|
||||
}"
|
||||
>
|
||||
<text class="poem-row__number">第 {{ item.generationNo }} 世</text>
|
||||
<text class="poem-row__character">{{ item.generationText }}</text>
|
||||
<text class="poem-row__status">{{ item.status === GENERATION_POEM_STATUS.DISABLED ? '已停用·记录保留' : '传承字序' }}</text>
|
||||
<text class="poem-row__status">{{
|
||||
item.status === GENERATION_POEM_STATUS.DISABLED
|
||||
? "已停用·记录保留"
|
||||
: "传承字序"
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="remainingPoemCount > 0" class="poem-load-more" @click="loadMorePoems">
|
||||
<view
|
||||
v-if="remainingPoemCount > 0"
|
||||
class="poem-load-more"
|
||||
@click="loadMorePoems"
|
||||
>
|
||||
<text>继续加载后续字辈(剩余 {{ remainingPoemCount }} 代)</text>
|
||||
</view>
|
||||
<view class="poem-action" @click="enterManagement">
|
||||
<image src="/static/assets/foundation/transparent/a01-scroll-primary-v3.png" mode="aspectFit" /><text>{{ canManage ? '继续维护字辈诗' : '读取维护列表' }}</text>
|
||||
<image
|
||||
src="/static/assets/foundation/transparent/a01-scroll-primary-v3.png"
|
||||
mode="aspectFit"
|
||||
/><text>{{ canManage ? "继续维护字辈诗" : "读取维护列表" }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else-if="poemState === 'edit'" class="poem-editor">
|
||||
<text class="poem-list__eyebrow">服务端批量维护</text>
|
||||
<text class="poem-list__title">录入完整字辈序列</text>
|
||||
<text class="poem-list__copy">提交前会先请求服务端批量预览。无分隔符时每个字符对应一代;也可用空格、逗号、分号、顿号、斜杠或竖线分隔多字字辈。</text>
|
||||
<text class="poem-list__copy"
|
||||
>提交前会先请求服务端批量预览。无分隔符时每个字符对应一代;也可用空格、逗号、分号、顿号、斜杠或竖线分隔多字字辈。</text
|
||||
>
|
||||
<view class="poem-field">
|
||||
<text>字辈内容</text>
|
||||
<textarea v-model="poemDraft" auto-height :maxlength="MAX_GENERATION_POEM_INPUT_LENGTH" placeholder="例如:启宗敦本,或 克勤 克俭 承先 启后" placeholder-class="poem-placeholder" @input="invalidatePreview" />
|
||||
<textarea
|
||||
v-model="poemDraft"
|
||||
auto-height
|
||||
:maxlength="MAX_GENERATION_POEM_INPUT_LENGTH"
|
||||
placeholder="例如:启宗敦本,或 克勤 克俭 承先 启后"
|
||||
placeholder-class="poem-placeholder"
|
||||
@input="invalidatePreview"
|
||||
/>
|
||||
</view>
|
||||
<text v-if="poemError" class="poem-field-error">{{ poemError }}</text>
|
||||
<view class="poem-policy">
|
||||
<text>未被新文本覆盖的后续世代</text>
|
||||
<view class="poem-policy__option" @click="toggleDisableMissing">
|
||||
<image :src="disableMissing ? '/static/assets/foundation/transparent/a01-scroll-primary-v3.png' : '/static/assets/foundation/transparent/a01-scroll-secondary-v3.png'" mode="aspectFit" />
|
||||
<text :class="{ 'poem-policy__option-text--active': disableMissing }">{{ disableMissing ? '停用并保留记录' : '保持原状态' }}</text>
|
||||
<image
|
||||
:src="
|
||||
disableMissing
|
||||
? '/static/assets/foundation/transparent/a01-scroll-primary-v3.png'
|
||||
: '/static/assets/foundation/transparent/a01-scroll-secondary-v3.png'
|
||||
"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<text
|
||||
:class="{ 'poem-policy__option-text--active': disableMissing }"
|
||||
>{{ disableMissing ? "停用并保留记录" : "保持原状态" }}</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<text class="poem-preview">{{ previewSummary }}</text>
|
||||
<view class="poem-editor__actions">
|
||||
<view class="poem-action" @click="requestLeaveEditor">
|
||||
<image src="/static/assets/foundation/transparent/a01-scroll-secondary-v3.png" mode="aspectFit" /><text class="poem-action__secondary">取消</text>
|
||||
<image
|
||||
src="/static/assets/foundation/transparent/a01-scroll-secondary-v3.png"
|
||||
mode="aspectFit"
|
||||
/><text class="poem-action__secondary">取消</text>
|
||||
</view>
|
||||
<view class="poem-action" :class="{ 'poem-action--disabled': previewing || saving }" @click="previewPoems">
|
||||
<image src="/static/assets/foundation/transparent/a01-scroll-secondary-v3.png" mode="aspectFit" /><text class="poem-action__secondary">{{ previewing ? '正在预览' : '服务端预览' }}</text>
|
||||
<view
|
||||
class="poem-action"
|
||||
:class="{ 'poem-action--disabled': previewing || saving }"
|
||||
@click="previewPoems"
|
||||
>
|
||||
<image
|
||||
src="/static/assets/foundation/transparent/a01-scroll-secondary-v3.png"
|
||||
mode="aspectFit"
|
||||
/><text class="poem-action__secondary">{{
|
||||
previewing ? "正在预览" : "服务端预览"
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="poem-action" :class="{ 'poem-action--disabled': !canSave || saving }" @click="savePoems">
|
||||
<image src="/static/assets/foundation/transparent/a01-scroll-primary-v3.png" mode="aspectFit" /><text>{{ saving ? '正在保存' : '保存字辈' }}</text>
|
||||
<view
|
||||
class="poem-action"
|
||||
:class="{ 'poem-action--disabled': !canSave || saving }"
|
||||
@click="savePoems"
|
||||
>
|
||||
<image
|
||||
src="/static/assets/foundation/transparent/a01-scroll-primary-v3.png"
|
||||
mode="aspectFit"
|
||||
/><text>{{ saving ? "正在保存" : "保存字辈" }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else class="poem-state-card">
|
||||
<text class="poem-list__eyebrow">{{ poemState === 'empty' ? '尚未建立字辈' : '字辈暂不可用' }}</text>
|
||||
<text class="poem-list__title">{{ poemState === 'empty' ? '当前读取没有正常状态字辈' : '暂时无法读取字辈诗' }}</text>
|
||||
<text class="poem-list__eyebrow">{{
|
||||
poemState === "empty" ? "尚未建立字辈" : "字辈暂不可用"
|
||||
}}</text>
|
||||
<text class="poem-list__title">{{
|
||||
poemState === "empty"
|
||||
? "当前读取没有正常状态字辈"
|
||||
: "暂时无法读取字辈诗"
|
||||
}}</text>
|
||||
<text class="poem-list__copy">{{ stateCopy }}</text>
|
||||
<view class="poem-action" @click="handleStateAction">
|
||||
<image src="/static/assets/foundation/transparent/a01-scroll-primary-v3.png" mode="aspectFit" /><text>{{ poemState === 'empty' ? '读取维护列表' : '重新读取' }}</text>
|
||||
<image
|
||||
src="/static/assets/foundation/transparent/a01-scroll-primary-v3.png"
|
||||
mode="aspectFit"
|
||||
/><text>{{
|
||||
poemState === "empty" ? "读取维护列表" : "重新读取"
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -79,7 +157,9 @@
|
||||
@confirm="confirmDiscard"
|
||||
@cancel="cancelDiscard"
|
||||
/>
|
||||
<view v-if="feedbackMessage" class="poem-feedback"><text>{{ feedbackMessage }}</text></view>
|
||||
<view v-if="feedbackMessage" class="poem-feedback"
|
||||
><text>{{ feedbackMessage }}</text></view
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -91,7 +171,11 @@ import AppLoading from "@/components/AppLoading.vue";
|
||||
import GenealogyPageBackground from "@/components/GenealogyPageBackground.vue";
|
||||
import PageHeader from "@/components/PageHeader.vue";
|
||||
import { createDiscardConfirmation } from "@/utils/discard-confirmation.js";
|
||||
import { appApi, createRequestController, isRequestCancelled } from "@/utils/api.js";
|
||||
import {
|
||||
appApi,
|
||||
createRequestController,
|
||||
isRequestCancelled,
|
||||
} from "@/utils/api.js";
|
||||
import {
|
||||
MAX_GENERATION_POEM_INPUT_LENGTH,
|
||||
GENERATION_POEM_STATUS,
|
||||
@@ -119,32 +203,46 @@ const previewSignature = ref("");
|
||||
const requestController = createRequestController();
|
||||
let requestSequence = 0;
|
||||
|
||||
const visiblePoemRows = computed(() => poemRows.value.slice(0, visiblePoemCount.value));
|
||||
const remainingPoemCount = computed(() => Math.max(0, poemRows.value.length - visiblePoemCount.value));
|
||||
const pageTitle = computed(() => poemState.value === "edit" ? "维护字辈诗" : "字辈诗");
|
||||
const visiblePoemRows = computed(() =>
|
||||
poemRows.value.slice(0, visiblePoemCount.value),
|
||||
);
|
||||
const remainingPoemCount = computed(() =>
|
||||
Math.max(0, poemRows.value.length - visiblePoemCount.value),
|
||||
);
|
||||
const pageTitle = computed(() =>
|
||||
poemState.value === "edit" ? "维护字辈诗" : "字辈诗",
|
||||
);
|
||||
const generationRangeTitle = computed(() => {
|
||||
if (!poemRows.value.length) return "尚未建立字辈";
|
||||
const first = poemRows.value[0].generationNo;
|
||||
const last = poemRows.value[poemRows.value.length - 1].generationNo;
|
||||
return first === last ? `第 ${first} 世字辈` : `第 ${first}—${last} 世字辈`;
|
||||
});
|
||||
const draftSignature = computed(() => `${poemDraft.value}\u0000${disableMissing.value}`);
|
||||
const canSave = computed(() => Boolean(preview.value) && previewSignature.value === draftSignature.value);
|
||||
const draftSignature = computed(
|
||||
() => `${poemDraft.value}\u0000${disableMissing.value}`,
|
||||
);
|
||||
const canSave = computed(
|
||||
() =>
|
||||
Boolean(preview.value) && previewSignature.value === draftSignature.value,
|
||||
);
|
||||
const previewSummary = computed(() => {
|
||||
if (previewing.value) return "正在请求服务端预览。";
|
||||
if (!preview.value) return "尚未请求服务端预览;预览成功后才可保存。";
|
||||
return `服务端预览:新增 ${preview.value.createCount} 条,更新 ${preview.value.updateCount} 条,保留 ${preview.value.keepCount} 条,停用 ${preview.value.disableCount} 条。`;
|
||||
});
|
||||
const stateCopy = computed(() => poemState.value === "empty"
|
||||
? "当前尚未添加可用的字辈,可进入维护页面查看。"
|
||||
: "暂未读取到可展示的字辈,请稍后重试。",
|
||||
const stateCopy = computed(() =>
|
||||
poemState.value === "empty"
|
||||
? "当前尚未添加可用的字辈,可进入维护页面查看。"
|
||||
: "暂未读取到可展示的字辈,请稍后重试。",
|
||||
);
|
||||
const isDirty = computed(() => Boolean(
|
||||
poemState.value === "edit" && editorSnapshot.value && (
|
||||
poemDraft.value !== editorSnapshot.value.poemDraft ||
|
||||
disableMissing.value !== editorSnapshot.value.disableMissing
|
||||
const isDirty = computed(() =>
|
||||
Boolean(
|
||||
poemState.value === "edit" &&
|
||||
editorSnapshot.value &&
|
||||
(poemDraft.value !== editorSnapshot.value.poemDraft ||
|
||||
disableMissing.value !== editorSnapshot.value.disableMissing),
|
||||
),
|
||||
));
|
||||
);
|
||||
const discardConfirmation = createDiscardConfirmation((visible) => {
|
||||
discardVisible.value = visible;
|
||||
});
|
||||
@@ -168,8 +266,12 @@ const loadPoems = async ({ management = false } = {}) => {
|
||||
poemError.value = "";
|
||||
try {
|
||||
const rows = management
|
||||
? await appApi.getGenerationPoemManagement(genealogyId.value, { requestController })
|
||||
: await appApi.getGenerationPoems(genealogyId.value, { requestController });
|
||||
? await appApi.getGenerationPoemManagement(genealogyId.value, {
|
||||
requestController,
|
||||
})
|
||||
: await appApi.getGenerationPoems(genealogyId.value, {
|
||||
requestController,
|
||||
});
|
||||
if (sequence !== requestSequence) return false;
|
||||
applyRows(rows);
|
||||
canManage.value = management;
|
||||
@@ -182,7 +284,10 @@ const loadPoems = async ({ management = false } = {}) => {
|
||||
}
|
||||
};
|
||||
const loadMorePoems = () => {
|
||||
visiblePoemCount.value = Math.min(poemRows.value.length, visiblePoemCount.value + POEM_RENDER_BATCH_SIZE);
|
||||
visiblePoemCount.value = Math.min(
|
||||
poemRows.value.length,
|
||||
visiblePoemCount.value + POEM_RENDER_BATCH_SIZE,
|
||||
);
|
||||
};
|
||||
const invalidatePreview = () => {
|
||||
poemError.value = "";
|
||||
@@ -202,7 +307,10 @@ const openEditor = () => {
|
||||
disableMissing.value = false;
|
||||
preview.value = null;
|
||||
previewSignature.value = "";
|
||||
editorSnapshot.value = Object.freeze({ poemDraft: poemDraft.value, disableMissing: disableMissing.value });
|
||||
editorSnapshot.value = Object.freeze({
|
||||
poemDraft: poemDraft.value,
|
||||
disableMissing: disableMissing.value,
|
||||
});
|
||||
poemState.value = "edit";
|
||||
return true;
|
||||
};
|
||||
@@ -234,13 +342,18 @@ const previewPoems = async () => {
|
||||
previewing.value = true;
|
||||
poemError.value = "";
|
||||
try {
|
||||
preview.value = await appApi.previewGenerationPoemBatch(genealogyId.value, {
|
||||
poemText: poemDraft.value,
|
||||
disableMissing: disableMissing.value,
|
||||
}, { requestController });
|
||||
preview.value = await appApi.previewGenerationPoemBatch(
|
||||
genealogyId.value,
|
||||
{
|
||||
poemText: poemDraft.value,
|
||||
disableMissing: disableMissing.value,
|
||||
},
|
||||
{ requestController },
|
||||
);
|
||||
previewSignature.value = draftSignature.value;
|
||||
} catch (error) {
|
||||
if (!isRequestCancelled(error)) poemError.value = error?.message || "服务端预览失败,请稍后重试。";
|
||||
if (!isRequestCancelled(error))
|
||||
poemError.value = error?.message || "服务端预览失败,请稍后重试。";
|
||||
} finally {
|
||||
previewing.value = false;
|
||||
}
|
||||
@@ -250,10 +363,14 @@ const savePoems = async () => {
|
||||
saving.value = true;
|
||||
poemError.value = "";
|
||||
try {
|
||||
await appApi.saveGenerationPoemBatch(genealogyId.value, {
|
||||
poemText: poemDraft.value,
|
||||
disableMissing: disableMissing.value,
|
||||
}, { requestController });
|
||||
await appApi.saveGenerationPoemBatch(
|
||||
genealogyId.value,
|
||||
{
|
||||
poemText: poemDraft.value,
|
||||
disableMissing: disableMissing.value,
|
||||
},
|
||||
{ requestController },
|
||||
);
|
||||
feedbackMessage.value = "服务端字辈已保存,正在刷新维护列表。";
|
||||
const loaded = await loadPoems({ management: true });
|
||||
if (!loaded) {
|
||||
@@ -263,20 +380,23 @@ const savePoems = async () => {
|
||||
editorSnapshot.value = null;
|
||||
feedbackMessage.value = "服务端字辈已保存并已刷新。";
|
||||
} catch (error) {
|
||||
if (!isRequestCancelled(error)) poemError.value = error?.message || "字辈保存失败,请稍后重试。";
|
||||
if (!isRequestCancelled(error))
|
||||
poemError.value = error?.message || "字辈保存失败,请稍后重试。";
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
};
|
||||
const requestBack = () => runBackGuard({
|
||||
transientOpen: discardVisible.value,
|
||||
internalTrail: poemState.value === "edit",
|
||||
submitting: previewing.value || saving.value,
|
||||
"close-transient": cancelDiscard,
|
||||
"pop-internal-trail": requestLeaveEditor,
|
||||
"block-submitting": () => true,
|
||||
});
|
||||
const handleStateAction = () => poemState.value === "empty" ? enterManagement() : loadPoems();
|
||||
const requestBack = () =>
|
||||
runBackGuard({
|
||||
transientOpen: discardVisible.value,
|
||||
internalTrail: poemState.value === "edit",
|
||||
submitting: previewing.value || saving.value,
|
||||
"close-transient": cancelDiscard,
|
||||
"pop-internal-trail": requestLeaveEditor,
|
||||
"block-submitting": () => true,
|
||||
});
|
||||
const handleStateAction = () =>
|
||||
poemState.value === "empty" ? enterManagement() : loadPoems();
|
||||
|
||||
onLoad((query) => {
|
||||
genealogyId.value = String(query?.genealogyId || "");
|
||||
@@ -292,46 +412,267 @@ onUnload(() => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "../../styles/adaptive-frame-profiles.scss" as adaptive;
|
||||
.poem-page { display: flex; min-height: 100vh; flex-direction: column; background: $paper; }
|
||||
.poem-page__header { z-index: 3; }
|
||||
.poem-panel { @include adaptive.adaptive-genealogy-state-panel; z-index: 2; width: calc(100% - 32rpx); margin: 18rpx auto 0; padding: 76rpx 8%; box-sizing: border-box; }
|
||||
.poem-panel > .app-loading { grid-area: 1 / 1 / -1 / -1; }
|
||||
.poem-list, .poem-editor, .poem-state-card { min-width: 0; }
|
||||
.poem-list__eyebrow { display: block; color: $brand-red; font-size: 23rpx; letter-spacing: 3rpx; }
|
||||
.poem-list__title { display: block; margin-top: 11rpx; color: $ink; font-family: "STKaiti", "KaiTi", serif; font-size: 35rpx; font-weight: 700; }
|
||||
.poem-list__copy { display: block; margin-top: 10rpx; color: $ink-muted; font-size: 24rpx; line-height: 1.55; }
|
||||
.poem-rows { margin-top: 18rpx; }
|
||||
.poem-load-more { display: flex; min-height: 64rpx; align-items: center; justify-content: center; margin-top: 14rpx; background: url("/static/assets/foundation/transparent/a01-scroll-secondary-v3.png") center / contain no-repeat; }
|
||||
.poem-load-more text { color: $ink; font-size: 23rpx; font-weight: 700; }
|
||||
.poem-row { @include adaptive.adaptive-genealogy-form-field; display: grid; min-height: 72rpx; margin-top: 10rpx; grid-template-columns: minmax(116rpx, 38%) minmax(0, 1fr) auto; align-items: center; }
|
||||
.poem-row__number { z-index: 1; grid-column: 1; margin-left: 24rpx; color: $ink-muted; font-size: 23rpx; }
|
||||
.poem-row__character { z-index: 1; grid-column: 2; min-width: 0; padding: 12rpx 16rpx 12rpx 0; color: $ink; font-family: "STKaiti", "KaiTi", serif; font-size: 32rpx; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; word-break: break-word; }
|
||||
.poem-row__status { z-index: 1; grid-column: 3; margin-right: 22rpx; color: $ink-muted; font-size: 22rpx; }
|
||||
.poem-row--disabled .poem-row__character, .poem-row--disabled .poem-row__status { color: $ink-muted; opacity: .62; }
|
||||
.poem-action { display: grid; width: 100%; min-height: 76rpx; margin-top: 20rpx; }
|
||||
.poem-action--disabled { opacity: .55; }
|
||||
.poem-action image { grid-area: 1 / 1; width: 100%; height: 100%; }
|
||||
.poem-action text { z-index: 1; display: flex; grid-area: 1 / 1; align-items: center; justify-content: center; height: 100%; color: #fff9ed; font-size: 25rpx; font-weight: 700; letter-spacing: 2rpx; }
|
||||
.poem-field { @include adaptive.adaptive-genealogy-form-field; display: grid; min-height: 118rpx; margin-top: 22rpx; }
|
||||
.poem-field > text { z-index: 1; grid-area: 1 / 1; align-self: center; margin-left: 24rpx; color: $ink; font-size: 22rpx; font-weight: 700; }
|
||||
.poem-field textarea { z-index: 1; grid-area: 1 / 1; box-sizing: border-box; width: auto; min-width: 0; min-height: 118rpx; margin-right: 20rpx; margin-left: 164rpx; padding-top: 34rpx; color: $ink; font-size: 22rpx; line-height: 1.5; }
|
||||
.poem-placeholder { color: #a79884; }
|
||||
.poem-field-error { display: block; margin-top: 4rpx; color: $brand-red; font-size: 24rpx; line-height: 34rpx; text-align: right; }
|
||||
.poem-policy { display: flex; align-items: center; justify-content: space-between; margin-top: 22rpx; }
|
||||
.poem-policy > text { color: $ink; font-size: 24rpx; font-weight: 700; }
|
||||
.poem-policy__option { display: grid; width: 248rpx; min-height: 62rpx; }
|
||||
.poem-policy__option image { grid-area: 1 / 1; width: 100%; height: 100%; }
|
||||
.poem-policy__option text { z-index: 1; display: flex; grid-area: 1 / 1; align-items: center; justify-content: center; height: 100%; color: $ink; font-size: 23rpx; font-weight: 700; }
|
||||
.poem-policy__option .poem-policy__option-text--active { color: #fff9ed; }
|
||||
.poem-preview { display: block; margin-top: 22rpx; color: $ink-muted; font-size: 23rpx; line-height: 1.6; }
|
||||
.poem-editor__actions { display: flex; gap: 14rpx; margin-top: 18rpx; }
|
||||
.poem-editor__actions .poem-action { width: calc((100% - 28rpx) / 3); margin-top: 0; }
|
||||
.poem-action .poem-action__secondary { color: $ink; }
|
||||
.poem-state-card { padding: 180rpx 4% 70rpx; text-align: center; }
|
||||
.poem-state-card .poem-list__eyebrow { text-align: center; }
|
||||
.poem-state-card .poem-list__copy { margin-top: 22rpx; }
|
||||
.poem-state-card .poem-action { width: 420rpx; max-width: 100%; margin: 34rpx auto 0; }
|
||||
.poem-feedback { position: fixed; z-index: 30; top: 138rpx; left: 50%; display: flex; min-width: 260rpx; min-height: 74rpx; align-items: center; justify-content: center; padding: 0 34rpx; transform: translateX(-50%); background: url("/static/assets/foundation/transparent/a01-scroll-secondary-v3.png") center / contain no-repeat; }
|
||||
.poem-feedback text { z-index: 1; color: $ink; font-size: 22rpx; }
|
||||
@media (min-width: 400px) { .poem-panel { width: calc(100% - 48rpx); } }
|
||||
.poem-page {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
flex-direction: column;
|
||||
background: $paper;
|
||||
}
|
||||
.poem-page__header {
|
||||
z-index: 3;
|
||||
}
|
||||
.poem-panel {
|
||||
@include adaptive.adaptive-genealogy-state-panel;
|
||||
z-index: 2;
|
||||
width: calc(100% - 32rpx);
|
||||
margin: 18rpx auto 0;
|
||||
padding: 76rpx 8%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.poem-panel > .app-loading {
|
||||
grid-area: 1 / 1 / -1 / -1;
|
||||
}
|
||||
.poem-list,
|
||||
.poem-editor,
|
||||
.poem-state-card {
|
||||
min-width: 0;
|
||||
}
|
||||
.poem-list__eyebrow {
|
||||
display: block;
|
||||
color: $brand-red;
|
||||
font-size: 23rpx;
|
||||
letter-spacing: 3rpx;
|
||||
}
|
||||
.poem-list__title {
|
||||
display: block;
|
||||
margin-top: 11rpx;
|
||||
color: $ink;
|
||||
font-family: "STKaiti", "KaiTi", serif;
|
||||
font-size: 35rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.poem-list__copy {
|
||||
display: block;
|
||||
margin-top: 10rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.55;
|
||||
}
|
||||
.poem-rows {
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
.poem-load-more {
|
||||
display: flex;
|
||||
min-height: 64rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 14rpx;
|
||||
background: url("/static/assets/foundation/transparent/a01-scroll-secondary-v3.png")
|
||||
center / contain no-repeat;
|
||||
}
|
||||
.poem-load-more text {
|
||||
color: $ink;
|
||||
font-size: 23rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.poem-row {
|
||||
@include adaptive.adaptive-genealogy-form-field;
|
||||
display: grid;
|
||||
min-height: 72rpx;
|
||||
margin-top: 10rpx;
|
||||
grid-template-columns: minmax(116rpx, 38%) minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
}
|
||||
.poem-row__number {
|
||||
z-index: 1;
|
||||
grid-column: 1;
|
||||
margin-left: 24rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 23rpx;
|
||||
}
|
||||
.poem-row__character {
|
||||
z-index: 1;
|
||||
grid-column: 2;
|
||||
min-width: 0;
|
||||
padding: 12rpx 16rpx 12rpx 0;
|
||||
color: $ink;
|
||||
font-family: "STKaiti", "KaiTi", serif;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
.poem-row__status {
|
||||
z-index: 1;
|
||||
grid-column: 3;
|
||||
margin-right: 22rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.poem-row--disabled .poem-row__character,
|
||||
.poem-row--disabled .poem-row__status {
|
||||
color: $ink-muted;
|
||||
opacity: 0.62;
|
||||
}
|
||||
.poem-action {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
min-height: 76rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.poem-action--disabled {
|
||||
opacity: 0.55;
|
||||
}
|
||||
.poem-action image {
|
||||
grid-area: 1 / 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.poem-action text {
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
grid-area: 1 / 1;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
color: #fff9ed;
|
||||
font-size: 25rpx;
|
||||
font-weight: 700;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
.poem-field {
|
||||
@include adaptive.adaptive-genealogy-form-field;
|
||||
display: grid;
|
||||
min-height: 118rpx;
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
.poem-field > text {
|
||||
z-index: 1;
|
||||
grid-area: 1 / 1;
|
||||
align-self: center;
|
||||
margin-left: 24rpx;
|
||||
color: $ink;
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.poem-field textarea {
|
||||
z-index: 1;
|
||||
grid-area: 1 / 1;
|
||||
box-sizing: border-box;
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
min-height: 118rpx;
|
||||
margin-right: 20rpx;
|
||||
margin-left: 164rpx;
|
||||
padding-top: 34rpx;
|
||||
color: $ink;
|
||||
font-size: 22rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.poem-placeholder {
|
||||
color: #a79884;
|
||||
}
|
||||
.poem-field-error {
|
||||
display: block;
|
||||
margin-top: 4rpx;
|
||||
color: $brand-red;
|
||||
font-size: 24rpx;
|
||||
line-height: 34rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.poem-policy {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
.poem-policy > text {
|
||||
color: $ink;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.poem-policy__option {
|
||||
display: grid;
|
||||
width: 248rpx;
|
||||
min-height: 62rpx;
|
||||
}
|
||||
.poem-policy__option image {
|
||||
grid-area: 1 / 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.poem-policy__option text {
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
grid-area: 1 / 1;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
color: $ink;
|
||||
font-size: 23rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.poem-policy__option .poem-policy__option-text--active {
|
||||
color: #fff9ed;
|
||||
}
|
||||
.poem-preview {
|
||||
display: block;
|
||||
margin-top: 22rpx;
|
||||
color: $ink-muted;
|
||||
font-size: 23rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.poem-editor__actions {
|
||||
display: flex;
|
||||
gap: 14rpx;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
.poem-editor__actions .poem-action {
|
||||
width: calc((100% - 28rpx) / 3);
|
||||
margin-top: 0;
|
||||
}
|
||||
.poem-action .poem-action__secondary {
|
||||
color: $ink;
|
||||
}
|
||||
.poem-state-card {
|
||||
padding: 180rpx 4% 70rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.poem-state-card .poem-list__eyebrow {
|
||||
text-align: center;
|
||||
}
|
||||
.poem-state-card .poem-list__copy {
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
.poem-state-card .poem-action {
|
||||
width: 420rpx;
|
||||
max-width: 100%;
|
||||
margin: 34rpx auto 0;
|
||||
}
|
||||
.poem-feedback {
|
||||
position: fixed;
|
||||
z-index: 30;
|
||||
top: 138rpx;
|
||||
left: 50%;
|
||||
display: flex;
|
||||
min-width: 260rpx;
|
||||
min-height: 74rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 34rpx;
|
||||
transform: translateX(-50%);
|
||||
background: url("/static/assets/foundation/transparent/a01-scroll-secondary-v3.png")
|
||||
center / contain no-repeat;
|
||||
}
|
||||
.poem-feedback text {
|
||||
z-index: 1;
|
||||
color: $ink;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
@media (min-width: 400px) {
|
||||
.poem-panel {
|
||||
width: calc(100% - 48rpx);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user