Commit 436af19b authored by jz's avatar jz

修改isFirst 避免冲突

parent d533b269
...@@ -262,8 +262,8 @@ static dispatch_semaphore_t _phobos_semaphore; ...@@ -262,8 +262,8 @@ static dispatch_semaphore_t _phobos_semaphore;
- (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page { - (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page {
if (![PhobosUtil isNonEmpty:page.pageName] || !page.needLogPV) { if (![PhobosUtil isNonEmpty:page.pageName] || !page.needLogPV) {
if (!page.isFirst) { if (!page.isFirstEntry) {
page.isFirst = YES; page.isFirstEntry = YES;
} }
return; return;
} }
...@@ -288,9 +288,9 @@ static dispatch_semaphore_t _phobos_semaphore; ...@@ -288,9 +288,9 @@ static dispatch_semaphore_t _phobos_semaphore;
[dict setObject:PhobosSafeString(page.inTimeMillis) forKey:@"in_time_millis"]; [dict setObject:PhobosSafeString(page.inTimeMillis) forKey:@"in_time_millis"];
[dict setObject:PhobosSafeString([PhobosUtil currentMMTime]) forKey:@"out_time_millis"]; [dict setObject:PhobosSafeString([PhobosUtil currentMMTime]) forKey:@"out_time_millis"];
//首次进来为1,再次进入的时候都为0 //首次进来为1,再次进入的时候都为0
[dict setObject:page.isFirst ? @(0):@(1) forKey:@"is_first"]; [dict setObject:page.isFirstEntry ? @(0):@(1) forKey:@"is_first"];
if (!page.isFirst) { if (!page.isFirstEntry) {
page.isFirst = YES; page.isFirstEntry = YES;
} }
if (page.inTime.length > 0) { if (page.inTime.length > 0) {
// 页面显示时间为空时不记录页面pv事件 // 页面显示时间为空时不记录页面pv事件
......
...@@ -340,8 +340,8 @@ static OldPhobos *sharedClient = nil; ...@@ -340,8 +340,8 @@ static OldPhobos *sharedClient = nil;
- (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page { - (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page {
if (![PhobosUtil isNonEmpty:page.pageName] || !page.needLogPV) { if (![PhobosUtil isNonEmpty:page.pageName] || !page.needLogPV) {
if (!page.isFirst) { if (!page.isFirstEntry) {
page.isFirst = YES; page.isFirstEntry = YES;
} }
return; return;
} }
...@@ -366,9 +366,9 @@ static OldPhobos *sharedClient = nil; ...@@ -366,9 +366,9 @@ static OldPhobos *sharedClient = nil;
[dict setObject:PhobosSafeString(page.inTimeMillis) forKey:@"in_time_millis"]; [dict setObject:PhobosSafeString(page.inTimeMillis) forKey:@"in_time_millis"];
[dict setObject:PhobosSafeString([PhobosUtil currentMMTime]) forKey:@"out_time_millis"]; [dict setObject:PhobosSafeString([PhobosUtil currentMMTime]) forKey:@"out_time_millis"];
//首次进来为1,再次进入的时候都为0 //首次进来为1,再次进入的时候都为0
[dict setObject:page.isFirst ? @(0):@(1) forKey:@"is_first"]; [dict setObject:page.isFirstEntry ? @(0):@(1) forKey:@"is_first"];
if (!page.isFirst) { if (!page.isFirstEntry) {
page.isFirst = YES; page.isFirstEntry = YES;
} }
if (page.inTime.length > 0) { if (page.inTime.length > 0) {
// 页面显示时间为空时不记录页面pv事件 // 页面显示时间为空时不记录页面pv事件
......
...@@ -91,9 +91,9 @@ typedef void(^PhobosUpdatePVBlock)(void); ...@@ -91,9 +91,9 @@ typedef void(^PhobosUpdatePVBlock)(void);
@property (nonatomic, strong) NSArray *referrerLink; @property (nonatomic, strong) NSArray *referrerLink;
/** /**
是否是第一次来到这个页面,在viewDidLoad赋值为1 是否是第一次来到这个页面,在viewDidLoad赋值为1
在即将消失的方法赋值为0 在即将消失的方法赋值为0 (是否是首次上报)
*/ */
@property (nonatomic, assign) BOOL isFirst; @property (nonatomic, assign) BOOL isFirstEntry;
/// 业务层更新PVStart信息 /// 业务层更新PVStart信息
@property (nonatomic, copy) PhobosUpdatePVBlock updatePVStartBlock; @property (nonatomic, copy) PhobosUpdatePVBlock updatePVStartBlock;
......
...@@ -254,11 +254,11 @@ ...@@ -254,11 +254,11 @@
objc_setAssociatedObject(self, @selector(updatePVStartBlock), updatePVStartBlock, OBJC_ASSOCIATION_COPY_NONATOMIC); objc_setAssociatedObject(self, @selector(updatePVStartBlock), updatePVStartBlock, OBJC_ASSOCIATION_COPY_NONATOMIC);
} }
- (void)setIsFirst:(BOOL)isFirst { - (void)setIsFirstEntry:(BOOL)isFirstEntry {
objc_setAssociatedObject(self, @selector(isFirst), @(isFirst), OBJC_ASSOCIATION_ASSIGN); objc_setAssociatedObject(self, @selector(isFirstEntry), @(isFirstEntry), OBJC_ASSOCIATION_ASSIGN);
} }
- (BOOL)isFirst { -(BOOL)isFirstEntry {
NSNumber *num = objc_getAssociatedObject(self, _cmd); NSNumber *num = objc_getAssociatedObject(self, _cmd);
return [num boolValue]; return [num boolValue];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment