文件
yjyf/yjyf-master-app/pages/master/security.vue
MiAn 894da56623 feat(security): 优化登录与支付密码错误提示文案并完善双端安全中心交互
- 安全校验提示:优化 AccountSecurity 与 MasterSecurity 密码错误提示,区分登录密码与支付密码,并增加剩余可重试次数提示
- 接口响应对齐:优化 Auth、MasterAuth、Security、Sms 控制器在短信验证码发送与密码校验时的异常处理与返回格式
- 腾讯云短信SDK:优化 SmsSingleSender::sendWithParam 方法入参默认值
- 双端小程序:优化用户端与师傅端登录页及账号安全中心的密码修改与找回交互逻辑
2026-11-26 17:29:23 +08:00

758 行
25 KiB
Vue

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<template>
<view class="page">
<YjyfNavBar theme="white" :title="setupFromPayment ? '设置支付密码' : '账号安全'" :border="true" :showBack="setupFromPayment ? true : null" :customBack="setupFromPayment" @back="handleBack" />
<template v-if="!setupFromPayment">
<view v-if="loaded" class="security-body">
<!-- 安全状态概览 -->
<view class="hero-card">
<image class="hero-ico" :src="isAccountSafe ? '/static/icons/shield-green.svg' : '/static/icons/info-orange.svg'" mode="aspectFit" />
<view class="hero-info">
<text class="hero-title">{{ isAccountSafe ? '账号安全保护中' : '建议完善安全设置' }}</text>
<text class="hero-sub">登录账号:{{ status.mobile || '-' }}</text>
</view>
</view>
<!-- 账号基础信息 -->
<view class="card">
<view class="card-head">
<text class="card-title">账号信息</text>
</view>
<view class="row">
<text class="row-label">绑定手机号</text>
<view class="row-right">
<text class="row-val">{{ status.mobile || '-' }}</text>
<text v-if="status.mobile" class="tag tag-success">已绑定</text>
</view>
</view>
<view class="row clickable-hover" @tap="goVerifyStatus">
<text class="row-label">实名认证</text>
<view class="row-right">
<text class="tag" :class="verifyTagClass">{{ verifyStatusText }}</text>
<image v-if="status.verify_status !== 'pass'" class="arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
</view>
<!-- 安全凭证管理 -->
<view class="card">
<view class="card-head">
<text class="card-title">安全凭证</text>
</view>
<view class="row clickable-hover" @tap="openPassword('login')">
<view class="row-left">
<text class="row-label">登录密码</text>
<text class="row-desc">用于 H5 网页端手机号密码登录</text>
</view>
<view class="row-right">
<text class="row-val" :class="{ unset: !status.has_login_password }">{{ status.has_login_password ? '已设置' : '未设置' }}</text>
<image class="arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<view class="row clickable-hover" @tap="openPassword('payment')">
<view class="row-left">
<text class="row-label">支付密码</text>
<text class="row-desc">用于余额提现安全确认</text>
</view>
<view class="row-right">
<text class="row-val" :class="{ unset: !status.has_payment_password }">{{ status.has_payment_password ? '已设置' : '未设置' }}</text>
<image class="arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
</view>
<view class="logout clickable-hover" @tap="logout">
<text>退出登录</text>
</view>
</view>
</template>
<!-- 密码设置 / 修改底部弹窗 -->
<view v-if="mode" class="mask" @tap="cancelSheet">
<view class="sheet" @tap.stop>
<view class="sheet-handle"></view>
<view class="sheet-head">
<view class="sheet-head-meta">
<text class="title">{{ sheetTitle }}</text>
<text class="sheet-sub">{{ sheetDesc }}</text>
</view>
<view class="sheet-close-btn clickable-hover" @tap="cancelSheet">
<image class="sheet-close-ico" src="/static/icons/close.svg" mode="aspectFit" />
</view>
</view>
<view class="sheet-body">
<view v-if="hasCurrentPassword && currentVerifyMode === 'old_password'" class="field-group">
<view class="field-label-row">
<text class="field-label">{{ isPaymentMode ? '原支付密码' : '原登录密码' }}</text>
</view>
<view class="input-box" :class="{ 'is-error': !!oldPasswordError }">
<image class="input-prefix-ico" src="/static/icons/login-lock.svg" mode="aspectFit" />
<input
v-if="isPaymentMode"
v-model="oldPassword"
class="input-field"
type="number"
:password="!showOldPwd"
maxlength="6"
placeholder="请输入原6位数字支付密码"
placeholder-class="field-placeholder"
@input="oldPasswordError = ''; verifyLocked = false"
/>
<input
v-else
v-model="oldPassword"
class="input-field"
:password="!showOldPwd"
maxlength="30"
placeholder="请输入当前登录密码"
placeholder-class="field-placeholder"
@input="oldPasswordError = ''; verifyLocked = false"
/>
<view class="eye-btn clickable-hover" @tap="showOldPwd = !showOldPwd">
<image class="eye-ico" :src="showOldPwd ? '/static/icons/login-eye-open.svg' : '/static/icons/login-eye-close.svg'" mode="aspectFit" />
</view>
</view>
<text v-if="oldPasswordError" class="field-error">{{ oldPasswordError }}</text>
</view>
<view class="field-group">
<view class="field-label-row">
<text class="field-label">{{ isPaymentMode ? '新支付密码' : '新登录密码' }}</text>
<text class="field-rule">{{ isPaymentMode ? '6位纯数字' : '6至30位非空字符' }}</text>
</view>
<view class="input-box" :class="{ 'is-error': !!newPasswordError }">
<image class="input-prefix-ico" src="/static/icons/login-lock.svg" mode="aspectFit" />
<input
v-if="isPaymentMode"
v-model="newPassword"
class="input-field"
type="number"
:password="!showNewPwd"
maxlength="6"
placeholder="请输入6位数字支付密码"
placeholder-class="field-placeholder"
@input="newPasswordError = ''; confirmPasswordError = ''"
/>
<input
v-else
v-model="newPassword"
class="input-field"
:password="!showNewPwd"
maxlength="30"
placeholder="请设置新登录密码"
placeholder-class="field-placeholder"
@input="newPasswordError = ''; confirmPasswordError = ''"
/>
<view class="eye-btn clickable-hover" @tap="showNewPwd = !showNewPwd">
<image class="eye-ico" :src="showNewPwd ? '/static/icons/login-eye-open.svg' : '/static/icons/login-eye-close.svg'" mode="aspectFit" />
</view>
</view>
<text v-if="newPasswordError" class="field-error">{{ newPasswordError }}</text>
</view>
<view class="field-group">
<view class="field-label-row">
<text class="field-label">{{ isPaymentMode ? '确认支付密码' : '确认新密码' }}</text>
</view>
<view class="input-box" :class="{ 'is-error': passwordMismatch || !!confirmPasswordError }">
<image class="input-prefix-ico" src="/static/icons/login-lock.svg" mode="aspectFit" />
<input
v-if="isPaymentMode"
v-model="confirmPassword"
class="input-field"
type="number"
:password="!showConfirmPwd"
maxlength="6"
placeholder="请再次输入6位数字支付密码"
placeholder-class="field-placeholder"
@input="confirmPasswordError = ''"
/>
<input
v-else
v-model="confirmPassword"
class="input-field"
:password="!showConfirmPwd"
maxlength="30"
placeholder="请再次输入新登录密码"
placeholder-class="field-placeholder"
@input="confirmPasswordError = ''"
/>
<view class="eye-btn clickable-hover" @tap="showConfirmPwd = !showConfirmPwd">
<image class="eye-ico" :src="showConfirmPwd ? '/static/icons/login-eye-open.svg' : '/static/icons/login-eye-close.svg'" mode="aspectFit" />
</view>
</view>
<text v-if="confirmPasswordError || passwordMismatch" class="field-error">{{ confirmPasswordError || '两次输入的密码不一致' }}</text>
</view>
<template v-if="hasCurrentPassword && currentVerifyMode === 'sms'">
<view class="field-group">
<view class="field-label-row">
<text class="field-label">短信验证码</text>
<text class="field-rule">将发送至 {{ status.mobile || '绑定手机号' }}</text>
</view>
<view class="input-box sms-box" :class="{ 'is-error': !!smsCodeError }">
<input
v-model="smsCode"
class="input-field"
type="number"
maxlength="6"
placeholder="请输入6位短信验证码"
placeholder-class="field-placeholder"
@input="smsCodeError = ''"
/>
<view class="sms-divider"></view>
<button class="inline-sms-btn clickable-hover" :disabled="sendingSms || smsCountdown > 0" @tap="sendPwdSms">
{{ smsCountdown > 0 ? smsCountdown + 's 后重发' : (sendingSms ? '发送中...' : '获取验证码') }}
</button>
</view>
<text v-if="smsCodeError" class="field-error">{{ smsCodeError }}</text>
</view>
</template>
<button class="primary sheet-submit clickable-hover" :disabled="busy" @tap="savePassword">
{{ busy ? '提交中...' : (hasCurrentPassword ? '确认修改' : '确认设置') }}
</button>
<view v-if="hasCurrentPassword" class="switch-row">
<text
class="switch-link clickable-hover"
:class="{ 'is-highlight': verifyLocked && currentVerifyMode === 'old_password' }"
@tap="switchVerifyMode(currentVerifyMode === 'old_password' ? 'sms' : 'old_password')"
>{{ currentVerifyMode === 'old_password' ? (isPaymentMode ? '忘记原支付密码?改用短信验证码' : '忘记原密码?改用短信验证码') : (isPaymentMode ? '记得原支付密码?改用原密码验证' : '记得原密码?改用原密码验证') }}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref, computed } from 'vue';
import { onLoad, onShow, onBackPress, onUnload } from '@dcloudio/uni-app';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
import api from '@/utils/api.js';
import { clearAuth, isLogin, toLogin } from '@/utils/request.js';
import { finishPaymentSetup } from '@/utils/payment-setup.mjs';
const loaded = ref(false);
const busy = ref(false);
const mode = ref('');
const setupFromPayment = ref(false);
const initialOpen = ref('');
let setupOpened = false;
const status = ref({});
const oldPassword = ref('');
const newPassword = ref('');
const confirmPassword = ref('');
const showOldPwd = ref(false);
const showNewPwd = ref(false);
const showConfirmPwd = ref(false);
const loginVerifyMode = ref('old_password');
const paymentVerifyMode = ref('old_password');
const smsCode = ref('');
const smsCountdown = ref(0);
const sendingSms = ref(false);
const oldPasswordError = ref('');
const newPasswordError = ref('');
const confirmPasswordError = ref('');
const smsCodeError = ref('');
const verifyLocked = ref(false);
let smsTimer = null;
const isAccountSafe = computed(() => !!(status.value.mobile && status.value.has_payment_password));
const verifyStatusText = computed(() => {
const map = { pass: '已认证', pending: '审核中', reject: '未通过', draft: '未认证' };
return map[status.value.verify_status] || '未认证';
});
const verifyTagClass = computed(() => {
const st = status.value.verify_status;
if (st === 'pass') return 'tag-success';
if (st === 'pending') return 'tag-warning';
if (st === 'reject') return 'tag-danger';
return 'tag-muted';
});
const isPaymentMode = computed(() => mode.value === 'payment');
const hasCurrentPassword = computed(() => isPaymentMode.value ? !!status.value.has_payment_password : !!status.value.has_login_password);
const currentVerifyMode = computed(() => isPaymentMode.value ? paymentVerifyMode.value : loginVerifyMode.value);
const sheetTitle = computed(() => {
if (isPaymentMode.value) {
return status.value.has_payment_password ? '修改支付密码' : '设置支付密码';
}
return status.value.has_login_password ? '修改登录密码' : '设置登录密码';
});
const sheetDesc = computed(() => isPaymentMode.value ? '用于余额提现安全确认' : '用于 H5 网页端手机号密码登录');
const passwordMismatch = computed(() => confirmPassword.value.length > 0 && newPassword.value !== confirmPassword.value);
async function load() {
if (!isLogin()) {
toLogin('/pages/master/security');
return;
}
try {
status.value = await api.securityStatus();
loaded.value = true;
} catch (e) {}
}
function clearSmsTimer() {
if (smsTimer) {
clearInterval(smsTimer);
smsTimer = null;
}
}
function startSmsCountdown(sec = 60) {
clearSmsTimer();
smsCountdown.value = sec;
smsTimer = setInterval(() => {
if (smsCountdown.value <= 1) {
smsCountdown.value = 0;
clearSmsTimer();
} else {
smsCountdown.value -= 1;
}
}, 1000);
}
function clearFieldErrors() {
oldPasswordError.value = '';
newPasswordError.value = '';
confirmPasswordError.value = '';
smsCodeError.value = '';
}
function switchVerifyMode(nextMode) {
if (isPaymentMode.value) paymentVerifyMode.value = nextMode;
else loginVerifyMode.value = nextMode;
oldPassword.value = '';
smsCode.value = '';
verifyLocked.value = false;
clearFieldErrors();
}
async function sendPwdSms() {
if (sendingSms.value || smsCountdown.value > 0) return;
sendingSms.value = true;
try {
const res = mode.value === 'payment' ? await api.sendPaymentPasswordSms() : await api.sendPasswordSms();
uni.showToast({ title: '验证码已发送', icon: 'none' });
startSmsCountdown((res && res.cooldown) || 60);
} catch (e) {
} finally {
sendingSms.value = false;
}
}
function resetFormFields() {
oldPassword.value = '';
newPassword.value = '';
confirmPassword.value = '';
smsCode.value = '';
loginVerifyMode.value = 'old_password';
paymentVerifyMode.value = 'old_password';
showOldPwd.value = false;
showNewPwd.value = false;
showConfirmPwd.value = false;
verifyLocked.value = false;
clearFieldErrors();
}
function close() {
if (busy.value) return;
mode.value = '';
resetFormFields();
}
function openPassword(which) {
resetFormFields();
mode.value = which;
}
function goVerifyStatus() {
if (status.value.verify_status === 'pass') return;
uni.navigateTo({ url: '/pages/master/apply' });
}
function applyServerFieldError(e) {
if (e && e.code === 401) {
uni.showToast({ title: '登录已失效,请重新登录', icon: 'none' });
setTimeout(() => toLogin('/pages/master/security'), 800);
return;
}
const msg = String((e && e.message) || '操作失败,请稍后重试');
if (/验证码/.test(msg) && !/改用短信验证码/.test(msg)) {
smsCodeError.value = msg;
return;
}
if (/原登录密码|原支付密码|原密码|密码不正确|次数过多|15分钟|旧密码/.test(msg)) {
oldPasswordError.value = msg;
if (/15分钟|次数过多/.test(msg)) verifyLocked.value = true;
return;
}
if (/6位|6至30位|非空字符|新密码/.test(msg)) {
newPasswordError.value = msg;
return;
}
uni.showToast({ title: msg, icon: 'none' });
}
function validPassword() {
clearFieldErrors();
let ok = true;
const isPayment = mode.value === 'payment';
const useSms = isPayment
? (status.value.has_payment_password && paymentVerifyMode.value === 'sms')
: (status.value.has_login_password && loginVerifyMode.value === 'sms');
if (useSms) {
if (!/^\d{4,6}$/.test(smsCode.value.trim())) {
smsCodeError.value = '请输入有效的6位短信验证码';
ok = false;
}
} else {
const needOld = isPayment ? status.value.has_payment_password : status.value.has_login_password;
if (needOld && isPayment && !/^\d{6}$/.test(oldPassword.value)) {
oldPasswordError.value = '请输入原6位数字支付密码';
ok = false;
} else if (needOld && !isPayment && !oldPassword.value) {
oldPasswordError.value = '请输入原登录密码';
ok = false;
}
}
if (isPayment) {
if (!/^\d{6}$/.test(newPassword.value)) {
newPasswordError.value = '新支付密码须为6位纯数字';
ok = false;
}
} else {
if (!/^\S{6,30}$/.test(newPassword.value)) {
newPasswordError.value = '新登录密码须为6至30位非空字符';
ok = false;
}
}
if (!confirmPassword.value) {
confirmPasswordError.value = isPayment ? '请再次输入新支付密码' : '请再次输入新登录密码';
ok = false;
} else if (newPassword.value !== confirmPassword.value) {
confirmPasswordError.value = '两次输入的新密码不一致';
ok = false;
}
return ok;
}
async function savePassword() {
if (busy.value || !validPassword()) return;
busy.value = true;
try {
if (mode.value === 'login') {
const payload = loginVerifyMode.value === 'sms' && status.value.has_login_password
? {
verify_mode: 'sms',
sms_code: smsCode.value.trim(),
new_password: newPassword.value
}
: {
verify_mode: 'old_password',
old_password: oldPassword.value,
new_password: newPassword.value
};
await api.changeLoginPassword(payload, { silent: true });
clearAuth();
uni.showToast({ title: '密码已更新,请重新登录', icon: 'none' });
setTimeout(() => uni.reLaunch({ url: '/pages/login/login' }), 800);
return;
}
const firstSetup = !status.value.has_payment_password;
if (firstSetup) {
await api.setPaymentPassword({ new_password: newPassword.value }, { silent: true });
} else {
const payPayload = paymentVerifyMode.value === 'sms'
? {
verify_mode: 'sms',
sms_code: smsCode.value.trim(),
new_password: newPassword.value
}
: {
verify_mode: 'old_password',
old_password: oldPassword.value,
new_password: newPassword.value
};
await api.changePaymentPassword(payPayload, { silent: true });
}
busy.value = false;
close();
uni.showToast({ title: firstSetup ? '设置成功' : '修改成功', icon: 'success' });
if (setupFromPayment.value && firstSetup) {
try { await finishPaymentSetup(uni); } catch (e) { uni.showToast({ title: e.message, icon: 'none' }); }
} else {
await load();
}
} catch (e) {
applyServerFieldError(e);
} finally {
busy.value = false;
}
}
function handleBack() {
if (!busy.value) leaveSetup();
}
function cancelSheet() {
if (busy.value) return;
if (setupFromPayment.value) leaveSetup();
else close();
}
function logout() {
uni.showModal({
title: '退出登录',
content: '确认退出当前师傅账号?',
confirmColor: '#F0710D',
success: async (result) => {
if (result.confirm) {
try { await api.logout(); } catch (e) {}
clearAuth();
uni.reLaunch({ url: '/pages/login/login' });
}
}
});
}
async function leaveSetup() {
try { await finishPaymentSetup(uni); } catch (e) { uni.showToast({ title: e.message, icon: 'none' }); }
}
onLoad((options) => {
setupFromPayment.value = !!(options && options.setupPayment === '1');
initialOpen.value = (options && options.open) ? String(options.open) : '';
});
onBackPress(() => {
if (!setupFromPayment.value) return false;
if (!busy.value) leaveSetup();
return true;
});
onShow(async () => {
await load();
if (!loaded.value || setupOpened) return;
if (setupFromPayment.value) {
setupOpened = true;
if (status.value.has_payment_password) await leaveSetup();
else openPassword('payment');
} else if (initialOpen.value === 'payment') {
setupOpened = true;
openPassword('payment');
if (status.value.has_payment_password) switchVerifyMode('sms');
}
});
onUnload(() => {
clearSmsTimer();
});
</script>
<style lang="scss" scoped>
@import '@/uni.scss';
.page { min-height: 100vh; background: $yjyf-bg-page; padding-bottom: calc(48rpx + env(safe-area-inset-bottom)); }
.security-body { padding-top: 20rpx; }
.hero-card {
margin: 0 $yjyf-space-md 20rpx;
padding: 28rpx 32rpx;
background: $yjyf-bg-card;
border-radius: $yjyf-radius-md;
box-shadow: $yjyf-shadow-card;
display: flex;
align-items: center;
gap: 20rpx;
}
.hero-ico { width: 52rpx; height: 52rpx; flex-shrink: 0; }
.hero-info { display: flex; flex-direction: column; gap: 6rpx; min-width: 0; }
.hero-title { font-size: $yjyf-font-title; font-weight: 700; color: $yjyf-text-main; }
.hero-sub { font-size: $yjyf-font-sub; color: $yjyf-text-secondary; }
.card {
margin: 0 $yjyf-space-md 20rpx;
padding: 0 32rpx;
background: $yjyf-bg-card;
border-radius: $yjyf-radius-md;
box-shadow: $yjyf-shadow-card;
}
.card-head { padding: 26rpx 0 12rpx; }
.card-title { font-size: $yjyf-font-sub; color: $yjyf-text-secondary; font-weight: 600; }
.row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
min-height: 108rpx;
border-top: 1rpx solid $yjyf-border-color;
}
.row-left { display: flex; flex-direction: column; gap: 4rpx; }
.row-label { font-size: $yjyf-font-body; color: $yjyf-text-main; }
.row-desc { font-size: $yjyf-font-micro; color: $yjyf-text-muted; }
.row-right { display: flex; align-items: center; gap: 12rpx; flex-shrink: 0; }
.row-val { font-size: $yjyf-font-sub; color: $yjyf-text-secondary; }
.row-val.unset { color: $yjyf-warning; font-weight: 500; }
.arrow { width: 24rpx; height: 24rpx; }
.tag {
padding: 6rpx 16rpx;
border-radius: $yjyf-radius-pill;
font-size: $yjyf-font-micro;
font-weight: 600;
line-height: 1;
}
.tag-success { background: rgba(47, 168, 79, 0.1); color: $yjyf-success; }
.tag-warning { background: rgba(249, 141, 37, 0.12); color: $yjyf-warning; }
.tag-danger { background: rgba(232, 51, 27, 0.1); color: $yjyf-danger; }
.tag-muted { background: $yjyf-bg-page; color: $yjyf-text-secondary; }
.logout {
margin: 40rpx $yjyf-space-md 0;
height: 92rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: $yjyf-radius-pill;
background: $yjyf-bg-card;
box-shadow: $yjyf-shadow-card;
color: $yjyf-danger;
font-size: $yjyf-font-body;
font-weight: 600;
}
.mask { position: fixed; inset: 0; z-index: 999; display: flex; align-items: flex-end; background: rgba(15, 23, 42, 0.5); }
.sheet {
width: 100%;
max-height: 90vh;
overflow-y: auto;
box-sizing: border-box;
padding: 16rpx 0 calc(36rpx + env(safe-area-inset-bottom));
border-radius: 36rpx 36rpx 0 0;
background: $yjyf-bg-card;
display: flex;
flex-direction: column;
}
.sheet-handle {
width: 72rpx;
height: 8rpx;
border-radius: $yjyf-radius-pill;
background: #E5E6EB;
margin: 0 auto 20rpx;
}
.sheet-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding: 0 32rpx 24rpx;
border-bottom: 1rpx solid $yjyf-border-color;
}
.sheet-head-meta { display: flex; flex-direction: column; gap: 6rpx; }
.title { font-size: 36rpx; font-weight: 700; color: $yjyf-text-main; line-height: 1.25; }
.sheet-sub { font-size: $yjyf-font-sub; color: $yjyf-text-secondary; }
.sheet-close-btn {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
background: $yjyf-bg-page;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.sheet-close-ico { width: 26rpx; height: 26rpx; opacity: 0.65; }
.sheet-body {
padding: 28rpx 32rpx 0;
display: flex;
flex-direction: column;
gap: 24rpx;
}
.field-group { display: flex; flex-direction: column; gap: 10rpx; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; padding: 0 4rpx; }
.field-label { font-size: 26rpx; font-weight: 600; color: $yjyf-text-main; }
.field-rule { font-size: $yjyf-font-micro; color: $yjyf-text-secondary; }
.field-error { font-size: $yjyf-font-micro; color: $yjyf-danger; padding-left: 4rpx; }
.input-box {
height: 92rpx;
box-sizing: border-box;
padding: 0 18rpx 0 24rpx;
border-radius: 16rpx;
background: #F7F8FA;
border: 1.5rpx solid #EBEDF0;
display: flex;
align-items: center;
gap: 14rpx;
transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.input-box:focus-within {
background: $yjyf-bg-card;
border-color: $yjyf-primary;
box-shadow: 0 0 0 4rpx rgba(240, 113, 13, 0.1);
}
.input-box.is-error {
background: #FFF8F7;
border-color: $yjyf-danger;
}
.input-prefix-ico { width: 34rpx; height: 34rpx; flex-shrink: 0; opacity: 0.75; }
.input-field { flex: 1; min-width: 0; height: 92rpx; font-size: $yjyf-font-body; color: $yjyf-text-main; }
.field-placeholder { font-size: 26rpx; color: $yjyf-text-muted; }
.eye-btn { width: 64rpx; height: 64rpx; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.eye-ico { width: 34rpx; height: 34rpx; }
.sms-box { padding-right: 8rpx; }
.sms-divider { width: 1.5rpx; height: 36rpx; background: #E5E6EB; flex-shrink: 0; }
.inline-sms-btn {
flex-shrink: 0;
height: 76rpx;
padding: 0 20rpx;
margin: 0;
background: transparent;
border: none;
display: flex;
align-items: center;
justify-content: center;
color: $yjyf-primary;
font-size: 26rpx;
font-weight: 700;
}
.inline-sms-btn::after { border: none; }
.inline-sms-btn[disabled] { color: $yjyf-text-muted; font-weight: 500; }
.primary {
width: 100%;
height: 92rpx;
margin: 8rpx 0 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: $yjyf-radius-pill;
background: $yjyf-gradient-primary;
box-shadow: $yjyf-shadow-button;
color: $yjyf-text-inverse;
font-size: 30rpx;
font-weight: 700;
border: none;
}
.primary::after { border: none; }
.primary[disabled] { opacity: 0.65; }
.sheet-submit { margin-top: 8rpx; }
.switch-row { display: flex; justify-content: center; padding-top: 2rpx; }
.switch-link { padding: 12rpx 24rpx; font-size: $yjyf-font-sub; color: $yjyf-text-secondary; }
.switch-link.is-highlight { color: $yjyf-primary; font-weight: 600; }
</style>