Files
JayuCloud/FM-Wechat-Fronted/pages/login/index.wxml
T
2026-06-26 11:55:14 +08:00

77 lines
3.7 KiB
Plaintext

<view class="page no-tab auth-page">
<view class="brand">
<image class="logo" src="/assets/images/app-icon.png" mode="aspectFill"></image>
<text class="brand-name">{{appName}}</text>
<text class="brand-sub">美甲店预约排班管理</text>
</view>
<view class="card auth-card">
<view class="mode-tabs">
<view class="mode-tab {{loginMode === 'password' ? 'active' : ''}}" data-mode="password" bindtap="switchLoginMode">密码登录</view>
<view class="mode-tab {{loginMode === 'phone' ? 'active' : ''}}" data-mode="phone" bindtap="switchLoginMode">验证码登录</view>
</view>
<view wx:if="{{loginMode === 'password'}}" class="field">
<text class="field-label">账号</text>
<input value="{{form.account}}" data-field="account" bindinput="onInput" placeholder="请输入账号" />
</view>
<view wx:if="{{loginMode === 'password'}}" class="field">
<text class="field-label">密码</text>
<input value="{{form.password}}" data-field="password" bindinput="onInput" password placeholder="请输入密码" />
</view>
<view wx:if="{{loginMode === 'phone'}}" class="field">
<text class="field-label">手机号</text>
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" type="number" placeholder="请输入手机号" />
</view>
<view wx:if="{{loginMode === 'phone'}}" class="field">
<text class="field-label">验证码</text>
<view class="code-row">
<input class="code-input" value="{{form.code}}" data-field="code" bindinput="onInput" type="number" placeholder="请输入验证码" />
<button class="code-btn" loading="{{codeLoading}}" disabled="{{codeLoading || countdown > 0}}" bindtap="sendLoginCode">
{{countdown > 0 ? countdown + 's' : '获取验证码'}}
</button>
</view>
</view>
<view wx:if="{{loginMode === 'phone'}}" class="agreement-row" bindtap="toggleAgreement">
<view class="agreement-check {{agreementAccepted ? 'checked' : ''}}">{{agreementAccepted ? '✓' : ''}}</view>
<view class="agreement-copy">我已阅读并同意用户协议和隐私政策</view>
</view>
<view class="remember-row" bindtap="toggleRememberMe">
<view class="agreement-check {{rememberMe ? 'checked' : ''}}">{{rememberMe ? '✓' : ''}}</view>
<view class="agreement-copy">记住我</view>
</view>
<button class="primary-btn login-btn" loading="{{loading}}" bindtap="submit">登录</button>
<view class="auth-links">
<button class="text-btn">忘记密码</button>
<button class="text-btn" bindtap="goRegister">注册账号</button>
</view>
</view>
<button class="secondary-btn wechat-btn" bindtap="wechatLogin">微信快捷登录</button>
<view wx:if="{{shopSelectVisible}}" class="shop-select-mask">
<view class="shop-select-dialog">
<view class="shop-select-header">
<text class="shop-select-title">选择店铺</text>
<text class="shop-select-subtitle">请选择本次登录的店铺</text>
</view>
<scroll-view class="shop-option-list" scroll-y>
<view
wx:for="{{shopOptions}}"
wx:key="id"
class="shop-option {{switchingShop ? 'disabled' : ''}}"
data-id="{{item.id}}"
bindtap="selectLoginShop"
>
<view class="shop-option-icon">店</view>
<view class="shop-option-copy">
<text class="shop-option-name">{{item.name}}</text>
<text class="shop-option-id">{{item.description || ('ID ' + item.id)}}</text>
</view>
</view>
</scroll-view>
<view wx:if="{{switchingShop}}" class="shop-switching">正在进入店铺...</view>
</view>
</view>
</view>