V4.0.9版本更新合伙人H5端调整

This commit is contained in:
2026-09-02 09:46:41 +08:00
parent af3c4b6f08
commit c905b3f930
33 changed files with 893 additions and 176 deletions
+19
View File
@@ -162,6 +162,11 @@ export async function capturePromoSceneAndTouchScan(): Promise<void> {
const assocScene = extractAssocSceneFromEnterOptions(opts);
if (assocScene) {
setStoredAssocScene(assocScene);
const touchKey = `assoc|${assocScene}|${opts?.path || ''}|${JSON.stringify(opts?.query || {})}|${String(opts?.scene ?? '')}`;
if (touchKey !== lastScanTouchKey) {
lastScanTouchKey = touchKey;
await touchAssoc({ scene: assocScene, countScan: true });
}
await bindStoredAssocIfLoggedIn();
return;
}
@@ -179,6 +184,20 @@ export async function capturePromoSceneAndTouchScan(): Promise<void> {
// 无新 scene 时不重复扫码计数
}
async function touchAssoc(input: { scene: string; countScan: boolean }): Promise<void> {
try {
await request('/user/partner-assoc/touch', {
method: 'POST',
data: {
scene: input.scene,
countScan: input.countScan,
},
});
} catch {
/* 静默失败,不阻断浏览 */
}
}
/** 登录成功后:用已缓存的活动 ID 做归因(不重复加扫码次数) */
export async function touchStoredPromoAfterLogin(): Promise<void> {
await bindStoredAssocIfLoggedIn();