hku-class/miniprogram/pages/bind/index.wxml
2026-05-12 23:10:05 +08:00

72 lines
3.4 KiB
Plaintext

<view class="page">
<view class="hero">
<view class="eyebrow">SECURE SIGN IN</view>
<view class="hero-title">登录 ClassHub</view>
<view class="hero-subtitle">可以使用微信快速登录,也可以用原来的邮箱和密码登录。</view>
</view>
<view wx:if="{{isLoginMode}}" class="section">
<view class="login-panel">
<view class="login-tabs">
<view class="login-tab {{isWechatLogin ? 'active' : ''}}" data-method="wechat" bindtap="switchLoginMethod">微信</view>
<view class="login-tab {{isEmailLogin ? 'active' : ''}}" data-method="email" bindtap="switchLoginMethod">邮箱</view>
</view>
<view wx:if="{{isWechatLogin}}" class="login-method">
<view class="wechat-symbol">微</view>
<view class="login-title">微信快捷登录</view>
<view class="login-copy">已绑定微信的同学可直接进入班级空间;未绑定账号会进入激活流程。</view>
<button class="button login-primary" loading="{{loading}}" bindtap="loginWithWechatTap">使用微信登录</button>
</view>
<view wx:if="{{isEmailLogin}}" class="login-method">
<view class="login-title">邮箱密码登录</view>
<view class="login-copy">继续使用 Web 端账号登录,登录后可绑定微信以便下次快捷进入。</view>
<view class="form-field">
<view class="field-label">邮箱</view>
<input value="{{email}}" bindinput="onEmailInput" placeholder="请输入邮箱" />
</view>
<view class="form-field">
<view class="field-label">密码</view>
<input password="{{true}}" value="{{password}}" bindinput="onPasswordInput" placeholder="请输入密码" />
</view>
<button class="button login-primary" loading="{{loading}}" bindtap="loginWithEmail">登录</button>
</view>
</view>
</view>
<view wx:elif="{{isActivateMode}}" class="section">
<view class="section-head">
<view class="section-title">激活账号</view>
<view class="section-action" bindtap="backToLogin">返回登录</view>
</view>
<view class="card">
<view class="muted">说明</view>
<view class="card-title">没有找到已绑定的微信账号</view>
<view class="muted">请用班级邀请码、学号和微信手机号激活你的班级账号。</view>
</view>
<view class="card">
<view class="muted">邀请码</view>
<input value="{{inviteCode}}" bindinput="onInviteCodeInput" placeholder="请输入班级邀请码" />
</view>
<view class="card">
<view class="muted">学号</view>
<input value="{{studentId}}" bindinput="onStudentIdInput" placeholder="请输入学号" />
</view>
<button class="button" loading="{{loading}}" open-type="getPhoneNumber" bindgetphonenumber="bindWithPhone">
授权手机号并绑定
</button>
</view>
<view wx:elif="{{isBindCurrentMode}}" class="section">
<view class="card">
<view class="card-title">绑定微信和手机号</view>
<view class="muted">邮箱登录成功。为了下次可以微信快速登录,请绑定当前微信和手机号。</view>
</view>
<button class="button" loading="{{loading}}" open-type="getPhoneNumber" bindgetphonenumber="bindCurrentWithPhone">
授权手机号并绑定微信
</button>
<button class="button secondary" bindtap="skipCurrentBinding">暂时跳过</button>
</view>
</view>