feat(front): 新增手机号快捷登录功能,替换微信登录按钮

- 新增手机号登录图标资源
- 替换登录按钮样式和文案
- 更新登录错误提示信息
这个提交包含在:
2026-11-28 16:10:18 +08:00
父节点 9b8561d7ea
当前提交 d706953cdb
共有 2 个文件被更改,包括 23 次插入 和 29 次删除

查看文件

@@ -30,18 +30,16 @@
<!-- 核心交互区 -->
<view class="action-block">
<!-- #ifdef MP-WEIXIN -->
<!-- 微信小程序端默认只使用微信登录(手机号授权一键登录) -->
<!-- 微信小程序端默认使用手机号快捷登录 -->
<button
class="btn-wx-primary clickable-hover"
class="btn-phone-primary clickable-hover"
:class="{ disabled: loading, 'btn-shake': needShake }"
:open-type="agreePolicy ? 'getPhoneNumber' : ''"
@getphonenumber="onGetPhoneNumber"
@tap="handleTapButton"
>
<view class="wx-icon-wrap">
<image class="wx-svg-icon" src="/static/icons/wechat.svg" mode="aspectFit" />
</view>
<text class="btn-text">{{ loading ? '安全授权中...' : '微信手机号一键登录' }}</text>
<image class="phone-svg-icon" src="/static/icons/login-phone-white.svg" mode="aspectFit" />
<text class="btn-text">{{ loading ? '安全登录中...' : '手机号快捷登录' }}</text>
</button>
<!-- #endif -->
@@ -304,12 +302,12 @@
return '隐私保护指引尚未生效,请稍后重试或联系客服';
}
if (msg.includes('no permission') || msg.includes('unauthorized')) {
return '当前暂不支持微信手机号快捷登录,请联系客服';
return '当前暂不支持手机号快捷登录,请联系客服';
}
if (msg.includes('quota') || msg.includes('limit')) {
return '手机号验证次数已达上限,请稍后再试';
}
return '获取微信手机号失败,请重试';
return '获取手机号失败,请重试';
}
function formatLoginError(err, fallback) {
@@ -592,7 +590,7 @@
}, 600);
} catch (err) {
loading.value = false;
toast(formatLoginError(err, '微信手机号登录失败,请重试'));
toast(formatLoginError(err, '手机号登录失败,请重试'));
}
}
@@ -871,13 +869,13 @@
opacity: 0.65;
}
/* 微信手机号授权大胶囊按钮 */
.btn-wx-primary {
/* 手机号快捷登录大胶囊按钮 */
.btn-phone-primary {
width: 100%;
height: 100rpx;
border-radius: 50rpx;
background: linear-gradient(135deg, #07C160 0%, #05A351 100%);
box-shadow: 0 12rpx 28rpx rgba(7, 193, 96, 0.28);
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
box-shadow: 0 12rpx 28rpx rgba(240, 113, 13, 0.28);
display: flex;
align-items: center;
justify-content: center;
@@ -888,27 +886,18 @@
line-height: normal;
transition: opacity 0.2s ease, transform 0.15s ease;
}
.btn-wx-primary::after {
.btn-phone-primary::after {
border: none;
}
.btn-wx-primary.disabled {
.btn-phone-primary.disabled {
opacity: 0.65;
}
.wx-icon-wrap {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin-right: 18rpx;
box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.08);
}
.wx-svg-icon {
width: 34rpx;
height: 34rpx;
.phone-svg-icon {
width: 38rpx;
height: 38rpx;
margin-right: 14rpx;
flex-shrink: 0;
}
.btn-text {
font-size: 32rpx;

查看文件

@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="6" y="2" width="12" height="20" rx="2.5" ry="2.5"/>
<line x1="10" y1="5.5" x2="14" y2="5.5"/>
<circle cx="12" cy="18" r="0.9" fill="#FFFFFF" stroke="none"/>
</svg>

之后

宽度:  |  高度:  |  大小: 356 B