优化小程序推荐码处理逻辑,支持通过扫码场景解析推荐码和初始章节ID。新增获取用户邀请码的功能以便于分享。更新分享配置,确保分享时自动带上推荐码。调整部分页面逻辑以提升用户体验。

This commit is contained in:
乘风
2026-02-12 15:09:52 +08:00
parent c57866ffe0
commit 448e908855
40 changed files with 1068 additions and 318 deletions

View File

@@ -796,14 +796,13 @@ Page({
})
},
// 分享 - 带推荐码
// 分享 - 带自己的邀请码(与 app.getMyReferralCode 一致)
onShareAppMessage() {
console.log('[Referral] 分享给好友,推荐码:', this.data.referralCode)
const app = getApp()
const ref = app.getMyReferralCode() || this.data.referralCode
return {
title: 'Soul创业派对 - 来自派对房的真实商业故事',
path: `/pages/index/index?ref=${this.data.referralCode}`
// 不设置 imageUrl使用小程序默认截图
// 如需自定义图片,请将图片放在 /assets/ 目录并配置路径
path: ref ? `/pages/index/index?ref=${ref}` : '/pages/index/index'
}
},