feat: 支持分享关卡通关上报

This commit is contained in:
richarjiang
2026-04-08 21:34:36 +08:00
parent fe823df01e
commit 447e7a944a
6 changed files with 672 additions and 4 deletions

View File

@@ -688,12 +688,15 @@ export class PageLevel extends BaseView {
// 播放成功音效
this.playSuccessSound();
// 通关奖励:分享模式下不增加积分
const levelId = this._currentConfig?.id ?? '';
const timeSpent = 60 - this._countdown;
if (!this._isShareMode) {
const levelId = this._currentConfig?.id ?? '';
const timeSpent = 60 - this._countdown;
await UserAssetsManager.instance.earnPoint(levelId, timeSpent);
this.updatePointsLabel();
} else {
// fire-and-forget: errors are logged inside reportLevelProgress
void ShareManager.instance.reportLevelProgress(levelId, true, timeSpent);
}
// 显示通关弹窗