添加埋点

This commit is contained in:
2026-01-06 19:25:34 +08:00
parent 1096f24c57
commit c3909d63da
30 changed files with 784 additions and 39 deletions

View File

@@ -202,6 +202,18 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
NSInteger old = self.selectedIndex;
self.selectedIndex = indexPath.item;
KBPayProductModel *item = (indexPath.item < self.data.count) ? self.data[indexPath.item] : nil;
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
extra[@"index"] = @(indexPath.item);
if ([item.productId isKindOfClass:NSString.class] && item.productId.length > 0) {
extra[@"product_id"] = item.productId;
}
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_points_select_product"
pageId:@"points_recharge"
elementId:@"product_item"
extra:extra.copy
completion:nil];
KBJfPayCell *newCell = (KBJfPayCell *)[collectionView cellForItemAtIndexPath:indexPath];
[newCell applySelected:YES animated:YES];
if (old >= 0 && old < self.data.count) {
@@ -319,6 +331,15 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
[KBHUD showInfo:KBLocalized(@"Please select a product")];
return;
}
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
if ([selectedItem.productId isKindOfClass:NSString.class] && selectedItem.productId.length > 0) {
extra[@"product_id"] = selectedItem.productId;
}
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_points_pay_btn"
pageId:@"points_recharge"
elementId:@"pay_btn"
extra:extra.copy
completion:nil];
NSString *productId = selectedItem.productId;
if (productId.length == 0) {
[KBHUD showInfo:KBLocalized(@"Product unavailable")];

View File

@@ -293,6 +293,11 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
#pragma mark - Action
- (void)onTapClose{
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_close_btn"
pageId:@"vip_pay"
elementId:@"close_btn"
extra:nil
completion:nil];
[self.navigationController popViewControllerAnimated:true];
}
@@ -303,6 +308,15 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
[KBHUD showInfo:KBLocalized(@"Please select a product")];
return;
}
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
if ([plan.productId isKindOfClass:NSString.class] && plan.productId.length > 0) {
extra[@"product_id"] = plan.productId;
}
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_pay_btn"
pageId:@"vip_pay"
elementId:@"pay_btn"
extra:extra.copy
completion:nil];
NSString *productId = plan.productId;
if (productId.length == 0) {
[KBHUD showInfo:KBLocalized(@"Product unavailable")];
@@ -326,6 +340,11 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
}
- (void)onTapRestoreButton {
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_restore_btn"
pageId:@"vip_pay"
elementId:@"restore_btn"
extra:nil
completion:nil];
[KBHUD show];
__weak typeof(self) weakSelf = self;
[[KBStoreKitBridge shared] restorePurchasesWithCompletion:^(BOOL success, NSString * _Nullable message) {
@@ -386,6 +405,18 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
if (self.selectedIndex == indexPath.item) { return; }
NSInteger old = self.selectedIndex;
self.selectedIndex = indexPath.item;
KBPayProductModel *plan = (indexPath.item < self.plans.count) ? self.plans[indexPath.item] : nil;
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
extra[@"index"] = @(indexPath.item);
if ([plan.productId isKindOfClass:NSString.class] && plan.productId.length > 0) {
extra[@"product_id"] = plan.productId;
}
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_select_plan"
pageId:@"vip_pay"
elementId:@"plan_item"
extra:extra.copy
completion:nil];
KBVipSubscribeCell *newCell = (KBVipSubscribeCell *)[collectionView cellForItemAtIndexPath:indexPath];
[newCell applySelected:YES animated:YES];