Merge remote-tracking branch 'origin/feat/camcard' into feat/camcard
# Conflicts: # components-diy/diy-card-mini.vue # components-diy/diy-card-show.vue # tests/diy-card-ab-visual.test.js # tests/diy-card-qr-style.test.js
This commit is contained in:
@@ -66,12 +66,20 @@ export default {
|
||||
miniConfig() {
|
||||
const v = this.value || {};
|
||||
return {
|
||||
bgColor: v.bgColor,
|
||||
nameColor: v.nameColor,
|
||||
infoColor: v.infoColor,
|
||||
labelColor: v.labelColor,
|
||||
borderRadius: v.borderRadius,
|
||||
padding: v.padding,
|
||||
bgColor: v.bgColor,
|
||||
nameColor: v.nameColor,
|
||||
infoColor: v.infoColor,
|
||||
labelColor: v.labelColor,
|
||||
borderRadius: v.borderRadius,
|
||||
padding: v.padding,
|
||||
// 字号定制(px 口径, 缺省时基件按历史默认值渲染)
|
||||
nameSize: v.nameSize,
|
||||
cardTitleSize: v.cardTitleSize,
|
||||
subSize: v.subSize,
|
||||
labelSize: v.labelSize,
|
||||
valueSize: v.valueSize,
|
||||
actSize: v.actSize,
|
||||
btnSize: v.btnSize,
|
||||
showQuick: v.showQuick,
|
||||
showDetailBtn: v.showDetailBtn,
|
||||
detailBtnText: v.detailBtnText,
|
||||
@@ -95,6 +103,27 @@ export default {
|
||||
qrOffsetX: v.qrOffsetX,
|
||||
qrOffsetY: v.qrOffsetY,
|
||||
qrTipShow: v.qrTipShow,
|
||||
// 2.17 双形态: 渐变头部 / 宫格快捷操作 / 资料区标题 / 复制按钮
|
||||
headStyle: v.headStyle,
|
||||
headNameColor: v.headNameColor,
|
||||
headSubColor: v.headSubColor,
|
||||
actsLayout: v.actsLayout,
|
||||
actGridColorMode: v.actGridColorMode,
|
||||
showRowsTitle: v.showRowsTitle,
|
||||
rowsTitle: v.rowsTitle,
|
||||
showCopyBtn: v.showCopyBtn,
|
||||
// 2.18: 操作区位置/独立块样式/每按钮图标/自定义二维码图
|
||||
actsPosition: v.actsPosition,
|
||||
actsBlockBg: v.actsBlockBg,
|
||||
actsBlockRadius: v.actsBlockRadius,
|
||||
actsBlockPad: v.actsBlockPad,
|
||||
actIcons: v.actIcons,
|
||||
qrImage: v.qrImage,
|
||||
// 2.19: 默认动作显隐/文案 + 自定义动作(基件 acts computed 合成)
|
||||
actVis: v.actVis,
|
||||
actLabels: v.actLabels,
|
||||
actOrder: v.actOrder,
|
||||
customActs: v.customActs,
|
||||
};
|
||||
},
|
||||
boxStyle() {
|
||||
@@ -176,7 +205,13 @@ export default {
|
||||
this.$util.redirectTo('/pages_tool/card/list');
|
||||
},
|
||||
doAct(act) {
|
||||
if (!act || !act.value) return;
|
||||
if (!act) return;
|
||||
// save(存通讯录): value 为空, 字段由本组件从 card 组装(白名单口径)
|
||||
if (act.type === 'save') {
|
||||
this.goSaveContact();
|
||||
return;
|
||||
}
|
||||
if (!act.value) return;
|
||||
if (act.type === 'tel') {
|
||||
uni.makePhoneCall({ phoneNumber: act.value, fail: () => {} });
|
||||
} else if (act.type === 'wx') {
|
||||
@@ -222,6 +257,37 @@ export default {
|
||||
if (!card || !card.card_id) return;
|
||||
this.$util.redirectTo('/pages_tool/card/detail', { card_id: card.card_id });
|
||||
},
|
||||
/**
|
||||
* 存通讯录(2.17.1): 与 diy-card-show 同构 —— 字段全部从 card 组装
|
||||
* (rows 已过 shouldShow 白名单), 键名与 save-contact.vue onLoad 的 keys 一一对应。
|
||||
*/
|
||||
goSaveContact() {
|
||||
const c = this.card || {};
|
||||
const map = {};
|
||||
(Array.isArray(c.rows) ? c.rows : []).forEach(r => {
|
||||
if (r && r.field) map[r.field] = String(r.value || '');
|
||||
});
|
||||
// #ifdef H5
|
||||
// H5 无通讯录 API: 复制资料文本兜底(小程序端走 save-contact 原生页)
|
||||
const text = [c.name, map.mobile, map.email, c.company, c.job_title].filter(Boolean).join(' ');
|
||||
uni.setClipboardData({
|
||||
data: text,
|
||||
success: () => uni.showToast({ title: '名片资料已复制', icon: 'none' }),
|
||||
});
|
||||
return;
|
||||
// #endif
|
||||
this.$util.redirectTo('/pages_tool/card/save-contact', {
|
||||
name: c.name || '',
|
||||
mobile: map.mobile || '',
|
||||
company: c.company || '',
|
||||
job_title: c.job_title || '',
|
||||
email: map.email || '',
|
||||
website: map.website || '',
|
||||
address: map.address || '',
|
||||
remark: map.remark || '',
|
||||
wechat: map.wechat || '',
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user