chore:精选名片组件可以支持头像开启关闭

This commit is contained in:
2026-10-21 16:05:59 +08:00
parent 37cd3c2f30
commit 724e7ac134
2 changed files with 52 additions and 3 deletions

View File

@@ -182,6 +182,13 @@ test('self: miniConfig 透传头像+二维码新六字段', () => {
assert.match(selfSrc, /qrTipShow:\s*v\.qrTipShow/);
});
test('show: 头像开关(面板「显示头像」, 默认显示, 关后头部只留姓名/职位)', () => {
assert.match(showSrc, /showAvatarBlock\(\)\s*\{\s*return flagOn\(this\.c\.showAvatar,\s*true\)/);
assert.match(showSrc, /<view v-if="showAvatarBlock" class="card-avatar" :style="avatarStyle">/);
// 反例形态: 不允许出现常显头像(绕过开关)
assert.ok(!showSrc.includes('<view class="card-avatar"'));
});
test('show: 自绘版式自带小二维码(预览名片 + 点击进详情, 尺寸面板可调)', () => {
assert.match(showSrc, /class="card-qr"/);
assert.match(showSrc, /\$util\.img\(card\.qr_url\)/);