Files
yunzerwebsiteallinone/uniapp/pages/login/login.vue
T
2026-11-16 18:25:44 +08:00

1236 lines
26 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.
<template>
<view class="login-page">
<view class="deco deco-a" />
<view class="deco deco-b" />
<view v-if="step !== 'main'" class="nav-bar" :style="{ paddingTop: navPadTop }">
<view class="nav-back" :class="{ invisible: !canGoBack }" @tap="onNavBack">
<FaIcon name="chevron-left" color="#1e293b" :size="20" />
</view>
<text class="nav-title">{{ navTitle }}</text>
<view class="nav-side" />
</view>
<view class="login-body">
<view class="brand" :class="{ compact: step !== 'main' }" :style="{ paddingTop: brandPadTop }">
<view class="brand-logo">
<FaIcon name="shield-halved" color="#ffffff" :size="22" />
</view>
<text class="brand-name">温新云统一认证</text>
<text class="brand-desc">一次登录,全平台通行</text>
</view>
<view class="card">
<block v-if="step === 'main'">
<view class="panel-head">
<text class="panel-title">欢迎登录</text>
<text class="panel-sub">使用手机号快捷登录,快速完成身份认证</text>
</view>
<view v-if="errorMsg" class="error-box">
<text class="error-text">{{ errorMsg }}</text>
</view>
<!-- #ifdef MP-WEIXIN -->
<block v-if="showMiniLogin">
<button
class="btn-phone"
open-type="getPhoneNumber"
:class="{ disabled: submitting }"
@getphonenumber="onGetPhoneNumber"
>
<FaIcon name="phone" color="#ffffff" :size="20" />
<text class="btn-phone-text">{{ submitting ? '登录中...' : '手机号快捷登录' }}</text>
</button>
<view class="tip-row">
<text class="tip-text">首次使用请先用账号密码登录一次,完成账号绑定后即可快捷登录</text>
</view>
</block>
<view v-else class="loading-box">
<text class="tip-text">正在加载登录方式…</text>
</view>
<!-- #endif -->
<view class="alt-entry" @tap="goAccount">
<view class="alt-line" />
<text class="alt-text">使用账号密码登录</text>
<FaIcon name="chevron-right" color="#94a3b8" :size="12" />
<view class="alt-line" />
</view>
<view class="forget-entry" @tap="goForget">
<text class="forget-entry-text">无法登录?忘记密码</text>
</view>
<view class="back-portal" @tap="goPortal">
<FaIcon name="chevron-left" color="#94a3b8" :size="12" />
<text class="back-portal-text">返回门户,先使用免登录功能</text>
</view>
</block>
<block v-else-if="step === 'account'">
<view class="panel-head">
<text class="panel-title">欢迎回来</text>
<text class="panel-sub">请输入您的账号与密码以继续</text>
</view>
<view v-if="errorMsg" class="error-box">
<text class="error-text">{{ errorMsg }}</text>
</view>
<view class="field">
<text class="field-label">账号</text>
<view class="input-wrap">
<FaIcon name="user" color="#94a3b8" :size="16" />
<input
v-model="account"
class="field-input"
type="text"
placeholder="手机号 / 邮箱 / 企业账号"
placeholder-class="field-placeholder"
/>
</view>
</view>
<view class="field">
<text class="field-label">密码</text>
<view class="input-wrap">
<FaIcon name="lock" color="#94a3b8" :size="16" />
<input
v-model="password"
class="field-input"
:password="!showPassword"
placeholder="请输入密码"
placeholder-class="field-placeholder"
@confirm="handleLogin"
/>
<view class="eye-btn" @tap="showPassword = !showPassword">
<FaIcon
:name="showPassword ? 'eye-slash' : 'eye'"
color="#a7b1c7"
:size="16"
/>
</view>
</view>
</view>
<view class="row-extra">
<view class="remember" @tap="rememberMe = !rememberMe">
<view class="checkbox" :class="{ on: rememberMe }" />
<text class="remember-text">记住账号</text>
</view>
<view class="link-btn" @tap="goForget">
<text class="link">忘记密码</text>
</view>
</view>
<view
class="btn"
:class="{ disabled: submitting }"
@tap="handleLogin"
>
<text>{{ submitting ? '登录中...' : '登 录' }}</text>
</view>
<view class="back-row">
<text class="tip-text">没有账号?请联系企业管理员开通</text>
</view>
<view class="back-portal" @tap="goPortal">
<FaIcon name="chevron-left" color="#94a3b8" :size="12" />
<text class="back-portal-text">返回门户,先使用免登录功能</text>
</view>
</block>
<block v-else>
<view class="panel-head">
<text class="panel-title">请选择企业</text>
<text class="panel-sub">该账号已加入多家企业,请选择要进入的空间</text>
</view>
<view v-if="errorMsg" class="error-box">
<text class="error-text">{{ errorMsg }}</text>
</view>
<view class="tenant-list">
<view
v-for="item in tenants"
:key="item.tid"
class="tenant-item"
:class="{ disabled: submitting }"
@tap="chooseTenant(item)"
>
<view class="tenant-avatar">
<FaIcon name="building" color="#2563eb" :size="18" />
</view>
<view class="tenant-info">
<text class="tenant-name">{{ item.tenant_name || `企业${item.tid}` }}</text>
<text class="tenant-meta">{{ item.name ? `${item.name} · ` : '' }}企业ID {{ item.tid }}</text>
</view>
<FaIcon name="chevron-right" color="#c8cfdf" :size="14" />
</view>
</view>
</block>
<block v-if="step !== 'tenant'">
<view class="agreement" @tap="toggleAgree">
<view class="agree-dot" :class="{ on: agreed }" />
<text class="agree-text">
登录即表示同意
<text class="agree-link" @tap.stop="showAgreement">《用户协议》</text>
和
<text class="agree-link" @tap.stop="showAgreement">《隐私政策》</text>
</text>
</view>
<view v-if="!agreed && showAgreementTip" class="agree-tip">
<FaIcon name="circle-info" color="#f79009" :size="12" />
<text class="agree-tip-text">请先阅读并勾选同意《用户协议》和《隐私政策》</text>
</view>
</block>
</view>
</view>
<view class="foot-tip">
<FaIcon name="shield-halved" color="#94a3b8" :size="12" />
<text class="foot-tip-text">全程加密传输 · 账号安全可控</text>
</view>
</view>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
import {
loginUAC,
switchTenant,
fetchUserInfo,
getAuthVerifyConfig,
getMiniappLoginConfig,
loginByMiniapp,
bindMiniapp
} from '@/api/auth.js'
import {
loginSuccess,
isLoggedIn,
getRememberLogin,
saveRememberLogin,
clearRememberLogin,
setAuthTokens,
setTenants,
setTid,
setTenantName,
getTenantName,
resolveTenantName,
clearPendingAuth,
getToken
} from '@/utils/auth.js'
import { showGeetest4 } from '@/utils/geetest.js'
import { getGuestToken, clearGuestToken } from '@/utils/guest.js'
import { guestMerge } from '@/api/guest.js'
import FaIcon from '@/components/FaIcon.vue'
const platform = ref('')
// #ifdef H5
platform.value = 'h5'
// #endif
// #ifdef APP-PLUS
platform.value = 'apk'
// #endif
// #ifdef MP-WEIXIN
platform.value = 'mp-weixin'
// #endif
const step = ref(platform.value === 'mp-weixin' ? 'main' : 'account')
const account = ref('')
const password = ref('')
const showPassword = ref(false)
const agreed = ref(false)
const rememberMe = ref(false)
const submitting = ref(false)
const showAgreementTip = ref(false)
const errorMsg = ref('')
const tenants = ref([])
const verifyCfg = ref({ needGeetest: false, captchaId: '' })
const showMiniLogin = ref(false)
const navTitle = computed(() => {
if (step.value === 'tenant') return '选择企业'
return '账号密码登录'
})
const statusBarHeight = ref(0)
try {
const info =
typeof uni.getWindowInfo === 'function' ? uni.getWindowInfo() : uni.getSystemInfoSync()
statusBarHeight.value = (info && info.statusBarHeight) || 0
} catch (e) {
statusBarHeight.value = 0
}
const navPadTop = computed(() => `${statusBarHeight.value}px`)
const brandPadTop = computed(() => {
if (step.value !== 'main') return '32rpx'
return `${statusBarHeight.value + uni.upx2px(88)}px`
})
const canGoBack = computed(() => {
if (step.value === 'tenant') return true
if (step.value === 'account') return true
return false
})
function goAccount() {
if (submitting.value) return
step.value = 'account'
errorMsg.value = ''
}
function goMain() {
if (submitting.value) return
if (!showMiniLogin.value) return
step.value = 'main'
errorMsg.value = ''
}
function onNavBack() {
if (step.value === 'tenant') {
backToAccount()
return
}
if (step.value === 'account' && showMiniLogin.value) {
goMain()
return
}
goPortal()
}
function goPortal() {
if (submitting.value) return
const pages = (typeof getCurrentPages === 'function' && getCurrentPages()) || []
if (pages.length > 1) uni.navigateBack()
else uni.reLaunch({ url: '/pages/nav/nav' })
}
onMounted(async () => {
if (isLoggedIn()) {
uni.reLaunch({ url: '/pages/nav/nav' })
return
}
const remembered = getRememberLogin()
if (remembered.rememberMe) {
rememberMe.value = true
account.value = remembered.account
}
loadVerifyConfig()
loadMiniLoginConfig()
})
async function loadVerifyConfig() {
try {
const data = await getAuthVerifyConfig()
verifyCfg.value = {
needGeetest: !!data?.needGeetest,
captchaId: data?.captchaId || ''
}
} catch {
verifyCfg.value = { needGeetest: false, captchaId: '' }
}
}
async function loadMiniLoginConfig() {
if (platform.value !== 'mp-weixin') return
try {
const data = await getMiniappLoginConfig()
showMiniLogin.value = !!data?.enabled
} catch {
showMiniLogin.value = false
}
if (!showMiniLogin.value && step.value === 'main') {
step.value = 'account'
}
}
async function handleLogin() {
console.log('[login] tap handleLogin', { submitting: submitting.value, agreed: agreed.value })
if (submitting.value) {
uni.showToast({ title: '登录处理中,请稍候', icon: 'none' })
return
}
if (!agreed.value) {
let ok = false
try {
ok = await confirmAgreement()
} catch {
ok = false
}
if (!ok) {
showAgreementTip.value = true
return
}
}
const acc = account.value.trim()
if (!acc) {
uni.showToast({ title: '请输入账号', icon: 'none' })
return
}
if (!password.value) {
uni.showToast({ title: '请输入密码', icon: 'none' })
return
}
submitting.value = true
errorMsg.value = ''
try {
let captcha = null
if (verifyCfg.value.needGeetest && platform.value !== 'mp-weixin') {
if (!verifyCfg.value.captchaId) {
errorMsg.value = '人机验证未配置,请联系管理员'
return
}
captcha = await showGeetest4(verifyCfg.value.captchaId)
}
const data = await loginUAC(Object.assign({ account: acc, password: password.value }, captcha || {}))
saveRememberAccount(acc)
await handleAuthResult(data, acc)
} catch (err) {
showError(err)
} finally {
submitting.value = false
}
}
async function handleAuthResult(data, fallbackAccount = '') {
if (!data || data.code !== 200) {
errorMsg.value = (data && data.msg) || '登录失败'
return
}
if (data.need_choose_tenant) {
setAuthTokens(data.tokens || { access_token: data.access_token, sid: data.sid })
tenants.value = data.tenants || []
if (!tenants.value.length) {
clearAuthState()
errorMsg.value = '该账号未加入任何企业,请联系管理员'
return
}
step.value = 'tenant'
return
}
const list = data.tenants || []
const tid = list.length ? list[0].tid : 0
await finishLogin(data.tokens || {}, list, tid, fallbackAccount)
}
function chooseTenant(item) {
if (submitting.value) return
submitting.value = true
errorMsg.value = ''
uni.showLoading({ title: '进入中...', mask: true })
switchTenant({ tid: item.tid })
.then(async (res) => {
if (!res || !res.tokens) {
errorMsg.value = (res && res.msg) || '进入企业失败'
return
}
await finishLogin(res.tokens, tenants.value, item.tid, account.value.trim())
})
.catch((err) => showError(err))
.finally(() => {
uni.hideLoading()
submitting.value = false
})
}
function backToAccount() {
clearAuthState()
step.value = 'account'
errorMsg.value = ''
}
async function finishLogin(tokens, tenantList, tid, fallbackAccount = '') {
setAuthTokens(tokens || {})
const list = Array.isArray(tenantList) ? tenantList : []
setTenants(list)
let profile = null
try {
profile = await fetchUserInfo()
} catch {
profile = null
}
const currentTid = tid || (profile && profile.tid) || 0
const name = (profile && (profile.name || profile.nickname || profile.account)) || ''
setTid(currentTid)
setTenantName(resolveTenantName(profile || {}, currentTid))
loginSuccess({
token: getToken(),
user: {
id: (profile && (profile.id || profile.sub)) || 0,
account: (profile && (profile.account || profile.mobile)) || fallbackAccount,
name,
nickname: (profile && (profile.nickname || profile.name)) || name || fallbackAccount,
avatar: (profile && profile.avatar) || '',
phone: (profile && profile.mobile) || '',
group_id: (profile && profile.group_id) || '',
tid: currentTid,
tenant_name: resolveTenantName(profile || {}, currentTid)
}
})
await silentBindMiniapp()
if (getGuestToken()) {
try {
await guestMerge()
clearGuestToken()
} catch (e) {
console.warn('[login] guest merge failed:', e)
}
}
uni.hideLoading()
uni.showToast({ title: '登录成功', icon: 'success' })
setTimeout(() => {
uni.reLaunch({ url: '/pages/nav/nav' })
}, 400)
}
function uniLoginCode() {
return new Promise((resolve, reject) => {
uni.login({
provider: 'weixin',
success: (res) => {
if (res && res.code) resolve(res.code)
else reject(new Error('未获取到登录凭证'))
},
fail: () => reject(new Error('获取登录凭证失败'))
})
})
}
async function silentBindMiniapp() {
if (platform.value !== 'mp-weixin') return
try {
const code = await uniLoginCode()
await bindMiniapp({ code })
} catch {
}
}
// #ifdef MP-WEIXIN
async function onGetPhoneNumber(e) {
if (submitting.value) return
const detail = (e && e.detail) || {}
const errMsg = detail.errMsg || ''
if (errMsg.indexOf('deny') !== -1) {
uni.showToast({ title: '已取消手机号快捷登录', icon: 'none' })
return
}
const phoneCode = detail.code && errMsg.indexOf('fail') === -1 ? detail.code : ''
if (!agreed.value) {
const ok = await confirmAgreement()
if (!ok) {
showAgreementTip.value = true
return
}
}
submitting.value = true
errorMsg.value = ''
try {
const code = await uniLoginCode()
const data = await loginByMiniapp({ code, phoneCode })
await handleAuthResult(data)
} catch (err) {
handleMiniError(err)
} finally {
submitting.value = false
}
}
function handleMiniError(err) {
const reason = err && err.response && err.response.reason
if (reason === 'identity_not_found') {
uni.showModal({
title: '暂无使用权限',
content: '您没有该程序使用权,请联系企业管理员。也可以使用已有账号登录。',
showCancel: true,
cancelText: '知道了',
confirmText: '账号登录',
confirmColor: '#2563eb',
success: (res) => {
if (res.confirm) goAccount()
}
})
return
}
if (reason === 'not_configured') {
showMiniLogin.value = false
step.value = 'account'
}
showError(err)
}
// #endif
function saveRememberAccount(acc) {
if (rememberMe.value) {
saveRememberLogin({ tenantName: '', account: acc })
} else {
clearRememberLogin()
}
}
function clearAuthState() {
clearPendingAuth()
}
function showError(err) {
const raw = (err && err.message) || ''
if (/url not in domain list/i.test(raw)) {
errorMsg.value =
'当前小程序未配置服务器域名,请在小程序管理后台「开发管理 - 开发设置 - 服务器域名」中添加 api.yunzer.cn 为 request 合法域名'
return
}
errorMsg.value = raw || '登录失败,请稍后重试'
}
function toggleAgree() {
agreed.value = !agreed.value
if (agreed.value) showAgreementTip.value = false
}
function openLegal(path, title) {
uni.navigateTo({ url: `/pages/legal/document?path=${encodeURIComponent(path)}&title=${encodeURIComponent(title)}` })
}
function confirmAgreement() {
return new Promise((resolve) => {
let settled = false
let timer = null
const finish = (val) => {
if (settled) return
settled = true
if (timer) clearTimeout(timer)
resolve(val)
}
timer = setTimeout(() => {
console.warn('[login] confirmAgreement 超时未回调,按未同意处理')
finish(false)
}, 8000)
uni.showModal({
title: '请确认用户协议',
content: '登录即表示您已阅读并同意《用户协议》与《隐私政策》,是否同意并继续登录?',
confirmText: '同意登录',
cancelText: '再看看',
confirmColor: '#2563eb',
success: (res) => {
if (res.confirm) {
agreed.value = true
showAgreementTip.value = false
finish(true)
} else {
finish(false)
}
},
fail: () => finish(false)
})
})
}
function goForget() {
if (submitting.value) return
const remembered = getRememberLogin() || {}
const acc = String(account.value || remembered.account || '').trim()
const tenant = String(getTenantName() || remembered.tenantName || '').trim()
uni.setStorageSync('app_forget_prefill', { tenant_name: tenant, account: acc })
uni.navigateTo({
url: '/pages/login/forget',
fail: (err) => {
console.error('[login] 打开忘记密码失败:', err)
uni.showToast({ title: '打开忘记密码失败,请重试', icon: 'none' })
}
})
}
</script>
<style lang="scss" scoped>
@import '@/src/styles/page-common.scss';
.login-page {
position: relative;
min-height: 100vh;
box-sizing: border-box;
display: flex;
flex-direction: column;
background: linear-gradient(180deg, #eef4ff 0%, #ffffff 38%, #f7f9fc 100%);
padding: 0 32rpx calc(env(safe-area-inset-bottom, 0px) + 36rpx);
overflow: hidden;
}
.login-body {
margin: auto 0;
}
.deco {
position: absolute;
border-radius: 50%;
pointer-events: none;
}
.deco-a {
width: 560rpx;
height: 560rpx;
top: -260rpx;
right: -240rpx;
background: radial-gradient(circle, rgba(96, 165, 250, 0.26) 0%, rgba(96, 165, 250, 0) 70%);
}
.deco-b {
width: 520rpx;
height: 520rpx;
bottom: -260rpx;
left: -240rpx;
background: radial-gradient(circle, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0) 70%);
}
.nav-bar {
position: relative;
z-index: 2;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: content-box;
height: 88rpx;
margin-top: 8rpx;
}
.nav-back {
width: 64rpx;
height: 64rpx;
display: flex;
align-items: center;
justify-content: flex-start;
flex-shrink: 0;
&.invisible {
opacity: 0;
}
}
.nav-side {
width: 64rpx;
flex-shrink: 0;
}
.nav-title {
position: absolute;
left: 50%;
transform: translateX(-50%);
font-size: 32rpx;
font-weight: 600;
color: $color-text;
}
.brand {
position: relative;
z-index: 2;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 88rpx;
padding-bottom: 48rpx;
&.compact {
padding-bottom: 36rpx;
.brand-logo {
width: 76rpx;
height: 76rpx;
border-radius: 22rpx;
}
.brand-name {
margin-top: 16rpx;
font-size: 32rpx;
}
.brand-desc {
font-size: 22rpx;
}
}
}
.brand-logo {
width: 96rpx;
height: 96rpx;
border-radius: 28rpx;
background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
box-shadow: 0 14rpx 30rpx rgba(37, 99, 235, 0.28);
display: flex;
align-items: center;
justify-content: center;
}
.brand-name {
margin-top: 22rpx;
font-size: 38rpx;
font-weight: 600;
letter-spacing: 2rpx;
color: $color-text;
}
.brand-desc {
margin-top: 10rpx;
font-size: 24rpx;
color: $color-text-secondary;
}
.card {
position: relative;
z-index: 2;
background: $color-card;
border: 1rpx solid rgba(226, 232, 240, 0.9);
border-radius: $radius-lg;
padding: 44rpx 36rpx 32rpx;
box-shadow: 0 2rpx 8rpx rgba(15, 23, 42, 0.04), 0 18rpx 44rpx rgba(37, 99, 235, 0.1);
}
.panel-head {
margin-bottom: 32rpx;
}
.panel-title {
display: block;
font-size: 42rpx;
font-weight: 700;
letter-spacing: 1rpx;
color: #183b63;
}
.panel-sub {
display: block;
margin-top: 10rpx;
font-size: 26rpx;
color: $color-text-secondary;
}
.error-box {
background: #fff2f0;
border: 1rpx solid #ffd4cf;
border-radius: 12rpx;
padding: 18rpx 20rpx;
margin-bottom: 24rpx;
}
.error-text {
font-size: 24rpx;
color: #cf1322;
line-height: 1.6;
}
.loading-box {
display: flex;
align-items: center;
justify-content: center;
height: 96rpx;
}
.field {
margin-bottom: 28rpx;
}
.field-label {
display: block;
font-size: 26rpx;
color: $color-text-secondary;
margin-bottom: 14rpx;
font-weight: 500;
}
.input-wrap {
position: relative;
display: flex;
align-items: center;
gap: 14rpx;
background: #f8fafc;
border: 1rpx solid $color-border;
border-radius: $radius-md;
padding: 0 20rpx;
box-shadow: inset 0 2rpx 8rpx rgba(104, 158, 202, 0.05);
}
.field-input {
flex: 1;
min-width: 0;
height: 92rpx;
font-size: 28rpx;
color: $color-text;
}
.field-placeholder {
color: #adb6c9;
font-size: 28rpx;
}
.eye-btn {
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.row-extra {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 32rpx;
}
.remember {
display: flex;
align-items: center;
gap: 10rpx;
}
.checkbox {
position: relative;
width: 32rpx;
height: 32rpx;
border-radius: 8rpx;
border: 2rpx solid $color-border;
background: $color-card;
flex-shrink: 0;
&.on {
background: $color-primary;
border-color: $color-primary;
}
&.on::after {
content: '';
position: absolute;
left: 50%;
top: 48%;
width: 7rpx;
height: 14rpx;
margin-left: -4rpx;
transform: translateY(-50%) rotate(45deg);
border-right: 3rpx solid #ffffff;
border-bottom: 3rpx solid #ffffff;
}
}
.remember-text {
font-size: 26rpx;
color: $color-text-secondary;
}
.btn {
height: 92rpx;
border-radius: $radius-md;
background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
color: #ffffff;
font-size: 32rpx;
font-weight: 500;
letter-spacing: 4rpx;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 8rpx 20rpx rgba(57, 115, 255, 0.28);
&.disabled {
opacity: 0.72;
}
}
.btn-phone {
margin-top: 0;
height: 96rpx;
border-radius: 20rpx;
background: linear-gradient(135deg, #2563eb 0%, #4f8ef7 100%);
color: #ffffff;
font-size: 32rpx;
font-weight: 500;
letter-spacing: 2rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 12rpx;
border: none;
padding: 0;
box-shadow: 0 12rpx 26rpx rgba(37, 99, 235, 0.32);
&::after {
border: none;
}
&.disabled {
opacity: 0.72;
}
}
.btn-phone-text {
font-size: 32rpx;
color: #ffffff;
}
.tip-row {
margin-top: 18rpx;
display: flex;
justify-content: center;
}
.tip-text {
font-size: 22rpx;
color: $color-text-muted;
line-height: 1.6;
}
.alt-entry {
display: flex;
align-items: center;
justify-content: center;
gap: 10rpx;
margin-top: 44rpx;
}
.alt-line {
width: 80rpx;
height: 1rpx;
background: $color-border;
}
.alt-text {
font-size: 26rpx;
color: $color-text-muted;
}
.alt-entry {
display: flex;
align-items: center;
justify-content: center;
gap: 10rpx;
margin-top: 44rpx;
}
.alt-line {
width: 80rpx;
height: 1rpx;
background: $color-border;
}
.alt-text {
font-size: 26rpx;
color: $color-text-muted;
}
.back-row {
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
margin-top: 32rpx;
}
.back-portal {
display: flex;
align-items: center;
justify-content: center;
gap: 6rpx;
margin-top: 28rpx;
padding: 8rpx 0;
}
.back-portal:active {
opacity: 0.6;
}
.back-portal-text {
font-size: 24rpx;
color: $color-text-muted;
}
.link {
font-size: 26rpx;
color: $color-primary;
}
.link-btn {
display: flex;
align-items: center;
padding: 12rpx 0 12rpx 32rpx;
margin: -12rpx 0;
&:active {
opacity: 0.6;
}
}
.forget-entry {
display: flex;
align-items: center;
justify-content: center;
margin-top: 12rpx;
padding: 16rpx 0;
&:active {
opacity: 0.6;
}
}
.forget-entry-text {
font-size: 26rpx;
color: $color-primary;
}
.tenant-list {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.tenant-item {
display: flex;
align-items: center;
gap: 20rpx;
padding: 24rpx 24rpx;
border: 1rpx solid $color-border;
border-radius: $radius-md;
background: #fbfcff;
&:active {
border-color: #2563eb;
background: #f5f9ff;
}
&.disabled {
opacity: 0.6;
}
}
.tenant-avatar {
width: 72rpx;
height: 72rpx;
flex-shrink: 0;
border-radius: 16rpx;
background: rgba(57, 115, 255, 0.12);
display: flex;
align-items: center;
justify-content: center;
}
.tenant-info {
flex: 1;
min-width: 0;
}
.tenant-name {
display: block;
font-size: 30rpx;
font-weight: 500;
color: $color-text;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tenant-meta {
display: block;
margin-top: 6rpx;
font-size: 22rpx;
color: $color-text-muted;
}
.agreement {
position: relative;
z-index: 1;
display: flex;
align-items: flex-start;
gap: 12rpx;
margin-top: 36rpx;
padding: 0 4rpx;
}
.agree-dot {
position: relative;
width: 34rpx;
height: 34rpx;
border-radius: 8rpx;
border: 2rpx solid #cbd5e1;
background: $color-card;
flex-shrink: 0;
margin-top: 2rpx;
&.on {
background: $color-primary;
border-color: $color-primary;
}
&.on::after {
content: '';
position: absolute;
left: 50%;
top: 48%;
width: 8rpx;
height: 16rpx;
margin-left: -5rpx;
transform: translateY(-50%) rotate(45deg);
border-right: 3rpx solid #ffffff;
border-bottom: 3rpx solid #ffffff;
}
}
.agree-text {
flex: 1;
font-size: 22rpx;
color: $color-text-secondary;
line-height: 1.7;
}
.agree-link {
color: $color-primary;
}
.agree-tip {
display: flex;
align-items: center;
gap: 8rpx;
margin-top: 16rpx;
padding: 12rpx 18rpx;
border-radius: $radius-sm;
background: #fff7e6;
border: 1rpx solid #ffe0a3;
}
.agree-tip-text {
font-size: 22rpx;
color: #b45309;
line-height: 1.5;
}
.foot-tip {
position: relative;
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
margin-top: 40rpx;
}
.foot-tip-text {
font-size: 22rpx;
color: $color-text-muted;
}
</style>