Enhance profile editing and sharing functionality
- Added a new feature for sharing profile cards, including special handling for forwarding to friends and displaying a canvas cover with user information. - Updated the mini program's profile-edit page to generate a shareable card with a structured layout, including user avatar, nickname, and additional information. - Improved the documentation to reflect the new sharing capabilities and updated the last modified date for relevant entries.
This commit is contained in:
@@ -92,7 +92,19 @@ description: Soul 创业派对小程序开发规范。在 miniprogram/ 下编辑
|
||||
|
||||
---
|
||||
|
||||
## 10. 何时使用本 Skill
|
||||
## 10. 分享名片(编辑资料页)
|
||||
|
||||
- **场景**:编辑资料页转发/朋友圈做特殊处理,直接变成分享名片。
|
||||
- **标题**:`昵称+为您分享名片`(如「少年梦想家为您分享名片」)。
|
||||
- **封面**:Canvas 绘制 5:4 封面图,布局:左头像(圆形)+ 右昵称 +「个人名片」副标题 + 分隔线 + 四栏信息(地区、MBTI、行业、职位)。
|
||||
- **路径**:`member-detail?id=userId`,好友打开即见名片详情。
|
||||
- **预生成**:资料加载完成后、头像更新后调用 `generateShareCard()`,将 `shareCardPath` 存入 data;`onShareAppMessage`/`onShareTimeline` 返回 `imageUrl: shareCardPath`。
|
||||
- **朋友圈重定向**:分享带 `id` 时,`profile-edit` 的 `onLoad` 检测 `options.id` 即 `redirectTo` 到 `member-detail`。
|
||||
- **头像**:网络头像需 `wx.downloadFile`,域名须配置 downloadFile 合法域名;失败时用昵称首字母占位。
|
||||
|
||||
---
|
||||
|
||||
## 11. 何时使用本 Skill
|
||||
|
||||
- 在 **miniprogram/** 下新增或修改页面、组件、utils 时。
|
||||
- 在小程序内新增或修改任何网络请求路径时(必须保持 `/api/miniprogram/...`)。
|
||||
@@ -101,5 +113,6 @@ description: Soul 创业派对小程序开发规范。在 miniprogram/ 下编辑
|
||||
- 做表单、input/textarea 样式时(遵循 §6,用 view 包裹,padding 写在 view 上)。
|
||||
- 做个人中心、设置页布局时(遵循 §7,卡片区边距 16rpx)。
|
||||
- 做阅读、文章等需长按复制的文本时(遵循 §9,text 加 user-select)。
|
||||
- 做编辑资料页分享名片时(遵循 §10)。
|
||||
|
||||
遵循本 Skill 可保证小程序只与 soul-api 的 miniprogram 路由组对接,避免与管理端或 next-project 接口混用。
|
||||
|
||||
Reference in New Issue
Block a user