Files
jiapuapp/pages/auth/a06-auth-status.vue
T
2026-07-14 17:36:43 +08:00

372 lines
8.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- 页面编号A-06用途承接登录未完成失败受限与授权结果 -->
<template>
<view class="auth-page status-page">
<!-- 认证入口沿用纸纹淡墨与祠堂头图不以 CSS 重绘完整装饰面 -->
<image class="paper-background" src="/static/assets/foundation/opaque/auth-page-paper.jpg" mode="aspectFill" />
<image class="scenery-background" src="/static/assets/foundation/transparent/auth-ink-scenery.png" mode="aspectFill" />
<view class="auth-content">
<view class="auth-header">
<image class="header-background" src="/static/assets/foundation/opaque/auth-header.png" mode="aspectFill" />
<image class="header-seal" src="/static/assets/foundation/transparent/brand-seal.png" mode="aspectFit" />
</view>
<view class="status-panel">
<image class="status-panel__skin" src="/static/assets/modules/auth/opaque/a02-login-panel.png" mode="scaleToFill" />
<view class="status-panel__content">
<view class="page-heading">
<image class="status-title-cloud" src="/static/assets/foundation/transparent/auth-title-cloud.png" mode="aspectFit" />
<view class="back-button" hover-class="back-hover" @click="goBack">
<image class="back-button__icon" src="/static/assets/foundation/transparent/chevron-right.png" mode="aspectFit" />
</view>
<view class="page-heading__copy">
<text class="page-title">登录提示</text>
<text class="page-subtitle">请确认当前状态后继续操作</text>
</view>
</view>
<image class="status-divider" src="/static/assets/foundation/transparent/auth-divider-knot.png" mode="aspectFit" />
<view class="status-body">
<image class="status-icon" src="/static/assets/foundation/transparent/auth-login-outline.png" mode="aspectFit" />
<text class="status-eyebrow">{{ currentState.eyebrow }}</text>
<text class="status-title">{{ currentState.title }}</text>
<text class="status-description">{{ currentState.description }}</text>
</view>
<view class="status-primary" hover-class="button-hover" @click="handlePrimary">
<image class="status-primary__skin" src="/static/assets/foundation/opaque/a01-primary-button.png" mode="scaleToFill" />
<text class="status-primary__copy">{{ currentState.primaryLabel }}</text>
</view>
<view v-if="currentState.secondaryLabel" class="status-secondary" hover-class="text-hover" @click="goLogin">
{{ currentState.secondaryLabel }}
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { computed, ref } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
const status = ref('normal')
const statusConfig = {
normal: {
eyebrow: '登录提示',
title: '登录未完成',
description: '登录流程尚未完成,请选择一种方式继续。',
primaryLabel: '返回登录',
action: 'login',
secondaryLabel: ''
},
failed: {
eyebrow: '登录提示',
title: '登录失败',
description: '当前无法完成登录,请稍后重试或改用其他方式。',
primaryLabel: '返回登录',
action: 'login',
secondaryLabel: ''
},
restricted: {
eyebrow: '账号安全',
title: '账号暂时受限',
description: '为保护家谱资料,当前账号暂不能登录。',
primaryLabel: '查看帮助',
action: 'help',
secondaryLabel: '返回登录'
},
'register-pending': {
eyebrow: '注册提示',
title: '注册尚未完成',
description: '请返回注册页完善信息后再登录。',
primaryLabel: '继续注册',
action: 'register',
secondaryLabel: '返回登录'
},
'wechat-cancelled': {
eyebrow: '微信登录',
title: '微信授权已取消',
description: '未获得微信授权,不会影响账号安全。',
primaryLabel: '返回登录',
action: 'login',
secondaryLabel: ''
},
'wechat-failed': {
eyebrow: '微信登录',
title: '微信授权失败',
description: '当前无法完成微信授权,请使用账号密码登录。',
primaryLabel: '返回登录',
action: 'login',
secondaryLabel: ''
}
}
const currentState = computed(() => statusConfig[status.value])
const resolveStatus = () => {
let requestedStatus = 'normal'
if (typeof location !== 'undefined') {
const query = new URLSearchParams(location.hash.split('?')[1] || '')
requestedStatus = query.get('status') || 'normal'
} else {
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
requestedStatus = currentPage?.options?.status || 'normal'
}
status.value = Object.prototype.hasOwnProperty.call(statusConfig, requestedStatus) ? requestedStatus : 'normal'
}
onLoad(() => {
resolveStatus()
})
onShow(() => {
resolveStatus()
})
const goLogin = () => {
uni.navigateTo({ url: '/pages/auth/a02-login' })
}
const goRegister = () => {
uni.navigateTo({ url: '/pages/auth/a04-register' })
}
const handlePrimary = () => {
if (currentState.value.action === 'register') {
goRegister()
return
}
if (currentState.value.action === 'help') {
uni.showToast({ title: '账号申诉功能待接入', icon: 'none' })
return
}
goLogin()
}
const goBack = () => {
uni.navigateBack()
}
</script>
<style scoped lang="scss">
.auth-page {
position: relative;
min-height: 100vh;
background: #f7f1e6;
}
.paper-background,
.scenery-background {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}
.paper-background { opacity: 0.96; }
.scenery-background { opacity: 0.76; }
.auth-content {
position: relative;
z-index: 1;
box-sizing: border-box;
min-height: 100vh;
padding-bottom: calc(44rpx + env(safe-area-inset-bottom));
}
.auth-header {
position: relative;
height: 253rpx;
overflow: hidden;
}
.header-background {
width: 100%;
height: 100%;
}
.header-seal {
position: absolute;
top: 70rpx;
left: 50%;
width: 136rpx;
height: 136rpx;
transform: translateX(-50%);
}
.status-panel {
position: relative;
min-height: 1030rpx;
margin: 32rpx 42rpx 0;
}
.status-panel__skin {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.status-panel__content {
position: relative;
z-index: 1;
box-sizing: border-box;
min-height: 1030rpx;
padding: 66rpx 50rpx 72rpx;
}
.page-heading {
position: relative;
display: flex;
align-items: center;
}
.status-title-cloud {
position: absolute;
top: -26rpx;
right: 2rpx;
width: 154rpx;
height: 92rpx;
opacity: 0.62;
}
.back-button {
display: flex;
align-items: center;
justify-content: center;
width: 56rpx;
height: 56rpx;
margin-right: 18rpx;
}
.back-hover { opacity: 0.62; }
.back-button__icon {
width: 42rpx;
height: 42rpx;
transform: scaleX(-1);
}
.page-heading__copy {
position: relative;
z-index: 1;
}
.page-title,
.page-subtitle {
display: block;
}
.page-title {
color: #3f2c1d;
font-family: STKaiti, KaiTi, serif;
font-size: 50rpx;
font-weight: 700;
letter-spacing: 4rpx;
}
.page-subtitle {
margin-top: 10rpx;
color: #8c7864;
font-size: 24rpx;
letter-spacing: 1rpx;
}
.status-divider {
display: block;
width: 154rpx;
height: 42rpx;
margin: 40rpx auto 0;
}
.status-body {
display: flex;
flex-direction: column;
align-items: center;
min-height: 430rpx;
padding-top: 54rpx;
text-align: center;
}
.status-icon {
width: 132rpx;
height: 132rpx;
opacity: 0.82;
}
.status-eyebrow {
display: block;
margin-top: 28rpx;
color: #a7160c;
font-size: 24rpx;
letter-spacing: 3rpx;
}
.status-title {
display: block;
margin-top: 18rpx;
color: #3f2c1d;
font-family: STKaiti, KaiTi, serif;
font-size: 44rpx;
font-weight: 700;
letter-spacing: 4rpx;
}
.status-description {
display: block;
box-sizing: border-box;
width: 100%;
min-height: 64rpx;
margin-top: 20rpx;
padding: 0 8rpx;
color: #786654;
font-size: 26rpx;
line-height: 1.8;
}
.status-primary {
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 128rpx;
overflow: hidden;
}
.status-primary__skin {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}
.status-primary__copy {
position: relative;
z-index: 1;
color: #fffaf0;
font-family: STKaiti, KaiTi, serif;
font-size: 36rpx;
letter-spacing: 6rpx;
}
.status-secondary {
display: flex;
align-items: center;
justify-content: center;
min-height: 88rpx;
color: #a7160c;
font-size: 25rpx;
}
.button-hover { opacity: 0.84; }
.text-hover { opacity: 0.64; }
</style>