chore:二维码精选名片后台控制开启显示
This commit is contained in:
@@ -144,6 +144,12 @@ test('show: 自绘资料行(图标/文字标签退化 + href 派生动作 + doAc
|
||||
assert.match(showSrc, /onRowTap\(row\)\s*\{[\s\S]*?this\.doAct\(act\)/);
|
||||
});
|
||||
|
||||
test('show: 资料行总开关(面板「显示资料行」, 默认显示, 关后整块隐藏)', () => {
|
||||
assert.match(showSrc, /showRowsBlock\(\)\s*\{\s*return flagOn\(this\.c\.showRows,\s*true\)/);
|
||||
// 模板资料行块受开关控制(与头像开关同口径: v-if 直接消费)
|
||||
assert.match(showSrc, /v-if="showRowsBlock && shownRows\.length" class="card-rows"/);
|
||||
});
|
||||
|
||||
// =============================================================
|
||||
// 反例(防恒真)
|
||||
// =============================================================
|
||||
|
||||
@@ -57,8 +57,8 @@ test('self: miniConfig 透传 showDetailBtn 与 detailBtnText', () => {
|
||||
assert.match(selfSrc, /detailBtnText:\s*v\.detailBtnText/);
|
||||
});
|
||||
|
||||
test('show: 自绘二维码块挂 @tap.stop="goDetail(card)"(点「预览名片」进详情)', () => {
|
||||
assert.match(showSrc, /@tap\.stop="goDetail\(card\)"/);
|
||||
test('show: 自绘二维码块挂 @tap.stop="openCardShare"(点二维码弹「分享名片」抽屉)', () => {
|
||||
assert.match(showSrc, /@tap\.stop="openCardShare"/);
|
||||
});
|
||||
|
||||
// =============================================================
|
||||
|
||||
@@ -189,13 +189,33 @@ test('show: 头像开关(面板「显示头像」, 默认显示, 关后头部只
|
||||
assert.ok(!showSrc.includes('<view class="card-avatar"'));
|
||||
});
|
||||
|
||||
test('show: 自绘版式自带小二维码(预览名片 + 点击进详情, 尺寸面板可调)', () => {
|
||||
test('show: 快捷操作开关(面板「显示快捷操作」, 默认显示, 关后芯片整块隐藏)', () => {
|
||||
assert.match(showSrc, /showActsBlock\(\)\s*\{\s*return flagOn\(this\.c\.showQuick,\s*true\)/);
|
||||
assert.match(showSrc, /v-if="showActsBlock && acts\.length" class="card-acts"/);
|
||||
// 芯片点击直连 doAct(自绘版式不再经 $emit('act') 中转)
|
||||
assert.match(showSrc, /@tap\.stop="doAct\(act\)"/);
|
||||
});
|
||||
|
||||
test('show: 自绘版式自带小二维码(开关可关 + 点击进详情, 尺寸/提示文字面板可调)', () => {
|
||||
assert.match(showSrc, /class="card-qr"/);
|
||||
assert.match(showSrc, /\$util\.img\(card\.qr_url\)/);
|
||||
assert.match(showSrc, /预览名片/);
|
||||
assert.match(showSrc, /@tap\.stop="goDetail\(card\)"/);
|
||||
// 尺寸仍消费面板 qrSize(默认 48px)
|
||||
assert.match(showSrc, /qrSide\(\)\s*\{\s*return px2rpx\(num\(this\.c\.qrSize,\s*48\)\)/);
|
||||
// 二维码块受面板「显示二维码」开关控制(与头像/资料行/快捷操作同口径: flagOn 默认显示)
|
||||
assert.match(showSrc, /showQrBlock\(\)\s*\{\s*return flagOn\(this\.c\.showQr,\s*true\)/);
|
||||
assert.match(showSrc, /v-if="showQrBlock && card\.qr_url" class="card-qr"/);
|
||||
// 提示文字消费面板 qrTip, 未配置回落「扫码查看完整名片」(与 mini 基件同口径)
|
||||
assert.match(showSrc, /qrTipText\(\)\s*\{\s*return this\.c\.qrTip \|\| '扫码查看完整名片';/);
|
||||
// 点二维码弹「分享名片」抽屉(复刻 detail.vue: 码 + 链接 + 复制链接/浏览器分享/保存二维码)
|
||||
assert.match(showSrc, /@tap\.stop="openCardShare"/);
|
||||
assert.match(showSrc, /v-if="showShare" @tap="closeShare"/);
|
||||
assert.match(showSrc, /class="cs-sheet" :class="\{ 'cs-sheet-show': showShare \}"/);
|
||||
assert.match(showSrc, /<view class="ss-title">分享名片<\/view>/);
|
||||
assert.match(showSrc, /客户打开链接即可查看名片并留言留资/);
|
||||
assert.match(showSrc, /copyCardLink\(\)\s*\{\s*const url = \(this\.card && this\.card\.wap_url\) \|\| '';/);
|
||||
// 尺寸走 resolveQrSize: 面板 qrSize>0 用自定义, 0/空 = 自动档(head 120rpx)。
|
||||
// 反例形态: 不允许 num(qrSize, 48) 兜底 —— 面板默认 0 是合法数字, 会算出 0rpx 宽高,
|
||||
// 二维码图渲染成 0 尺寸「看不见」(2026-10-21 线上问题)
|
||||
assert.match(showSrc, /qrSide\(\)\s*\{\s*return resolveQrSize\('head',\s*this\.c\.qrSize\)/);
|
||||
assert.ok(!showSrc.includes("num(this.c.qrSize"));
|
||||
});
|
||||
|
||||
// =============================================================
|
||||
|
||||
Reference in New Issue
Block a user