forked from gxwebsoft/mp-10550
refactor(share): 优化首页分享功能并移除商品页分享
- 在 BestSellers 组件中移除商品分享逻辑,避免与首页分享冲突 - 在首页 index.tsx 中添加分享成功和失败的提示 - 更新 invite.ts 中的邀请信息解析逻辑,支持处理首页分享链接
This commit is contained in:
@@ -65,11 +65,23 @@ export function parseInviteParams(options: any): InviteParams | null {
|
||||
}
|
||||
}
|
||||
|
||||
// 从 query 参数中解析邀请信息(兼容旧版本)
|
||||
if (options.referrer) {
|
||||
return {
|
||||
inviter: options.referrer,
|
||||
source: 'link'
|
||||
// 从 query 参数中解析邀请信息(处理首页分享链接)
|
||||
if (options.query) {
|
||||
const query = options.query
|
||||
if (query.inviter) {
|
||||
return {
|
||||
inviter: query.inviter,
|
||||
source: query.source || 'share',
|
||||
t: query.t
|
||||
}
|
||||
}
|
||||
|
||||
// 兼容旧版本
|
||||
if (query.referrer) {
|
||||
return {
|
||||
inviter: query.referrer,
|
||||
source: 'link'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user