重构项目文件夹目录

This commit is contained in:
2026-06-15 15:53:55 +08:00
parent 8093e07190
commit 7cbe5b3de5
1098 changed files with 34 additions and 4441 deletions
File diff suppressed because it is too large Load Diff
+5
View File
@@ -0,0 +1,5 @@
{
"usingComponents": {
"navigation-bar": "/components/navigation-bar/navigation-bar"
}
}
+355
View File
@@ -0,0 +1,355 @@
<view class="auth-page-root" style="{{themeVars}}">
<navigation-bar title="账号中心" showBack="{{true}}" fallbackPath="/pages/home/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
<scroll-view class="auth-scroll" scroll-y="true" enhanced="true" show-scrollbar="false">
<view class="page-shell auth-page-shell auth-page">
<view class="page-content auth-content {{keyboardVisible ? 'keyboard-active' : ''}}">
<view class="page-card auth-panel">
<view class="tab-row">
<view class="tab-item {{activeTab === 'login' ? 'active' : ''}}" data-tab="login" bindtap="handleTabChange">登录</view>
<view class="tab-item {{activeTab === 'register' ? 'active' : ''}}" data-tab="register" bindtap="handleTabChange">注册</view>
</view>
<block wx:if="{{activeTab === 'login'}}">
<view wx:if="{{!traditionalLoginExpanded}}" class="wechat-login-panel">
<view class="wechat-login-copy">
<text class="wechat-login-title">微信手机号一键登录</text>
<text class="wechat-login-desc">更快登录</text>
</view>
<button
wx:if="{{wechatMiniSupported}}"
class="primary-btn wechat-login-btn"
open-type="getPhoneNumber"
bindgetphonenumber="handleWechatMiniPhoneLogin"
loading="{{wechatMiniLoading}}"
disabled="{{wechatMiniLoading || loading}}"
>
{{wechatMiniLoading ? '正在获取微信手机号...' : '微信手机号一键登录'}}
</button>
<button
wx:else
class="secondary-btn wechat-login-btn wechat-login-btn-disabled"
bindtap="handleWechatMiniUnavailableTap"
>
微信手机号一键登录
</button>
<text class="wechat-login-hint">{{wechatMiniSupported ? '单门店可直接登录' : wechatMiniDisabledReason}}</text>
<view class="agreement-row wechat-agreement" bindtap="handleAgreementToggle">
<view class="agreement-check {{agreementAccepted ? 'checked' : ''}}">{{agreementAccepted ? '✓' : ''}}</view>
<view class="agreement-copy">
<text>我已阅读并同意</text>
<text class="agreement-link" data-type="USER_TERMS" catchtap="openAgreement">《用户协议》</text>
<text>和</text>
<text class="agreement-link" data-type="PRIVACY_POLICY" catchtap="openAgreement">《隐私政策》</text>
</view>
</view>
</view>
<view wx:if="{{miniShopTicket && !showMiniShopSelector}}" class="hint-card mini-login-resume">
<text class="mini-login-resume-text">请选择登录门店</text>
<view class="ghost-btn mini-login-resume-btn" bindtap="handleResumeMiniShopSelector">继续选择门店</view>
</view>
<view wx:if="{{!traditionalLoginExpanded}}" class="traditional-entry">
<view class="secondary-btn traditional-entry-btn" bindtap="handleShowTraditionalLogin">其他登录方式</view>
</view>
<view wx:if="{{traditionalLoginExpanded}}" class="traditional-login-panel">
<view class="login-divider">
<view class="divider-line"></view>
<text class="login-divider-text">其他方式</text>
<view class="divider-line"></view>
</view>
<view class="toggle-row">
<view class="toggle-item {{loginType === 'password' ? 'active' : ''}}" data-type="password" bindtap="handleLoginTypeChange">账号密码登录</view>
<view class="toggle-item {{loginType === 'phone' ? 'active' : ''}}" data-type="phone" bindtap="handleLoginTypeChange">验证码登录</view>
</view>
</view>
</block>
<view wx:if="{{activeTab === 'register' || traditionalLoginExpanded}}" class="auth-helper">{{authHelperText}}</view>
<block wx:if="{{activeTab === 'register'}}">
<view id="auth-register-nickname-anchor" class="field-block">
<text class="field-label">昵称</text>
<input
class="field-input"
placeholder="请输入昵称"
placeholder-class="field-placeholder"
value="{{form.nickname}}"
data-field="nickname"
data-keyboard-anchor="auth-register-nickname-anchor"
bindinput="handleInputChange"
bindfocus="handleKeyboardFocus"
bindblur="handleKeyboardBlur"
adjust-position="false"
cursor-spacing="{{keyboardCursorSpacing}}"
></input>
</view>
</block>
<view id="auth-account-anchor" wx:if="{{activeTab === 'register' || traditionalLoginExpanded}}" class="field-block">
<text class="field-label">账号</text>
<input
class="field-input"
placeholder="请输入账号"
placeholder-class="field-placeholder"
value="{{form.account}}"
data-field="account"
data-keyboard-anchor="auth-account-anchor"
bindinput="handleInputChange"
bindblur="handleAccountBlur"
bindfocus="handleKeyboardFocus"
adjust-position="false"
cursor-spacing="{{keyboardCursorSpacing}}"
></input>
<text wx:if="{{activeTab === 'login' && loginAccountStatusText}}" class="status-text {{loginAccountStatusType}}">{{loginAccountStatusText}}</text>
<text wx:if="{{activeTab === 'register' && registerAccountStatusText}}" class="status-text {{registerAccountStatusType}}">{{registerAccountStatusText}}</text>
</view>
<view id="auth-phone-anchor" wx:if="{{activeTab === 'register' || (traditionalLoginExpanded && loginType === 'phone')}}" class="field-block">
<text class="field-label">手机号</text>
<input
class="field-input"
type="number"
placeholder="请输入手机号"
placeholder-class="field-placeholder"
value="{{form.phone}}"
data-field="phone"
data-keyboard-anchor="auth-phone-anchor"
bindinput="handleInputChange"
bindblur="handlePhoneBlur"
bindfocus="handleKeyboardFocus"
adjust-position="false"
cursor-spacing="{{keyboardCursorSpacing}}"
></input>
<text wx:if="{{activeTab === 'register' && registerPhoneStatusText}}" class="status-text {{registerPhoneStatusType}}">{{registerPhoneStatusText}}</text>
</view>
<view id="auth-login-password-anchor" wx:if="{{activeTab === 'login' && traditionalLoginExpanded && loginType === 'password'}}" class="field-block">
<text class="field-label">密码</text>
<input
class="field-input"
password
placeholder="请输入密码"
placeholder-class="field-placeholder"
value="{{form.password}}"
data-field="password"
data-keyboard-anchor="auth-login-password-anchor"
bindinput="handleInputChange"
bindfocus="handleKeyboardFocus"
bindblur="handleKeyboardBlur"
adjust-position="false"
cursor-spacing="{{keyboardCursorSpacing}}"
></input>
</view>
<view id="auth-code-anchor" wx:if="{{activeTab === 'register' || (traditionalLoginExpanded && loginType === 'phone')}}" class="field-block">
<text class="field-label">验证码</text>
<view class="code-row">
<input
class="field-input code-input"
type="number"
placeholder="请输入验证码"
placeholder-class="field-placeholder"
value="{{form.verificationCode}}"
data-field="verificationCode"
data-keyboard-anchor="auth-code-anchor"
bindinput="handleInputChange"
bindfocus="handleKeyboardFocus"
bindblur="handleKeyboardBlur"
adjust-position="false"
cursor-spacing="{{keyboardCursorSpacing}}"
></input>
<view class="code-btn {{countdown > 0 ? 'disabled' : ''}}" bindtap="handleSendCode">{{countdown > 0 ? countdown + 's' : '发送验证码'}}</view>
</view>
</view>
<view id="auth-register-password-anchor" wx:if="{{activeTab === 'register'}}" class="field-block">
<text class="field-label">密码</text>
<input
class="field-input"
password
placeholder="请输入密码"
placeholder-class="field-placeholder"
value="{{form.password}}"
data-field="password"
data-keyboard-anchor="auth-register-password-anchor"
bindinput="handleInputChange"
bindfocus="handleKeyboardFocus"
bindblur="handleKeyboardBlur"
adjust-position="false"
cursor-spacing="{{keyboardCursorSpacing}}"
></input>
</view>
<view id="auth-register-confirm-password-anchor" wx:if="{{activeTab === 'register'}}" class="field-block">
<text class="field-label">确认密码</text>
<input
class="field-input"
password
placeholder="请再次输入密码"
placeholder-class="field-placeholder"
value="{{form.confirmPassword}}"
data-field="confirmPassword"
data-keyboard-anchor="auth-register-confirm-password-anchor"
bindinput="handleInputChange"
bindfocus="handleKeyboardFocus"
bindblur="handleKeyboardBlur"
adjust-position="false"
cursor-spacing="{{keyboardCursorSpacing}}"
></input>
</view>
<view wx:if="{{activeTab === 'register'}}" class="field-block">
<text class="field-label">选择门店</text>
<picker mode="selector" range="{{shops}}" range-key="shopName" value="{{registerShopIndex}}" bindchange="handleRegisterShopChange">
<view class="field-picker">{{registerShopDisplayName || '请选择门店'}}</view>
</picker>
</view>
<view wx:if="{{activeTab === 'login' && traditionalLoginExpanded && loginShops.length}}" class="field-block">
<text class="field-label">选择登录门店</text>
<picker mode="selector" range="{{loginShops}}" range-key="shopName" value="{{loginShopIndex}}" bindchange="handleLoginShopChange">
<view class="field-picker">{{loginShopDisplayName || '请选择登录门店'}}</view>
</picker>
</view>
<view wx:if="{{activeTab === 'login' && traditionalLoginExpanded && loginShopMessage}}" class="hint-card login-shop-tip">{{loginShopMessage}}</view>
<view wx:if="{{activeTab === 'login' && traditionalLoginExpanded}}" class="aux-row">
<text class="aux-link" bindtap="handleToggleResetPanel">忘记密码?</text>
</view>
<view wx:if="{{activeTab === 'register' || traditionalLoginExpanded}}" class="agreement-row" bindtap="handleAgreementToggle">
<view class="agreement-check {{agreementAccepted ? 'checked' : ''}}">{{agreementAccepted ? '✓' : ''}}</view>
<view class="agreement-copy">
<text>我已阅读并同意</text>
<text class="agreement-link" data-type="USER_TERMS" catchtap="openAgreement">《用户协议》</text>
<text>和</text>
<text class="agreement-link" data-type="PRIVACY_POLICY" catchtap="openAgreement">《隐私政策》</text>
</view>
</view>
<view wx:if="{{activeTab === 'register' || traditionalLoginExpanded}}" class="primary-btn submit-btn {{agreementAccepted ? '' : 'disabled'}}" bindtap="handleSubmit">{{activeTab === 'login' ? '立即登录' : '完成注册'}}</view>
</view>
<view wx:if="{{showResetPanel}}" class="page-card reset-card">
<view class="section-title">重置密码</view>
<view class="section-subtitle">短信验证后重置密码</view>
<view id="auth-reset-phone-anchor" class="field-block">
<text class="field-label">手机号</text>
<input
class="field-input"
type="number"
placeholder="请输入绑定手机号"
placeholder-class="field-placeholder"
value="{{resetForm.phone}}"
data-field="phone"
data-keyboard-anchor="auth-reset-phone-anchor"
bindinput="handleResetInputChange"
bindfocus="handleKeyboardFocus"
bindblur="handleKeyboardBlur"
adjust-position="false"
cursor-spacing="{{keyboardCursorSpacing}}"
></input>
</view>
<view id="auth-reset-code-anchor" class="field-block">
<text class="field-label">验证码</text>
<view class="code-row">
<input
class="field-input code-input"
type="number"
placeholder="请输入验证码"
placeholder-class="field-placeholder"
value="{{resetForm.verificationCode}}"
data-field="verificationCode"
data-keyboard-anchor="auth-reset-code-anchor"
bindinput="handleResetInputChange"
bindfocus="handleKeyboardFocus"
bindblur="handleKeyboardBlur"
adjust-position="false"
cursor-spacing="{{keyboardCursorSpacing}}"
></input>
<view class="code-btn {{forgotCountdown > 0 ? 'disabled' : ''}}" bindtap="handleSendForgotCode">{{forgotCountdown > 0 ? forgotCountdown + 's' : '发送验证码'}}</view>
</view>
</view>
<view id="auth-reset-password-anchor" class="field-block">
<text class="field-label">新密码</text>
<input
class="field-input"
password
placeholder="请输入新密码"
placeholder-class="field-placeholder"
value="{{resetForm.newPassword}}"
data-field="newPassword"
data-keyboard-anchor="auth-reset-password-anchor"
bindinput="handleResetInputChange"
bindfocus="handleKeyboardFocus"
bindblur="handleKeyboardBlur"
adjust-position="false"
cursor-spacing="{{keyboardCursorSpacing}}"
></input>
</view>
<view class="primary-btn submit-btn" bindtap="handleResetPassword">确认重置密码</view>
</view>
<view class="admin-switch-link" bindtap="handleOpenAdminLogin">管理后台登录</view>
</view>
<view wx:if="{{keyboardVisible}}" class="keyboard-spacer" style="height: {{keyboardInsetRpx}}rpx;"></view>
</view>
</scroll-view>
<view wx:if="{{showMiniShopSelector}}" class="mini-shop-mask" catchtouchmove="noop">
<view class="page-card mini-shop-modal">
<text class="mini-shop-kicker">{{miniShopNewUser ? '首次微信登录' : '确认本次登录门店'}}</text>
<text class="mini-shop-title">{{miniShopNewUser ? '先选门店' : '选择登录门店'}}</text>
<text class="mini-shop-desc">{{miniShopMessage || '选择后继续登录'}}</text>
<view class="field-block mini-shop-field">
<text class="field-label">登录门店</text>
<picker mode="selector" range="{{miniShops}}" range-key="shopName" value="{{miniShopIndex}}" bindchange="handleMiniShopChange">
<view class="field-picker">{{miniShopDisplayName || '请选择门店'}}</view>
</picker>
</view>
<view wx:if="{{miniShopNewUser}}" class="hint-card mini-shop-note">首次登录会自动注册并绑定手机号。</view>
<view class="agreement-row mini-shop-agreement" bindtap="handleAgreementToggle">
<view class="agreement-check {{agreementAccepted ? 'checked' : ''}}">{{agreementAccepted ? '✓' : ''}}</view>
<view class="agreement-copy">
<text>我已阅读并同意</text>
<text class="agreement-link" data-type="USER_TERMS" catchtap="openAgreement">《用户协议》</text>
<text>和</text>
<text class="agreement-link" data-type="PRIVACY_POLICY" catchtap="openAgreement">《隐私政策》</text>
</view>
</view>
<view class="mini-shop-actions">
<view class="secondary-btn mini-shop-action" bindtap="handleCloseMiniShopSelector">稍后再选</view>
<view class="primary-btn mini-shop-action" bindtap="handleConfirmMiniShopLogin">{{miniShopSubmitting ? '确认中...' : '确认登录'}}</view>
</view>
</view>
</view>
<view wx:if="{{agreementModalVisible}}" class="agreement-mask" catchtouchmove="noop">
<view class="agreement-modal">
<view class="agreement-modal-title">{{selectedAgreement.title || '协议详情'}}</view>
<view class="agreement-modal-meta">版本:{{selectedAgreement.version || '-'}}</view>
<scroll-view class="agreement-modal-body" scroll-y="true">
<text>{{selectedAgreement.content || '暂无协议内容'}}</text>
</scroll-view>
<view class="primary-btn agreement-modal-close" bindtap="closeAgreementModal">我知道了</view>
</view>
</view>
</view>
+421
View File
@@ -0,0 +1,421 @@
.auth-page-root {
min-height: 100vh;
overflow: visible;
}
.auth-scroll {
height: 100vh;
box-sizing: border-box;
}
.auth-page-shell {
min-height: 100%;
}
.auth-page {
background: var(--theme-page-bg);
}
.auth-content {
min-height: 100%;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
padding: 24rpx 24rpx calc(80rpx + env(safe-area-inset-bottom));
}
.auth-content.keyboard-active {
justify-content: flex-start;
align-items: stretch;
}
.auth-panel,
.reset-card {
width: 100%;
max-width: 680rpx;
padding: 30rpx 28rpx;
}
.auth-panel {
margin-top: 24rpx;
}
.reset-card {
margin-top: 18rpx;
margin-left: auto;
margin-right: auto;
}
.tab-row,
.toggle-row {
display: flex;
align-items: center;
gap: 12rpx;
}
.tab-row {
margin-bottom: 20rpx;
}
.toggle-row {
margin-bottom: 14rpx;
padding: 10rpx;
border-radius: 999rpx;
background: var(--theme-primary-soft);
}
.tab-item,
.toggle-item {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 76rpx;
border-radius: 999rpx;
color: var(--text-secondary);
font-size: 26rpx;
font-weight: 600;
}
.tab-item.active,
.toggle-item.active {
background: var(--theme-primary-soft);
color: var(--theme-primary);
}
.wechat-login-panel {
padding: 24rpx 22rpx;
border-radius: 28rpx;
background: var(--theme-gradient-soft);
border: 1rpx solid var(--theme-border);
box-shadow: 0 18rpx 38rpx rgba(74, 68, 63, 0.1);
}
.wechat-login-copy {
display: flex;
flex-direction: column;
gap: 8rpx;
}
.wechat-login-title {
display: block;
font-size: 29rpx;
font-weight: 700;
color: var(--text-primary);
}
.wechat-login-desc {
display: block;
font-size: 24rpx;
line-height: 1.6;
color: var(--text-secondary);
}
.wechat-login-btn {
margin-top: 18rpx;
}
.wechat-login-btn.primary-btn {
background: var(--theme-gradient);
box-shadow: 0 16rpx 36rpx rgba(74, 68, 63, 0.16);
}
.wechat-login-btn-disabled {
color: var(--theme-accent);
border-color: var(--theme-border);
background: var(--theme-card-bg);
}
.wechat-login-hint {
display: block;
margin-top: 14rpx;
font-size: 22rpx;
line-height: 1.6;
color: var(--theme-accent);
}
.mini-login-resume {
display: flex;
align-items: center;
justify-content: space-between;
gap: 18rpx;
margin-top: 18rpx;
}
.mini-login-resume-text {
flex: 1;
min-width: 0;
}
.mini-login-resume-btn {
flex-shrink: 0;
}
.traditional-entry {
margin-top: 18rpx;
}
.traditional-entry-btn {
color: var(--theme-primary-action);
background: var(--theme-card-bg);
}
.traditional-login-panel {
margin-top: 18rpx;
}
.login-divider {
display: flex;
align-items: center;
gap: 18rpx;
margin: 0 0 16rpx;
}
.login-divider-text {
flex-shrink: 0;
font-size: 22rpx;
color: var(--text-secondary);
}
.auth-helper {
margin-bottom: 4rpx;
font-size: 22rpx;
line-height: 1.6;
color: var(--text-secondary);
}
.field-block {
margin-top: 16rpx;
}
.code-row {
display: flex;
align-items: center;
gap: 14rpx;
}
.code-input {
flex: 1;
}
.code-btn {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 180rpx;
height: 92rpx;
padding: 0 18rpx;
border-radius: 24rpx;
background: var(--theme-primary-soft);
color: var(--theme-primary);
font-size: 24rpx;
font-weight: 700;
}
.code-btn.disabled {
background: var(--theme-secondary-soft);
color: var(--text-secondary);
}
.aux-row {
display: flex;
justify-content: flex-end;
margin-top: 16rpx;
}
.aux-link {
font-size: 24rpx;
color: var(--theme-primary);
font-weight: 600;
}
.login-shop-tip {
margin-top: 16rpx;
}
.submit-btn {
margin-top: 24rpx;
}
.submit-btn.disabled {
opacity: 0.52;
}
.agreement-row {
display: flex;
align-items: flex-start;
gap: 14rpx;
margin-top: 22rpx;
color: var(--text-secondary);
font-size: 23rpx;
line-height: 1.6;
}
.agreement-check {
display: flex;
align-items: center;
justify-content: center;
width: 34rpx;
height: 34rpx;
margin-top: 2rpx;
border: 2rpx solid var(--theme-border);
border-radius: 10rpx;
color: var(--theme-card-bg);
font-size: 22rpx;
font-weight: 800;
flex-shrink: 0;
}
.agreement-check.checked {
border-color: var(--theme-primary);
background: var(--theme-primary);
}
.agreement-copy {
flex: 1;
min-width: 0;
}
.agreement-link {
color: var(--theme-primary);
font-weight: 700;
}
.mini-shop-agreement {
margin-top: 22rpx;
}
.wechat-agreement {
width: 100%;
margin-top: 18rpx;
text-align: left;
}
.agreement-mask {
position: fixed;
inset: 0;
z-index: 80;
display: flex;
align-items: center;
justify-content: center;
padding: 28rpx;
background: rgba(74, 68, 63, 0.42);
}
.agreement-modal {
width: 100%;
max-width: 690rpx;
max-height: 82vh;
padding: 30rpx 28rpx;
border-radius: 32rpx;
background: var(--theme-card-bg);
}
.agreement-modal-title {
font-size: 32rpx;
line-height: 1.35;
font-weight: 800;
color: var(--text-primary);
}
.agreement-modal-meta {
margin-top: 10rpx;
font-size: 22rpx;
color: var(--text-secondary);
}
.agreement-modal-body {
height: 640rpx;
max-height: 56vh;
margin-top: 22rpx;
padding: 20rpx;
border-radius: 22rpx;
background: var(--theme-primary-soft);
color: var(--text-primary);
font-size: 24rpx;
line-height: 1.85;
box-sizing: border-box;
}
.agreement-modal-close {
margin-top: 22rpx;
}
.mini-shop-mask {
position: fixed;
inset: 0;
z-index: 60;
display: flex;
align-items: center;
justify-content: center;
padding: 24rpx;
background: rgba(74, 68, 63, 0.34);
}
.mini-shop-modal {
width: 100%;
max-width: 680rpx;
padding: 30rpx 28rpx;
border-radius: 36rpx;
background: var(--theme-card-bg);
}
.mini-shop-kicker {
display: block;
font-size: 22rpx;
font-weight: 700;
letter-spacing: 2rpx;
color: var(--theme-primary);
}
.mini-shop-title {
display: block;
margin-top: 16rpx;
font-size: 34rpx;
line-height: 1.35;
font-weight: 700;
color: var(--text-primary);
}
.mini-shop-desc {
display: block;
margin-top: 14rpx;
font-size: 24rpx;
line-height: 1.75;
color: var(--text-secondary);
}
.mini-shop-field {
margin-top: 26rpx;
}
.mini-shop-note {
margin-top: 20rpx;
}
.mini-shop-actions {
display: flex;
gap: 16rpx;
margin-top: 24rpx;
}
.mini-shop-action {
flex: 1;
}
.keyboard-spacer {
width: 100%;
flex-shrink: 0;
}
.admin-switch-link {
display: flex;
align-items: center;
justify-content: center;
min-height: 72rpx;
margin-top: 24rpx;
color: var(--theme-primary-action);
font-size: 26rpx;
font-weight: 700;
}