fix(login): 邮箱登录文案改为拆书帮注册邮箱唯一步

- 主按钮文案改为「微信手机号快速登录」
- 切换入口改为「使用拆书帮注册邮箱登录」
- placeholder/提示语/前端校验同步为仅邮箱
This commit is contained in:
2026-11-15 03:07:58 +08:00
parent 1beb0796c6
commit d3a82807f0
2 changed files with 8 additions and 9 deletions
+4 -5
View File
@@ -94,19 +94,18 @@ Page({
async handleIdentifierLogin() {
const raw = (this.data.identifier || '').trim();
if (!raw) {
wx.showToast({ title: '请输入手机号、微信号或邮箱', icon: 'none' });
wx.showToast({ title: '请输入拆书帮注册邮箱', icon: 'none' });
return;
}
if (this.data.loading) return;
this.setData({ loading: true });
try {
const isEmail = /^[\w.+-]+@[\w-]+(\.[\w-]+)+$/.test(raw);
const isCnPhone = /^1\d{10}$/.test(raw);
if (!isEmail && !isCnPhone) {
wx.showToast({ title: '请输入正确的手机号或邮箱', icon: 'none' });
if (!isEmail) {
wx.showToast({ title: '请输入正确的邮箱地址', icon: 'none' });
return;
}
const payload = isEmail ? { email: raw } : { phone: raw };
const payload = { email: raw };
const res = await post('/auth/login', payload, { showLoading: false });
if (res.success && res.data) {
+4 -4
View File
@@ -22,7 +22,7 @@
bindgetphonenumber="handleWechatLogin"
disabled="{{loading}}"
>
<text class="wechat-btn-text">{{loading ? '登录中...' : '手机号快速验证'}}</text>
<text class="wechat-btn-text">{{loading ? '登录中...' : '微信手机号快速登录'}}</text>
</button>
<view class="divider">
@@ -36,7 +36,7 @@
class="identifier-input"
type="text"
value="{{identifier}}"
placeholder="手机号 / 微信号 / 邮箱"
placeholder="拆书帮注册邮箱"
placeholder-class="identifier-placeholder"
bindinput="onIdentifierInput"
confirm-type="done"
@@ -50,11 +50,11 @@
<text class="identifier-btn-text">{{loading ? '登录中...' : '登录'}}</text>
</button>
<view class="identifier-tip">
<text>邮箱为拆书帮会员身份认定凭证;非会员用手机号或微信号登录</text>
<text>邮箱为拆书帮会员身份认定凭证</text>
</view>
</view>
<view class="toggle-login-wrap" wx:else>
<text class="toggle-login-text" bindtap="toggleIdentifierLogin">使用手机号 / 微信号 / 邮箱登录</text>
<text class="toggle-login-text" bindtap="toggleIdentifierLogin">使用拆书帮注册邮箱登录</text>
</view>
</view>