556 lines
22 KiB
Vue
556 lines
22 KiB
Vue
<template>
|
||
<view class="login-page">
|
||
<view class="deco deco-a" />
|
||
<view class="deco deco-b" />
|
||
|
||
<view class="nav-bar" :style="{ paddingTop: navPadTop, height: navInnerHeight }">
|
||
<view class="nav-back" @tap="goPortal">
|
||
<FaIcon name="chevron-left" color="#1e293b" :size="18" />
|
||
<text class="nav-back-text">返回</text>
|
||
</view>
|
||
<text class="nav-title">{{ step === 'tenant' ? '选择企业' : '登录 / 注册' }}</text>
|
||
<view class="nav-side" />
|
||
</view>
|
||
|
||
<view class="login-body">
|
||
<view class="brand">
|
||
<view class="brand-logo"><FaIcon name="shield-halved" color="#ffffff" :size="22" /></view>
|
||
<text class="brand-name">温新云统一认证</text>
|
||
<text class="brand-desc">一次登录,全平台通行</text>
|
||
</view>
|
||
|
||
<block v-if="step === 'tenant'">
|
||
<view class="card">
|
||
<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" @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>
|
||
<view class="back-row" @tap="backToAccount"><text>返回重新登录</text></view>
|
||
</view>
|
||
</block>
|
||
|
||
<block v-else>
|
||
<view class="card">
|
||
<view class="mode-tabs">
|
||
<view class="mode-tab" :class="{ on: mode === 'wechat' }" @tap="switchMode('wechat')">一键登录</view>
|
||
<view class="mode-tab" :class="{ on: mode === 'password' }" @tap="switchMode('password')">账号密码</view>
|
||
<view class="mode-tab" :class="{ on: mode === 'sms' }" @tap="switchMode('sms')">手机号</view>
|
||
<view class="mode-tab" :class="{ on: mode === 'email' }" @tap="switchMode('email')">邮箱</view>
|
||
</view>
|
||
|
||
<view v-if="errorMsg" class="error-box"><text class="error-text">{{ errorMsg }}</text></view>
|
||
|
||
<!-- 手机号一键登录 -->
|
||
<view v-if="mode === 'wechat'" class="panel panel-center">
|
||
<view class="panel-head">
|
||
<text class="panel-title">快捷登录</text>
|
||
<text class="panel-sub">一键登陆,快速进入工作台</text>
|
||
</view>
|
||
<!-- #ifdef MP-WEIXIN -->
|
||
<button class="btn btn-primary" open-type="getPhoneNumber" :disabled="submitting" @getphonenumber="onWxPhone">
|
||
<text>{{ submitting ? '登录中...' : '快捷登录' }}</text>
|
||
</button>
|
||
<!-- #endif -->
|
||
<!-- #ifndef MP-WEIXIN -->
|
||
<view class="tip-row"><text class="tip-text">请在小程序中使用快捷登录</text></view>
|
||
<!-- #endif -->
|
||
<view class="tip-row"><text class="tip-text">未注册的手机号在验证后,按提示完成注册即可</text></view>
|
||
</view>
|
||
|
||
<!-- 账号密码 -->
|
||
<view v-else-if="mode === 'password'" class="panel">
|
||
<view class="panel-head">
|
||
<text class="panel-title">账号密码登录</text>
|
||
<text class="panel-sub">请输入账号与密码,并完成人机验证</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="手机号 / 邮箱 / 企业账号" />
|
||
</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="请输入密码" @confirm="submitPassword" />
|
||
<view class="eye-btn" @tap="showPassword = !showPassword">
|
||
<FaIcon :name="showPassword ? 'eye-slash' : 'eye'" color="#a7b1c7" :size="16" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<button class="btn btn-primary" :disabled="submitting" @tap="submitPassword">{{ submitting ? '登录中...' : '登 录' }}</button>
|
||
</view>
|
||
|
||
<!-- 手机号验证码 -->
|
||
<view v-else-if="mode === 'sms'" class="panel">
|
||
<view class="panel-head">
|
||
<text class="panel-title">手机号验证码登录</text>
|
||
<text class="panel-sub">输入已注册手机号,获取验证码登录</text>
|
||
</view>
|
||
<view class="field">
|
||
<text class="field-label">手机号</text>
|
||
<view class="input-wrap">
|
||
<FaIcon name="phone" color="#94a3b8" :size="16" />
|
||
<input v-model="smsPhone" class="field-input" type="number" :maxlength="11" placeholder="请输入手机号" />
|
||
</view>
|
||
</view>
|
||
<view class="field">
|
||
<text class="field-label">验证码</text>
|
||
<view class="code-row">
|
||
<input v-model="smsCode" class="field-input code-input" type="number" :maxlength="6" placeholder="请输入验证码" />
|
||
<button class="code-btn" :disabled="smsCountdown > 0 || codeBusy" @tap="sendCode('sms')">{{ smsCountdown > 0 ? (smsCountdown + 's') : (codeBusy ? '发送中' : '获取验证码') }}</button>
|
||
</view>
|
||
</view>
|
||
<button class="btn btn-primary" :disabled="submitting" @tap="submitCode('sms')">{{ submitting ? '登录中...' : '登 录' }}</button>
|
||
</view>
|
||
|
||
<!-- 邮箱验证码 -->
|
||
<view v-else class="panel">
|
||
<view class="panel-head">
|
||
<text class="panel-title">邮箱验证码登录</text>
|
||
<text class="panel-sub">输入已注册邮箱,获取验证码登录</text>
|
||
</view>
|
||
<view class="field">
|
||
<text class="field-label">邮箱</text>
|
||
<view class="input-wrap">
|
||
<FaIcon name="envelope" color="#94a3b8" :size="16" />
|
||
<input v-model="emailAddr" class="field-input" type="text" placeholder="请输入邮箱" />
|
||
</view>
|
||
</view>
|
||
<view class="field">
|
||
<text class="field-label">验证码</text>
|
||
<view class="code-row">
|
||
<input v-model="emailCode" class="field-input code-input" type="number" :maxlength="6" placeholder="请输入验证码" />
|
||
<button class="code-btn" :disabled="emailCountdown > 0 || codeBusy" @tap="sendCode('email')">{{ emailCountdown > 0 ? (emailCountdown + 's') : (codeBusy ? '发送中' : '获取验证码') }}</button>
|
||
</view>
|
||
</view>
|
||
<button class="btn btn-primary" :disabled="submitting" @tap="submitCode('email')">{{ submitting ? '登录中...' : '登 录' }}</button>
|
||
</view>
|
||
</view>
|
||
</block>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||
import FaIcon from '@/components/FaIcon.vue'
|
||
import {
|
||
loginUAC,
|
||
switchTenant,
|
||
fetchUserInfo,
|
||
getMiniappLoginConfig,
|
||
loginByMiniapp,
|
||
bindMiniapp,
|
||
sendAuthLoginCode,
|
||
loginByAuthCode
|
||
} from '@/api/auth.js'
|
||
import { onboardingPhone } from '@/api/onboarding.js'
|
||
import {
|
||
loginSuccess,
|
||
isLoggedIn,
|
||
getRememberLogin,
|
||
saveRememberLogin,
|
||
clearRememberLogin,
|
||
setAuthTokens,
|
||
setTenants,
|
||
setTid,
|
||
setTenantName,
|
||
getTenantName,
|
||
resolveTenantName,
|
||
clearPendingAuth,
|
||
getToken
|
||
} from '@/utils/auth.js'
|
||
import { getGuestToken, clearGuestToken } from '@/utils/guest.js'
|
||
import { guestMerge } from '@/api/guest.js'
|
||
|
||
const platform = ref('mp-weixin')
|
||
// #ifdef H5
|
||
platform.value = 'h5'
|
||
// #endif
|
||
// #ifdef APP-PLUS
|
||
platform.value = 'apk'
|
||
// #endif
|
||
// #ifdef MP-WEIXIN
|
||
platform.value = 'mp-weixin'
|
||
// #endif
|
||
|
||
const step = ref('account')
|
||
const mode = ref(platform.value === 'mp-weixin' ? 'wechat' : 'password')
|
||
const account = ref('')
|
||
const password = ref('')
|
||
const showPassword = ref(false)
|
||
const rememberMe = ref(false)
|
||
const submitting = ref(false)
|
||
const errorMsg = ref('')
|
||
const tenants = ref([])
|
||
const showMiniLogin = ref(false)
|
||
|
||
const smsPhone = ref('')
|
||
const smsCode = ref('')
|
||
const emailAddr = ref('')
|
||
const emailCode = ref('')
|
||
const smsCountdown = ref(0)
|
||
const emailCountdown = ref(0)
|
||
const codeBusy = ref(false)
|
||
let smsTimer = null
|
||
let emailTimer = null
|
||
|
||
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 navInnerHeight = computed(() => {
|
||
// #ifdef MP-WEIXIN
|
||
try {
|
||
const mb = typeof uni.getMenuButtonBoundingClientRect === 'function' ? uni.getMenuButtonBoundingClientRect() : null
|
||
if (mb && mb.height > 0 && mb.top > 0) {
|
||
const gap = mb.top - statusBarHeight.value
|
||
const h = gap * 2 + mb.height
|
||
if (h > 0) return `${h}px`
|
||
}
|
||
} catch (e) {
|
||
}
|
||
// #endif
|
||
return '88rpx'
|
||
})
|
||
|
||
function switchMode(next) {
|
||
if (submitting.value) return
|
||
mode.value = next
|
||
errorMsg.value = ''
|
||
}
|
||
|
||
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.account) {
|
||
account.value = remembered.account
|
||
rememberMe.value = true
|
||
}
|
||
const tenantName = remembered.tenantName || getTenantName() || ''
|
||
if (tenantName) getTenantName()
|
||
loadMiniConfig()
|
||
})
|
||
|
||
onUnmounted(() => {
|
||
if (smsTimer) clearInterval(smsTimer)
|
||
if (emailTimer) clearInterval(emailTimer)
|
||
})
|
||
|
||
async function loadMiniConfig() {
|
||
if (platform.value !== 'mp-weixin') return
|
||
try {
|
||
const data = await getMiniappLoginConfig()
|
||
showMiniLogin.value = !!(data && data.enabled)
|
||
} catch {
|
||
showMiniLogin.value = false
|
||
}
|
||
}
|
||
|
||
function saveRememberAccount(acc) {
|
||
if (rememberMe.value) saveRememberLogin({ tenantName: '', account: acc })
|
||
else clearRememberLogin()
|
||
}
|
||
|
||
async function submitPassword() {
|
||
if (submitting.value) return
|
||
const acc = account.value.trim()
|
||
if (!acc) { errorMsg.value = '请输入账号'; return }
|
||
if (!password.value) { errorMsg.value = '请输入密码'; return }
|
||
submitting.value = true
|
||
errorMsg.value = ''
|
||
try {
|
||
const data = await loginUAC({ account: acc, password: password.value })
|
||
saveRememberAccount(acc)
|
||
await handleAuthResult(data, acc)
|
||
} catch (err) {
|
||
showError(err)
|
||
} finally {
|
||
submitting.value = false
|
||
}
|
||
}
|
||
|
||
function startCountdown(channel) {
|
||
if (channel === 'sms') {
|
||
smsCountdown.value = 60
|
||
if (smsTimer) clearInterval(smsTimer)
|
||
smsTimer = setInterval(() => {
|
||
smsCountdown.value--
|
||
if (smsCountdown.value <= 0) { clearInterval(smsTimer); smsTimer = null }
|
||
}, 1000)
|
||
} else {
|
||
emailCountdown.value = 60
|
||
if (emailTimer) clearInterval(emailTimer)
|
||
emailTimer = setInterval(() => {
|
||
emailCountdown.value--
|
||
if (emailCountdown.value <= 0) { clearInterval(emailTimer); emailTimer = null }
|
||
}, 1000)
|
||
}
|
||
}
|
||
|
||
async function sendCode(channel) {
|
||
if (codeBusy.value) return
|
||
errorMsg.value = ''
|
||
const accountValue = (channel === 'sms' ? smsPhone.value : emailAddr.value).trim()
|
||
if (!accountValue) {
|
||
errorMsg.value = channel === 'sms' ? '请输入手机号' : '请输入邮箱'
|
||
return
|
||
}
|
||
if (channel === 'sms' && !/^1\d{10}$/.test(accountValue)) {
|
||
errorMsg.value = '请输入正确的手机号'
|
||
return
|
||
}
|
||
if (channel === 'email' && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(accountValue)) {
|
||
errorMsg.value = '请输入正确的邮箱'
|
||
return
|
||
}
|
||
codeBusy.value = true
|
||
try {
|
||
await sendAuthLoginCode({ account: accountValue, channel })
|
||
startCountdown(channel)
|
||
uni.showToast({ title: '验证码已发送', icon: 'success' })
|
||
} catch (err) {
|
||
showError(err)
|
||
} finally {
|
||
codeBusy.value = false
|
||
}
|
||
}
|
||
|
||
async function submitCode(channel) {
|
||
if (submitting.value) return
|
||
errorMsg.value = ''
|
||
const accountValue = (channel === 'sms' ? smsPhone.value : emailAddr.value).trim()
|
||
const code = (channel === 'sms' ? smsCode.value : emailCode.value).trim()
|
||
if (!accountValue) {
|
||
errorMsg.value = channel === 'sms' ? '请输入手机号' : '请输入邮箱'
|
||
return
|
||
}
|
||
if (!code) { errorMsg.value = '请输入验证码'; return }
|
||
submitting.value = true
|
||
try {
|
||
const data = await loginByAuthCode({ account: accountValue, code, channel })
|
||
saveRememberAccount(accountValue)
|
||
await handleAuthResult(data, accountValue)
|
||
} catch (err) {
|
||
showError(err)
|
||
} finally {
|
||
submitting.value = false
|
||
}
|
||
}
|
||
|
||
function uniLoginCode() {
|
||
return new Promise((resolve, reject) => {
|
||
uni.login({
|
||
provider: 'weixin',
|
||
success: (res) => (res && res.code ? resolve(res.code) : reject(new Error('未获取到登录凭证'))),
|
||
fail: () => reject(new Error('获取登录凭证失败'))
|
||
})
|
||
})
|
||
}
|
||
|
||
async function onWxPhone(e) {
|
||
if (submitting.value) return
|
||
const detail = (e && e.detail) || {}
|
||
const errMsg = detail.errMsg || ''
|
||
if (errMsg.indexOf('deny') !== -1) {
|
||
return
|
||
}
|
||
const phoneCode = detail.code && errMsg.indexOf('fail') === -1 ? detail.code : ''
|
||
submitting.value = true
|
||
errorMsg.value = ''
|
||
try {
|
||
const code = await uniLoginCode()
|
||
let appid = ''
|
||
try { appid = (uni.getAccountInfoSync().miniProgram || {}).appId || '' } catch (err) { appid = '' }
|
||
const res = await onboardingPhone({ code, phoneCode, appid })
|
||
if (res && res.need_register) {
|
||
uni.navigateTo({
|
||
url: '/pages/onboarding/register?token=' + encodeURIComponent(res.register_token || '') +
|
||
'&mobile_mask=' + encodeURIComponent(res.mobile_mask || '')
|
||
})
|
||
return
|
||
}
|
||
const data = await loginByMiniapp({ code, phoneCode })
|
||
await handleAuthResult(data)
|
||
} 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)
|
||
}
|
||
})
|
||
if (platform.value === 'mp-weixin') {
|
||
try { await bindMiniapp({ code: await uniLoginCode() }) } catch {}
|
||
}
|
||
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 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 || '登录失败,请稍后重试'
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
@import '@/src/styles/page-common.scss';
|
||
|
||
.login-page { min-height: 100vh; position: relative; overflow: hidden; background: linear-gradient(160deg, #eaf3ff 0%, #f8fafc 46%, #f8fafc 100%); }
|
||
.deco { position: absolute; border-radius: 50%; filter: blur(2rpx); opacity: .55; }
|
||
.deco-a { width: 520rpx; height: 520rpx; top: -220rpx; right: -180rpx; background: radial-gradient(circle, #cfe0ff, transparent 70%); }
|
||
.deco-b { width: 420rpx; height: 420rpx; bottom: -180rpx; left: -160rpx; background: radial-gradient(circle, #d9f0ff, transparent 70%); }
|
||
.nav-bar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; box-sizing: content-box; height: 88rpx; padding-left: $page-padding-x; padding-right: $page-padding-x; }
|
||
.nav-back { display: flex; align-items: center; gap: 4rpx; height: 64rpx; padding-right: 12rpx; flex-shrink: 0; }
|
||
.nav-back-text { font-size: 28rpx; color: $color-text; }
|
||
.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; }
|
||
.login-body { position: relative; z-index: 2; padding: 24rpx $page-padding-x 60rpx; }
|
||
.brand { display: flex; flex-direction: column; align-items: center; padding: 24rpx 0 40rpx; }
|
||
.brand-logo { width: 96rpx; height: 96rpx; border-radius: 28rpx; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 14rpx 30rpx rgba(37,99,235,.28); }
|
||
.brand-name { margin-top: 20rpx; font-size: 36rpx; font-weight: 600; letter-spacing: 2rpx; color: $color-text; }
|
||
.brand-desc { margin-top: 8rpx; font-size: 24rpx; color: $color-text-secondary; }
|
||
.card { @include card; box-sizing: border-box; min-height: 350px; padding: 30rpx 26rpx 34rpx; display: flex; flex-direction: column; }
|
||
.panel { display: flex; flex-direction: column; flex: 1; }
|
||
.panel-center {
|
||
justify-content: center;
|
||
|
||
.panel-head { text-align: center; }
|
||
.panel-title { text-align: center; }
|
||
.panel-sub { text-align: center; }
|
||
}
|
||
.mode-tabs { display: flex; gap: 8rpx; padding: 6rpx; margin-bottom: 28rpx; border-radius: $radius-full; background: #f1f5f9; }
|
||
.mode-tab { flex: 1; padding: 16rpx 0; text-align: center; font-size: 24rpx; color: $color-text-secondary; border-radius: $radius-full; transition: all .15s ease; }
|
||
.mode-tab.on { background: #ffffff; color: #2563eb; font-weight: 600; box-shadow: 0 4rpx 12rpx rgba(15,23,42,.08); }
|
||
.panel-head { margin-bottom: 24rpx; }
|
||
.panel-title { display: block; font-size: 32rpx; font-weight: 700; color: $color-text; }
|
||
.panel-sub { display: block; margin-top: 10rpx; font-size: 23rpx; color: $color-text-muted; line-height: 1.5; }
|
||
.error-box { margin-bottom: 20rpx; padding: 18rpx 20rpx; border-radius: $radius-md; background: #fef2f2; border: 1rpx solid #fecaca; }
|
||
.error-text { font-size: 24rpx; color: $color-danger; }
|
||
.field { margin-bottom: 24rpx; }
|
||
.field-label { display: block; margin-bottom: 12rpx; font-size: 24rpx; font-weight: 600; color: #334155; }
|
||
.input-wrap { position: relative; display: flex; align-items: center; gap: 12rpx; height: 88rpx; padding: 0 22rpx; border: 1rpx solid #dce7f7; border-radius: $radius-md; background: #fbfdff; }
|
||
.field-input { flex: 1; height: 100%; font-size: 28rpx; color: $color-text; }
|
||
.eye-btn { padding: 10rpx; }
|
||
.code-row { display: flex; gap: 16rpx; }
|
||
.code-input { height: 88rpx; padding: 0 22rpx; border: 1rpx solid #dce7f7; border-radius: $radius-md; background: #fbfdff; font-size: 28rpx; flex: 1; }
|
||
.code-btn { width: 220rpx; height: 88rpx; border: none; border-radius: $radius-md; background: #eaf2ff; color: #2563eb; font-size: 25rpx; font-weight: 600; }
|
||
.code-btn[disabled] { opacity: .6; }
|
||
.btn { display: flex; align-items: center; justify-content: center; gap: 12rpx; width: 100%; height: 92rpx; border: none; border-radius: $radius-full; font-size: 30rpx; font-weight: 600; }
|
||
.btn-primary { margin-top: 12rpx; background: linear-gradient(135deg, #60a5fa, #2563eb); color: #ffffff; box-shadow: 0 10rpx 24rpx rgba(37,99,235,.22); }
|
||
.btn[disabled] { opacity: .6; }
|
||
.tip-row { margin-top: 24rpx; text-align: center; }
|
||
.tip-text { font-size: 23rpx; line-height: 1.6; color: $color-text-muted; }
|
||
.tenant-list { margin-top: 8rpx; }
|
||
.tenant-item { display: flex; align-items: center; gap: 18rpx; padding: 24rpx 20rpx; margin-bottom: 18rpx; border: 1rpx solid #e6edf8; border-radius: 18rpx; background: #fff; }
|
||
.tenant-avatar { width: 72rpx; height: 72rpx; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 18rpx; background: linear-gradient(135deg, #60a5fa, #2563eb); }
|
||
.tenant-info { flex: 1; min-width: 0; }
|
||
.tenant-name { display: block; font-size: 28rpx; font-weight: 600; color: $color-text; }
|
||
.tenant-meta { display: block; margin-top: 6rpx; font-size: 22rpx; color: $color-text-muted; }
|
||
.back-row { margin-top: 20rpx; text-align: center; font-size: 26rpx; color: $color-text-muted; }
|
||
</style>
|