2025-08-15 11:14:42 +08:00
|
|
|
|
<view class="page">
|
2025-05-17 23:17:14 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<!-- 顶部 Logo -->
|
|
|
|
|
<image class="logo" src="/static/logo.jpg" mode="aspectFit" />
|
2025-07-20 18:22:59 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<!-- 标题与角色 -->
|
|
|
|
|
<view class="title-wrap">
|
|
|
|
|
<text class="title bold-text">欢迎登录 — 丁香校园</text>
|
|
|
|
|
<text class="subtitle">({{ showRole }}端)</text>
|
|
|
|
|
</view>
|
2025-07-20 18:22:59 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<!-- 登录卡片 -->
|
|
|
|
|
<view class="card">
|
2025-05-17 23:17:14 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<!-- 登录方式切换 -->
|
|
|
|
|
<view class="tabs">
|
|
|
|
|
<text
|
|
|
|
|
class="tab {{loginType==='password' ? 'active' : ''}}"
|
|
|
|
|
bindtap="switchToPassword"
|
|
|
|
|
>密码登录</text>
|
2025-05-17 23:17:14 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<text
|
|
|
|
|
class="tab {{loginType==='sms' ? 'active' : ''}}"
|
|
|
|
|
bindtap="switchToSms"
|
|
|
|
|
wx:if="{{ role === 'user' }}"
|
|
|
|
|
>验证码登录</text>
|
|
|
|
|
</view>
|
2025-07-20 18:22:59 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<!-- 表单 -->
|
|
|
|
|
<view class="form">
|
2025-05-17 23:17:14 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<!-- 手机号 -->
|
|
|
|
|
<view class="field">
|
|
|
|
|
<input
|
|
|
|
|
class="field-input"
|
|
|
|
|
placeholder="请输入手机号"
|
|
|
|
|
placeholder-class="ph"
|
|
|
|
|
value="{{phone}}"
|
|
|
|
|
bindinput="onPhoneInput"
|
|
|
|
|
maxlength="11"
|
|
|
|
|
type="number"
|
|
|
|
|
/>
|
|
|
|
|
</view>
|
2025-05-17 23:17:14 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<!-- 密码 / 验证码 -->
|
|
|
|
|
<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' }}"
|
2025-05-17 23:17:14 +08:00
|
|
|
|
>
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<text class="code-btn-text">{{ codeButtonText }}</text>
|
2025-05-17 23:17:14 +08:00
|
|
|
|
</view>
|
2025-08-15 11:14:42 +08:00
|
|
|
|
</view>
|
2025-05-17 23:17:14 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<!-- 忘记密码(仅密码登录) -->
|
|
|
|
|
<text
|
|
|
|
|
class="link-right"
|
|
|
|
|
bindtap="gotoForgetPwd"
|
|
|
|
|
wx:if="{{ loginType==='password' }}"
|
|
|
|
|
>忘记密码</text>
|
2025-05-17 23:17:14 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<!-- 登录按钮 -->
|
|
|
|
|
<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>
|
2025-05-17 23:17:14 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-07-20 18:22:59 +08:00
|
|
|
|
|
2025-08-15 11:14:42 +08:00
|
|
|
|
<!-- 去注册 -->
|
|
|
|
|
<view class="register" wx:if="{{isShowRegister}}">
|
|
|
|
|
<text class="muted">没有账号?</text>
|
|
|
|
|
<text class="link-strong" bindtap="gotoRegister">去注册 →</text>
|
|
|
|
|
</view>
|
2025-07-20 18:22:59 +08:00
|
|
|
|
</view>
|
2025-05-17 23:17:14 +08:00
|
|
|
|
</view>
|
2025-08-15 11:14:42 +08:00
|
|
|
|
|
|
|
|
|
<!-- 加入我们(仅 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>
|