chore:我的名片组件,隐藏我的名片组件的下面登录后即可展示我的名片隐藏,

This commit is contained in:
2026-10-23 10:21:25 +08:00
parent cb454db326
commit 8348cbb179
2 changed files with 9 additions and 39 deletions

View File

@@ -21,15 +21,10 @@
> >
</diy-card-mini> </diy-card-mini>
<!-- 未登录提示条(参考图 2026-10-22): 兜底名片下方灰条, 左文案右链接 --> <!-- 未登录提示条已按 2026-10-23 用户要求移除(不再显示「登录后即可展示我的名片」) -->
<view v-if="!hasToken && fallbackMode !== 'none' && !loading && card"
class="self-login-bar" hover-class="btn-press">
<text class="login-bar-text" :style="subTextStyle" @tap="goLogin">{{ value.loginBarTip || '登录后即可展示我的名片' }}</text>
<text class="login-bar-link" :style="loginLinkStyle" @tap="goCardList">{{ value.loginBarBtnText || '去看看名片' }}</text>
</view>
<!-- 已登录但没有任何名片可显示 --> <!-- 没有任何名片可显示(非登录引导模式; 登录引导已由第一个分支承接) -->
<view v-else-if="!loading" class="self-empty" :style="boxStyle"> <view v-else-if="!loading && !card" class="self-empty" :style="boxStyle">
<text class="empty-icon">🪪</text> <text class="empty-icon">🪪</text>
<text class="empty-tip" :style="subTextStyle">{{ value.noCardTip || '登录后即可展示我的名片' }}</text> <text class="empty-tip" :style="subTextStyle">{{ value.noCardTip || '登录后即可展示我的名片' }}</text>
<view class="empty-btn" :style="loginBtnStyle" hover-class="btn-press" @tap="goCardList"> <view class="empty-btn" :style="loginBtnStyle" hover-class="btn-press" @tap="goCardList">
@@ -117,9 +112,6 @@ export default {
subTextStyle() { subTextStyle() {
return this.$util.objToStyle({ color: (this.value || {}).infoColor || '#8A8F99' }); return this.$util.objToStyle({ color: (this.value || {}).infoColor || '#8A8F99' });
}, },
loginLinkStyle() {
return this.$util.objToStyle({ color: (this.card || {}).theme_color || '#2F6BFF' });
},
loginBtnStyle() { loginBtnStyle() {
return this.$util.objToStyle({ return this.$util.objToStyle({
background: (this.card || {}).theme_color || '#2F6BFF', background: (this.card || {}).theme_color || '#2F6BFF',
@@ -222,28 +214,6 @@ export default {
width: 100%; width: 100%;
position: relative; position: relative;
/* 未登录提示条(参考图 2026-10-22): 兜底名片下方, 浅灰圆角条 左文案右链接 */
.self-login-bar {
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: #F5F6F8;
border-radius: 12rpx;
padding: 20rpx 24rpx;
.login-bar-text {
font-size: 24rpx;
}
.login-bar-link {
font-size: 24rpx;
font-weight: 600;
flex-shrink: 0;
margin-left: 16rpx;
}
}
.self-login, .self-login,
.self-empty { .self-empty {
width: 100%; width: 100%;

View File

@@ -254,13 +254,13 @@ test('self: miniConfig 透传头像+二维码新六字段', () => {
assert.match(selfSrc, /qrTipShow:\s*v\.qrTipShow/); assert.match(selfSrc, /qrTipShow:\s*v\.qrTipShow/);
}); });
test('self: 「我的名片」角标已移除 + 未登录提示条(2026-10-23 参考图定稿)', () => { test('self: 「我的名片」角标与未登录提示条均已移除(2026-10-23 用户定稿)', () => {
// 角标按 2026-10-23 参考图删除(此前 2026-10-22 曾恒显), 反例防回归 // 角标按 2026-10-23 参考图删除, 反例防回归
assert.ok(!selfSrc.includes('self-badge') && !selfSrc.includes('slot="badge"')); assert.ok(!selfSrc.includes('self-badge') && !selfSrc.includes('slot="badge"'));
// 未登录提示条: 兜底名片下方, 左文案(点去登录)右链接(点去看看名片) // 未登录提示条(「登录后即可展示我的名片·去看看名片」)按用户要求整条移除, 反例防回归
assert.match(selfSrc, /v-if="!hasToken && fallbackMode !== 'none' && !loading && card"\s+class="self-login-bar"/); assert.ok(!selfSrc.includes('self-login-bar') && !selfSrc.includes('loginBarTip'));
assert.match(selfSrc, /class="login-bar-text" :style="subTextStyle" @tap="goLogin"/); // 空态分支接管提示条删除后的条件(非引导模式 + 无卡 + 非加载)
assert.match(selfSrc, /class="login-bar-link" :style="loginLinkStyle" @tap="goCardList"/); assert.match(selfSrc, /v-else-if="!loading && !card" class="self-empty"/);
}); });
test('show: 头像开关(面板「显示头像」, 默认显示, 关后头部只留姓名/职位)', () => { test('show: 头像开关(面板「显示头像」, 默认显示, 关后头部只留姓名/职位)', () => {