fix(fe): 成长海报的「保存/分享」原来是个装饰按钮
报告页 → 分享卡片,弹层底部那个「保存 / 分享卡片」按钮绑的是 bindtap="close" —— 点了只是把弹层关掉,既不保存也不分享。按钮文案 承诺了两件事,一件也没做。 拆成两个真按钮: - 分享给朋友:走微信原生 open-type="share",转发标题带上宠物名 - 保存到相册:把海报画进离屏 canvas 再存相册 canvas 部分的几个坑: - 画布用 position:fixed 挪到屏幕外,不能 display:none —— 那样 selectorQuery 取不到节点 - 按 pixelRatio 放大再 scale,否则高分屏上导出的图是糊的 - 相册权限被拒过一次后 wx.authorize 不会再弹,必须 wx.openSetting 引导,否则这里会永远静默失败——正是这次要修的那类问题 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -62,9 +62,12 @@ Page({
|
||||
wx.navigateTo({ url: '/pages/ai/ai' });
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return { title: '看看我家毛孩子的成长报告', path: '/pages/report/report' };
|
||||
// 带上宠物名,转发出去别人一眼知道是谁家的
|
||||
const n = (this.data.pet && this.data.pet.name) || '我家毛孩子';
|
||||
return { title: `${n} 的成长报告`, path: '/pages/report/report' };
|
||||
},
|
||||
onShareTimeline() {
|
||||
return { title: '看看我家毛孩子的成长报告' };
|
||||
const n = (this.data.pet && this.data.pet.name) || '我家毛孩子';
|
||||
return { title: `${n} 的成长报告` };
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user