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:
@@ -35,6 +35,7 @@
|
||||
* 入参(query, 均需 encodeURIComponent):
|
||||
* name/mobile/company/job_title/email/website/address/remark/wechat 名片字段
|
||||
* action=call 时进入页面直接拨号(wap 页「打电话」按钮也可走本页)
|
||||
* action=mail 时复制 email 到剪贴板并返回(web-view 内 mailto: 不生效的兜底)
|
||||
*/
|
||||
export default {
|
||||
data() {
|
||||
@@ -70,6 +71,10 @@ export default {
|
||||
if (options && options.action === 'call' && this.form.mobile) {
|
||||
this.callNow();
|
||||
}
|
||||
// 发邮件动作: web-view 内 mailto: 不生效, 复制邮箱后返回名片页
|
||||
if (options && options.action === 'mail' && this.form.email) {
|
||||
this.copyEmail();
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
// 微信真机才生效(模拟器 bug 见 docs/weixin-bug.md), onShow 兜底见下
|
||||
@@ -91,6 +96,22 @@ export default {
|
||||
fail: () => {}
|
||||
});
|
||||
},
|
||||
// 发邮件兜底: 小程序无唤起邮件 App 的 API, 复制邮箱 + 提示后返回原名片页
|
||||
copyEmail() {
|
||||
uni.setClipboardData({
|
||||
data: this.form.email,
|
||||
showToast: false,
|
||||
success: () => {
|
||||
uni.showToast({ title: '邮箱已复制,去邮件 App 粘贴发送', icon: 'none', duration: 2000 });
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({ fail: () => {} });
|
||||
}, 1400);
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({ title: '复制失败,邮箱:' + this.form.email, icon: 'none', duration: 3000 });
|
||||
}
|
||||
});
|
||||
},
|
||||
saveToContacts() {
|
||||
if (this.saving) return;
|
||||
if (!this.form.name && !this.form.mobile) {
|
||||
|
||||
Reference in New Issue
Block a user