Files
qingcheng-xiaochengxu/pages/loginModule/pwdLogin/pwdLogin.wxml
2025-08-15 11:14:42 +08:00

114 lines
3.0 KiB
Plaintext
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.

<view class="page">
<!-- 顶部 Logo -->
<image class="logo" src="/static/logo.jpg" mode="aspectFit" />
<!-- 标题与角色 -->
<view class="title-wrap">
<text class="title bold-text">欢迎登录 — 丁香校园</text>
<text class="subtitle">{{ showRole }}端)</text>
</view>
<!-- 登录卡片 -->
<view class="card">
<!-- 登录方式切换 -->
<view class="tabs">
<text
class="tab {{loginType==='password' ? 'active' : ''}}"
bindtap="switchToPassword"
>密码登录</text>
<text
class="tab {{loginType==='sms' ? 'active' : ''}}"
bindtap="switchToSms"
wx:if="{{ role === 'user' }}"
>验证码登录</text>
</view>
<!-- 表单 -->
<view class="form">
<!-- 手机号 -->
<view class="field">
<input
class="field-input"
placeholder="请输入手机号"
placeholder-class="ph"
value="{{phone}}"
bindinput="onPhoneInput"
maxlength="11"
type="number"
/>
</view>
<!-- 密码 / 验证码 -->
<view class="field field-row">
<input
class="field-input flex-1"
placeholder="{{ loginType==='password' ? '请输入密码' : '请输入验证码' }}"
placeholder-class="ph"
value="{{credential}}"
bindinput="onCredentialInput"
password="{{ loginType==='password' }}"
type="{{ loginType==='sms' ? 'number' : 'text' }}"
/>
<!-- 验证码按钮(仅验证码登录显示) -->
<view
class="code-btn"
bindtap="getSmsCode"
wx:if="{{ loginType==='sms' }}"
>
<text class="code-btn-text">{{ codeButtonText }}</text>
</view>
</view>
<!-- 忘记密码(仅密码登录) -->
<text
class="link-right"
bindtap="gotoForgetPwd"
wx:if="{{ loginType==='password' }}"
>忘记密码</text>
<!-- 登录按钮 -->
<view
class="btn-primary"
bindtap="onLogin"
>
<text class="btn-primary-text">登录</text>
</view>
<!-- 协议 -->
<view class="agreements">
<checkbox-group bindchange="onAgreeChange">
<checkbox
class="checkbox"
value="agree"
checked="{{ isAgree }}"
color="#FF8D1A"
/>
</checkbox-group>
<view class="agreements-text">
<text class="muted">登录代表您已同意</text>
<text class="link" bindtap="gotoAgreement">《用户协议》</text>
<text class="muted">&</text>
<text class="link" bindtap="gotoPolicy">《隐私协议》</text>
</view>
</view>
<!-- 去注册 -->
<view class="register" wx:if="{{isShowRegister}}">
<text class="muted">没有账号?</text>
<text class="link-strong" bindtap="gotoRegister">去注册 →</text>
</view>
</view>
</view>
<!-- 加入我们(仅 user 端) -->
<view class="cta-join" bind:tap="joinUs" wx:if="{{ role === 'user' }}">
<text class="cta-join-text">加入我们</text>
<image class="cta-join-img" src="./images/joinus.png" mode="aspectFit" />
</view>
</view>