验收20%

This commit is contained in:
2026-07-16 07:42:07 +08:00
parent 0dec90ffdd
commit cb25317412
108 changed files with 6477 additions and 1308 deletions
+64 -20
View File
@@ -3,7 +3,7 @@
<view class="join-page">
<image class="join-page__paper" src="/static/assets/foundation/opaque/page-paper.jpg" mode="aspectFill" />
<image class="join-page__footer" src="/static/assets/foundation/transparent/footer-mountain-bamboo.png" mode="widthFix" />
<view class="join-page__header"><PageHeader title="申请加入家谱" /></view>
<view class="join-page__header"><PageHeader :title="sourceContract.headerTitle" /></view>
<view class="join-panel" :class="{
'join-state--form': joinState === 'form',
@@ -13,37 +13,40 @@
<image class="join-panel__skin" src="/static/assets/modules/genealogy/opaque/g03-create-flow-panel.png" mode="scaleToFill" />
<view v-if="joinState === 'form'" class="join-form">
<text class="join-form__eyebrow">公开家谱入谱申请</text>
<text class="join-form__title">申请加入 {{ genealogyName }}</text>
<text class="join-form__copy">请填写真实身份和亲属关系管理员审核后会通过消息告知结果</text>
<text class="join-form__eyebrow">{{ sourceContract.eyebrow }}</text>
<text class="join-form__title">{{ sourceContract.formTitle }} {{ genealogyName }}</text>
<text class="join-form__copy">{{ sourceContract.formCopy }}</text>
<view class="join-field">
<image src="/static/assets/modules/genealogy/opaque/g06-search-input-wide.png" mode="scaleToFill" />
<text>真实姓名</text><input v-model="form.realName" placeholder="请输入真实姓名" placeholder-class="join-placeholder" />
<text>真实姓名</text><input v-model="form.realName" placeholder="请输入真实姓名" placeholder-class="join-placeholder" @input="clearFieldError('realName')" />
</view>
<text v-if="fieldErrors.realName" class="join-field-error">{{ fieldErrors.realName }}</text>
<view class="join-field">
<image src="/static/assets/modules/genealogy/opaque/g06-search-input-wide.png" mode="scaleToFill" />
<text>与家谱关系</text><input v-model="form.relation" placeholder="例如:汤正华堂侄" placeholder-class="join-placeholder" />
<text>与家谱关系</text><input v-model="form.relation" placeholder="例如:汤正华堂侄" placeholder-class="join-placeholder" @input="clearFieldError('relation')" />
</view>
<text v-if="fieldErrors.relation" class="join-field-error">{{ fieldErrors.relation }}</text>
<text class="relation-help">请以家谱中一位已知长辈为参照例如汤正华堂侄</text>
<view class="join-field join-field--message">
<image src="/static/assets/modules/genealogy/opaque/g06-search-input-wide.png" mode="scaleToFill" />
<text>申请说明</text><textarea v-model="form.message" maxlength="80" placeholder="补充祖居地、长辈姓名等核验信息" placeholder-class="join-placeholder" />
<text>{{ sourceContract.thirdFieldLabel }}</text><textarea v-model="form.message" maxlength="80" :placeholder="sourceContract.thirdFieldPlaceholder" placeholder-class="join-placeholder" />
</view>
<text class="join-form__note">提交后可在我的申请中查看审核进度</text>
<text class="join-form__note">{{ sourceContract.note }}</text>
<view class="join-action" @click="submitJoin">
<image src="/static/assets/foundation/opaque/a01-primary-button.png" mode="scaleToFill" />
<text>{{ isSubmitting ? '正在提交…' : '提交申请' }}</text>
<text>{{ isSubmitting ? sourceContract.submittingLabel : sourceContract.submitLabel }}</text>
</view>
</view>
<view v-else class="join-result">
<text class="join-result__eyebrow">{{ joinState === 'success' ? '申请已送达' : '申请未提交' }}</text>
<text class="join-result__title">{{ joinState === 'success' ? '等待管理员核实亲属关系' : '暂时无法提交申请' }}</text>
<text class="join-result__eyebrow">{{ joinState === 'success' ? sourceContract.successEyebrow : sourceContract.errorEyebrow }}</text>
<text class="join-result__title">{{ joinState === 'success' ? sourceContract.successTitle : sourceContract.errorTitle }}</text>
<text class="join-result__copy">{{ resultCopy }}</text>
<view class="join-action" @click="joinState === 'success' ? toMyApplications() : retryForm()">
<view class="join-action" @click="joinState === 'success' ? completeFlow() : retryForm()">
<image src="/static/assets/foundation/opaque/a01-primary-button.png" mode="scaleToFill" />
<text>{{ joinState === 'success' ? '查看我的申请' : '重新填写' }}</text>
<text>{{ joinState === 'success' ? sourceContract.nextLabel : '重新填写' }}</text>
</view>
</view>
</view>
@@ -56,6 +59,7 @@ import { onLoad } from '@dcloudio/uni-app'
import PageHeader from '@/components/PageHeader.vue'
const genealogyId = ref('')
const source = ref('search')
const genealogyName = ref('这部家谱')
const genealogyPreview = {
'1001': '汤氏家谱',
@@ -65,12 +69,47 @@ const joinState = ref('form')
const isSubmitting = ref(false)
const errorMessage = ref('')
const form = reactive({ realName: '', relation: '', message: '' })
const fieldErrors = reactive({ realName: '', relation: '' })
const sourceContract = computed(() => source.value === 'invite' ? {
headerTitle: '确认关系并加入',
eyebrow: '邀请码直接加入',
formTitle: '确认加入',
formCopy: '请填写真实身份和亲属关系;提交后直接加入,无需等待管理员审核。',
thirdFieldLabel: '补充信息',
thirdFieldPlaceholder: '选填:补充祖居地、长辈姓名等信息',
note: '邀请码来源提交后直接加入,无需等待审核。',
submitLabel: '确认加入',
submittingLabel: '正在加入…',
successEyebrow: '已加入家谱',
successTitle: '关系信息已提交',
errorEyebrow: '加入未完成',
errorTitle: '暂时无法加入家谱',
nextLabel: '返回我的家谱',
successCopy: `已直接加入“${genealogyName.value}”,无需等待审核;返回后将刷新并选中这部家谱。`
} : {
headerTitle: '申请加入家谱',
eyebrow: '公开家谱入谱申请',
formTitle: '申请加入',
formCopy: '请填写真实身份和亲属关系,管理员审核后会通过消息告知结果。',
thirdFieldLabel: '申请说明',
thirdFieldPlaceholder: '补充祖居地、长辈姓名等核验信息',
note: '提交后可在“我的申请”中查看审核进度。',
submitLabel: '提交申请',
submittingLabel: '正在提交…',
successEyebrow: '申请已送达',
successTitle: '等待管理员核实亲属关系',
errorEyebrow: '申请未提交',
errorTitle: '暂时无法提交申请',
nextLabel: '查看我的申请',
successCopy: `${genealogyName.value}”的管理员会在核实后给出结果,请留意消息中心。`
})
const resultCopy = computed(() => joinState.value === 'success'
? `${genealogyName.value}”的管理员会在核实后给出结果,请留意消息中心。`
? sourceContract.value.successCopy
: errorMessage.value || '请检查网络后重新填写;未成功提交的内容不会进入审核列表。')
onLoad((query) => {
genealogyId.value = query.genealogyId || ''
source.value = query.source === 'invite' ? 'invite' : 'search'
if (query.state === 'success') {
joinState.value = 'success'
return
@@ -85,22 +124,25 @@ onLoad((query) => {
const submitJoin = () => {
if (isSubmitting.value) return
if (!form.realName.trim() || !form.relation.trim()) {
uni.showToast({ title: '请填写真实姓名和亲属关系', icon: 'none' })
return
}
fieldErrors.realName = form.realName.trim() ? '' : '请填写真实姓名'
fieldErrors.relation = form.relation.trim() ? '' : '请填写与家谱的关系'
if (fieldErrors.realName || fieldErrors.relation) return
isSubmitting.value = true
setTimeout(() => {
joinState.value = 'success'
joinState.value = form.realName.trim() === '失败' ? 'error' : 'success'
if (joinState.value === 'error') errorMessage.value = source.value === 'invite' ? '邀请码加入暂未完成,请稍后重试。' : '申请暂未提交,请稍后重试。'
isSubmitting.value = false
}, 280)
}
const clearFieldError = (field) => { fieldErrors[field] = '' }
const retryForm = () => { joinState.value = 'form'; errorMessage.value = '' }
const toMyApplications = () => uni.redirectTo({ url: '/pages/genealogy/g09-my-applications' })
const toMyGenealogies = () => uni.reLaunch({ url: `/pages/genealogy/g01-my-genealogies?genealogyId=${genealogyId.value}` })
const completeFlow = () => source.value === 'invite' ? toMyGenealogies() : toMyApplications()
</script>
<style scoped lang="scss">
.join-page { position: relative; min-height: 100vh; overflow: hidden; background: $paper; }
.join-page { position: relative; min-height: 100vh; overflow-x: hidden; background: $paper; }
.join-page__paper { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; opacity: .98; pointer-events: none; }
.join-page__footer { position: absolute; right: 0; bottom: 0; left: 0; z-index: 1; width: 100%; opacity: .13; pointer-events: none; }
.join-page__header { position: relative; z-index: 3; }
@@ -116,6 +158,8 @@ const toMyApplications = () => uni.redirectTo({ url: '/pages/genealogy/g09-my-ap
.join-field input, .join-field textarea { position: absolute; top: 0; right: 20rpx; bottom: 0; left: 170rpx; z-index: 1; height: 92rpx; color: $ink; font-size: 23rpx; line-height: 92rpx; }
.join-field textarea { box-sizing: border-box; padding-top: 26rpx; line-height: 1.5; }
.join-placeholder { color: #a79884; }
.join-field-error { display: block; margin-top: 3rpx; color: $brand-red; font-size: 20rpx; text-align: right; }
.relation-help { display: block; margin-top: 5rpx; color: #8e7b67; font-size: 19rpx; line-height: 29rpx; }
.join-form__note { display: block; margin-top: 18rpx; color: $ink-muted; font-size: 21rpx; text-align: center; }
.join-action { position: relative; width: 100%; height: 82rpx; margin-top: 20rpx; }
.join-action image { position: absolute; inset: 0; width: 100%; height: 100%; }